Version Description
- Plugin restructure for performance improvements and Premium bundle system
Download this release
Release Info
Developer | BrechtVds |
Plugin | WP Recipe Maker |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.27.0 to 2.0.0
- assets/css/admin/addons.min.css +0 -1
- assets/css/admin/comments.min.css +0 -1
- assets/css/admin/faq.min.css +0 -1
- assets/css/admin/import.min.css +0 -1
- assets/css/admin/manage.min.css +0 -1
- assets/css/admin/modal.min.css +0 -1
- assets/css/admin/settings.min.css +0 -1
- assets/css/public/{_comments.scss → comments.scss} +0 -1
- assets/css/public/{_print.scss → print.scss} +0 -2
- assets/css/public/public.scss +0 -4
- assets/css/public/{_snippets.scss → snippets.scss} +0 -2
- assets/css/public/{_template_reset.scss → template_reset.scss} +0 -1
- assets/js/admin.js +17 -0
- assets/js/admin/editor.js +19 -0
- assets/js/admin/feedback.js +6 -8
- assets/js/admin/import.js +4 -117
- assets/js/admin/import/after_import.js +14 -0
- assets/js/admin/import/before_import.js +66 -0
- assets/js/admin/import/import.js +41 -0
- assets/js/admin/manage.js +7 -384
- assets/js/admin/manage/api.js +66 -0
- assets/js/admin/manage/datatable.js +186 -0
- assets/js/admin/manage/interactions.js +140 -0
- assets/js/admin/modal.js +10 -229
- assets/js/admin/modal/Modal.js +48 -0
- assets/js/admin/modal/ModalInit.js +144 -0
- assets/js/admin/modal/Recipe.js +367 -0
- assets/js/admin/modal/RecipeInit.js +121 -0
- assets/js/admin/modal/RichEditor.js +121 -0
- assets/js/admin/{rich-editor.js → modal/RichEditorLinks.js} +190 -291
- assets/js/admin/{import-text.js → modal/tabs/import-text.js} +91 -87
- assets/js/admin/modal/tabs/recipe-snippets.js +48 -0
- assets/js/admin/modal/tabs/recipe.js +146 -0
- assets/js/admin/modal/utils.js +83 -0
- assets/js/admin/recipe-form.js +0 -704
- assets/js/admin/recipe-snippets.js +0 -47
- assets/js/admin/settings.js +3 -1
- assets/js/admin/shortcode-tinymce.js +0 -85
- assets/js/{admin → other}/shortcode-button-tinymce.js +1 -1
- assets/js/other/shortcode-tinymce.js +85 -0
- assets/js/public.js +6 -87
- assets/js/public.min.js +0 -1
- assets/js/public/comment-rating.js +2 -2
- assets/js/public/print.js +24 -28
- dist/admin.css +1 -0
- dist/admin.js +7 -0
- dist/assets/9db239b0b8817856fa53552be937ab40.png +0 -0
- dist/print.css +483 -0
- dist/print.js +76 -0
- assets/css/public/public.min.css → dist/public.css +0 -0
- dist/public.js +1 -0
- includes/admin/class-wprm-import-manager.php +1 -13
- includes/admin/import/class-wprm-import-recipecard.php +1 -1
- includes/admin/manage/class-wprm-manage-recipes.php +4 -0
- includes/admin/manage/class-wprm-manage.php +0 -30
- includes/admin/menu/class-wprm-admin-menu-addons.php +0 -10
- includes/admin/menu/class-wprm-admin-menu-faq.php +0 -10
- includes/admin/modal/class-wprm-button.php +1 -1
- includes/admin/modal/class-wprm-modal.php +0 -45
- includes/admin/modal/class-wprm-shortcode-preview.php +1 -1
- includes/class-wp-recipe-maker.php +2 -2
- includes/public/class-wprm-assets.php +47 -2
- includes/public/class-wprm-comment-rating.php +0 -18
- includes/public/class-wprm-print.php +12 -17
- includes/public/class-wprm-settings.php +0 -13
- includes/public/class-wprm-template-helper.php +1 -1
- readme.txt +7 -1
- templates/admin/menu/faq/whats_new.php +5 -0
- vendor/datatables/DataTables-1.10.12/images/sort_asc.png +0 -0
- vendor/datatables/DataTables-1.10.12/images/sort_asc_disabled.png +0 -0
- vendor/datatables/DataTables-1.10.12/images/sort_both.png +0 -0
- vendor/datatables/DataTables-1.10.12/images/sort_desc.png +0 -0
- vendor/datatables/DataTables-1.10.12/images/sort_desc_disabled.png +0 -0
- vendor/datatables/datatables.min.css +0 -15
- vendor/datatables/datatables.min.js +0 -180
- vendor/medium-editor/LICENSE +0 -36
- vendor/medium-editor/README.md +0 -725
- vendor/medium-editor/css/medium-editor.min.css +0 -1
- vendor/medium-editor/css/themes/beagle.min.css +0 -1
- vendor/medium-editor/js/medium-editor.min.js +0 -4
- vendor/rangy/rangy-core.js +0 -11
- vendor/tooltipster/css/tooltipster.bundle.min.css +0 -6
- vendor/tooltipster/js/tooltipster.bundle.min.js +0 -2
- wp-recipe-maker.php +1 -1
assets/css/admin/addons.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-addons p{max-width:650px}.wprm-addons ul{list-style-type:square}.wprm-addons .wprm-drip-form{margin:20px 0}.wprm-addons .wprm-drip-form input{width:100%;max-width:400px;margin:10px 0}.wprm-addons .wprm-drip-form input[type=submit]{max-width:250px;margin-bottom:0}.wprm-addons .wprm-drip-form .wprm-disclaimer{font-size:.8em}
|
|
assets/css/admin/comments.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.comment-form-wprm-rating label{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.comment-form-wprm-rating .wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.comment-form-wprm-rating .wprm-rating-star.rated svg polygon{fill:#000}
|
|
assets/css/admin/faq.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-faq p{max-width:650px}.wprm-faq ul{list-style-type:square}.wprm-faq .wprm-drip-form{margin:20px 0}.wprm-faq .wprm-drip-form input{width:100%;max-width:400px;margin:10px 0}.wprm-faq .wprm-drip-form input[type=submit]{max-width:350px;margin-bottom:0}.wprm-faq .wprm-drip-form .wprm-disclaimer{font-size:.8em}.wprm-badge{background:url(../../images/icon-128x128.png) center 20px no-repeat #fff;-webkit-background-size:128px 128px;background-size:128px 128px;color:#333;font-size:14px;text-align:center;font-weight:600;margin:5px 0 0;padding-top:155px;height:25px;display:inline-block;width:150px;text-rendering:optimizeLegibility;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2)}.about-wrap .wprm-badge{position:absolute;top:0;right:0}@media only screen and (max-width:500px){.about-wrap .wprm-badge{position:relative;margin-bottom:1.5em;width:100%}}
|
|
assets/css/admin/import.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-import p{max-width:600px}.wprm-import .wprm-import-error{max-width:600px;border:1px solid #8b0000;background-color:#ff9f9f;padding:10px}.wprm-import .wprm-import-recipes{width:100%}.wprm-import .wprm-import-recipes input[type=checkbox]{vertical-align:top}.wprm-import .wprm-import-recipes a{text-decoration:none}.wprm-import .wprm-import-recipes .dashicons.dashicons-visibility{font-size:18px}.wprm-import .wprm-import-recipes td:nth-child(1){width:2%}.wprm-import .wprm-import-recipes td:nth-child(2){width:30%}.wprm-import #wprm-import-progress-container{width:100%;max-width:300px;height:20px;margin:10px 0;border:1px solid #000;background-color:#fff}.wprm-import #wprm-import-progress-bar{width:0%;height:100%;background-color:#4484ce}.wprm-import #wprm-import-finished{display:none}
|
|
assets/css/admin/manage.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-manage .dataTables_wrapper,.wprm-manage .wprm-manage-header{margin-top:20px}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container,.wprm-manage .wprm-manage-recipes-filters .wprm-manage-recipes-filter{margin-left:5px;z-index:100;max-width:100%}.wprm-manage .wprm-manage-datatable{display:none}.wprm-manage .wprm-manage-datatable .wprm-icon{cursor:pointer;color:#444}.wprm-manage .dataTables_wrapper .wprm-manage-datatable{display:table}.wprm-manage .wprm-manage-recipes-rating-details{font-size:.7em}.wprm-manage .wprm-manage-recipes-seo{margin:0 auto;width:15px;height:15px;border:1px solid #444;border-radius:50%}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-bad{background-color:#e74c3c}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-warning{background-color:#e67e22}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-rating{background-color:#f1c40f}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-good{background-color:#27ae60}.wprm-manage .wprm-manage-recipes-seo:hover{cursor:pointer}.wprm-manage .wprm-manage-recipes-seo-tooltip{display:none}.wprm-manage-custom-taxonomies-actions-tooltip,.wprm-manage-ingredients-actions-tooltip,.wprm-manage-recipes-actions-tooltip,.wprm-manage-taxonomies-actions-tooltip{text-align:right;min-width:250px;min-height:70px;font-size:14px}.wprm-manage-custom-taxonomies-actions-tooltip .tooltip-header,.wprm-manage-ingredients-actions-tooltip .tooltip-header,.wprm-manage-recipes-actions-tooltip .tooltip-header,.wprm-manage-taxonomies-actions-tooltip .tooltip-header{margin-bottom:5px;font-weight:700}.wprm-manage-custom-taxonomies-actions-tooltip a,.wprm-manage-ingredients-actions-tooltip a,.wprm-manage-recipes-actions-tooltip a,.wprm-manage-taxonomies-actions-tooltip a{color:#fff;display:block;text-decoration:none}.wprm-manage-custom-taxonomies-actions-tooltip a:hover,.wprm-manage-ingredients-actions-tooltip a:hover,.wprm-manage-recipes-actions-tooltip a:hover,.wprm-manage-taxonomies-actions-tooltip a:hover{text-decoration:underline}
|
|
assets/css/admin/modal.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router,.wprm-modal-container{display:none}.wprm-giveaway-notice{border:1px solid #006400;background-color:rgba(0,255,0,.15);padding:10px;margin-bottom:10px}.wprm-feedback-notice{border:1px solid #0085ba;background-color:rgba(0,133,186,.15);padding:10px;margin-bottom:10px}.wprm-feedback-notice button{margin:5px 5px 0 0!important}.wprm-easyrecipe-warning{display:none;border:1px solid #8b0000;background-color:rgba(255,0,0,.15);padding:10px 10px 0;margin-bottom:10px}.mce-floatpanel{z-index:100101!important}.select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-anchor-preview,.medium-editor-toolbar{z-index:100080}.medium-editor-anchor-preview{font-size:12px}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-hint{max-width:400px;margin-bottom:20px}.wprm-modal-hint .wprm-modal-hint-header{font-weight:700;font-variant:small-caps}.wprm-modal-hint .wprm-modal-hint-text{font-style:italic}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;text-decoration:none!important;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\f158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-close:hover .wprm-modal-icon:before{color:#00a0d2}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu-hidden{padding:5px 5px 0 10px;font-style:italic}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-button-action-save,.wprm-frame .hidden,.wprm-frame-content-tab:not(.active),.wprm-router:not(.active){display:none}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-toolbar,.wprm-toolbar{position:absolute;right:0;z-index:100;height:60px}.wprm-frame-content-tab{margin:20px}.wprm-frame-toolbar{left:200px;bottom:0}.wprm-toolbar{top:0;left:0;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width:900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar,.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width:640px),screen and (max-height:400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width:480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-form{max-width:600px}.wprm-recipe-form .wprm-recipe-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-form .wprm-recipe-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-form .wprm-recipe-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-form label{display:block;font-weight:700;margin-bottom:5px}.wprm-recipe-form input[type=text],.wprm-recipe-form input[type=number]{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-form input[type=text][type=number],.wprm-recipe-form input[type=number][type=number]{max-width:50px}.wprm-recipe-form input[type=text].select2_wprm-search__field,.wprm-recipe-form input[type=number].select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-form select{width:100%}.wprm-recipe-form textarea{width:100%;resize:vertical}@media only screen and (max-width:480px){.wprm-recipe-form .wprm-recipe-form-container-halfs,.wprm-recipe-form .wprm-recipe-form-container-thirds{display:block;width:100%}}.wprm-recipe-import-text-form .import-text-buttons{margin-bottom:10px}.wprm-recipe-import-text-form .import-text-step{display:none}.wprm-recipe-import-text-form .import-text-step#import-text-step-input{display:block}.wprm-recipe-import-text-form #import-text-highlight-sandbox,.wprm-recipe-import-text-form .import-text-input{margin-top:10px}.wprm-recipe-import-text-form #import-text-ingredient-groups label,.wprm-recipe-import-text-form #import-text-instruction-groups label{display:inline;font-weight:400}.wprm-recipe-import-text-form .import-text-group-warning{margin-top:10px;display:none}.wprm-recipe-import-text-form #import-text-highlight-sandbox{display:none;max-height:400px;overflow:scroll;padding:10px;border:1px dashed #999}.wprm-loader,.wprm-loader:after,.wprm-loader:before{border-radius:50%;width:1.5em;height:1.5em;-webkit-animation:load7 1.8s infinite ease-in-out;animation:load7 1.8s infinite ease-in-out}.wprm-loader{display:none;color:#444;font-size:10px;margin:20px auto;position:relative;text-indent:-9999em;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}.wprm-loader:after,.wprm-loader:before{content:'';position:absolute;top:0}.wprm-loader:before{left:-2.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.wprm-loader:after{left:2.5em}@-webkit-keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}.wprm-recipe-details-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input#wprm-recipe-author-link,.wprm-recipe-details-form input#wprm-recipe-author-name{max-width:none}.wprm-recipe-details-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width:480px){.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:700;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}
|
|
assets/css/admin/settings.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.wprm-settings select{min-width:200px}.wprm-settings .select2_wprm-container{z-index:99000}.wprm-settings #template_font_size{width:60px}.wprm-settings .template-preview-container .template-preview{float:left;text-align:center;width:250px;height:230px;overflow:hidden;margin:5px}.wprm-settings .template-preview-container .template-name{font-weight:700;line-height:30px}.wprm-settings .template-preview-container .template-screenshot{width:250px}.wprm-settings .template-preview-container .template-no-screenshot{width:250px;height:200px;line-height:200px;border:1px dashed #999;box-sizing:border-box}
|
|
assets/css/public/{_comments.scss → comments.scss}
RENAMED
@@ -1,4 +1,3 @@
|
|
1 |
-
// main: public.scss
|
2 |
.comment-form-wprm-rating {
|
3 |
.wprm-rating-star {
|
4 |
cursor: pointer;
|
|
|
1 |
.comment-form-wprm-rating {
|
2 |
.wprm-rating-star {
|
3 |
cursor: pointer;
|
assets/css/public/{_print.scss → print.scss}
RENAMED
@@ -1,5 +1,3 @@
|
|
1 |
-
// main: public.scss
|
2 |
-
|
3 |
.wprm-print {
|
4 |
.wprm-recipe {
|
5 |
max-width: 750px;
|
|
|
|
|
1 |
.wprm-print {
|
2 |
.wprm-recipe {
|
3 |
max-width: 750px;
|
assets/css/public/public.scss
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
@import "comments";
|
2 |
-
@import "print";
|
3 |
-
@import "snippets";
|
4 |
-
@import "template_reset";
|
|
|
|
|
|
|
|
assets/css/public/{_snippets.scss → snippets.scss}
RENAMED
@@ -1,5 +1,3 @@
|
|
1 |
-
// main: public.scss
|
2 |
-
|
3 |
.wprm-automatic-recipe-snippets {
|
4 |
text-align: center;
|
5 |
margin-bottom: 10px;
|
|
|
|
|
1 |
.wprm-automatic-recipe-snippets {
|
2 |
text-align: center;
|
3 |
margin-bottom: 10px;
|
assets/css/public/{_template_reset.scss → template_reset.scss}
RENAMED
@@ -1,4 +1,3 @@
|
|
1 |
-
// main: public.scss
|
2 |
.wprm-recipe {
|
3 |
// Clearfix
|
4 |
overflow: auto;
|
|
|
1 |
.wprm-recipe {
|
2 |
// Clearfix
|
3 |
overflow: auto;
|
assets/js/admin.js
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import './admin/editor';
|
2 |
+
import './admin/feedback';
|
3 |
+
import './admin/import';
|
4 |
+
import './admin/manage';
|
5 |
+
import './admin/modal';
|
6 |
+
import './admin/settings';
|
7 |
+
|
8 |
+
import '../css/admin/addons.scss';
|
9 |
+
import '../css/admin/comments.scss';
|
10 |
+
import '../css/admin/faq.scss';
|
11 |
+
|
12 |
+
import './public/comment-rating';
|
13 |
+
|
14 |
+
import Modal from './admin/modal/Modal';
|
15 |
+
import Recipe from './admin/modal/Recipe';
|
16 |
+
import * as utils from './admin/modal/utils';
|
17 |
+
export { Modal, Recipe, utils };
|
assets/js/admin/editor.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Modal from './modal/Modal';
|
2 |
+
|
3 |
+
// Opening Modal
|
4 |
+
jQuery(document).ready(function($) {
|
5 |
+
jQuery(document).on('click', '.wprm-modal-button', function() {
|
6 |
+
var editor_id = jQuery(this).data('editor');
|
7 |
+
Modal.open(editor_id);
|
8 |
+
});
|
9 |
+
|
10 |
+
// Edit Recipe button
|
11 |
+
jQuery(document).on('click', '.wprm-modal-edit-button', function() {
|
12 |
+
var editor_id = jQuery(this).data('editor');
|
13 |
+
var recipe_id = jQuery(this).data('recipe');
|
14 |
+
|
15 |
+
Modal.open(editor_id, {
|
16 |
+
recipe_id: recipe_id
|
17 |
+
});
|
18 |
+
});
|
19 |
+
});
|
assets/js/admin/feedback.js
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
wprm_admin.give_feedback = function(answer) {
|
4 |
var data = {
|
5 |
action: 'wprm_feedback',
|
6 |
-
security:
|
7 |
answer: answer
|
8 |
};
|
9 |
|
10 |
-
jQuery.post(
|
11 |
};
|
12 |
|
13 |
jQuery(document).ready(function($) {
|
@@ -15,19 +13,19 @@ jQuery(document).ready(function($) {
|
|
15 |
|
16 |
if (feedback_notice.length > 0) {
|
17 |
jQuery('#wprm-feedback-stop').on('click', function() {
|
18 |
-
|
19 |
feedback_notice.slideUp();
|
20 |
});
|
21 |
|
22 |
jQuery('#wprm-feedback-no').on('click', function() {
|
23 |
-
|
24 |
var message = '<strong>How could we make it better?</strong><br/>';
|
25 |
message += 'Please send any issues or suggestions you have to <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20feedback">support@bootstrapped.ventures</a> and we\'ll see what we can do!';
|
26 |
feedback_notice.html(message);
|
27 |
});
|
28 |
|
29 |
jQuery('#wprm-feedback-yes').on('click', function() {
|
30 |
-
|
31 |
var message = '<strong>Happy to hear!</strong><br/>';
|
32 |
message += 'It would be really helpful if you could leave us an honest review over at <a href="https://wordpress.org/support/plugin/wp-recipe-maker/reviews/#new-post" target="_blank">wordpress.org</a><br/>';
|
33 |
message += 'Suggestions to make the plugin even better are also very welcome at <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20suggestions">support@bootstrapped.ventures</a>';
|
1 |
+
function give_feedback(answer) {
|
|
|
|
|
2 |
var data = {
|
3 |
action: 'wprm_feedback',
|
4 |
+
security: wprm_temp_admin.nonce,
|
5 |
answer: answer
|
6 |
};
|
7 |
|
8 |
+
jQuery.post(wprm_temp_admin.ajax_url, data);
|
9 |
};
|
10 |
|
11 |
jQuery(document).ready(function($) {
|
13 |
|
14 |
if (feedback_notice.length > 0) {
|
15 |
jQuery('#wprm-feedback-stop').on('click', function() {
|
16 |
+
give_feedback('stop');
|
17 |
feedback_notice.slideUp();
|
18 |
});
|
19 |
|
20 |
jQuery('#wprm-feedback-no').on('click', function() {
|
21 |
+
give_feedback('no');
|
22 |
var message = '<strong>How could we make it better?</strong><br/>';
|
23 |
message += 'Please send any issues or suggestions you have to <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20feedback">support@bootstrapped.ventures</a> and we\'ll see what we can do!';
|
24 |
feedback_notice.html(message);
|
25 |
});
|
26 |
|
27 |
jQuery('#wprm-feedback-yes').on('click', function() {
|
28 |
+
give_feedback('yes');
|
29 |
var message = '<strong>Happy to hear!</strong><br/>';
|
30 |
message += 'It would be really helpful if you could leave us an honest review over at <a href="https://wordpress.org/support/plugin/wp-recipe-maker/reviews/#new-post" target="_blank">wordpress.org</a><br/>';
|
31 |
message += 'Suggestions to make the plugin even better are also very welcome at <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20suggestions">support@bootstrapped.ventures</a>';
|
assets/js/admin/import.js
CHANGED
@@ -1,118 +1,5 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
wprm_admin.importing_recipes_total = 0;
|
7 |
-
wprm_admin.import_recipes = function() {
|
8 |
-
var data = {
|
9 |
-
action: 'wprm_import_recipes',
|
10 |
-
security: wprm_modal.nonce,
|
11 |
-
importer_uid: wprm_import.importer_uid,
|
12 |
-
post_data: wprm_import.post_data,
|
13 |
-
recipes: wprm_admin.importing_recipes
|
14 |
-
};
|
15 |
-
|
16 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
17 |
-
if (out.success) {
|
18 |
-
wprm_admin.importing_recipes = out.data.recipes_left;
|
19 |
-
wprm_admin.update_progress_bar();
|
20 |
-
|
21 |
-
if(wprm_admin.importing_recipes.length > 0) {
|
22 |
-
wprm_admin.import_recipes();
|
23 |
-
} else {
|
24 |
-
jQuery('#wprm-import-finished').show();
|
25 |
-
}
|
26 |
-
} else {
|
27 |
-
window.location = out.data.redirect;
|
28 |
-
}
|
29 |
-
}, 'json');
|
30 |
-
}
|
31 |
-
|
32 |
-
wprm_admin.update_progress_bar = function() {
|
33 |
-
var percentage = ( 1.0 - ( wprm_admin.importing_recipes.length / wprm_admin.importing_recipes_total ) ) * 100;
|
34 |
-
jQuery('#wprm-import-progress-bar').css('width', percentage + '%');
|
35 |
-
};
|
36 |
-
|
37 |
-
jQuery(document).ready(function($) {
|
38 |
-
// Quick select functionality.
|
39 |
-
jQuery('.wprm-import-recipes-select-all').on('click', function(e) {
|
40 |
-
e.preventDefault();
|
41 |
-
jQuery('.wprm-import-recipes').find(':checkbox').each(function() {
|
42 |
-
jQuery(this).prop('checked', true);
|
43 |
-
});
|
44 |
-
});
|
45 |
-
jQuery('.wprm-import-recipes-select-none').on('click', function(e) {
|
46 |
-
e.preventDefault();
|
47 |
-
jQuery('.wprm-import-recipes').find(':checkbox').each(function() {
|
48 |
-
jQuery(this).prop('checked', false);
|
49 |
-
});
|
50 |
-
});
|
51 |
-
|
52 |
-
// Select multiple using SHIFT
|
53 |
-
jQuery('.wprm-import-recipes').on('click', ':checkbox', function(e) {
|
54 |
-
if(wprm_admin.import_last_checked && e.shiftKey) {
|
55 |
-
var checkboxes = jQuery('.wprm-import-recipes').find(':checkbox'),
|
56 |
-
start = checkboxes.index(this),
|
57 |
-
end = checkboxes.index(wprm_admin.import_last_checked);
|
58 |
-
|
59 |
-
checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', wprm_admin.import_last_checked.checked);
|
60 |
-
}
|
61 |
-
|
62 |
-
wprm_admin.import_last_checked = this;
|
63 |
-
});
|
64 |
-
|
65 |
-
// Go to next import page
|
66 |
-
jQuery('.wprm-import-next-page').on('click', function() {
|
67 |
-
var url = window.location.href,
|
68 |
-
regex = /(&|\?)p=(\d+)/,
|
69 |
-
match = regex.exec(url);
|
70 |
-
|
71 |
-
if(match) {
|
72 |
-
var page = parseInt(match[2]),
|
73 |
-
search = 'p=' + page,
|
74 |
-
replace = 'p=' + (page+1);
|
75 |
-
|
76 |
-
url = url.replace('?' + search, '?' + replace);
|
77 |
-
url = url.replace('&' + search, '&' + replace);
|
78 |
-
}
|
79 |
-
|
80 |
-
window.location = url;
|
81 |
-
});
|
82 |
-
|
83 |
-
// Go back to the first import page
|
84 |
-
jQuery('.wprm-import-reset-page').on('click', function() {
|
85 |
-
var url = window.location.href,
|
86 |
-
regex = /(&|\?)p=(\d+)/,
|
87 |
-
match = regex.exec(url);
|
88 |
-
|
89 |
-
if(match) {
|
90 |
-
var page = parseInt(match[2]),
|
91 |
-
search = 'p=' + page,
|
92 |
-
replace = 'p=0';
|
93 |
-
|
94 |
-
url = url.replace('?' + search, '?' + replace);
|
95 |
-
url = url.replace('&' + search, '&' + replace);
|
96 |
-
}
|
97 |
-
|
98 |
-
window.location = url;
|
99 |
-
});
|
100 |
-
|
101 |
-
// Edit imported recipe
|
102 |
-
jQuery(document).on('click', '.wprm-import-recipes-actions-edit', function(e) {
|
103 |
-
e.preventDefault();
|
104 |
-
|
105 |
-
var id = jQuery(this).data('id');
|
106 |
-
|
107 |
-
wprm_admin.open_modal(false, {
|
108 |
-
recipe_id: id
|
109 |
-
});
|
110 |
-
});
|
111 |
-
|
112 |
-
// Import Process
|
113 |
-
if(window.wprm_import !== undefined) {
|
114 |
-
wprm_admin.importing_recipes = wprm_import.recipes;
|
115 |
-
wprm_admin.importing_recipes_total = wprm_import.recipes.length;
|
116 |
-
wprm_admin.import_recipes();
|
117 |
-
}
|
118 |
-
});
|
1 |
+
import '../../css/admin/import.scss';
|
2 |
|
3 |
+
import './import/before_import';
|
4 |
+
import './import/import';
|
5 |
+
import './import/after_import';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/import/after_import.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Modal from '../modal/Modal';
|
2 |
+
|
3 |
+
jQuery(document).ready(function($) {
|
4 |
+
// Edit imported recipe
|
5 |
+
jQuery(document).on('click', '.wprm-import-recipes-actions-edit', function(e) {
|
6 |
+
e.preventDefault();
|
7 |
+
|
8 |
+
var id = jQuery(this).data('id');
|
9 |
+
|
10 |
+
Modal.open(false, {
|
11 |
+
recipe_id: id
|
12 |
+
});
|
13 |
+
});
|
14 |
+
});
|
assets/js/admin/import/before_import.js
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let import_last_checked = false;
|
2 |
+
|
3 |
+
jQuery(document).ready(function($) {
|
4 |
+
// Quick select functionality.
|
5 |
+
jQuery('.wprm-import-recipes-select-all').on('click', function(e) {
|
6 |
+
e.preventDefault();
|
7 |
+
jQuery('.wprm-import-recipes').find(':checkbox').each(function() {
|
8 |
+
jQuery(this).prop('checked', true);
|
9 |
+
});
|
10 |
+
});
|
11 |
+
jQuery('.wprm-import-recipes-select-none').on('click', function(e) {
|
12 |
+
e.preventDefault();
|
13 |
+
jQuery('.wprm-import-recipes').find(':checkbox').each(function() {
|
14 |
+
jQuery(this).prop('checked', false);
|
15 |
+
});
|
16 |
+
});
|
17 |
+
|
18 |
+
// Select multiple using SHIFT
|
19 |
+
jQuery('.wprm-import-recipes').on('click', ':checkbox', function(e) {
|
20 |
+
if(import_last_checked && e.shiftKey) {
|
21 |
+
var checkboxes = jQuery('.wprm-import-recipes').find(':checkbox'),
|
22 |
+
start = checkboxes.index(this),
|
23 |
+
end = checkboxes.index(import_last_checked);
|
24 |
+
|
25 |
+
checkboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', import_last_checked.checked);
|
26 |
+
}
|
27 |
+
|
28 |
+
import_last_checked = this;
|
29 |
+
});
|
30 |
+
|
31 |
+
// Go to next import page
|
32 |
+
jQuery('.wprm-import-next-page').on('click', function() {
|
33 |
+
var url = window.location.href,
|
34 |
+
regex = /(&|\?)p=(\d+)/,
|
35 |
+
match = regex.exec(url);
|
36 |
+
|
37 |
+
if(match) {
|
38 |
+
var page = parseInt(match[2]),
|
39 |
+
search = 'p=' + page,
|
40 |
+
replace = 'p=' + (page+1);
|
41 |
+
|
42 |
+
url = url.replace('?' + search, '?' + replace);
|
43 |
+
url = url.replace('&' + search, '&' + replace);
|
44 |
+
}
|
45 |
+
|
46 |
+
window.location = url;
|
47 |
+
});
|
48 |
+
|
49 |
+
// Go back to the first import page
|
50 |
+
jQuery('.wprm-import-reset-page').on('click', function() {
|
51 |
+
var url = window.location.href,
|
52 |
+
regex = /(&|\?)p=(\d+)/,
|
53 |
+
match = regex.exec(url);
|
54 |
+
|
55 |
+
if(match) {
|
56 |
+
var page = parseInt(match[2]),
|
57 |
+
search = 'p=' + page,
|
58 |
+
replace = 'p=0';
|
59 |
+
|
60 |
+
url = url.replace('?' + search, '?' + replace);
|
61 |
+
url = url.replace('&' + search, '&' + replace);
|
62 |
+
}
|
63 |
+
|
64 |
+
window.location = url;
|
65 |
+
});
|
66 |
+
});
|
assets/js/admin/import/import.js
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let importing_recipes = [];
|
2 |
+
let importing_recipes_total = 0;
|
3 |
+
|
4 |
+
function import_recipes() {
|
5 |
+
var data = {
|
6 |
+
action: 'wprm_import_recipes',
|
7 |
+
security: wprm_temp_admin.nonce,
|
8 |
+
importer_uid: wprm_import.importer_uid,
|
9 |
+
post_data: wprm_import.post_data,
|
10 |
+
recipes: importing_recipes
|
11 |
+
};
|
12 |
+
|
13 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
14 |
+
if (out.success) {
|
15 |
+
importing_recipes = out.data.recipes_left;
|
16 |
+
update_progress_bar();
|
17 |
+
|
18 |
+
if(importing_recipes.length > 0) {
|
19 |
+
import_recipes();
|
20 |
+
} else {
|
21 |
+
jQuery('#wprm-import-finished').show();
|
22 |
+
}
|
23 |
+
} else {
|
24 |
+
window.location = out.data.redirect;
|
25 |
+
}
|
26 |
+
}, 'json');
|
27 |
+
}
|
28 |
+
|
29 |
+
function update_progress_bar() {
|
30 |
+
var percentage = ( 1.0 - ( importing_recipes.length / importing_recipes_total ) ) * 100;
|
31 |
+
jQuery('#wprm-import-progress-bar').css('width', percentage + '%');
|
32 |
+
};
|
33 |
+
|
34 |
+
jQuery(document).ready(function($) {
|
35 |
+
// Import Process
|
36 |
+
if(window.wprm_import !== undefined) {
|
37 |
+
importing_recipes = wprm_import.recipes;
|
38 |
+
importing_recipes_total = wprm_import.recipes.length;
|
39 |
+
import_recipes();
|
40 |
+
}
|
41 |
+
});
|
assets/js/admin/manage.js
CHANGED
@@ -1,387 +1,10 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
var data = {
|
5 |
-
action: 'wprm_rename_term',
|
6 |
-
security: wprm_manage.nonce,
|
7 |
-
term_id: term_id,
|
8 |
-
taxonomy: taxonomy,
|
9 |
-
new_name: new_name
|
10 |
-
};
|
11 |
-
|
12 |
-
jQuery.post(wprm_manage.ajax_url, data, function() {
|
13 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
14 |
-
});
|
15 |
-
};
|
16 |
-
|
17 |
-
wprm_admin.update_term_metadata = function(term_id, field, value) {
|
18 |
-
var data = {
|
19 |
-
action: 'wprm_update_term_metadata',
|
20 |
-
security: wprm_manage.nonce,
|
21 |
-
term_id: term_id,
|
22 |
-
field: field,
|
23 |
-
value: value
|
24 |
-
};
|
25 |
-
|
26 |
-
jQuery.post(wprm_manage.ajax_url, data, function() {
|
27 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
28 |
-
});
|
29 |
-
};
|
30 |
-
|
31 |
-
wprm_admin.delete_or_merge_term = function(term_id, taxonomy, new_term_id) {
|
32 |
-
var data = {
|
33 |
-
action: 'wprm_delete_or_merge_term',
|
34 |
-
security: wprm_manage.nonce,
|
35 |
-
term_id: term_id,
|
36 |
-
taxonomy: taxonomy,
|
37 |
-
new_term_id: new_term_id
|
38 |
-
};
|
39 |
-
|
40 |
-
jQuery.post(wprm_manage.ajax_url, data, function() {
|
41 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
42 |
-
});
|
43 |
-
};
|
44 |
-
|
45 |
-
wprm_admin.delete_terms = function(term_ids, taxonomy) {
|
46 |
-
var data = {
|
47 |
-
action: 'wprm_delete_terms',
|
48 |
-
security: wprm_manage.nonce,
|
49 |
-
term_ids: term_ids,
|
50 |
-
taxonomy: taxonomy
|
51 |
-
};
|
52 |
-
|
53 |
-
jQuery.post(wprm_manage.ajax_url, data, function() {
|
54 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
55 |
-
});
|
56 |
-
};
|
57 |
-
|
58 |
-
wprm_admin.delete_recipe = function(recipe_id) {
|
59 |
-
var data = {
|
60 |
-
action: 'wprm_delete_recipe',
|
61 |
-
security: wprm_manage.nonce,
|
62 |
-
recipe_id: recipe_id,
|
63 |
-
};
|
64 |
-
|
65 |
-
jQuery.post(wprm_manage.ajax_url, data, function() {
|
66 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
67 |
-
});
|
68 |
-
};
|
69 |
-
|
70 |
-
// Source: http://stackoverflow.com/questions/647259/javascript-query-string
|
71 |
-
wprm_admin.get_query_args = function() {
|
72 |
-
var result = {}, queryString = location.search.slice(1),
|
73 |
-
re = /([^&=]+)=([^&]*)/g, m;
|
74 |
-
|
75 |
-
while (m = re.exec(queryString)) {
|
76 |
-
result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
|
77 |
-
}
|
78 |
-
|
79 |
-
return result;
|
80 |
-
}
|
81 |
|
82 |
jQuery(document).ready(function($) {
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
wprm_active_datatable = jQuery(this).attr('id');
|
87 |
-
});
|
88 |
-
|
89 |
-
// Datatable filters.
|
90 |
-
var args = wprm_admin.get_query_args();
|
91 |
-
jQuery('.wprm-manage-recipes-filter').on('change', function() {
|
92 |
-
wprm_datatable.search('').draw();
|
93 |
-
}).each(function() {
|
94 |
-
var taxonomy = jQuery(this).data('taxonomy');
|
95 |
-
|
96 |
-
if(args.hasOwnProperty(taxonomy)) {
|
97 |
-
jQuery(this).val(args[taxonomy]);
|
98 |
-
}
|
99 |
-
}).select2_wprm();
|
100 |
-
|
101 |
-
// Init datatable
|
102 |
-
$.fn.dataTable.ext.errMode = 'throw';
|
103 |
-
|
104 |
-
var wprm_datatable = jQuery('.wprm-manage-datatable').DataTable( {
|
105 |
-
pageLength: 10,
|
106 |
-
order: [ 0, 'desc' ],
|
107 |
-
serverSide: true,
|
108 |
-
ajax: {
|
109 |
-
url: wprm_manage.ajax_url,
|
110 |
-
type: 'POST',
|
111 |
-
data: function ( d ) {
|
112 |
-
d.action = 'wprm_manage_datatable';
|
113 |
-
d.security = wprm_manage.nonce;
|
114 |
-
d.table = wprm_active_datatable;
|
115 |
-
|
116 |
-
// Check for advanced search filters.
|
117 |
-
var search_filters = jQuery('.wprm-manage-recipes-filter');
|
118 |
-
|
119 |
-
if(search_filters.length > 0) {
|
120 |
-
var search = jQuery('#wprm-manage-recipes_wrapper').find('input[type="search"]').val();
|
121 |
-
|
122 |
-
search_filters.each(function() {
|
123 |
-
var taxonomy = jQuery(this).data('taxonomy');
|
124 |
-
var value = parseInt(jQuery(this).val());
|
125 |
-
|
126 |
-
if(value > 0) {
|
127 |
-
search += '{{' + taxonomy + '=' + value +'}}';
|
128 |
-
}
|
129 |
-
});
|
130 |
-
|
131 |
-
d.search.value = search;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
},
|
135 |
-
drawCallback: function() {
|
136 |
-
// Select2.
|
137 |
-
jQuery('.wprm-manage-datatable').find('select').select2_wprm();
|
138 |
-
|
139 |
-
// Add tooltips.
|
140 |
-
jQuery('.wprm-manage-ingredients-actions').tooltipster({
|
141 |
-
content: '<div class="wprm-manage-ingredients-actions-tooltip">' + wprm_manage.tooltip.ingredients + '</div>',
|
142 |
-
contentAsHTML: true,
|
143 |
-
functionBefore: function() {
|
144 |
-
var instances = jQuery.tooltipster.instances();
|
145 |
-
jQuery.each(instances, function(i, instance){
|
146 |
-
instance.close();
|
147 |
-
});
|
148 |
-
},
|
149 |
-
functionReady: function(instance, helper) {
|
150 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
151 |
-
count = parseInt(jQuery(helper.origin).data('count')),
|
152 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
153 |
-
|
154 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
155 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
156 |
-
|
157 |
-
if(count > 0) {
|
158 |
-
jQuery(helper.tooltip)
|
159 |
-
.find('.wprm-manage-ingredients-actions-delete')
|
160 |
-
.remove();
|
161 |
-
}
|
162 |
-
},
|
163 |
-
interactive: true,
|
164 |
-
delay: 0,
|
165 |
-
side: 'left',
|
166 |
-
trigger: 'custom',
|
167 |
-
triggerOpen: {
|
168 |
-
mouseenter: true,
|
169 |
-
touchstart: true
|
170 |
-
},
|
171 |
-
triggerClose: {
|
172 |
-
click: true,
|
173 |
-
tap: true
|
174 |
-
},
|
175 |
-
});
|
176 |
-
|
177 |
-
jQuery('.wprm-manage-taxonomies-actions').tooltipster({
|
178 |
-
content: '<div class="wprm-manage-taxonomies-actions-tooltip">' + wprm_manage.tooltip.taxonomies + '</div>',
|
179 |
-
contentAsHTML: true,
|
180 |
-
functionBefore: function() {
|
181 |
-
var instances = jQuery.tooltipster.instances();
|
182 |
-
jQuery.each(instances, function(i, instance){
|
183 |
-
instance.close();
|
184 |
-
});
|
185 |
-
},
|
186 |
-
functionReady: function(instance, helper) {
|
187 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
188 |
-
count = parseInt(jQuery(helper.origin).data('count')),
|
189 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text();
|
190 |
-
|
191 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
192 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
193 |
-
},
|
194 |
-
interactive: true,
|
195 |
-
delay: 0,
|
196 |
-
side: 'left',
|
197 |
-
trigger: 'custom',
|
198 |
-
triggerOpen: {
|
199 |
-
mouseenter: true,
|
200 |
-
touchstart: true
|
201 |
-
},
|
202 |
-
triggerClose: {
|
203 |
-
click: true,
|
204 |
-
tap: true
|
205 |
-
},
|
206 |
-
});
|
207 |
-
|
208 |
-
jQuery('.wprm-manage-recipes-actions').tooltipster({
|
209 |
-
content: '<div class="wprm-manage-recipes-actions-tooltip">' + wprm_manage.tooltip.recipes + '</div>',
|
210 |
-
contentAsHTML: true,
|
211 |
-
functionBefore: function() {
|
212 |
-
var instances = jQuery.tooltipster.instances();
|
213 |
-
jQuery.each(instances, function(i, instance){
|
214 |
-
instance.close();
|
215 |
-
});
|
216 |
-
},
|
217 |
-
functionReady: function(instance, helper) {
|
218 |
-
var id = parseInt(jQuery(helper.origin).data('id')),
|
219 |
-
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
220 |
-
|
221 |
-
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
222 |
-
jQuery(helper.tooltip).find('a').data('id', id);
|
223 |
-
},
|
224 |
-
interactive: true,
|
225 |
-
delay: 0,
|
226 |
-
side: 'left',
|
227 |
-
trigger: 'custom',
|
228 |
-
triggerOpen: {
|
229 |
-
mouseenter: true,
|
230 |
-
touchstart: true
|
231 |
-
},
|
232 |
-
triggerClose: {
|
233 |
-
click: true,
|
234 |
-
tap: true
|
235 |
-
},
|
236 |
-
});
|
237 |
-
|
238 |
-
jQuery('.wprm-manage-recipes-seo').tooltipster({
|
239 |
-
delay: 0,
|
240 |
-
side: 'left',
|
241 |
-
});
|
242 |
-
}
|
243 |
-
} );
|
244 |
-
|
245 |
-
jQuery(document).on('click', '.wprm-manage-recipes-seo', function(e) {
|
246 |
-
e.preventDefault();
|
247 |
-
|
248 |
-
var id = jQuery(this).data('id');
|
249 |
-
|
250 |
-
wprm_admin.open_modal(false, {
|
251 |
-
recipe_id: id
|
252 |
-
});
|
253 |
-
});
|
254 |
-
|
255 |
-
jQuery(document).on('change', '.wprm-manage-ingredients-link-nofollow', function(e) {
|
256 |
-
e.preventDefault();
|
257 |
-
|
258 |
-
var id = jQuery(this).data('id'),
|
259 |
-
nofollow = jQuery(this).val();
|
260 |
-
|
261 |
-
wprm_admin.update_term_metadata(id, 'ingredient_link_nofollow', nofollow);
|
262 |
-
});
|
263 |
-
|
264 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-rename', function(e) {
|
265 |
-
e.preventDefault();
|
266 |
-
|
267 |
-
var id = jQuery(this).data('id'),
|
268 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
269 |
-
|
270 |
-
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
271 |
-
if(new_name) {
|
272 |
-
wprm_admin.rename_term(id, 'ingredient', new_name);
|
273 |
-
}
|
274 |
-
});
|
275 |
-
|
276 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-link', function(e) {
|
277 |
-
e.preventDefault();
|
278 |
-
|
279 |
-
var id = jQuery(this).data('id'),
|
280 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text(),
|
281 |
-
link_container = jQuery('#wprm-manage-ingredients-link-' + id),
|
282 |
-
link = link_container.text();
|
283 |
-
|
284 |
-
var new_link = prompt('What do you want the link for "' + name + '" to be?', link).trim();
|
285 |
-
wprm_admin.update_term_metadata(id, 'ingredient_link', new_link);
|
286 |
-
});
|
287 |
-
|
288 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-merge', function(e) {
|
289 |
-
e.preventDefault();
|
290 |
-
|
291 |
-
var id = jQuery(this).data('id'),
|
292 |
-
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
293 |
-
|
294 |
-
var new_term = parseInt(prompt('What is the ID of the ingredient that you want to merge "' + name + '" into?', ''));
|
295 |
-
if(new_term) {
|
296 |
-
wprm_admin.delete_or_merge_term(id, 'ingredient', new_term);
|
297 |
-
}
|
298 |
-
});
|
299 |
-
|
300 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-rename', function(e) {
|
301 |
-
e.preventDefault();
|
302 |
-
|
303 |
-
var id = jQuery(this).data('id'),
|
304 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
305 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
306 |
-
|
307 |
-
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
308 |
-
if(new_name) {
|
309 |
-
wprm_admin.rename_term(id, taxonomy, new_name);
|
310 |
-
}
|
311 |
-
});
|
312 |
-
|
313 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-merge', function(e) {
|
314 |
-
e.preventDefault();
|
315 |
-
|
316 |
-
var id = jQuery(this).data('id'),
|
317 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
318 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
319 |
-
|
320 |
-
var new_term = parseInt(prompt('What is the ID of the term that you want to merge "' + name + '" into?', ''));
|
321 |
-
if(new_term) {
|
322 |
-
wprm_admin.delete_or_merge_term(id, taxonomy, new_term);
|
323 |
-
}
|
324 |
-
});
|
325 |
-
|
326 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-actions-delete', function(e) {
|
327 |
-
e.preventDefault();
|
328 |
-
|
329 |
-
var id = jQuery(this).data('id');
|
330 |
-
wprm_admin.delete_or_merge_term(id, 'ingredient', 0);
|
331 |
-
});
|
332 |
-
|
333 |
-
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-delete', function(e) {
|
334 |
-
e.preventDefault();
|
335 |
-
|
336 |
-
var id = jQuery(this).data('id'),
|
337 |
-
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
338 |
-
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
339 |
-
|
340 |
-
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
341 |
-
wprm_admin.delete_or_merge_term(id, taxonomy, 0);
|
342 |
-
}
|
343 |
-
});
|
344 |
-
|
345 |
-
jQuery(document).on('click', '.wprm-manage-recipes-actions-edit', function(e) {
|
346 |
-
e.preventDefault();
|
347 |
-
|
348 |
-
var id = jQuery(this).data('id');
|
349 |
-
|
350 |
-
wprm_admin.open_modal(false, {
|
351 |
-
recipe_id: id
|
352 |
-
});
|
353 |
-
});
|
354 |
-
|
355 |
-
jQuery(document).on('click', '.wprm-manage-recipes-actions-delete', function(e) {
|
356 |
-
e.preventDefault();
|
357 |
-
|
358 |
-
var id = jQuery(this).data('id'),
|
359 |
-
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
360 |
-
|
361 |
-
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
362 |
-
wprm_admin.delete_recipe(id);
|
363 |
-
}
|
364 |
-
});
|
365 |
-
|
366 |
-
jQuery(document).on('click', '.wprm-manage-ingredients-bulk-delete', function(e) {
|
367 |
-
e.preventDefault();
|
368 |
-
|
369 |
-
var ingredients = jQuery('.wprm-manage-ingredients-bulk:checkbox:checked');
|
370 |
-
var ids = [];
|
371 |
-
|
372 |
-
ingredients.each(function() {
|
373 |
-
ids.push(parseInt(jQuery(this).val()));
|
374 |
-
});
|
375 |
-
|
376 |
-
if(ids.length > 0) {
|
377 |
-
wprm_admin.delete_terms(ids, 'ingredient', 0);
|
378 |
-
}
|
379 |
-
});
|
380 |
-
});
|
381 |
-
|
382 |
-
// Prevent Jetpack compatibility problem.
|
383 |
-
var grunionEditorView = grunionEditorView || {
|
384 |
-
labels : {
|
385 |
-
tinymce_label: ''
|
386 |
}
|
387 |
-
};
|
1 |
+
import initDatatable from './manage/datatable';
|
2 |
+
import initDatatableInteractions from './manage/interactions';
|
3 |
+
import '../../css/admin/manage.scss';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
jQuery(document).ready(function($) {
|
6 |
+
if(jQuery('.wprm-manage-datatable').length > 0) {
|
7 |
+
initDatatable();
|
8 |
+
initDatatableInteractions();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
+
});
|
assets/js/admin/manage/api.js
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export function rename_term(term_id, taxonomy, new_name) {
|
2 |
+
var data = {
|
3 |
+
action: 'wprm_rename_term',
|
4 |
+
security: wprm_temp_admin.nonce,
|
5 |
+
term_id: term_id,
|
6 |
+
taxonomy: taxonomy,
|
7 |
+
new_name: new_name
|
8 |
+
};
|
9 |
+
|
10 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function() {
|
11 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
12 |
+
});
|
13 |
+
};
|
14 |
+
|
15 |
+
export function update_term_metadata(term_id, field, value) {
|
16 |
+
var data = {
|
17 |
+
action: 'wprm_update_term_metadata',
|
18 |
+
security: wprm_temp_admin.nonce,
|
19 |
+
term_id: term_id,
|
20 |
+
field: field,
|
21 |
+
value: value
|
22 |
+
};
|
23 |
+
|
24 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function() {
|
25 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
26 |
+
});
|
27 |
+
};
|
28 |
+
|
29 |
+
export function delete_or_merge_term(term_id, taxonomy, new_term_id) {
|
30 |
+
var data = {
|
31 |
+
action: 'wprm_delete_or_merge_term',
|
32 |
+
security: wprm_temp_admin.nonce,
|
33 |
+
term_id: term_id,
|
34 |
+
taxonomy: taxonomy,
|
35 |
+
new_term_id: new_term_id
|
36 |
+
};
|
37 |
+
|
38 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function() {
|
39 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
40 |
+
});
|
41 |
+
};
|
42 |
+
|
43 |
+
export function delete_terms(term_ids, taxonomy) {
|
44 |
+
var data = {
|
45 |
+
action: 'wprm_delete_terms',
|
46 |
+
security: wprm_temp_admin.nonce,
|
47 |
+
term_ids: term_ids,
|
48 |
+
taxonomy: taxonomy
|
49 |
+
};
|
50 |
+
|
51 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function() {
|
52 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
53 |
+
});
|
54 |
+
};
|
55 |
+
|
56 |
+
export function delete_recipe(recipe_id) {
|
57 |
+
var data = {
|
58 |
+
action: 'wprm_delete_recipe',
|
59 |
+
security: wprm_temp_admin.nonce,
|
60 |
+
recipe_id: recipe_id,
|
61 |
+
};
|
62 |
+
|
63 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function() {
|
64 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
65 |
+
});
|
66 |
+
};
|
assets/js/admin/manage/datatable.js
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import '../../../../vendor/select2/js/select2.min.js';
|
2 |
+
import '../../../../vendor/select2/css/select2.min.css';
|
3 |
+
import 'datatables.net';
|
4 |
+
import 'datatables.net';
|
5 |
+
import 'datatables.net-dt/css/jquery.dataTables.css';
|
6 |
+
import 'tooltipster';
|
7 |
+
import 'tooltipster/dist/css/tooltipster.bundle.css';
|
8 |
+
|
9 |
+
// Source: http://stackoverflow.com/questions/647259/javascript-query-string
|
10 |
+
function get_query_args() {
|
11 |
+
var result = {}, queryString = location.search.slice(1),
|
12 |
+
re = /([^&=]+)=([^&]*)/g, m;
|
13 |
+
|
14 |
+
while (m = re.exec(queryString)) {
|
15 |
+
result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
|
16 |
+
}
|
17 |
+
|
18 |
+
return result;
|
19 |
+
}
|
20 |
+
|
21 |
+
function initDatatableFilters(datable) {
|
22 |
+
var args = get_query_args();
|
23 |
+
jQuery('.wprm-manage-recipes-filter').on('change', function() {
|
24 |
+
datable.search('').draw();
|
25 |
+
}).each(function() {
|
26 |
+
var taxonomy = jQuery(this).data('taxonomy');
|
27 |
+
|
28 |
+
if(args.hasOwnProperty(taxonomy)) {
|
29 |
+
jQuery(this).val(args[taxonomy]);
|
30 |
+
}
|
31 |
+
}).select2_wprm();
|
32 |
+
}
|
33 |
+
|
34 |
+
export default function initDatatable() {
|
35 |
+
// Get ID of datatable that's active on this page
|
36 |
+
var wprm_active_datatable = '';
|
37 |
+
jQuery('.wprm-manage-datatable').each(function() {
|
38 |
+
wprm_active_datatable = jQuery(this).attr('id');
|
39 |
+
});
|
40 |
+
|
41 |
+
// Init datatable
|
42 |
+
$.fn.dataTable.ext.errMode = 'throw';
|
43 |
+
|
44 |
+
var datatable = jQuery('.wprm-manage-datatable').DataTable( {
|
45 |
+
pageLength: 10,
|
46 |
+
order: [ 0, 'desc' ],
|
47 |
+
serverSide: true,
|
48 |
+
ajax: {
|
49 |
+
url: wprm_temp_admin.ajax_url,
|
50 |
+
type: 'POST',
|
51 |
+
data: function ( d ) {
|
52 |
+
d.action = 'wprm_manage_datatable';
|
53 |
+
d.security = wprm_temp_admin.nonce;
|
54 |
+
d.table = wprm_active_datatable;
|
55 |
+
|
56 |
+
// Check for advanced search filters.
|
57 |
+
var search_filters = jQuery('.wprm-manage-recipes-filter');
|
58 |
+
|
59 |
+
if(search_filters.length > 0) {
|
60 |
+
var search = jQuery('#wprm-manage-recipes_wrapper').find('input[type="search"]').val();
|
61 |
+
|
62 |
+
search_filters.each(function() {
|
63 |
+
var taxonomy = jQuery(this).data('taxonomy');
|
64 |
+
var value = parseInt(jQuery(this).val());
|
65 |
+
|
66 |
+
if(value > 0) {
|
67 |
+
search += '{{' + taxonomy + '=' + value +'}}';
|
68 |
+
}
|
69 |
+
});
|
70 |
+
|
71 |
+
d.search.value = search;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
},
|
75 |
+
drawCallback: function() {
|
76 |
+
// Select2.
|
77 |
+
jQuery('.wprm-manage-datatable').find('select').select2_wprm();
|
78 |
+
|
79 |
+
// Add tooltips.
|
80 |
+
jQuery('.wprm-manage-ingredients-actions').tooltipster({
|
81 |
+
content: '<div class="wprm-manage-ingredients-actions-tooltip">' + wprm_temp_admin.manage.tooltip.ingredients + '</div>',
|
82 |
+
contentAsHTML: true,
|
83 |
+
functionBefore: function() {
|
84 |
+
var instances = jQuery.tooltipster.instances();
|
85 |
+
jQuery.each(instances, function(i, instance){
|
86 |
+
instance.close();
|
87 |
+
});
|
88 |
+
},
|
89 |
+
functionReady: function(instance, helper) {
|
90 |
+
var id = parseInt(jQuery(helper.origin).data('id')),
|
91 |
+
count = parseInt(jQuery(helper.origin).data('count')),
|
92 |
+
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
93 |
+
|
94 |
+
jQuery(helper.tooltip).find('a').data('id', id);
|
95 |
+
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
96 |
+
|
97 |
+
if(count > 0) {
|
98 |
+
jQuery(helper.tooltip)
|
99 |
+
.find('.wprm-manage-ingredients-actions-delete')
|
100 |
+
.remove();
|
101 |
+
}
|
102 |
+
},
|
103 |
+
interactive: true,
|
104 |
+
delay: 0,
|
105 |
+
side: 'left',
|
106 |
+
trigger: 'custom',
|
107 |
+
triggerOpen: {
|
108 |
+
mouseenter: true,
|
109 |
+
touchstart: true
|
110 |
+
},
|
111 |
+
triggerClose: {
|
112 |
+
click: true,
|
113 |
+
tap: true
|
114 |
+
},
|
115 |
+
});
|
116 |
+
|
117 |
+
jQuery('.wprm-manage-taxonomies-actions').tooltipster({
|
118 |
+
content: '<div class="wprm-manage-taxonomies-actions-tooltip">' + wprm_temp_admin.manage.tooltip.taxonomies + '</div>',
|
119 |
+
contentAsHTML: true,
|
120 |
+
functionBefore: function() {
|
121 |
+
var instances = jQuery.tooltipster.instances();
|
122 |
+
jQuery.each(instances, function(i, instance){
|
123 |
+
instance.close();
|
124 |
+
});
|
125 |
+
},
|
126 |
+
functionReady: function(instance, helper) {
|
127 |
+
var id = parseInt(jQuery(helper.origin).data('id')),
|
128 |
+
count = parseInt(jQuery(helper.origin).data('count')),
|
129 |
+
name = jQuery('#wprm-manage-taxonomies-name-' + id).text();
|
130 |
+
|
131 |
+
jQuery(helper.tooltip).find('a').data('id', id);
|
132 |
+
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
133 |
+
},
|
134 |
+
interactive: true,
|
135 |
+
delay: 0,
|
136 |
+
side: 'left',
|
137 |
+
trigger: 'custom',
|
138 |
+
triggerOpen: {
|
139 |
+
mouseenter: true,
|
140 |
+
touchstart: true
|
141 |
+
},
|
142 |
+
triggerClose: {
|
143 |
+
click: true,
|
144 |
+
tap: true
|
145 |
+
},
|
146 |
+
});
|
147 |
+
|
148 |
+
jQuery('.wprm-manage-recipes-actions').tooltipster({
|
149 |
+
content: '<div class="wprm-manage-recipes-actions-tooltip">' + wprm_temp_admin.manage.tooltip.recipes + '</div>',
|
150 |
+
contentAsHTML: true,
|
151 |
+
functionBefore: function() {
|
152 |
+
var instances = jQuery.tooltipster.instances();
|
153 |
+
jQuery.each(instances, function(i, instance){
|
154 |
+
instance.close();
|
155 |
+
});
|
156 |
+
},
|
157 |
+
functionReady: function(instance, helper) {
|
158 |
+
var id = parseInt(jQuery(helper.origin).data('id')),
|
159 |
+
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
160 |
+
|
161 |
+
jQuery(helper.tooltip).find('.tooltip-header').text('#' + id + ' - ' + name);
|
162 |
+
jQuery(helper.tooltip).find('a').data('id', id);
|
163 |
+
},
|
164 |
+
interactive: true,
|
165 |
+
delay: 0,
|
166 |
+
side: 'left',
|
167 |
+
trigger: 'custom',
|
168 |
+
triggerOpen: {
|
169 |
+
mouseenter: true,
|
170 |
+
touchstart: true
|
171 |
+
},
|
172 |
+
triggerClose: {
|
173 |
+
click: true,
|
174 |
+
tap: true
|
175 |
+
},
|
176 |
+
});
|
177 |
+
|
178 |
+
jQuery('.wprm-manage-recipes-seo').tooltipster({
|
179 |
+
delay: 0,
|
180 |
+
side: 'left',
|
181 |
+
});
|
182 |
+
}
|
183 |
+
} );
|
184 |
+
|
185 |
+
initDatatableFilters(datatable);
|
186 |
+
}
|
assets/js/admin/manage/interactions.js
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import * as api from './api';
|
2 |
+
import Modal from '../modal/Modal';
|
3 |
+
|
4 |
+
export default function initDatatableInteractions() {
|
5 |
+
jQuery(document).on('click', '.wprm-manage-recipes-seo', function(e) {
|
6 |
+
e.preventDefault();
|
7 |
+
|
8 |
+
var id = jQuery(this).data('id');
|
9 |
+
|
10 |
+
Modal.open(false, {
|
11 |
+
recipe_id: id
|
12 |
+
});
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery(document).on('change', '.wprm-manage-ingredients-link-nofollow', function(e) {
|
16 |
+
e.preventDefault();
|
17 |
+
|
18 |
+
var id = jQuery(this).data('id'),
|
19 |
+
nofollow = jQuery(this).val();
|
20 |
+
|
21 |
+
api.update_term_metadata(id, 'ingredient_link_nofollow', nofollow);
|
22 |
+
});
|
23 |
+
|
24 |
+
jQuery(document).on('click', '.wprm-manage-ingredients-actions-rename', function(e) {
|
25 |
+
e.preventDefault();
|
26 |
+
|
27 |
+
var id = jQuery(this).data('id'),
|
28 |
+
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
29 |
+
|
30 |
+
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
31 |
+
if(new_name) {
|
32 |
+
api.rename_term(id, 'ingredient', new_name);
|
33 |
+
}
|
34 |
+
});
|
35 |
+
|
36 |
+
jQuery(document).on('click', '.wprm-manage-ingredients-actions-link', function(e) {
|
37 |
+
e.preventDefault();
|
38 |
+
|
39 |
+
var id = jQuery(this).data('id'),
|
40 |
+
name = jQuery('#wprm-manage-ingredients-name-' + id).text(),
|
41 |
+
link_container = jQuery('#wprm-manage-ingredients-link-' + id),
|
42 |
+
link = link_container.text();
|
43 |
+
|
44 |
+
var new_link = prompt('What do you want the link for "' + name + '" to be?', link).trim();
|
45 |
+
api.update_term_metadata(id, 'ingredient_link', new_link);
|
46 |
+
});
|
47 |
+
|
48 |
+
jQuery(document).on('click', '.wprm-manage-ingredients-actions-merge', function(e) {
|
49 |
+
e.preventDefault();
|
50 |
+
|
51 |
+
var id = jQuery(this).data('id'),
|
52 |
+
name = jQuery('#wprm-manage-ingredients-name-' + id).text();
|
53 |
+
|
54 |
+
var new_term = parseInt(prompt('What is the ID of the ingredient that you want to merge "' + name + '" into?', ''));
|
55 |
+
if(new_term) {
|
56 |
+
api.delete_or_merge_term(id, 'ingredient', new_term);
|
57 |
+
}
|
58 |
+
});
|
59 |
+
|
60 |
+
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-rename', function(e) {
|
61 |
+
e.preventDefault();
|
62 |
+
|
63 |
+
var id = jQuery(this).data('id'),
|
64 |
+
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
65 |
+
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
66 |
+
|
67 |
+
var new_name = prompt('What do you want to rename "' + name + '" to?', name).trim();
|
68 |
+
if(new_name) {
|
69 |
+
api.rename_term(id, taxonomy, new_name);
|
70 |
+
}
|
71 |
+
});
|
72 |
+
|
73 |
+
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-merge', function(e) {
|
74 |
+
e.preventDefault();
|
75 |
+
|
76 |
+
var id = jQuery(this).data('id'),
|
77 |
+
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
78 |
+
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
79 |
+
|
80 |
+
var new_term = parseInt(prompt('What is the ID of the term that you want to merge "' + name + '" into?', ''));
|
81 |
+
if(new_term) {
|
82 |
+
api.delete_or_merge_term(id, taxonomy, new_term);
|
83 |
+
}
|
84 |
+
});
|
85 |
+
|
86 |
+
jQuery(document).on('click', '.wprm-manage-ingredients-actions-delete', function(e) {
|
87 |
+
e.preventDefault();
|
88 |
+
|
89 |
+
var id = jQuery(this).data('id');
|
90 |
+
api.delete_or_merge_term(id, 'ingredient', 0);
|
91 |
+
});
|
92 |
+
|
93 |
+
jQuery(document).on('click', '.wprm-manage-taxonomies-actions-delete', function(e) {
|
94 |
+
e.preventDefault();
|
95 |
+
|
96 |
+
var id = jQuery(this).data('id'),
|
97 |
+
name = jQuery('#wprm-manage-taxonomies-name-' + id).text(),
|
98 |
+
taxonomy = jQuery('.wprm-manage-taxonomies').data('taxonomy');
|
99 |
+
|
100 |
+
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
101 |
+
api.delete_or_merge_term(id, taxonomy, 0);
|
102 |
+
}
|
103 |
+
});
|
104 |
+
|
105 |
+
jQuery(document).on('click', '.wprm-manage-recipes-actions-edit', function(e) {
|
106 |
+
e.preventDefault();
|
107 |
+
|
108 |
+
var id = jQuery(this).data('id');
|
109 |
+
|
110 |
+
Modal.open(false, {
|
111 |
+
recipe_id: id
|
112 |
+
});
|
113 |
+
});
|
114 |
+
|
115 |
+
jQuery(document).on('click', '.wprm-manage-recipes-actions-delete', function(e) {
|
116 |
+
e.preventDefault();
|
117 |
+
|
118 |
+
var id = jQuery(this).data('id'),
|
119 |
+
name = jQuery('#wprm-manage-recipes-name-' + id).text();
|
120 |
+
|
121 |
+
if(confirm('Are you sure you want to delete "' + name + '"?')) {
|
122 |
+
api.delete_recipe(id);
|
123 |
+
}
|
124 |
+
});
|
125 |
+
|
126 |
+
jQuery(document).on('click', '.wprm-manage-ingredients-bulk-delete', function(e) {
|
127 |
+
e.preventDefault();
|
128 |
+
|
129 |
+
var ingredients = jQuery('.wprm-manage-ingredients-bulk:checkbox:checked');
|
130 |
+
var ids = [];
|
131 |
+
|
132 |
+
ingredients.each(function() {
|
133 |
+
ids.push(parseInt(jQuery(this).val()));
|
134 |
+
});
|
135 |
+
|
136 |
+
if(ids.length > 0) {
|
137 |
+
api.delete_terms(ids, 'ingredient', 0);
|
138 |
+
}
|
139 |
+
});
|
140 |
+
}
|
assets/js/admin/modal.js
CHANGED
@@ -1,233 +1,14 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
wprm_admin.disable_menu = function() {
|
6 |
-
jQuery('.wprm-frame-menu').find('.wprm-menu-item').hide();
|
7 |
-
jQuery('.wprm-menu-hidden').show();
|
8 |
-
};
|
9 |
-
|
10 |
-
wprm_admin.open_modal = function(editor_id, args) {
|
11 |
-
args = args === undefined ? {} : args;
|
12 |
-
|
13 |
-
// Enable menu items
|
14 |
-
jQuery('.wprm-menu-item').show();
|
15 |
-
jQuery('.wprm-menu-hidden').hide();
|
16 |
-
|
17 |
-
wprm_admin.active_editor_id = editor_id;
|
18 |
-
jQuery('.wprm-modal-container').show();
|
19 |
-
|
20 |
-
// Init tabs
|
21 |
-
var tabs = jQuery('.wprm-router').find('.wprm-menu-item');
|
22 |
-
jQuery(tabs).each(function() {
|
23 |
-
init_callback = jQuery(this).data('init');
|
24 |
-
|
25 |
-
if (init_callback && typeof wprm_admin[init_callback] == 'function') {
|
26 |
-
wprm_admin[init_callback](args);
|
27 |
-
}
|
28 |
-
});
|
29 |
-
|
30 |
-
// Default to first menu item
|
31 |
-
jQuery('.wprm-menu').find('.wprm-menu-item').first().click();
|
32 |
-
};
|
33 |
-
|
34 |
-
wprm_admin.close_modal = function() {
|
35 |
-
wprm_admin.active_editor_id = false;
|
36 |
-
jQuery('.wprm-menu').removeClass('visible');
|
37 |
-
jQuery('.wprm-modal-container').hide();
|
38 |
-
};
|
39 |
-
|
40 |
-
wprm_admin.shortcode_escape_map = {
|
41 |
-
'"': "'",
|
42 |
-
'[': '{',
|
43 |
-
']': '}'
|
44 |
-
};
|
45 |
-
|
46 |
-
wprm_admin.shortcode_escape = function(text) {
|
47 |
-
return String(text).replace(/["]/g, function(s) {
|
48 |
-
return wprm_admin.shortcode_escape_map[s];
|
49 |
-
});
|
50 |
-
};
|
51 |
-
|
52 |
-
wprm_admin.add_text_to_editor = function(text) {
|
53 |
-
text = ' ' + text + ' ';
|
54 |
-
|
55 |
-
if (wprm_admin.active_editor_id) {
|
56 |
-
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(wprm_admin.active_editor_id) || tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
57 |
-
var current = jQuery('textarea#' + wprm_admin.active_editor_id).val();
|
58 |
-
jQuery('textarea#' + wprm_admin.active_editor_id).val(current + text);
|
59 |
-
} else {
|
60 |
-
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
61 |
-
tinyMCE.activeEditor.selection.collapse(false);
|
62 |
-
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
};
|
66 |
|
67 |
jQuery(document).ready(function($) {
|
68 |
-
|
69 |
-
jQuery(document).on('click', '.wprm-modal-button', function() {
|
70 |
-
var editor_id = jQuery(this).data('editor');
|
71 |
-
wprm_admin.open_modal(editor_id);
|
72 |
-
});
|
73 |
-
|
74 |
-
// Edit Recipe button
|
75 |
-
jQuery(document).on('click', '.wprm-modal-edit-button', function() {
|
76 |
-
var editor_id = jQuery(this).data('editor');
|
77 |
-
var recipe_id = jQuery(this).data('recipe');
|
78 |
-
|
79 |
-
wprm_admin.open_modal(editor_id, {
|
80 |
-
recipe_id: recipe_id
|
81 |
-
});
|
82 |
-
});
|
83 |
-
|
84 |
-
// Closing Modal
|
85 |
-
jQuery('.wprm-modal-container').on('click', '.wprm-modal-close, .wprm-modal-backdrop', function() {
|
86 |
-
if( ! wprm_admin.changes_made || confirm(wprm_modal.text.modal_close_confirm) ) {
|
87 |
-
wprm_admin.close_modal();
|
88 |
-
}
|
89 |
-
});
|
90 |
-
|
91 |
-
// Modal Menu
|
92 |
-
jQuery('.wprm-menu').on('click', '.wprm-menu-item', function() {
|
93 |
-
var menu_item = jQuery(this),
|
94 |
-
menu_target = menu_item.data('menu'),
|
95 |
-
menu_tab = menu_item.data('tab');
|
96 |
-
|
97 |
-
// Hide Menu if on Mobile
|
98 |
-
jQuery('.wprm-menu').removeClass('visible');
|
99 |
-
|
100 |
-
// Set clicked on tab as the active one
|
101 |
-
jQuery('.wprm-menu').find('.wprm-menu-item').removeClass('active');
|
102 |
-
menu_item.addClass('active');
|
103 |
-
|
104 |
-
// Show correct menu
|
105 |
-
jQuery('.wprm-frame-router').find('.wprm-router').removeClass('active');
|
106 |
-
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).addClass('active');
|
107 |
-
|
108 |
-
// Show the first tab as active or whichever tab was passed along
|
109 |
-
var active_tab = false;
|
110 |
-
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
111 |
-
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).find('.wprm-menu-item').each(function(index) {
|
112 |
-
if (index === 0 || jQuery(this).data('tab') == menu_tab) {
|
113 |
-
active_tab = jQuery(this);
|
114 |
-
}
|
115 |
-
});
|
116 |
-
|
117 |
-
if (active_tab) {
|
118 |
-
active_tab.click();
|
119 |
-
}
|
120 |
-
|
121 |
-
// Change main title
|
122 |
-
jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
|
123 |
-
|
124 |
-
// // Show save button for recipes
|
125 |
-
// if ('recipe' == menu_target) {
|
126 |
-
// jQuery('.wprm-button-action-save').show();
|
127 |
-
// } else {
|
128 |
-
// jQuery('.wprm-button-action-save').hide();
|
129 |
-
// }
|
130 |
-
});
|
131 |
-
|
132 |
-
// Modal Menu on Mobile
|
133 |
-
jQuery('.wprm-modal-container').on('click', '.wprm-frame-title', function() {
|
134 |
-
jQuery('.wprm-menu').toggleClass('visible');
|
135 |
-
});
|
136 |
-
|
137 |
-
// Modal Tabs
|
138 |
-
jQuery('.wprm-router').on('click', '.wprm-menu-item', function() {
|
139 |
-
var menu_item = jQuery(this),
|
140 |
-
tab_target = menu_item.data('tab'),
|
141 |
-
tab_button = menu_item.data('button');
|
142 |
-
|
143 |
-
// Set clicked on tab as the active one
|
144 |
-
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
145 |
-
menu_item.addClass('active');
|
146 |
-
|
147 |
-
// Hide action button if no callback is set
|
148 |
-
if (menu_item.data('callback')) {
|
149 |
-
jQuery('.wprm-button-action').text(tab_button).show();
|
150 |
-
|
151 |
-
if('wprm-menu-recipe' == menu_item.parents('.wprm-router').attr('id')) {
|
152 |
-
jQuery('.wprm-button-action-save').show();
|
153 |
-
} else {
|
154 |
-
jQuery('.wprm-button-action-save').hide();
|
155 |
-
}
|
156 |
-
} else {
|
157 |
-
jQuery('.wprm-button-action').hide();
|
158 |
-
jQuery('.wprm-button-action-save').hide();
|
159 |
-
}
|
160 |
-
|
161 |
-
// Show correct tab
|
162 |
-
jQuery('.wprm-frame-content').find('.wprm-frame-content-tab').removeClass('active');
|
163 |
-
jQuery('.wprm-frame-content').find('#wprm-tab-' + tab_target).addClass('active');
|
164 |
-
});
|
165 |
-
|
166 |
-
// Select Recipes Dropdown
|
167 |
-
jQuery('.wprm-recipes-dropdown').select2_wprm({
|
168 |
-
width: '250px',
|
169 |
-
ajax: {
|
170 |
-
type: 'POST',
|
171 |
-
url: wprm_modal.ajax_url,
|
172 |
-
dataType: 'json',
|
173 |
-
delay: 250,
|
174 |
-
data: function (params) {
|
175 |
-
return {
|
176 |
-
action: 'wprm_search_recipes',
|
177 |
-
security: wprm_modal.nonce,
|
178 |
-
search: params.term
|
179 |
-
};
|
180 |
-
},
|
181 |
-
processResults: function (out, params) {
|
182 |
-
return {
|
183 |
-
results: out.data.recipes_with_id,
|
184 |
-
};
|
185 |
-
},
|
186 |
-
cache: true
|
187 |
-
},
|
188 |
-
minimumInputLength: 1,
|
189 |
-
});
|
190 |
-
|
191 |
-
jQuery('.wprm-recipes-dropdown-with-first').select2_wprm({
|
192 |
-
width: '250px',
|
193 |
-
ajax: {
|
194 |
-
type: 'POST',
|
195 |
-
url: wprm_modal.ajax_url,
|
196 |
-
dataType: 'json',
|
197 |
-
delay: 250,
|
198 |
-
data: function (params) {
|
199 |
-
return {
|
200 |
-
action: 'wprm_search_recipes',
|
201 |
-
security: wprm_modal.nonce,
|
202 |
-
search: params.term
|
203 |
-
};
|
204 |
-
},
|
205 |
-
processResults: function (out, params) {
|
206 |
-
var default_options = [{
|
207 |
-
id: '0',
|
208 |
-
text: wprm_modal.text.first_recipe_on_page,
|
209 |
-
}];
|
210 |
-
return {
|
211 |
-
results: default_options.concat(out.data.recipes_with_id),
|
212 |
-
};
|
213 |
-
},
|
214 |
-
cache: true
|
215 |
-
},
|
216 |
-
minimumInputLength: 1,
|
217 |
-
});
|
218 |
-
|
219 |
-
// Insert or Update Button
|
220 |
-
jQuery('.wprm-button-action').on('click', function() {
|
221 |
-
var active_tab = jQuery('.wprm-router.active').find('.wprm-menu-item.active'),
|
222 |
-
callback = active_tab.data('callback');
|
223 |
-
|
224 |
-
if (typeof wprm_admin[callback] == 'function') {
|
225 |
-
wprm_admin[callback](jQuery(this));
|
226 |
-
}
|
227 |
-
});
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
});
|
1 |
+
import Modal from './modal/Modal';
|
2 |
+
import './modal/tabs/import-text';
|
3 |
+
import './modal/tabs/recipe-snippets';
|
4 |
+
import './modal/tabs/recipe';
|
5 |
|
6 |
+
import '../../css/admin/modal.scss';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
jQuery(document).ready(function($) {
|
9 |
+
let container = jQuery('.wprm-modal-container');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
if (container) {
|
12 |
+
Modal.init(container);
|
13 |
+
}
|
14 |
+
});
|
|
assets/js/admin/modal/Modal.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Recipe from './Recipe';
|
2 |
+
import modalInit from './ModalInit';
|
3 |
+
|
4 |
+
let Modal = {
|
5 |
+
changes_made: false,
|
6 |
+
container: false,
|
7 |
+
active_editor_id: false,
|
8 |
+
actions: {},
|
9 |
+
recipe: Recipe,
|
10 |
+
init: function(container) {
|
11 |
+
this.container = container;
|
12 |
+
modalInit(this);
|
13 |
+
this.recipe.init();
|
14 |
+
},
|
15 |
+
open: function(editor_id, args = {}) {
|
16 |
+
// Enable menu items
|
17 |
+
jQuery('.wprm-menu-item').show();
|
18 |
+
jQuery('.wprm-menu-hidden').hide();
|
19 |
+
|
20 |
+
this.active_editor_id = editor_id;
|
21 |
+
jQuery('.wprm-modal-container').show();
|
22 |
+
|
23 |
+
// Init tabs
|
24 |
+
var tabs = jQuery('.wprm-router').find('.wprm-menu-item');
|
25 |
+
jQuery(tabs).each(function() {
|
26 |
+
let init_callback = jQuery(this).data('init');
|
27 |
+
|
28 |
+
if (init_callback && typeof Modal.actions[init_callback] == 'function') {
|
29 |
+
Modal.actions[init_callback](args);
|
30 |
+
}
|
31 |
+
});
|
32 |
+
|
33 |
+
// Default to first menu item
|
34 |
+
jQuery('.wprm-menu').find('.wprm-menu-item').first().click();
|
35 |
+
|
36 |
+
this.changes_made = false;
|
37 |
+
},
|
38 |
+
close: function() {
|
39 |
+
this.active_editor_id = false;
|
40 |
+
jQuery('.wprm-menu').removeClass('visible');
|
41 |
+
jQuery('.wprm-modal-container').hide();
|
42 |
+
},
|
43 |
+
disable_menu: function() {
|
44 |
+
jQuery('.wprm-frame-menu').find('.wprm-menu-item').hide();
|
45 |
+
jQuery('.wprm-menu-hidden').show();
|
46 |
+
},
|
47 |
+
}
|
48 |
+
export default Modal;
|
assets/js/admin/modal/ModalInit.js
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export default function modalInit(modal) {
|
2 |
+
// Closing Modal.
|
3 |
+
jQuery(modal.container).on('click', '.wprm-modal-close, .wprm-modal-backdrop', function() {
|
4 |
+
if( ! modal.changes_made || confirm(wprm_temp_admin.modal.text.modal_close_confirm) ) {
|
5 |
+
modal.close();
|
6 |
+
}
|
7 |
+
});
|
8 |
+
|
9 |
+
// Modal Menu.
|
10 |
+
jQuery('.wprm-menu').on('click', '.wprm-menu-item', function() {
|
11 |
+
var menu_item = jQuery(this),
|
12 |
+
menu_target = menu_item.data('menu'),
|
13 |
+
menu_tab = menu_item.data('tab');
|
14 |
+
|
15 |
+
// Hide Menu if on Mobile
|
16 |
+
jQuery('.wprm-menu').removeClass('visible');
|
17 |
+
|
18 |
+
// Set clicked on tab as the active one
|
19 |
+
jQuery('.wprm-menu').find('.wprm-menu-item').removeClass('active');
|
20 |
+
menu_item.addClass('active');
|
21 |
+
|
22 |
+
// Show correct menu
|
23 |
+
jQuery('.wprm-frame-router').find('.wprm-router').removeClass('active');
|
24 |
+
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).addClass('active');
|
25 |
+
|
26 |
+
// Show the first tab as active or whichever tab was passed along
|
27 |
+
var active_tab = false;
|
28 |
+
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
29 |
+
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).find('.wprm-menu-item').each(function(index) {
|
30 |
+
if (index === 0 || jQuery(this).data('tab') == menu_tab) {
|
31 |
+
active_tab = jQuery(this);
|
32 |
+
}
|
33 |
+
});
|
34 |
+
|
35 |
+
if (active_tab) {
|
36 |
+
active_tab.click();
|
37 |
+
}
|
38 |
+
|
39 |
+
// Change main title
|
40 |
+
jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
|
41 |
+
});
|
42 |
+
|
43 |
+
// Modal Menu on Mobile
|
44 |
+
jQuery(modal.container).on('click', '.wprm-frame-title', function() {
|
45 |
+
jQuery('.wprm-menu').toggleClass('visible');
|
46 |
+
});
|
47 |
+
|
48 |
+
// Modal Tabs
|
49 |
+
jQuery('.wprm-router').on('click', '.wprm-menu-item', function() {
|
50 |
+
var menu_item = jQuery(this),
|
51 |
+
tab_target = menu_item.data('tab'),
|
52 |
+
tab_button = menu_item.data('button');
|
53 |
+
|
54 |
+
// Set clicked on tab as the active one
|
55 |
+
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
56 |
+
menu_item.addClass('active');
|
57 |
+
|
58 |
+
// Hide action button if no callback is set
|
59 |
+
if (menu_item.data('callback')) {
|
60 |
+
jQuery('.wprm-button-action').text(tab_button).show();
|
61 |
+
|
62 |
+
if('wprm-menu-recipe' == menu_item.parents('.wprm-router').attr('id')) {
|
63 |
+
jQuery('.wprm-button-action-save').show();
|
64 |
+
} else {
|
65 |
+
jQuery('.wprm-button-action-save').hide();
|
66 |
+
}
|
67 |
+
} else {
|
68 |
+
jQuery('.wprm-button-action').hide();
|
69 |
+
jQuery('.wprm-button-action-save').hide();
|
70 |
+
}
|
71 |
+
|
72 |
+
// Show correct tab
|
73 |
+
jQuery('.wprm-frame-content').find('.wprm-frame-content-tab').removeClass('active');
|
74 |
+
jQuery('.wprm-frame-content').find('#wprm-tab-' + tab_target).addClass('active');
|
75 |
+
});
|
76 |
+
|
77 |
+
// Insert or Update Button
|
78 |
+
jQuery('.wprm-button-action').on('click', function() {
|
79 |
+
var active_tab = jQuery('.wprm-router.active').find('.wprm-menu-item.active'),
|
80 |
+
callback = active_tab.data('callback');
|
81 |
+
|
82 |
+
if (callback && typeof modal.actions[callback] == 'function') {
|
83 |
+
modal.actions[callback](jQuery(this));
|
84 |
+
}
|
85 |
+
});
|
86 |
+
|
87 |
+
// Prevent Divi Builder bug.
|
88 |
+
jQuery(modal.container).keydown( function(e) {
|
89 |
+
e.stopPropagation();
|
90 |
+
});
|
91 |
+
|
92 |
+
// Select Recipes Dropdown
|
93 |
+
jQuery('.wprm-recipes-dropdown').select2_wprm({
|
94 |
+
width: '250px',
|
95 |
+
ajax: {
|
96 |
+
type: 'POST',
|
97 |
+
url: wprm_temp_admin.ajax_url,
|
98 |
+
dataType: 'json',
|
99 |
+
delay: 250,
|
100 |
+
data: function (params) {
|
101 |
+
return {
|
102 |
+
action: 'wprm_search_recipes',
|
103 |
+
security: wprm_temp_admin.nonce,
|
104 |
+
search: params.term
|
105 |
+
};
|
106 |
+
},
|
107 |
+
processResults: function (out, params) {
|
108 |
+
return {
|
109 |
+
results: out.data.recipes_with_id,
|
110 |
+
};
|
111 |
+
},
|
112 |
+
cache: true
|
113 |
+
},
|
114 |
+
minimumInputLength: 1,
|
115 |
+
});
|
116 |
+
|
117 |
+
jQuery('.wprm-recipes-dropdown-with-first').select2_wprm({
|
118 |
+
width: '250px',
|
119 |
+
ajax: {
|
120 |
+
type: 'POST',
|
121 |
+
url: wprm_temp_admin.ajax_url,
|
122 |
+
dataType: 'json',
|
123 |
+
delay: 250,
|
124 |
+
data: function (params) {
|
125 |
+
return {
|
126 |
+
action: 'wprm_search_recipes',
|
127 |
+
security: wprm_temp_admin.nonce,
|
128 |
+
search: params.term
|
129 |
+
};
|
130 |
+
},
|
131 |
+
processResults: function (out, params) {
|
132 |
+
var default_options = [{
|
133 |
+
id: '0',
|
134 |
+
text: wprm_temp_admin.modal.text.first_recipe_on_page,
|
135 |
+
}];
|
136 |
+
return {
|
137 |
+
results: default_options.concat(out.data.recipes_with_id),
|
138 |
+
};
|
139 |
+
},
|
140 |
+
cache: true
|
141 |
+
},
|
142 |
+
minimumInputLength: 1,
|
143 |
+
});
|
144 |
+
}
|
assets/js/admin/modal/Recipe.js
ADDED
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import * as utils from './utils';
|
2 |
+
import recipeInit from './RecipeInit';
|
3 |
+
import RichEditor from './RichEditor';
|
4 |
+
|
5 |
+
let Recipe = {
|
6 |
+
id: 0,
|
7 |
+
type: 'insert',
|
8 |
+
fields: false,
|
9 |
+
ingredient: {},
|
10 |
+
instructions: {},
|
11 |
+
prep_time_set: false,
|
12 |
+
cook_time_set: false,
|
13 |
+
total_time_set: false,
|
14 |
+
init: function() {
|
15 |
+
recipeInit(this);
|
16 |
+
},
|
17 |
+
clear: function() {
|
18 |
+
// Recipe Details
|
19 |
+
utils.remove_media_image(jQuery('.wprm-recipe-image-container'));
|
20 |
+
jQuery('#wprm-recipe-name').val('');
|
21 |
+
RichEditor.clear(); // Recipe summary
|
22 |
+
jQuery('#wprm-recipe-author-display').val('default').change();
|
23 |
+
jQuery('#wprm-recipe-author-name').val('');
|
24 |
+
jQuery('#wprm-recipe-author-link').val('');
|
25 |
+
jQuery('#wprm-recipe-servings').val('');
|
26 |
+
jQuery('#wprm-recipe-servings-unit').val('');
|
27 |
+
jQuery('#wprm-recipe-calories').val('');
|
28 |
+
jQuery('#wprm-recipe-prep-time').val('');
|
29 |
+
jQuery('#wprm-recipe-cook-time').val('');
|
30 |
+
jQuery('#wprm-recipe-total-time').val('');
|
31 |
+
|
32 |
+
this.prep_time_set = false;
|
33 |
+
this.cook_time_set = false;
|
34 |
+
this.total_time_set = false;
|
35 |
+
|
36 |
+
jQuery('.wprm-recipe-tags').val(null).trigger('change');
|
37 |
+
|
38 |
+
// Ingredients & Instructions
|
39 |
+
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete, .wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
40 |
+
jQuery(this).click();
|
41 |
+
});
|
42 |
+
jQuery('.wprm-recipe-ingredients-add').click();
|
43 |
+
jQuery('.wprm-recipe-instructions-add').click();
|
44 |
+
|
45 |
+
// Recipe Notes
|
46 |
+
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
47 |
+
tinyMCE.get('wprm_recipe_notes').focus(true);
|
48 |
+
|
49 |
+
// Check for error caused by EasyRecipe.
|
50 |
+
jQuery('.wprm-easyrecipe-warning').hide();
|
51 |
+
try {
|
52 |
+
tinyMCE.activeEditor.setContent('');
|
53 |
+
} catch(err) {
|
54 |
+
jQuery('.wprm-easyrecipe-warning').show();
|
55 |
+
}
|
56 |
+
} else {
|
57 |
+
jQuery('#wprm_recipe_notes').val('');
|
58 |
+
}
|
59 |
+
},
|
60 |
+
set: function(recipe) {
|
61 |
+
// Recipe Details
|
62 |
+
if (parseInt(recipe.image_id) > 0) {
|
63 |
+
utils.set_media_image(jQuery('.wprm-recipe-details-form .wprm-recipe-image-container'), recipe.image_id, recipe.image_url);
|
64 |
+
}
|
65 |
+
|
66 |
+
jQuery('#wprm-recipe-name').val(recipe.name);
|
67 |
+
RichEditor.set(recipe.summary);
|
68 |
+
jQuery('#wprm-recipe-servings-unit').val(recipe.servings_unit);
|
69 |
+
|
70 |
+
jQuery('#wprm-recipe-author-display').val(recipe.author_display).change();
|
71 |
+
jQuery('#wprm-recipe-author-name').val(recipe.author_name);
|
72 |
+
jQuery('#wprm-recipe-author-link').val(recipe.author_link);
|
73 |
+
|
74 |
+
var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
|
75 |
+
calories = recipe.nutrition.calories ? parseFloat(recipe.nutrition.calories) : '',
|
76 |
+
prep_time = parseInt(recipe.prep_time) > 0 ? parseInt(recipe.prep_time) : '',
|
77 |
+
cook_time = parseInt(recipe.cook_time) > 0 ? parseInt(recipe.cook_time) : '',
|
78 |
+
total_time = parseInt(recipe.total_time) > 0 ? parseInt(recipe.total_time) : '';
|
79 |
+
|
80 |
+
jQuery('#wprm-recipe-servings').val(servings);
|
81 |
+
jQuery('#wprm-recipe-calories').val(calories);
|
82 |
+
jQuery('#wprm-recipe-prep-time').val(prep_time);
|
83 |
+
jQuery('#wprm-recipe-cook-time').val(cook_time);
|
84 |
+
jQuery('#wprm-recipe-total-time').val(total_time);
|
85 |
+
|
86 |
+
if (prep_time) this.prep_time_set = true;
|
87 |
+
if (cook_time) this.cook_time_set = true;
|
88 |
+
if (total_time) this.total_time_set = true;
|
89 |
+
|
90 |
+
for (var tag in recipe.tags) {
|
91 |
+
if (recipe.tags.hasOwnProperty(tag)) {
|
92 |
+
this.setTags(recipe, tag);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
// Ingredients & Instructions
|
97 |
+
this.setIngredients(recipe.ingredients);
|
98 |
+
this.setInstructions(recipe.instructions);
|
99 |
+
|
100 |
+
// Recipe Notes
|
101 |
+
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
102 |
+
tinyMCE.get('wprm_recipe_notes').focus(true);
|
103 |
+
tinyMCE.activeEditor.setContent(recipe.notes);
|
104 |
+
} else {
|
105 |
+
jQuery('#wprm_recipe_notes').val(recipe.notes);
|
106 |
+
}
|
107 |
+
},
|
108 |
+
setTags: function(recipe, tag) {
|
109 |
+
var term_ids = [],
|
110 |
+
select = jQuery('#wprm-recipe-tag-' + tag);
|
111 |
+
|
112 |
+
for (var i = 0, l = recipe.tags[tag].length; i < l; i++) {
|
113 |
+
var term = recipe.tags[tag][i];
|
114 |
+
term_ids.push(term.term_id);
|
115 |
+
|
116 |
+
// Add term to options if not in there
|
117 |
+
if (select.find('option[value=' + term.term_id + ']').length === 0) {
|
118 |
+
select.append('<option value="' + term.term_id + '">' + term.name + '</option>');
|
119 |
+
}
|
120 |
+
}
|
121 |
+
select.val(term_ids).trigger('change');
|
122 |
+
},
|
123 |
+
setIngredients: function(ingredients) {
|
124 |
+
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete').each(function() {
|
125 |
+
jQuery(this).click();
|
126 |
+
});
|
127 |
+
|
128 |
+
var i, l, group, j, m;
|
129 |
+
|
130 |
+
for (i = 0, l = ingredients.length; i < l; i++) {
|
131 |
+
group = ingredients[i];
|
132 |
+
|
133 |
+
if (i > 0 || group.name !== '') {
|
134 |
+
Recipe.addIngredientGroup(group.name);
|
135 |
+
}
|
136 |
+
|
137 |
+
for (j = 0, m = group.ingredients.length; j < m; j++) {
|
138 |
+
var ingredient = group.ingredients[j];
|
139 |
+
var uid = Recipe.addIngredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
|
140 |
+
Recipe.ingredients[uid] = ingredient;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
},
|
144 |
+
setInstructions: function(instructions) {
|
145 |
+
jQuery('.wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
146 |
+
jQuery(this).click();
|
147 |
+
});
|
148 |
+
|
149 |
+
var i, l, group, j, m;
|
150 |
+
|
151 |
+
for (i = 0, l = instructions.length; i < l; i++) {
|
152 |
+
group = instructions[i];
|
153 |
+
|
154 |
+
if (i > 0 || group.name !== '') {
|
155 |
+
Recipe.addInstructionGroup(group.name);
|
156 |
+
}
|
157 |
+
|
158 |
+
for (j = 0, m = group.instructions.length; j < m; j++) {
|
159 |
+
var instruction = group.instructions[j];
|
160 |
+
var uid = Recipe.addInstruction(instruction.text, instruction.image);
|
161 |
+
Recipe.instructions[uid] = instruction;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
},
|
165 |
+
get: function() {
|
166 |
+
// Default author display
|
167 |
+
var author_display = jQuery('#wprm-recipe-author-display').val();
|
168 |
+
|
169 |
+
if(author_display == 'default') {
|
170 |
+
author_display = jQuery('#wprm-recipe-author-display').find('option:first').data('default');
|
171 |
+
}
|
172 |
+
|
173 |
+
// Recipe Details
|
174 |
+
var recipe = {
|
175 |
+
image_id: jQuery('#wprm-recipe-image-id').val(),
|
176 |
+
name: jQuery('#wprm-recipe-name').val(),
|
177 |
+
summary: jQuery('#wprm-recipe-summary').val(),
|
178 |
+
author_display: author_display,
|
179 |
+
author_name: jQuery('#wprm-recipe-author-name').val(),
|
180 |
+
author_link: jQuery('#wprm-recipe-author-link').val(),
|
181 |
+
servings: jQuery('#wprm-recipe-servings').val(),
|
182 |
+
servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
|
183 |
+
prep_time: jQuery('#wprm-recipe-prep-time').val(),
|
184 |
+
cook_time: jQuery('#wprm-recipe-cook-time').val(),
|
185 |
+
total_time: jQuery('#wprm-recipe-total-time').val(),
|
186 |
+
nutrition: {
|
187 |
+
calories: jQuery('#wprm-recipe-calories').val()
|
188 |
+
},
|
189 |
+
tags: {
|
190 |
+
course: jQuery('#wprm-recipe-tag-course').val(),
|
191 |
+
cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
|
192 |
+
}
|
193 |
+
};
|
194 |
+
|
195 |
+
// Recipe Tags
|
196 |
+
recipe.tags = {};
|
197 |
+
jQuery('.wprm-recipe-tags').each(function() {
|
198 |
+
recipe.tags[jQuery(this).data('key')] = jQuery(this).val();
|
199 |
+
});
|
200 |
+
|
201 |
+
// Recipe Ingredients
|
202 |
+
recipe.ingredients = this.getIngredients();
|
203 |
+
|
204 |
+
// Recipe Instructions
|
205 |
+
var instructions = [];
|
206 |
+
var instruction_group = {
|
207 |
+
name: '',
|
208 |
+
instructions: []
|
209 |
+
};
|
210 |
+
jQuery('.wprm-recipe-instructions').find('tr').each(function() {
|
211 |
+
var row = jQuery(this);
|
212 |
+
if (row.hasClass('wprm-recipe-instruction-group')) {
|
213 |
+
// Add current instruction group to instructions
|
214 |
+
instructions.push(instruction_group);
|
215 |
+
|
216 |
+
instruction_group = {
|
217 |
+
name: row.find('.wprm-recipe-instruction-group-name').val(),
|
218 |
+
instructions: []
|
219 |
+
};
|
220 |
+
} else {
|
221 |
+
instruction_group.instructions.push({
|
222 |
+
text: row.find('textarea.wprm-recipe-instruction-text').val(),
|
223 |
+
image: row.find('.wprm-recipe-instruction-image').val()
|
224 |
+
});
|
225 |
+
}
|
226 |
+
});
|
227 |
+
// Add remaining instruction group
|
228 |
+
instructions.push(instruction_group);
|
229 |
+
|
230 |
+
recipe.instructions = instructions;
|
231 |
+
|
232 |
+
// Recipe Notes
|
233 |
+
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
234 |
+
recipe.notes = tinyMCE.get('wprm_recipe_notes').getContent();
|
235 |
+
} else {
|
236 |
+
recipe.notes = jQuery('#wprm_recipe_notes').val();
|
237 |
+
}
|
238 |
+
|
239 |
+
return recipe;
|
240 |
+
},
|
241 |
+
getIngredients: function() {
|
242 |
+
var ingredients = [];
|
243 |
+
var ingredient_group = {
|
244 |
+
name: '',
|
245 |
+
ingredients: []
|
246 |
+
};
|
247 |
+
jQuery('.wprm-recipe-ingredients').find('tr').each(function() {
|
248 |
+
var row = jQuery(this);
|
249 |
+
if (row.hasClass('wprm-recipe-ingredient-group')) {
|
250 |
+
// Add current ingredient group to ingredients
|
251 |
+
ingredients.push(ingredient_group);
|
252 |
+
|
253 |
+
ingredient_group = {
|
254 |
+
name: row.find('.wprm-recipe-ingredient-group-name').val(),
|
255 |
+
ingredients: []
|
256 |
+
};
|
257 |
+
} else {
|
258 |
+
var uid = row.data('uid'),
|
259 |
+
ingredient = {};
|
260 |
+
|
261 |
+
// Get original values.
|
262 |
+
if(Recipe.ingredients.hasOwnProperty(uid)) {
|
263 |
+
ingredient = Recipe.ingredients[uid];
|
264 |
+
}
|
265 |
+
|
266 |
+
// Update ingredients.
|
267 |
+
ingredient['amount'] = row.find('.wprm-recipe-ingredient-amount').val();
|
268 |
+
ingredient['unit'] = row.find('.wprm-recipe-ingredient-unit').val();
|
269 |
+
ingredient['name'] = row.find('.wprm-recipe-ingredient-name').val();
|
270 |
+
ingredient['notes'] = row.find('.wprm-recipe-ingredient-notes').val();
|
271 |
+
|
272 |
+
// Unit Conversion.
|
273 |
+
var converted = jQuery('#wprm-ingredient-conversion-' + uid);
|
274 |
+
|
275 |
+
if (converted.length > 0) {
|
276 |
+
var amount = converted.find('.wprmuc-system-2-amount').val(),
|
277 |
+
unit = converted.find('.wprmuc-system-2-unit').val();
|
278 |
+
|
279 |
+
ingredient['converted'] = {
|
280 |
+
2: {
|
281 |
+
amount: amount,
|
282 |
+
unit: unit,
|
283 |
+
}
|
284 |
+
};
|
285 |
+
}
|
286 |
+
|
287 |
+
// Add ingredient to group.
|
288 |
+
ingredient_group.ingredients.push(ingredient);
|
289 |
+
}
|
290 |
+
});
|
291 |
+
|
292 |
+
// Add remaining ingredient group
|
293 |
+
ingredients.push(ingredient_group);
|
294 |
+
|
295 |
+
return ingredients;
|
296 |
+
},
|
297 |
+
addIngredient: function(amount = '', unit = '', name = '', notes = '') {
|
298 |
+
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient').clone();
|
299 |
+
jQuery('.wprm-recipe-ingredients').append(clone);
|
300 |
+
|
301 |
+
clone.find('.wprm-recipe-ingredient-amount').val(amount).focus();
|
302 |
+
clone.find('.wprm-recipe-ingredient-unit').val(unit);
|
303 |
+
clone.find('.wprm-recipe-ingredient-name').val(name);
|
304 |
+
clone.find('.wprm-recipe-ingredient-notes').val(notes);
|
305 |
+
|
306 |
+
while(true) {
|
307 |
+
var uid = Math.floor(Math.random() * 99999);
|
308 |
+
if(!Recipe.ingredients.hasOwnProperty(uid)) {
|
309 |
+
clone.data('uid', uid);
|
310 |
+
Recipe.ingredients[uid] = {};
|
311 |
+
return uid;
|
312 |
+
}
|
313 |
+
}
|
314 |
+
},
|
315 |
+
addIngredientGroup: function(name = '') {
|
316 |
+
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient-group').clone();
|
317 |
+
jQuery('.wprm-recipe-ingredients').append(clone);
|
318 |
+
clone.find('input:first').val(name).focus();
|
319 |
+
},
|
320 |
+
addInstruction: function(text = '', image_id = 0) {
|
321 |
+
|
322 |
+
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction').clone();
|
323 |
+
clone.find('.wprm-recipe-instruction-text').addClass('wprm-rich-editor');
|
324 |
+
jQuery('.wprm-recipe-instructions').append(clone);
|
325 |
+
clone.find('.wprm-recipe-instruction-text').val(text);
|
326 |
+
RichEditor.init();
|
327 |
+
clone.find('.wprm-recipe-instruction-text').focus();
|
328 |
+
|
329 |
+
// Get image thumbnail if there is an instruction image.
|
330 |
+
if (parseInt(image_id) > 0) {
|
331 |
+
var image_container = clone.find('.wprm-recipe-image-container'),
|
332 |
+
button = image_container.find('.wprm-recipe-image-add');
|
333 |
+
|
334 |
+
var data = {
|
335 |
+
action: 'wprm_get_thumbnail',
|
336 |
+
security: wprm_temp_admin.nonce,
|
337 |
+
image_id: image_id
|
338 |
+
};
|
339 |
+
|
340 |
+
utils.start_loader(button);
|
341 |
+
|
342 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
343 |
+
utils.stop_loader(button);
|
344 |
+
|
345 |
+
if (out.success) {
|
346 |
+
utils.set_media_image(image_container, image_id, out.data.image_url);
|
347 |
+
}
|
348 |
+
}, 'json');
|
349 |
+
}
|
350 |
+
|
351 |
+
while(true) {
|
352 |
+
var uid = Math.floor(Math.random() * 99999);
|
353 |
+
if(!Recipe.instructions.hasOwnProperty(uid)) {
|
354 |
+
clone.data('uid', uid);
|
355 |
+
Recipe.instructions[uid] = {};
|
356 |
+
return uid;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
},
|
361 |
+
addInstructionGroup: function(name = '') {
|
362 |
+
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction-group').clone();
|
363 |
+
jQuery('.wprm-recipe-instructions').append(clone);
|
364 |
+
clone.find('input:first').val(name).focus();
|
365 |
+
},
|
366 |
+
}
|
367 |
+
export default Recipe;
|
assets/js/admin/modal/RecipeInit.js
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import '../../../../vendor/select2/js/select2.min.js';
|
2 |
+
import '../../../../vendor/select2/css/select2.min.css';
|
3 |
+
|
4 |
+
import * as utils from './utils';
|
5 |
+
import Modal from './Modal';
|
6 |
+
import Recipe from './Recipe';
|
7 |
+
import RichEditor from './RichEditor';
|
8 |
+
|
9 |
+
export default function recipeInit(recipe) {
|
10 |
+
// Check for changes made
|
11 |
+
jQuery('.wprm-modal').on('change', 'input, textarea, #wprm-recipe-author-display, .wprm-recipe-tags, #wprm-ingredient-links-type', function() {
|
12 |
+
Modal.changes_made = true;
|
13 |
+
});
|
14 |
+
|
15 |
+
// Recipe and Instruction Image handler
|
16 |
+
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-add', function(e) {
|
17 |
+
utils.select_media_image(jQuery(this).parents('.wprm-recipe-image-container'));
|
18 |
+
});
|
19 |
+
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-remove', function(e) {
|
20 |
+
utils.remove_media_image(jQuery(this).parents('.wprm-recipe-image-container'));
|
21 |
+
});
|
22 |
+
|
23 |
+
// Initialize rich editor
|
24 |
+
RichEditor.init();
|
25 |
+
|
26 |
+
// Author
|
27 |
+
jQuery('#wprm-recipe-author-display').select2_wprm({
|
28 |
+
width: '95%'
|
29 |
+
});
|
30 |
+
|
31 |
+
jQuery(document).on('change', '#wprm-recipe-author-display', function() {
|
32 |
+
var author_display = jQuery(this).val(),
|
33 |
+
default_display = jQuery(this).find('option:first').data('default');
|
34 |
+
|
35 |
+
if(author_display == 'custom' || (author_display == 'default' && default_display == 'custom')) {
|
36 |
+
jQuery('#wprm-recipe-author-name-container').show();
|
37 |
+
jQuery('#wprm-recipe-author-link-container').show();
|
38 |
+
} else {
|
39 |
+
jQuery('#wprm-recipe-author-name-container').hide();
|
40 |
+
jQuery('#wprm-recipe-author-link-container').hide();
|
41 |
+
}
|
42 |
+
});
|
43 |
+
jQuery('#wprm-recipe-author-display').change();
|
44 |
+
|
45 |
+
// Recipe Times
|
46 |
+
jQuery('.wprm-recipe-time').on('keyup change', function() {
|
47 |
+
var container = jQuery(this),
|
48 |
+
prep_time_container = jQuery('#wprm-recipe-prep-time'),
|
49 |
+
prep_time = prep_time_container.val(),
|
50 |
+
cook_time_container = jQuery('#wprm-recipe-cook-time'),
|
51 |
+
cook_time = cook_time_container.val(),
|
52 |
+
total_time_container = jQuery('#wprm-recipe-total-time'),
|
53 |
+
total_time = total_time_container.val();
|
54 |
+
|
55 |
+
if (container.is('#wprm-recipe-prep-time')) Recipe.prep_time_set = true;
|
56 |
+
if (container.is('#wprm-recipe-cook-time')) Recipe.cook_time_set = true;
|
57 |
+
if (container.is('#wprm-recipe-total-time')) Recipe.total_time_set = true;
|
58 |
+
|
59 |
+
if (prep_time && cook_time && !Recipe.total_time_set) total_time_container.val(parseInt(prep_time) + parseInt(cook_time));
|
60 |
+
if (total_time && prep_time && !Recipe.cook_time_set) cook_time_container.val(parseInt(total_time) - parseInt(prep_time));
|
61 |
+
if (total_time && cook_time && !Recipe.prep_time_set) prep_time_container.val(parseInt(total_time) - parseInt(cook_time));
|
62 |
+
});
|
63 |
+
|
64 |
+
// Recipe Tags
|
65 |
+
jQuery('.wprm-recipe-tags').select2_wprm({
|
66 |
+
width: '95%',
|
67 |
+
tags: true
|
68 |
+
});
|
69 |
+
|
70 |
+
// Add Recipe Ingredients and Instructions
|
71 |
+
jQuery('.wprm-recipe-ingredients-add').on('click', function() {
|
72 |
+
Recipe.addIngredient();
|
73 |
+
});
|
74 |
+
jQuery('.wprm-recipe-ingredients-add-group').on('click', function() {
|
75 |
+
Recipe.addIngredientGroup();
|
76 |
+
});
|
77 |
+
jQuery('.wprm-recipe-instructions-add').on('click', function() {
|
78 |
+
Recipe.addInstruction();
|
79 |
+
});
|
80 |
+
jQuery('.wprm-recipe-instructions-add-group').on('click', function() {
|
81 |
+
Recipe.addInstructionGroup();
|
82 |
+
});
|
83 |
+
|
84 |
+
// Add new ingredient/instruction on TAB
|
85 |
+
jQuery('.wprm-recipe-ingredients').on('keydown', '.wprm-recipe-ingredient-notes, .wprm-recipe-ingredient-group-name', function(e) {
|
86 |
+
var keyCode = e.keyCode || e.which,
|
87 |
+
input = jQuery(this);
|
88 |
+
|
89 |
+
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
90 |
+
e.preventDefault();
|
91 |
+
Recipe.addIngredient();
|
92 |
+
}
|
93 |
+
});
|
94 |
+
jQuery('.wprm-recipe-instructions').on('keydown', '.wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name', function(e) {
|
95 |
+
var keyCode = e.keyCode || e.which,
|
96 |
+
input = jQuery(this);
|
97 |
+
|
98 |
+
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
99 |
+
e.preventDefault();
|
100 |
+
Recipe.addInstruction();
|
101 |
+
}
|
102 |
+
});
|
103 |
+
|
104 |
+
// Remove Recipe Ingredients and Instructions
|
105 |
+
jQuery('.wprm-recipe-ingredients-instructions-form').on('click', '.wprm-recipe-ingredients-instructions-delete', function() {
|
106 |
+
jQuery(this).parents('tr').remove();
|
107 |
+
});
|
108 |
+
|
109 |
+
// Sort Recipe Ingredients and Instructions
|
110 |
+
jQuery('.wprm-recipe-ingredients, .wprm-recipe-instructions').sortable({
|
111 |
+
opacity: 0.6,
|
112 |
+
revert: true,
|
113 |
+
cursor: 'move',
|
114 |
+
handle: '.wprm-recipe-ingredients-instructions-sort',
|
115 |
+
});
|
116 |
+
|
117 |
+
// Save recipe button.
|
118 |
+
jQuery('.wprm-button-action-save').on('click', function() {
|
119 |
+
Modal.actions.insert_update_recipe(jQuery(this));
|
120 |
+
});
|
121 |
+
}
|
assets/js/admin/modal/RichEditor.js
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import rangy from 'rangy';
|
2 |
+
import MediumEditor from 'medium-editor';
|
3 |
+
import 'medium-editor/dist/css/medium-editor.css';
|
4 |
+
import 'medium-editor/dist/css/themes/beagle.css';
|
5 |
+
|
6 |
+
import {initRichEditorLinks, RichEditorLinksExtension} from './RichEditorLinks';
|
7 |
+
import Modal from './Modal';
|
8 |
+
|
9 |
+
let RichEditor = {
|
10 |
+
editor: false,
|
11 |
+
clear: function() {
|
12 |
+
this.editor.resetContent();
|
13 |
+
},
|
14 |
+
set: function(content) {
|
15 |
+
this.editor.setContent(content);
|
16 |
+
},
|
17 |
+
init: function() {
|
18 |
+
if (this.editor) {
|
19 |
+
this.editor.addElements('.wprm-rich-editor');
|
20 |
+
} else {
|
21 |
+
rangy.init();
|
22 |
+
initRichEditorLinks();
|
23 |
+
|
24 |
+
let args = {
|
25 |
+
placeholder: {
|
26 |
+
text: wprm_temp_admin.modal.text.medium_editor_placeholder,
|
27 |
+
hideOnClick: true
|
28 |
+
},
|
29 |
+
autoLink: true,
|
30 |
+
anchorPreview: {
|
31 |
+
showWhenToolbarIsVisible: false,
|
32 |
+
},
|
33 |
+
imageDragging: false,
|
34 |
+
toolbar: {
|
35 |
+
buttons: ['bold', 'italic', 'underline', 'subscript', 'superscript']
|
36 |
+
},
|
37 |
+
extensions: {}
|
38 |
+
};
|
39 |
+
|
40 |
+
args.toolbar.buttons.push('links');
|
41 |
+
args.extensions.links = new this.extensions.links();
|
42 |
+
|
43 |
+
if(wprm_temp_admin.addons.premium) {
|
44 |
+
args.toolbar.buttons.push('adjustable_servings');
|
45 |
+
args.toolbar.buttons.push('timer');
|
46 |
+
|
47 |
+
args.extensions.adjustable_servings = new this.extensions.adjustable_servings();
|
48 |
+
args.extensions.timer = new this.extensions.timer();
|
49 |
+
}
|
50 |
+
|
51 |
+
this.editor = new MediumEditor('.wprm-rich-editor', args);
|
52 |
+
this.editor.subscribe('editableInput', function() {
|
53 |
+
Modal.changes_made = true;
|
54 |
+
});
|
55 |
+
}
|
56 |
+
},
|
57 |
+
extensions: {
|
58 |
+
adjustable_servings: MediumEditor.Extension.extend({
|
59 |
+
name: 'adjustable_servings',
|
60 |
+
init: function () {
|
61 |
+
this.button = this.document.createElement('button');
|
62 |
+
this.button.classList.add('medium-editor-action');
|
63 |
+
this.button.innerHTML = '<b>Adjustable</b>';
|
64 |
+
this.button.title = 'Adjustable Quantity';
|
65 |
+
|
66 |
+
this.on(this.button, 'click', this.handleClick.bind(this));
|
67 |
+
},
|
68 |
+
getButton: function () {
|
69 |
+
return this.button;
|
70 |
+
},
|
71 |
+
handleClick: function (event) {
|
72 |
+
var selection = rangy.getSelection(),
|
73 |
+
range = selection.getRangeAt(0),
|
74 |
+
original_range = range.cloneRange(),
|
75 |
+
end_range = range.cloneRange(),
|
76 |
+
text = range.getDocument().createTextNode('[adjustable]'),
|
77 |
+
end_text = range.getDocument().createTextNode('[/adjustable]');
|
78 |
+
|
79 |
+
end_range.collapse(false);
|
80 |
+
end_range.insertNode(end_text);
|
81 |
+
end_range.detach();
|
82 |
+
range.setEndAfter(end_text);
|
83 |
+
|
84 |
+
range.insertNode(text);
|
85 |
+
rangy.getSelection().setSingleRange(original_range);
|
86 |
+
}
|
87 |
+
}),
|
88 |
+
timer: MediumEditor.Extension.extend({
|
89 |
+
name: 'timer',
|
90 |
+
init: function () {
|
91 |
+
this.button = this.document.createElement('button');
|
92 |
+
this.button.classList.add('medium-editor-action');
|
93 |
+
this.button.innerHTML = '<b>Timer</b>';
|
94 |
+
this.button.title = 'Timer';
|
95 |
+
|
96 |
+
this.on(this.button, 'click', this.handleClick.bind(this));
|
97 |
+
},
|
98 |
+
getButton: function () {
|
99 |
+
return this.button;
|
100 |
+
},
|
101 |
+
handleClick: function (event) {
|
102 |
+
var selection = rangy.getSelection(),
|
103 |
+
range = selection.getRangeAt(0),
|
104 |
+
original_range = range.cloneRange(),
|
105 |
+
end_range = range.cloneRange(),
|
106 |
+
text = range.getDocument().createTextNode('[timer minutes=0]'),
|
107 |
+
end_text = range.getDocument().createTextNode('[/timer]');
|
108 |
+
|
109 |
+
end_range.collapse(false);
|
110 |
+
end_range.insertNode(end_text);
|
111 |
+
end_range.detach();
|
112 |
+
range.setEndAfter(end_text);
|
113 |
+
|
114 |
+
range.insertNode(text);
|
115 |
+
rangy.getSelection().setSingleRange(original_range);
|
116 |
+
}
|
117 |
+
}),
|
118 |
+
links: RichEditorLinksExtension,
|
119 |
+
}
|
120 |
+
}
|
121 |
+
export default RichEditor;
|
assets/js/admin/{rich-editor.js → modal/RichEditorLinks.js}
RENAMED
@@ -1,296 +1,195 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
//
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
parentElement,
|
191 |
-
parentElement.childNodes.length
|
192 |
-
);
|
193 |
-
}
|
194 |
-
|
195 |
-
var modifiedExportedSelection = this.exportSelection();
|
196 |
-
|
197 |
-
textNodes = MediumEditor.util.findOrCreateMatchingTextNodes(
|
198 |
-
this.options.ownerDocument,
|
199 |
-
fragment,
|
200 |
-
{
|
201 |
-
start: exportedSelection.start - modifiedExportedSelection.start,
|
202 |
-
end: exportedSelection.end - modifiedExportedSelection.start,
|
203 |
-
editableElementIndex: exportedSelection.editableElementIndex
|
204 |
-
}
|
205 |
-
);
|
206 |
-
// If textNodes are not present, when changing link on images
|
207 |
-
// ex: <a><img src="http://image.test.com"></a>, change fragment to currRange.startContainer
|
208 |
-
// and set textNodes array to [imageElement, imageElement]
|
209 |
-
if (textNodes.length === 0) {
|
210 |
-
fragment = this.options.ownerDocument.createDocumentFragment();
|
211 |
-
fragment.appendChild(commonAncestorContainer.cloneNode(true));
|
212 |
-
textNodes = [fragment.firstChild.firstChild, fragment.firstChild.lastChild];
|
213 |
-
}
|
214 |
-
|
215 |
-
// Creates the link in the document fragment
|
216 |
-
MediumEditor.util.createLink(this.options.ownerDocument, textNodes, targetUrl.trim());
|
217 |
-
|
218 |
-
// Chrome trims the leading whitespaces when inserting HTML, which messes up restoring the selection.
|
219 |
-
var leadingWhitespacesCount = (fragment.firstChild.innerHTML.match(/^\s+/) || [''])[0].length;
|
220 |
-
|
221 |
-
// Now move the created link back into the original document in a way to preserve undo/redo history
|
222 |
-
MediumEditor.util.insertHTMLCommand(this.options.ownerDocument, fragment.firstChild.innerHTML.replace(/^\s+/, ''));
|
223 |
-
exportedSelection.start -= leadingWhitespacesCount;
|
224 |
-
exportedSelection.end -= leadingWhitespacesCount;
|
225 |
-
|
226 |
-
this.importSelection(exportedSelection);
|
227 |
-
} else {
|
228 |
-
this.options.ownerDocument.execCommand('createLink', false, targetUrl);
|
229 |
-
}
|
230 |
-
|
231 |
-
if (this.options.targetBlank || opts.target === '_blank') {
|
232 |
-
MediumEditor.util.setTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
233 |
-
} else {
|
234 |
-
MediumEditor.util.removeTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
235 |
-
}
|
236 |
-
|
237 |
-
if (opts.rel === 'nofollow') {
|
238 |
-
MediumEditor.util.setNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
239 |
-
} else {
|
240 |
-
MediumEditor.util.removeNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
241 |
-
}
|
242 |
-
|
243 |
-
if (opts.buttonClass) {
|
244 |
-
MediumEditor.util.addClassToAnchors(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), opts.buttonClass);
|
245 |
-
}
|
246 |
-
}
|
247 |
-
}
|
248 |
-
// Fire input event for backwards compatibility if anyone was listening directly to the DOM input event
|
249 |
-
if (this.options.targetBlank || opts.target === '_blank' || opts.rel === 'nofollow' || opts.buttonClass) {
|
250 |
-
customEvent = this.options.ownerDocument.createEvent('HTMLEvents');
|
251 |
-
customEvent.initEvent('input', true, true, this.options.contentWindow);
|
252 |
-
for (var i = 0, len = this.elements.length; i < len; i += 1) {
|
253 |
-
this.elements[i].dispatchEvent(customEvent);
|
254 |
-
}
|
255 |
-
}
|
256 |
-
} finally {
|
257 |
-
this.events.enableCustomEvent('editableInput');
|
258 |
-
}
|
259 |
-
// Fire our custom editableInput event
|
260 |
-
this.events.triggerCustomEvent('editableInput', customEvent, currentEditor);
|
261 |
-
};
|
262 |
-
|
263 |
-
MediumEditor.util.setNofollow = function (el, anchorUrl) {
|
264 |
-
var i, url = anchorUrl || false;
|
265 |
-
if (el.nodeName.toLowerCase() === 'a') {
|
266 |
-
el.rel = 'nofollow';
|
267 |
-
} else {
|
268 |
-
el = el.getElementsByTagName('a');
|
269 |
-
|
270 |
-
for (i = 0; i < el.length; i += 1) {
|
271 |
-
if (false === url || url === el[i].attributes.href.value) {
|
272 |
-
el[i].rel = 'nofollow';
|
273 |
-
}
|
274 |
-
}
|
275 |
-
}
|
276 |
-
};
|
277 |
-
|
278 |
-
MediumEditor.util.removeNofollow = function (el, anchorUrl) {
|
279 |
-
var i;
|
280 |
-
if (el.nodeName.toLowerCase() === 'a') {
|
281 |
-
el.removeAttribute('rel');
|
282 |
-
} else {
|
283 |
-
el = el.getElementsByTagName('a');
|
284 |
-
|
285 |
-
for (i = 0; i < el.length; i += 1) {
|
286 |
-
if (anchorUrl === el[i].attributes.href.value) {
|
287 |
-
el[i].removeAttribute('rel');
|
288 |
-
}
|
289 |
-
}
|
290 |
-
}
|
291 |
};
|
292 |
|
293 |
-
|
294 |
/* Anchor Form Options */
|
295 |
|
296 |
/* customClassOption: [string] (previously options.anchorButton + options.anchorButtonClass)
|
1 |
+
import MediumEditor from 'medium-editor';
|
2 |
+
|
3 |
+
export function initRichEditorLinks() {
|
4 |
+
// Source: medium-editor.js
|
5 |
+
MediumEditor.prototype.createLink = function (opts) {
|
6 |
+
var currentEditor = MediumEditor.selection.getSelectionElement(this.options.contentWindow),
|
7 |
+
customEvent = {},
|
8 |
+
targetUrl;
|
9 |
+
|
10 |
+
// Make sure the selection is within an element this editor is tracking
|
11 |
+
if (this.elements.indexOf(currentEditor) === -1) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
try {
|
16 |
+
this.events.disableCustomEvent('editableInput');
|
17 |
+
// TODO: Deprecate support for opts.url in 6.0.0
|
18 |
+
if (opts.url) {
|
19 |
+
MediumEditor.util.deprecated('.url option for createLink', '.value', '6.0.0');
|
20 |
+
}
|
21 |
+
targetUrl = opts.url || opts.value;
|
22 |
+
if (targetUrl && targetUrl.trim().length > 0) {
|
23 |
+
var currentSelection = this.options.contentWindow.getSelection();
|
24 |
+
if (currentSelection) {
|
25 |
+
var currRange = currentSelection.getRangeAt(0),
|
26 |
+
commonAncestorContainer = currRange.commonAncestorContainer,
|
27 |
+
exportedSelection,
|
28 |
+
startContainerParentElement,
|
29 |
+
endContainerParentElement,
|
30 |
+
textNodes;
|
31 |
+
|
32 |
+
// If the selection is contained within a single text node
|
33 |
+
// and the selection starts at the beginning of the text node,
|
34 |
+
// MSIE still says the startContainer is the parent of the text node.
|
35 |
+
// If the selection is contained within a single text node, we
|
36 |
+
// want to just use the default browser 'createLink', so we need
|
37 |
+
// to account for this case and adjust the commonAncestorContainer accordingly
|
38 |
+
if (currRange.endContainer.nodeType === 3 &&
|
39 |
+
currRange.startContainer.nodeType !== 3 &&
|
40 |
+
currRange.startOffset === 0 &&
|
41 |
+
currRange.startContainer.firstChild === currRange.endContainer) {
|
42 |
+
commonAncestorContainer = currRange.endContainer;
|
43 |
+
}
|
44 |
+
|
45 |
+
startContainerParentElement = MediumEditor.util.getClosestBlockContainer(currRange.startContainer);
|
46 |
+
endContainerParentElement = MediumEditor.util.getClosestBlockContainer(currRange.endContainer);
|
47 |
+
|
48 |
+
// If the selection is not contained within a single text node
|
49 |
+
// but the selection is contained within the same block element
|
50 |
+
// we want to make sure we create a single link, and not multiple links
|
51 |
+
// which can happen with the built in browser functionality
|
52 |
+
if (commonAncestorContainer.nodeType !== 3 && commonAncestorContainer.textContent.length !== 0 && startContainerParentElement === endContainerParentElement) {
|
53 |
+
var parentElement = (startContainerParentElement || currentEditor),
|
54 |
+
fragment = this.options.ownerDocument.createDocumentFragment();
|
55 |
+
|
56 |
+
// since we are going to create a link from an extracted text,
|
57 |
+
// be sure that if we are updating a link, we won't let an empty link behind (see #754)
|
58 |
+
// (Workaroung for Chrome)
|
59 |
+
this.execAction('unlink');
|
60 |
+
|
61 |
+
exportedSelection = this.exportSelection();
|
62 |
+
fragment.appendChild(parentElement.cloneNode(true));
|
63 |
+
|
64 |
+
if (currentEditor === parentElement) {
|
65 |
+
// We have to avoid the editor itself being wiped out when it's the only block element,
|
66 |
+
// as our reference inside this.elements gets detached from the page when insertHTML runs.
|
67 |
+
// If we just use [parentElement, 0] and [parentElement, parentElement.childNodes.length]
|
68 |
+
// as the range boundaries, this happens whenever parentElement === currentEditor.
|
69 |
+
// The tradeoff to this workaround is that a orphaned tag can sometimes be left behind at
|
70 |
+
// the end of the editor's content.
|
71 |
+
// In Gecko:
|
72 |
+
// as an empty <strong></strong> if parentElement.lastChild is a <strong> tag.
|
73 |
+
// In WebKit:
|
74 |
+
// an invented <br /> tag at the end in the same situation
|
75 |
+
MediumEditor.selection.select(
|
76 |
+
this.options.ownerDocument,
|
77 |
+
parentElement.firstChild,
|
78 |
+
0,
|
79 |
+
parentElement.lastChild,
|
80 |
+
parentElement.lastChild.nodeType === 3 ?
|
81 |
+
parentElement.lastChild.nodeValue.length : parentElement.lastChild.childNodes.length
|
82 |
+
);
|
83 |
+
} else {
|
84 |
+
MediumEditor.selection.select(
|
85 |
+
this.options.ownerDocument,
|
86 |
+
parentElement,
|
87 |
+
0,
|
88 |
+
parentElement,
|
89 |
+
parentElement.childNodes.length
|
90 |
+
);
|
91 |
+
}
|
92 |
+
|
93 |
+
var modifiedExportedSelection = this.exportSelection();
|
94 |
+
|
95 |
+
textNodes = MediumEditor.util.findOrCreateMatchingTextNodes(
|
96 |
+
this.options.ownerDocument,
|
97 |
+
fragment,
|
98 |
+
{
|
99 |
+
start: exportedSelection.start - modifiedExportedSelection.start,
|
100 |
+
end: exportedSelection.end - modifiedExportedSelection.start,
|
101 |
+
editableElementIndex: exportedSelection.editableElementIndex
|
102 |
+
}
|
103 |
+
);
|
104 |
+
// If textNodes are not present, when changing link on images
|
105 |
+
// ex: <a><img src="http://image.test.com"></a>, change fragment to currRange.startContainer
|
106 |
+
// and set textNodes array to [imageElement, imageElement]
|
107 |
+
if (textNodes.length === 0) {
|
108 |
+
fragment = this.options.ownerDocument.createDocumentFragment();
|
109 |
+
fragment.appendChild(commonAncestorContainer.cloneNode(true));
|
110 |
+
textNodes = [fragment.firstChild.firstChild, fragment.firstChild.lastChild];
|
111 |
+
}
|
112 |
+
|
113 |
+
// Creates the link in the document fragment
|
114 |
+
MediumEditor.util.createLink(this.options.ownerDocument, textNodes, targetUrl.trim());
|
115 |
+
|
116 |
+
// Chrome trims the leading whitespaces when inserting HTML, which messes up restoring the selection.
|
117 |
+
var leadingWhitespacesCount = (fragment.firstChild.innerHTML.match(/^\s+/) || [''])[0].length;
|
118 |
+
|
119 |
+
// Now move the created link back into the original document in a way to preserve undo/redo history
|
120 |
+
MediumEditor.util.insertHTMLCommand(this.options.ownerDocument, fragment.firstChild.innerHTML.replace(/^\s+/, ''));
|
121 |
+
exportedSelection.start -= leadingWhitespacesCount;
|
122 |
+
exportedSelection.end -= leadingWhitespacesCount;
|
123 |
+
|
124 |
+
this.importSelection(exportedSelection);
|
125 |
+
} else {
|
126 |
+
this.options.ownerDocument.execCommand('createLink', false, targetUrl);
|
127 |
+
}
|
128 |
+
|
129 |
+
if (this.options.targetBlank || opts.target === '_blank') {
|
130 |
+
MediumEditor.util.setTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
131 |
+
} else {
|
132 |
+
MediumEditor.util.removeTargetBlank(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
133 |
+
}
|
134 |
+
|
135 |
+
if (opts.rel === 'nofollow') {
|
136 |
+
MediumEditor.util.setNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
137 |
+
} else {
|
138 |
+
MediumEditor.util.removeNofollow(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), targetUrl);
|
139 |
+
}
|
140 |
+
|
141 |
+
if (opts.buttonClass) {
|
142 |
+
MediumEditor.util.addClassToAnchors(MediumEditor.selection.getSelectionStart(this.options.ownerDocument), opts.buttonClass);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
// Fire input event for backwards compatibility if anyone was listening directly to the DOM input event
|
147 |
+
if (this.options.targetBlank || opts.target === '_blank' || opts.rel === 'nofollow' || opts.buttonClass) {
|
148 |
+
customEvent = this.options.ownerDocument.createEvent('HTMLEvents');
|
149 |
+
customEvent.initEvent('input', true, true, this.options.contentWindow);
|
150 |
+
for (var i = 0, len = this.elements.length; i < len; i += 1) {
|
151 |
+
this.elements[i].dispatchEvent(customEvent);
|
152 |
+
}
|
153 |
+
}
|
154 |
+
} finally {
|
155 |
+
this.events.enableCustomEvent('editableInput');
|
156 |
+
}
|
157 |
+
// Fire our custom editableInput event
|
158 |
+
this.events.triggerCustomEvent('editableInput', customEvent, currentEditor);
|
159 |
+
};
|
160 |
+
|
161 |
+
MediumEditor.util.setNofollow = function (el, anchorUrl) {
|
162 |
+
var i, url = anchorUrl || false;
|
163 |
+
if (el.nodeName.toLowerCase() === 'a') {
|
164 |
+
el.rel = 'nofollow';
|
165 |
+
} else {
|
166 |
+
el = el.getElementsByTagName('a');
|
167 |
+
|
168 |
+
for (i = 0; i < el.length; i += 1) {
|
169 |
+
if (false === url || url === el[i].attributes.href.value) {
|
170 |
+
el[i].rel = 'nofollow';
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
};
|
175 |
+
|
176 |
+
MediumEditor.util.removeNofollow = function (el, anchorUrl) {
|
177 |
+
var i;
|
178 |
+
if (el.nodeName.toLowerCase() === 'a') {
|
179 |
+
el.removeAttribute('rel');
|
180 |
+
} else {
|
181 |
+
el = el.getElementsByTagName('a');
|
182 |
+
|
183 |
+
for (i = 0; i < el.length; i += 1) {
|
184 |
+
if (anchorUrl === el[i].attributes.href.value) {
|
185 |
+
el[i].removeAttribute('rel');
|
186 |
+
}
|
187 |
+
}
|
188 |
+
}
|
189 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
};
|
191 |
|
192 |
+
export let RichEditorLinksExtension = MediumEditor.extensions.form.extend({
|
193 |
/* Anchor Form Options */
|
194 |
|
195 |
/* customClassOption: [string] (previously options.anchorButton + options.anchorButtonClass)
|
assets/js/admin/{import-text.js → modal/tabs/import-text.js}
RENAMED
@@ -1,25 +1,29 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
wprm_admin.text_import_waiting = false;
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
10 |
jQuery('.wprm-button-import-text-clear').removeAttr('disabled');
|
11 |
jQuery('.wprm-button-import-text-next').removeAttr('disabled');
|
12 |
|
13 |
-
|
14 |
jQuery('#import-text-highlight-sandbox').textHighlighter();
|
15 |
-
|
16 |
};
|
17 |
|
18 |
-
|
19 |
-
|
20 |
jQuery('#import-text-highlight-sandbox').text('');
|
21 |
-
|
22 |
-
|
23 |
|
24 |
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
25 |
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
@@ -30,41 +34,41 @@ wprm_admin.btn_text_import_reset = function() {
|
|
30 |
jQuery('#import-text-highlight-sandbox').hide();
|
31 |
};
|
32 |
|
33 |
-
|
34 |
-
if(all ||
|
35 |
jQuery('#import-text-input-recipe').val('');
|
36 |
}
|
37 |
|
38 |
-
if(all ||
|
39 |
jQuery('#import-text-ingredient-groups').find('input').attr('checked', false);
|
40 |
}
|
41 |
|
42 |
-
if(all ||
|
43 |
jQuery('#import-text-instruction-groups').find('input').attr('checked', false);
|
44 |
}
|
45 |
|
46 |
-
|
47 |
};
|
48 |
|
49 |
-
|
50 |
-
if(
|
51 |
-
|
52 |
-
jQuery('#import-text-highlight-sandbox').html(
|
53 |
|
54 |
-
|
55 |
-
} else if(
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
} else if(
|
60 |
-
|
61 |
|
62 |
jQuery('#import-text-highlight-sandbox').show();
|
63 |
|
64 |
-
|
65 |
-
} else if(
|
66 |
-
var ingredients =
|
67 |
-
|
68 |
|
69 |
jQuery('#import-text-ingredient-groups').html('');
|
70 |
for(var i = 0, l = ingredients.length; i<l; i++) {
|
@@ -77,13 +81,13 @@ wprm_admin.btn_text_import_next = function() {
|
|
77 |
|
78 |
if(ingredients.length == 0) {
|
79 |
jQuery('#import-text-highlight-sandbox').show();
|
80 |
-
|
81 |
-
|
82 |
} else {
|
83 |
jQuery('#import-text-highlight-sandbox').hide();
|
84 |
-
|
85 |
}
|
86 |
-
} else if(
|
87 |
var ingredients = [],
|
88 |
ingredient_group = {
|
89 |
name: '',
|
@@ -107,29 +111,29 @@ wprm_admin.btn_text_import_next = function() {
|
|
107 |
});
|
108 |
ingredients.push(ingredient_group);
|
109 |
|
110 |
-
|
111 |
|
112 |
// Parse ingredients
|
113 |
var data = {
|
114 |
action: 'wprm_parse_ingredients',
|
115 |
-
security:
|
116 |
ingredients: ingredients
|
117 |
};
|
118 |
|
119 |
-
|
120 |
-
jQuery.post(
|
121 |
-
|
122 |
if (out.success) {
|
123 |
-
|
124 |
}
|
125 |
}, 'json');
|
126 |
|
127 |
jQuery('#import-text-highlight-sandbox').show();
|
128 |
|
129 |
-
|
130 |
-
} else if(
|
131 |
-
var instructions =
|
132 |
-
|
133 |
|
134 |
jQuery('#import-text-instruction-groups').html('');
|
135 |
for(var i = 0, l = instructions.length; i<l; i++) {
|
@@ -142,13 +146,13 @@ wprm_admin.btn_text_import_next = function() {
|
|
142 |
|
143 |
if(instructions.length == 0) {
|
144 |
jQuery('#import-text-highlight-sandbox').show();
|
145 |
-
|
146 |
-
|
147 |
} else {
|
148 |
jQuery('#import-text-highlight-sandbox').hide();
|
149 |
-
|
150 |
}
|
151 |
-
} else if(
|
152 |
var instructions = [],
|
153 |
instruction_group = {
|
154 |
name: '',
|
@@ -172,50 +176,50 @@ wprm_admin.btn_text_import_next = function() {
|
|
172 |
});
|
173 |
instructions.push(instruction_group);
|
174 |
|
175 |
-
|
176 |
|
177 |
jQuery('#import-text-highlight-sandbox').show();
|
178 |
|
179 |
-
|
180 |
-
} else if(
|
181 |
-
|
182 |
|
183 |
jQuery('#import-text-highlight-sandbox').hide();
|
184 |
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
185 |
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
186 |
jQuery('.wprm-button-import-text-next').attr('disabled', 'disabled');
|
187 |
|
188 |
-
if(
|
189 |
-
|
190 |
-
|
191 |
} else {
|
192 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
193 |
-
|
194 |
-
|
195 |
}
|
196 |
-
} else if(
|
197 |
-
if(!
|
198 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
199 |
-
|
200 |
-
|
201 |
}
|
202 |
}
|
203 |
|
204 |
jQuery('.import-text-step').hide();
|
205 |
-
jQuery('#import-text-step-' +
|
206 |
-
|
207 |
};
|
208 |
|
209 |
-
|
210 |
-
if(
|
211 |
-
setTimeout(
|
212 |
} else {
|
213 |
-
|
214 |
}
|
215 |
};
|
216 |
|
217 |
-
|
218 |
-
var highlight_parts =
|
219 |
var highlight = '';
|
220 |
|
221 |
for(var i = 0, l = highlight_parts.length; i<l; i++) {
|
@@ -228,50 +232,50 @@ wprm_admin.get_highlighted_text = function() {
|
|
228 |
return highlight;
|
229 |
};
|
230 |
|
231 |
-
|
232 |
-
if(
|
233 |
-
jQuery('#wprm-recipe-name').val(
|
234 |
}
|
235 |
|
236 |
-
if(
|
237 |
-
|
238 |
}
|
239 |
|
240 |
-
if(
|
241 |
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
242 |
tinyMCE.get('wprm_recipe_notes').focus(true);
|
243 |
-
tinyMCE.activeEditor.setContent(
|
244 |
} else {
|
245 |
-
jQuery('#wprm_recipe_notes').val(
|
246 |
}
|
247 |
}
|
248 |
|
249 |
-
if(
|
250 |
-
|
251 |
}
|
252 |
|
253 |
-
if(
|
254 |
-
|
255 |
}
|
256 |
};
|
257 |
|
258 |
jQuery(document).ready(function($) {
|
259 |
jQuery('#import-text-input-recipe').on('keydown change', function() {
|
260 |
-
|
261 |
});
|
262 |
|
263 |
jQuery('.wprm-button-import-text-reset').on('click', function() {
|
264 |
-
if(confirm(
|
265 |
-
|
266 |
}
|
267 |
});
|
268 |
|
269 |
jQuery('.wprm-button-import-text-clear').on('click', function() {
|
270 |
-
|
271 |
});
|
272 |
|
273 |
jQuery('.wprm-button-import-text-next').on('click', function() {
|
274 |
-
|
275 |
});
|
276 |
|
277 |
jQuery('.import-text-input-groups').on('change', 'input', function() {
|
1 |
+
import '../../../../../vendor/texthighlighter/TextHighlighter.min.js';
|
2 |
|
3 |
+
import Modal from '../Modal';
|
4 |
+
import Recipe from '../Recipe';
|
5 |
+
import RichEditor from '../RichEditor';
|
|
|
6 |
|
7 |
+
let text_import_step = '';
|
8 |
+
let text_import_highlighter;
|
9 |
+
let text_import = {};
|
10 |
+
let text_import_waiting = false;
|
11 |
+
|
12 |
+
function start_text_import() {
|
13 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
14 |
jQuery('.wprm-button-import-text-clear').removeAttr('disabled');
|
15 |
jQuery('.wprm-button-import-text-next').removeAttr('disabled');
|
16 |
|
17 |
+
text_import_step = 'input';
|
18 |
jQuery('#import-text-highlight-sandbox').textHighlighter();
|
19 |
+
text_import_highlighter = jQuery('#import-text-highlight-sandbox').getHighlighter()
|
20 |
};
|
21 |
|
22 |
+
function btn_text_import_reset() {
|
23 |
+
btn_text_import_clear(true);
|
24 |
jQuery('#import-text-highlight-sandbox').text('');
|
25 |
+
text_import = {};
|
26 |
+
text_import_waiting = false;
|
27 |
|
28 |
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
29 |
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
34 |
jQuery('#import-text-highlight-sandbox').hide();
|
35 |
};
|
36 |
|
37 |
+
function btn_text_import_clear(all) {
|
38 |
+
if(all || text_import_step == 'input') {
|
39 |
jQuery('#import-text-input-recipe').val('');
|
40 |
}
|
41 |
|
42 |
+
if(all || text_import_step == 'ingredient-groups') {
|
43 |
jQuery('#import-text-ingredient-groups').find('input').attr('checked', false);
|
44 |
}
|
45 |
|
46 |
+
if(all || text_import_step == 'instruction-groups') {
|
47 |
jQuery('#import-text-instruction-groups').find('input').attr('checked', false);
|
48 |
}
|
49 |
|
50 |
+
text_import_highlighter.removeHighlights();
|
51 |
};
|
52 |
|
53 |
+
function btn_text_import_next() {
|
54 |
+
if(text_import_step == 'input') {
|
55 |
+
text_import.raw = jQuery('#import-text-input-recipe').val();
|
56 |
+
jQuery('#import-text-highlight-sandbox').html(text_import.raw.replace(/\r?\n/g,'<br/>')).show();
|
57 |
|
58 |
+
text_import_step = 'name';
|
59 |
+
} else if(text_import_step == 'name') {
|
60 |
+
text_import.name = get_highlighted_text();
|
61 |
|
62 |
+
text_import_step = 'summary';
|
63 |
+
} else if(text_import_step == 'summary') {
|
64 |
+
text_import.summary = get_highlighted_text();
|
65 |
|
66 |
jQuery('#import-text-highlight-sandbox').show();
|
67 |
|
68 |
+
text_import_step = 'ingredients';
|
69 |
+
} else if(text_import_step == 'ingredients') {
|
70 |
+
var ingredients = text_import_highlighter.getHighlights();
|
71 |
+
text_import.ingredients_raw = ingredients;
|
72 |
|
73 |
jQuery('#import-text-ingredient-groups').html('');
|
74 |
for(var i = 0, l = ingredients.length; i<l; i++) {
|
81 |
|
82 |
if(ingredients.length == 0) {
|
83 |
jQuery('#import-text-highlight-sandbox').show();
|
84 |
+
text_import.ingredients = [];
|
85 |
+
text_import_step = 'instructions';
|
86 |
} else {
|
87 |
jQuery('#import-text-highlight-sandbox').hide();
|
88 |
+
text_import_step = 'ingredient-groups';
|
89 |
}
|
90 |
+
} else if(text_import_step == 'ingredient-groups') {
|
91 |
var ingredients = [],
|
92 |
ingredient_group = {
|
93 |
name: '',
|
111 |
});
|
112 |
ingredients.push(ingredient_group);
|
113 |
|
114 |
+
text_import.ingredients = [];
|
115 |
|
116 |
// Parse ingredients
|
117 |
var data = {
|
118 |
action: 'wprm_parse_ingredients',
|
119 |
+
security: wprm_temp_admin.nonce,
|
120 |
ingredients: ingredients
|
121 |
};
|
122 |
|
123 |
+
text_import_waiting = true;
|
124 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
125 |
+
text_import_waiting = false;
|
126 |
if (out.success) {
|
127 |
+
text_import.ingredients = out.data.ingredients;
|
128 |
}
|
129 |
}, 'json');
|
130 |
|
131 |
jQuery('#import-text-highlight-sandbox').show();
|
132 |
|
133 |
+
text_import_step = 'instructions';
|
134 |
+
} else if(text_import_step == 'instructions') {
|
135 |
+
var instructions = text_import_highlighter.getHighlights();
|
136 |
+
text_import.instructions_raw = instructions;
|
137 |
|
138 |
jQuery('#import-text-instruction-groups').html('');
|
139 |
for(var i = 0, l = instructions.length; i<l; i++) {
|
146 |
|
147 |
if(instructions.length == 0) {
|
148 |
jQuery('#import-text-highlight-sandbox').show();
|
149 |
+
text_import.instructions = [];
|
150 |
+
text_import_step = 'notes';
|
151 |
} else {
|
152 |
jQuery('#import-text-highlight-sandbox').hide();
|
153 |
+
text_import_step = 'instruction-groups';
|
154 |
}
|
155 |
+
} else if(text_import_step == 'instruction-groups') {
|
156 |
var instructions = [],
|
157 |
instruction_group = {
|
158 |
name: '',
|
176 |
});
|
177 |
instructions.push(instruction_group);
|
178 |
|
179 |
+
text_import.instructions = instructions;
|
180 |
|
181 |
jQuery('#import-text-highlight-sandbox').show();
|
182 |
|
183 |
+
text_import_step = 'notes';
|
184 |
+
} else if(text_import_step == 'notes') {
|
185 |
+
text_import.notes = get_highlighted_text();
|
186 |
|
187 |
jQuery('#import-text-highlight-sandbox').hide();
|
188 |
jQuery('.wprm-button-import-text-reset').attr('disabled', 'disabled');
|
189 |
jQuery('.wprm-button-import-text-clear').attr('disabled', 'disabled');
|
190 |
jQuery('.wprm-button-import-text-next').attr('disabled', 'disabled');
|
191 |
|
192 |
+
if(text_import_waiting) {
|
193 |
+
text_import_step = 'waiting';
|
194 |
+
text_import_waiting_check();
|
195 |
} else {
|
196 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
197 |
+
import_recipe();
|
198 |
+
text_import_step = 'finished';
|
199 |
}
|
200 |
+
} else if(text_import_step == 'waiting') {
|
201 |
+
if(!text_import_waiting) {
|
202 |
jQuery('.wprm-button-import-text-reset').removeAttr('disabled');
|
203 |
+
import_recipe();
|
204 |
+
text_import_step = 'finished';
|
205 |
}
|
206 |
}
|
207 |
|
208 |
jQuery('.import-text-step').hide();
|
209 |
+
jQuery('#import-text-step-' + text_import_step).show();
|
210 |
+
text_import_highlighter.removeHighlights();
|
211 |
};
|
212 |
|
213 |
+
function text_import_waiting_check() {
|
214 |
+
if(text_import_waiting) {
|
215 |
+
setTimeout(text_import_waiting_check, 200);
|
216 |
} else {
|
217 |
+
btn_text_import_next();
|
218 |
}
|
219 |
};
|
220 |
|
221 |
+
function get_highlighted_text() {
|
222 |
+
var highlight_parts = text_import_highlighter.getHighlights();
|
223 |
var highlight = '';
|
224 |
|
225 |
for(var i = 0, l = highlight_parts.length; i<l; i++) {
|
232 |
return highlight;
|
233 |
};
|
234 |
|
235 |
+
function import_recipe() {
|
236 |
+
if(text_import.name) {
|
237 |
+
jQuery('#wprm-recipe-name').val(text_import.name);
|
238 |
}
|
239 |
|
240 |
+
if(text_import.summary) {
|
241 |
+
RichEditor.set(text_import.summary);
|
242 |
}
|
243 |
|
244 |
+
if(text_import.notes) {
|
245 |
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
246 |
tinyMCE.get('wprm_recipe_notes').focus(true);
|
247 |
+
tinyMCE.activeEditor.setContent(text_import.notes);
|
248 |
} else {
|
249 |
+
jQuery('#wprm_recipe_notes').val(text_import.notes);
|
250 |
}
|
251 |
}
|
252 |
|
253 |
+
if(text_import.instructions.length > 0) {
|
254 |
+
Recipe.setInstructions(text_import.instructions);
|
255 |
}
|
256 |
|
257 |
+
if(text_import.ingredients.length > 0) {
|
258 |
+
Recipe.setIngredients(text_import.ingredients);
|
259 |
}
|
260 |
};
|
261 |
|
262 |
jQuery(document).ready(function($) {
|
263 |
jQuery('#import-text-input-recipe').on('keydown change', function() {
|
264 |
+
start_text_import();
|
265 |
});
|
266 |
|
267 |
jQuery('.wprm-button-import-text-reset').on('click', function() {
|
268 |
+
if(confirm(wprm_temp_admin.modal.text.import_text_reset)) {
|
269 |
+
btn_text_import_reset();
|
270 |
}
|
271 |
});
|
272 |
|
273 |
jQuery('.wprm-button-import-text-clear').on('click', function() {
|
274 |
+
btn_text_import_clear(false);
|
275 |
});
|
276 |
|
277 |
jQuery('.wprm-button-import-text-next').on('click', function() {
|
278 |
+
btn_text_import_next();
|
279 |
});
|
280 |
|
281 |
jQuery('.import-text-input-groups').on('change', 'input', function() {
|
assets/js/admin/modal/tabs/recipe-snippets.js
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Modal from '../Modal';
|
2 |
+
import * as utils from '../utils';
|
3 |
+
|
4 |
+
Modal.actions.reset_snippets = function(args) {
|
5 |
+
jQuery('#wprm-recipe-jump-id').val('0').trigger('change');
|
6 |
+
jQuery('#wprm-recipe-jump-text').val('');
|
7 |
+
|
8 |
+
jQuery('#wprm-recipe-print-id').val('0').trigger('change');
|
9 |
+
jQuery('#wprm-recipe-print-text').val('');
|
10 |
+
}
|
11 |
+
|
12 |
+
Modal.actions.insert_jump_to_recipe = function(button) {
|
13 |
+
var id = parseInt(jQuery('#wprm-recipe-jump-id').val()),
|
14 |
+
text = utils.shortcode_escape(jQuery('#wprm-recipe-jump-text').val()),
|
15 |
+
shortcode = '[wprm-recipe-jump';
|
16 |
+
|
17 |
+
if (id > 0) {
|
18 |
+
shortcode += ' id="' + id + '"';
|
19 |
+
}
|
20 |
+
|
21 |
+
if (text) {
|
22 |
+
shortcode += ' text="' + text + '"';
|
23 |
+
}
|
24 |
+
|
25 |
+
shortcode += ']';
|
26 |
+
|
27 |
+
utils.add_text_to_editor(shortcode);
|
28 |
+
Modal.close();
|
29 |
+
};
|
30 |
+
|
31 |
+
Modal.actions.insert_print_recipe = function(button) {
|
32 |
+
var id = parseInt(jQuery('#wprm-recipe-print-id').val()),
|
33 |
+
text = utils.shortcode_escape(jQuery('#wprm-recipe-print-text').val()),
|
34 |
+
shortcode = '[wprm-recipe-print';
|
35 |
+
|
36 |
+
if (id > 0) {
|
37 |
+
shortcode += ' id="' + id + '"';
|
38 |
+
}
|
39 |
+
|
40 |
+
if (text) {
|
41 |
+
shortcode += ' text="' + text + '"';
|
42 |
+
}
|
43 |
+
|
44 |
+
shortcode += ']';
|
45 |
+
|
46 |
+
utils.add_text_to_editor(shortcode);
|
47 |
+
Modal.close();
|
48 |
+
};
|
assets/js/admin/modal/tabs/recipe.js
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import * as utils from '../utils';
|
2 |
+
import Modal from '../Modal';
|
3 |
+
import Recipe from '../Recipe';
|
4 |
+
|
5 |
+
Modal.actions.set_recipe = function(args) {
|
6 |
+
let recipe_id = args.recipe_id ? args.recipe_id : 0;
|
7 |
+
let clone_recipe_id = args.clone_recipe_id ? args.clone_recipe_id : 0;
|
8 |
+
|
9 |
+
Recipe.id = recipe_id;
|
10 |
+
Recipe.type = 0 === recipe_id ? 'insert' : 'update';
|
11 |
+
Recipe.fields = false;
|
12 |
+
Recipe.ingredients = {};
|
13 |
+
Recipe.instructions = {};
|
14 |
+
|
15 |
+
Recipe.clear();
|
16 |
+
|
17 |
+
if ('insert' === Recipe.type) {
|
18 |
+
var button = jQuery('.wprm-button-action'),
|
19 |
+
button_save = jQuery('.wprm-button-action-save');
|
20 |
+
|
21 |
+
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
22 |
+
jQuery(this).data('button', wprm_temp_admin.modal.text.action_button_insert);
|
23 |
+
});
|
24 |
+
button.text(wprm_temp_admin.modal.text.action_button_insert);
|
25 |
+
button_save.show();
|
26 |
+
|
27 |
+
if(clone_recipe_id) {
|
28 |
+
var data = {
|
29 |
+
action: 'wprm_get_recipe',
|
30 |
+
security: wprm_temp_admin.nonce,
|
31 |
+
recipe_id: clone_recipe_id
|
32 |
+
};
|
33 |
+
|
34 |
+
utils.start_loader(button);
|
35 |
+
utils.start_loader(button_save);
|
36 |
+
|
37 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
38 |
+
utils.stop_loader(button);
|
39 |
+
utils.stop_loader(button_save);
|
40 |
+
|
41 |
+
if (out.success) {
|
42 |
+
Recipe.fields = out.data.recipe;
|
43 |
+
Recipe.set(out.data.recipe);
|
44 |
+
Modal.changes_made = false;
|
45 |
+
}
|
46 |
+
}, 'json');
|
47 |
+
}
|
48 |
+
} else {
|
49 |
+
var button = jQuery('.wprm-button-action'),
|
50 |
+
button_save = jQuery('.wprm-button-action-save');
|
51 |
+
|
52 |
+
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
53 |
+
jQuery(this).data('button', wprm_temp_admin.modal.text.action_button_update);
|
54 |
+
});
|
55 |
+
button.text(wprm_temp_admin.modal.text.action_button_update);
|
56 |
+
button_save.show();
|
57 |
+
|
58 |
+
Modal.disable_menu();
|
59 |
+
|
60 |
+
var data = {
|
61 |
+
action: 'wprm_get_recipe',
|
62 |
+
security: wprm_temp_admin.nonce,
|
63 |
+
recipe_id: recipe_id
|
64 |
+
};
|
65 |
+
|
66 |
+
utils.start_loader(button);
|
67 |
+
utils.start_loader(button_save);
|
68 |
+
|
69 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
70 |
+
utils.stop_loader(button);
|
71 |
+
utils.stop_loader(button_save);
|
72 |
+
|
73 |
+
if (out.success) {
|
74 |
+
Recipe.fields = out.data.recipe;
|
75 |
+
Recipe.set(out.data.recipe);
|
76 |
+
Modal.changes_made = false;
|
77 |
+
jQuery('.wprm-frame-title').find('h1').text(wprm_temp_admin.modal.text.edit_recipe);
|
78 |
+
}
|
79 |
+
}, 'json');
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
Modal.actions.insert_update_recipe = function(button) {
|
84 |
+
let recipe = Recipe.get();
|
85 |
+
|
86 |
+
// Ajax call to recipe saver
|
87 |
+
var data = {
|
88 |
+
action: 'wprm_save_recipe',
|
89 |
+
security: wprm_temp_admin.nonce,
|
90 |
+
recipe_id: Recipe.id,
|
91 |
+
recipe: recipe
|
92 |
+
};
|
93 |
+
|
94 |
+
jQuery('.wprm-button-action-save').prop('disabled', true);
|
95 |
+
utils.start_loader(button);
|
96 |
+
|
97 |
+
jQuery.post(wprm_temp_admin.ajax_url, data, function(out) {
|
98 |
+
utils.stop_loader(button);
|
99 |
+
jQuery('.wprm-button-action-save').prop('disabled', false);
|
100 |
+
|
101 |
+
if (out.success) {
|
102 |
+
if (Recipe.id === 0) {
|
103 |
+
Recipe.id = out.data.id;
|
104 |
+
}
|
105 |
+
|
106 |
+
if(!button.hasClass('wprm-button-action-save')) {
|
107 |
+
if ('insert' === Recipe.type) {
|
108 |
+
utils.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
|
109 |
+
} else if(Modal.active_editor_id) {
|
110 |
+
// Refresh content in editor to reload recipe preview
|
111 |
+
if (typeof tinyMCE !== 'undefined' && tinyMCE.get(Modal.active_editor_id) && !tinyMCE.get(Modal.active_editor_id).isHidden()) {
|
112 |
+
tinyMCE.get(Modal.active_editor_id).focus(true);
|
113 |
+
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
if(jQuery('.wprm-manage-datatable').length > 0) {
|
118 |
+
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
119 |
+
}
|
120 |
+
|
121 |
+
Modal.close();
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}, 'json');
|
125 |
+
};
|
126 |
+
|
127 |
+
Modal.actions.edit_recipe = function(button) {
|
128 |
+
var id = parseInt(jQuery('#wprm-edit-recipe-id').val());
|
129 |
+
if(id != 0) {
|
130 |
+
var editor = Modal.active_editor_id;
|
131 |
+
Modal.close();
|
132 |
+
Modal.open(editor, {
|
133 |
+
recipe_id: id
|
134 |
+
});
|
135 |
+
}
|
136 |
+
};
|
137 |
+
|
138 |
+
Modal.actions.insert_recipe = function(button) {
|
139 |
+
var id = parseInt(jQuery('#wprm-insert-recipe-id').val());
|
140 |
+
if(id != 0) {
|
141 |
+
var shortcode = '[wprm-recipe id="' + id + '"]';
|
142 |
+
|
143 |
+
utils.add_text_to_editor(shortcode);
|
144 |
+
Modal.close();
|
145 |
+
}
|
146 |
+
};
|
assets/js/admin/modal/utils.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Modal from './Modal';
|
2 |
+
|
3 |
+
const shortcode_escape_map = {
|
4 |
+
'"': "'",
|
5 |
+
'[': '{',
|
6 |
+
']': '}'
|
7 |
+
};
|
8 |
+
|
9 |
+
export function shortcode_escape(text) {
|
10 |
+
return String(text).replace(/["]/g, function(s) {
|
11 |
+
return shortcode_escape_map[s];
|
12 |
+
});
|
13 |
+
};
|
14 |
+
|
15 |
+
export function add_text_to_editor(text) {
|
16 |
+
text = ' ' + text + ' ';
|
17 |
+
|
18 |
+
if (Modal.active_editor_id) {
|
19 |
+
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(Modal.active_editor_id) || tinyMCE.get(Modal.active_editor_id).isHidden()) {
|
20 |
+
var current = jQuery('textarea#' + Modal.active_editor_id).val();
|
21 |
+
jQuery('textarea#' + Modal.active_editor_id).val(current + text);
|
22 |
+
} else {
|
23 |
+
tinyMCE.get(Modal.active_editor_id).focus(true);
|
24 |
+
tinyMCE.activeEditor.selection.collapse(false);
|
25 |
+
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
26 |
+
}
|
27 |
+
}
|
28 |
+
};
|
29 |
+
|
30 |
+
export function select_media_image(container) {
|
31 |
+
// Create a new media frame (don't reuse because we have multiple different inputs)
|
32 |
+
let frame = wp.media({
|
33 |
+
title: wprm_temp_admin.modal.text.media_title,
|
34 |
+
button: {
|
35 |
+
text: wprm_temp_admin.modal.text.media_button
|
36 |
+
},
|
37 |
+
multiple: false
|
38 |
+
});
|
39 |
+
|
40 |
+
|
41 |
+
// When an image is selected in the media frame...
|
42 |
+
frame.on('select', function() {
|
43 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
44 |
+
set_media_image(container, attachment.id, attachment.url);
|
45 |
+
});
|
46 |
+
|
47 |
+
// Finally, open the modal on click
|
48 |
+
frame.open();
|
49 |
+
};
|
50 |
+
|
51 |
+
export function set_media_image(container, image_id, image_url) {
|
52 |
+
container.find('.wprm-recipe-image-preview').html('');
|
53 |
+
container.find('.wprm-recipe-image-preview').append('<img src="' + image_url + '" />');
|
54 |
+
container.find('input').val(image_id);
|
55 |
+
|
56 |
+
container.find('.wprm-recipe-image-add').addClass('hidden');
|
57 |
+
container.find('.wprm-recipe-image-remove').removeClass('hidden');
|
58 |
+
Modal.changes_made = true;
|
59 |
+
};
|
60 |
+
|
61 |
+
export function remove_media_image(container) {
|
62 |
+
container.find('.wprm-recipe-image-preview').html('');
|
63 |
+
container.find('input').val('');
|
64 |
+
|
65 |
+
container.find('.wprm-recipe-image-add').removeClass('hidden');
|
66 |
+
container.find('.wprm-recipe-image-remove').addClass('hidden');
|
67 |
+
Modal.changes_made = true;
|
68 |
+
};
|
69 |
+
|
70 |
+
export function start_loader(button) {
|
71 |
+
button
|
72 |
+
.prop('disabled', true)
|
73 |
+
.css('width', button.outerWidth())
|
74 |
+
.data('text', button.html())
|
75 |
+
.html('...');
|
76 |
+
};
|
77 |
+
|
78 |
+
export function stop_loader(button) {
|
79 |
+
button
|
80 |
+
.prop('disabled', false)
|
81 |
+
.css('width', '')
|
82 |
+
.html(button.data('text'));
|
83 |
+
};
|
assets/js/admin/recipe-form.js
DELETED
@@ -1,704 +0,0 @@
|
|
1 |
-
var wprm_admin = wprm_admin || {};
|
2 |
-
wprm_admin.prep_time_set = false;
|
3 |
-
wprm_admin.cook_time_set = false;
|
4 |
-
wprm_admin.total_time_set = false;
|
5 |
-
|
6 |
-
wprm_admin.editing_recipe = 0;
|
7 |
-
wprm_admin.editing_recipe_type = 'insert';
|
8 |
-
wprm_admin.editing_recipe_fields = false;
|
9 |
-
wprm_admin.editing_recipe_ingredients = {};
|
10 |
-
wprm_admin.editing_recipe_instructions = {};
|
11 |
-
|
12 |
-
wprm_admin.changes_made = false;
|
13 |
-
|
14 |
-
wprm_admin.set_recipe = function(args) {
|
15 |
-
var recipe_id = args.recipe_id ? args.recipe_id : 0;
|
16 |
-
var clone_recipe_id = args.clone_recipe_id ? args.clone_recipe_id : 0;
|
17 |
-
|
18 |
-
wprm_admin.editing_recipe = recipe_id;
|
19 |
-
wprm_admin.editing_recipe_type = 0 === recipe_id ? 'insert' : 'update';
|
20 |
-
wprm_admin.editing_recipe_fields = false;
|
21 |
-
wprm_admin.editing_recipe_ingredients = {};
|
22 |
-
wprm_admin.editing_recipe_instructions = {};
|
23 |
-
|
24 |
-
wprm_admin.clear_recipe_fields();
|
25 |
-
if(typeof wprmp_admin !== 'undefined') {
|
26 |
-
wprmp_admin.clear_recipe_fields();
|
27 |
-
}
|
28 |
-
wprm_admin.changes_made = false;
|
29 |
-
|
30 |
-
if ('insert' === wprm_admin.editing_recipe_type) {
|
31 |
-
var button = jQuery('.wprm-button-action'),
|
32 |
-
button_save = jQuery('.wprm-button-action-save');
|
33 |
-
|
34 |
-
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
35 |
-
jQuery(this).data('button', wprm_modal.text.action_button_insert);
|
36 |
-
});
|
37 |
-
button.text(wprm_modal.text.action_button_insert);
|
38 |
-
button_save.show();
|
39 |
-
|
40 |
-
if(clone_recipe_id) {
|
41 |
-
var data = {
|
42 |
-
action: 'wprm_get_recipe',
|
43 |
-
security: wprm_modal.nonce,
|
44 |
-
recipe_id: clone_recipe_id
|
45 |
-
};
|
46 |
-
|
47 |
-
wprm_admin.start_loader(button);
|
48 |
-
wprm_admin.start_loader(button_save);
|
49 |
-
|
50 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
51 |
-
wprm_admin.stop_loader(button);
|
52 |
-
wprm_admin.stop_loader(button_save);
|
53 |
-
|
54 |
-
if (out.success) {
|
55 |
-
wprm_admin.editing_recipe_fields = out.data.recipe;
|
56 |
-
|
57 |
-
wprm_admin.set_recipe_fields(out.data.recipe);
|
58 |
-
if(typeof wprmp_admin !== 'undefined') {
|
59 |
-
wprmp_admin.set_recipe_fields(out.data.recipe);
|
60 |
-
}
|
61 |
-
wprm_admin.changes_made = false;
|
62 |
-
}
|
63 |
-
}, 'json');
|
64 |
-
}
|
65 |
-
} else {
|
66 |
-
var button = jQuery('.wprm-button-action'),
|
67 |
-
button_save = jQuery('.wprm-button-action-save');
|
68 |
-
|
69 |
-
jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
|
70 |
-
jQuery(this).data('button', wprm_modal.text.action_button_update);
|
71 |
-
});
|
72 |
-
button.text(wprm_modal.text.action_button_update);
|
73 |
-
button_save.show();
|
74 |
-
|
75 |
-
wprm_admin.disable_menu();
|
76 |
-
|
77 |
-
var data = {
|
78 |
-
action: 'wprm_get_recipe',
|
79 |
-
security: wprm_modal.nonce,
|
80 |
-
recipe_id: recipe_id
|
81 |
-
};
|
82 |
-
|
83 |
-
wprm_admin.start_loader(button);
|
84 |
-
wprm_admin.start_loader(button_save);
|
85 |
-
|
86 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
87 |
-
wprm_admin.stop_loader(button);
|
88 |
-
wprm_admin.stop_loader(button_save);
|
89 |
-
|
90 |
-
if (out.success) {
|
91 |
-
wprm_admin.editing_recipe_fields = out.data.recipe;
|
92 |
-
|
93 |
-
wprm_admin.set_recipe_fields(out.data.recipe);
|
94 |
-
if(typeof wprmp_admin !== 'undefined') {
|
95 |
-
wprmp_admin.set_recipe_fields(out.data.recipe);
|
96 |
-
}
|
97 |
-
wprm_admin.changes_made = false;
|
98 |
-
jQuery('.wprm-frame-title').find('h1').text(wprm_modal.text.edit_recipe);
|
99 |
-
}
|
100 |
-
}, 'json');
|
101 |
-
}
|
102 |
-
};
|
103 |
-
|
104 |
-
wprm_admin.edit_recipe = function() {
|
105 |
-
var id = parseInt(jQuery('#wprm-edit-recipe-id').val());
|
106 |
-
if(id != 0) {
|
107 |
-
var editor = wprm_admin.active_editor_id;
|
108 |
-
wprm_admin.close_modal();
|
109 |
-
wprm_admin.open_modal(editor, {
|
110 |
-
recipe_id: id
|
111 |
-
});
|
112 |
-
}
|
113 |
-
};
|
114 |
-
|
115 |
-
wprm_admin.insert_recipe = function() {
|
116 |
-
var id = parseInt(jQuery('#wprm-insert-recipe-id').val());
|
117 |
-
if(id != 0) {
|
118 |
-
var shortcode = '[wprm-recipe id="' + id + '"]';
|
119 |
-
|
120 |
-
wprm_admin.add_text_to_editor(shortcode);
|
121 |
-
wprm_admin.close_modal();
|
122 |
-
}
|
123 |
-
};
|
124 |
-
|
125 |
-
wprm_admin.clear_recipe_fields = function() {
|
126 |
-
// Recipe Details
|
127 |
-
wprm_admin.remove_media_image(jQuery('.wprm-recipe-image-container'));
|
128 |
-
jQuery('#wprm-recipe-name').val('');
|
129 |
-
wprm_admin.rich_editor.resetContent(''); // Recipe summary
|
130 |
-
jQuery('#wprm-recipe-author-display').val('default').change();
|
131 |
-
jQuery('#wprm-recipe-author-name').val('');
|
132 |
-
jQuery('#wprm-recipe-author-link').val('');
|
133 |
-
jQuery('#wprm-recipe-servings').val('');
|
134 |
-
jQuery('#wprm-recipe-servings-unit').val('');
|
135 |
-
jQuery('#wprm-recipe-calories').val('');
|
136 |
-
jQuery('#wprm-recipe-prep-time').val('');
|
137 |
-
jQuery('#wprm-recipe-cook-time').val('');
|
138 |
-
jQuery('#wprm-recipe-total-time').val('');
|
139 |
-
|
140 |
-
wprm_admin.prep_time_set = false;
|
141 |
-
wprm_admin.cook_time_set = false;
|
142 |
-
wprm_admin.total_time_set = false;
|
143 |
-
|
144 |
-
jQuery('.wprm-recipe-tags').val(null).trigger('change');
|
145 |
-
|
146 |
-
// Ingredients & Instructions
|
147 |
-
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete, .wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
148 |
-
jQuery(this).click();
|
149 |
-
});
|
150 |
-
jQuery('.wprm-recipe-ingredients-add').click();
|
151 |
-
jQuery('.wprm-recipe-instructions-add').click();
|
152 |
-
|
153 |
-
// Recipe Notes
|
154 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
155 |
-
tinyMCE.get('wprm_recipe_notes').focus(true);
|
156 |
-
|
157 |
-
// Check for error caused by EasyRecipe.
|
158 |
-
jQuery('.wprm-easyrecipe-warning').hide();
|
159 |
-
try {
|
160 |
-
tinyMCE.activeEditor.setContent('');
|
161 |
-
} catch(err) {
|
162 |
-
jQuery('.wprm-easyrecipe-warning').show();
|
163 |
-
}
|
164 |
-
} else {
|
165 |
-
jQuery('#wprm_recipe_notes').val('');
|
166 |
-
}
|
167 |
-
};
|
168 |
-
|
169 |
-
wprm_admin.set_recipe_fields = function(recipe) {
|
170 |
-
// Recipe Details
|
171 |
-
if (parseInt(recipe.image_id) > 0) {
|
172 |
-
wprm_admin.set_media_image(jQuery('.wprm-recipe-details-form .wprm-recipe-image-container'), recipe.image_id, recipe.image_url);
|
173 |
-
}
|
174 |
-
|
175 |
-
jQuery('#wprm-recipe-name').val(recipe.name);
|
176 |
-
wprm_admin.rich_editor.setContent(recipe.summary);
|
177 |
-
jQuery('#wprm-recipe-servings-unit').val(recipe.servings_unit);
|
178 |
-
|
179 |
-
jQuery('#wprm-recipe-author-display').val(recipe.author_display).change();
|
180 |
-
jQuery('#wprm-recipe-author-name').val(recipe.author_name);
|
181 |
-
jQuery('#wprm-recipe-author-link').val(recipe.author_link);
|
182 |
-
|
183 |
-
var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
|
184 |
-
calories = recipe.nutrition.calories ? parseFloat(recipe.nutrition.calories) : '',
|
185 |
-
prep_time = parseInt(recipe.prep_time) > 0 ? parseInt(recipe.prep_time) : '',
|
186 |
-
cook_time = parseInt(recipe.cook_time) > 0 ? parseInt(recipe.cook_time) : '',
|
187 |
-
total_time = parseInt(recipe.total_time) > 0 ? parseInt(recipe.total_time) : '';
|
188 |
-
|
189 |
-
jQuery('#wprm-recipe-servings').val(servings);
|
190 |
-
jQuery('#wprm-recipe-calories').val(calories);
|
191 |
-
jQuery('#wprm-recipe-prep-time').val(prep_time);
|
192 |
-
jQuery('#wprm-recipe-cook-time').val(cook_time);
|
193 |
-
jQuery('#wprm-recipe-total-time').val(total_time);
|
194 |
-
|
195 |
-
if (prep_time) wprm_admin.prep_time_set = true;
|
196 |
-
if (cook_time) wprm_admin.cook_time_set = true;
|
197 |
-
if (total_time) wprm_admin.total_time_set = true;
|
198 |
-
|
199 |
-
for (var tag in recipe.tags) {
|
200 |
-
if (recipe.tags.hasOwnProperty(tag)) {
|
201 |
-
wprm_admin.set_recipe_tags(recipe, tag);
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
// Ingredients & Instructions
|
206 |
-
wprm_admin.set_recipe_ingredient_fields(recipe.ingredients);
|
207 |
-
wprm_admin.set_recipe_instruction_fields(recipe.instructions);
|
208 |
-
|
209 |
-
// Recipe Notes
|
210 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
211 |
-
tinyMCE.get('wprm_recipe_notes').focus(true);
|
212 |
-
tinyMCE.activeEditor.setContent(recipe.notes);
|
213 |
-
} else {
|
214 |
-
jQuery('#wprm_recipe_notes').val(recipe.notes);
|
215 |
-
}
|
216 |
-
};
|
217 |
-
|
218 |
-
wprm_admin.set_recipe_ingredient_fields = function(ingredients) {
|
219 |
-
jQuery('.wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete').each(function() {
|
220 |
-
jQuery(this).click();
|
221 |
-
});
|
222 |
-
|
223 |
-
var i, l, group, j, m;
|
224 |
-
|
225 |
-
for (i = 0, l = ingredients.length; i < l; i++) {
|
226 |
-
group = ingredients[i];
|
227 |
-
|
228 |
-
if (i > 0 || group.name !== '') {
|
229 |
-
wprm_admin.add_ingredient_group(group.name);
|
230 |
-
}
|
231 |
-
|
232 |
-
for (j = 0, m = group.ingredients.length; j < m; j++) {
|
233 |
-
var ingredient = group.ingredients[j];
|
234 |
-
var uid = wprm_admin.add_ingredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
|
235 |
-
wprm_admin.editing_recipe_ingredients[uid] = ingredient;
|
236 |
-
}
|
237 |
-
}
|
238 |
-
};
|
239 |
-
|
240 |
-
wprm_admin.set_recipe_instruction_fields = function(instructions) {
|
241 |
-
jQuery('.wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete').each(function() {
|
242 |
-
jQuery(this).click();
|
243 |
-
});
|
244 |
-
|
245 |
-
var i, l, group, j, m;
|
246 |
-
|
247 |
-
for (i = 0, l = instructions.length; i < l; i++) {
|
248 |
-
group = instructions[i];
|
249 |
-
|
250 |
-
if (i > 0 || group.name !== '') {
|
251 |
-
wprm_admin.add_instruction_group(group.name);
|
252 |
-
}
|
253 |
-
|
254 |
-
for (j = 0, m = group.instructions.length; j < m; j++) {
|
255 |
-
var instruction = group.instructions[j];
|
256 |
-
var uid = wprm_admin.add_instruction(instruction.text, instruction.image);
|
257 |
-
wprm_admin.editing_recipe_instructions[uid] = instruction;
|
258 |
-
}
|
259 |
-
}
|
260 |
-
};
|
261 |
-
|
262 |
-
wprm_admin.set_recipe_tags = function(recipe, tag) {
|
263 |
-
var term_ids = [],
|
264 |
-
select = jQuery('#wprm-recipe-tag-' + tag);
|
265 |
-
|
266 |
-
for (var i = 0, l = recipe.tags[tag].length; i < l; i++) {
|
267 |
-
var term = recipe.tags[tag][i];
|
268 |
-
term_ids.push(term.term_id);
|
269 |
-
|
270 |
-
// Add term to options if not in there
|
271 |
-
if (select.find('option[value=' + term.term_id + ']').length === 0) {
|
272 |
-
select.append('<option value="' + term.term_id + '">' + term.name + '</option>');
|
273 |
-
}
|
274 |
-
}
|
275 |
-
select.val(term_ids).trigger('change');
|
276 |
-
};
|
277 |
-
|
278 |
-
wprm_admin.select_media_image = function(container) {
|
279 |
-
// Create a new media frame (don't reuse because we have multiple different inputs)
|
280 |
-
var frame = wp.media({
|
281 |
-
title: wprm_modal.text.media_title,
|
282 |
-
button: {
|
283 |
-
text: wprm_modal.text.media_button
|
284 |
-
},
|
285 |
-
multiple: false
|
286 |
-
});
|
287 |
-
|
288 |
-
|
289 |
-
// When an image is selected in the media frame...
|
290 |
-
frame.on('select', function() {
|
291 |
-
var attachment = frame.state().get('selection').first().toJSON();
|
292 |
-
wprm_admin.set_media_image(container, attachment.id, attachment.url);
|
293 |
-
});
|
294 |
-
|
295 |
-
// Finally, open the modal on click
|
296 |
-
frame.open();
|
297 |
-
};
|
298 |
-
wprm_admin.set_media_image = function(container, image_id, image_url) {
|
299 |
-
container.find('.wprm-recipe-image-preview').html('');
|
300 |
-
container.find('.wprm-recipe-image-preview').append('<img src="' + image_url + '" />');
|
301 |
-
container.find('input').val(image_id);
|
302 |
-
|
303 |
-
container.find('.wprm-recipe-image-add').addClass('hidden');
|
304 |
-
container.find('.wprm-recipe-image-remove').removeClass('hidden');
|
305 |
-
wprm_admin.changes_made = true;
|
306 |
-
};
|
307 |
-
wprm_admin.remove_media_image = function(container) {
|
308 |
-
container.find('.wprm-recipe-image-preview').html('');
|
309 |
-
container.find('input').val('');
|
310 |
-
|
311 |
-
container.find('.wprm-recipe-image-add').removeClass('hidden');
|
312 |
-
container.find('.wprm-recipe-image-remove').addClass('hidden');
|
313 |
-
wprm_admin.changes_made = true;
|
314 |
-
};
|
315 |
-
|
316 |
-
wprm_admin.start_loader = function(button) {
|
317 |
-
button
|
318 |
-
.prop('disabled', true)
|
319 |
-
.css('width', button.outerWidth())
|
320 |
-
.data('text', button.html())
|
321 |
-
.html('...');
|
322 |
-
};
|
323 |
-
|
324 |
-
wprm_admin.stop_loader = function(button) {
|
325 |
-
button
|
326 |
-
.prop('disabled', false)
|
327 |
-
.css('width', '')
|
328 |
-
.html(button.data('text'));
|
329 |
-
};
|
330 |
-
|
331 |
-
wprm_admin.add_ingredient = function(amount, unit, name, notes) {
|
332 |
-
amount = amount || '';
|
333 |
-
unit = unit || '';
|
334 |
-
name = name || '';
|
335 |
-
notes = notes || '';
|
336 |
-
|
337 |
-
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient').clone();
|
338 |
-
jQuery('.wprm-recipe-ingredients').append(clone);
|
339 |
-
|
340 |
-
clone.find('.wprm-recipe-ingredient-amount').val(amount).focus();
|
341 |
-
clone.find('.wprm-recipe-ingredient-unit').val(unit);
|
342 |
-
clone.find('.wprm-recipe-ingredient-name').val(name);
|
343 |
-
clone.find('.wprm-recipe-ingredient-notes').val(notes);
|
344 |
-
|
345 |
-
while(true) {
|
346 |
-
var uid = Math.floor(Math.random() * 99999);
|
347 |
-
if(!wprm_admin.editing_recipe_ingredients.hasOwnProperty(uid)) {
|
348 |
-
clone.data('uid', uid);
|
349 |
-
wprm_admin.editing_recipe_ingredients[uid] = {};
|
350 |
-
return uid;
|
351 |
-
}
|
352 |
-
}
|
353 |
-
};
|
354 |
-
|
355 |
-
wprm_admin.add_ingredient_group = function(name) {
|
356 |
-
name = name || '';
|
357 |
-
|
358 |
-
var clone = jQuery('.wprm-recipe-ingredients-placeholder').find('.wprm-recipe-ingredient-group').clone();
|
359 |
-
jQuery('.wprm-recipe-ingredients').append(clone);
|
360 |
-
clone.find('input:first').val(name).focus();
|
361 |
-
};
|
362 |
-
|
363 |
-
wprm_admin.add_instruction = function(text, image_id) {
|
364 |
-
text = text || '';
|
365 |
-
image_id = image_id || 0;
|
366 |
-
|
367 |
-
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction').clone();
|
368 |
-
clone.find('.wprm-recipe-instruction-text').addClass('wprm-rich-editor');
|
369 |
-
jQuery('.wprm-recipe-instructions').append(clone);
|
370 |
-
clone.find('.wprm-recipe-instruction-text').val(text);
|
371 |
-
wprm_admin.init_rich_editor();
|
372 |
-
clone.find('.wprm-recipe-instruction-text').focus();
|
373 |
-
|
374 |
-
// Get image thumbnail if there is an instruction image.
|
375 |
-
if (parseInt(image_id) > 0) {
|
376 |
-
var image_container = clone.find('.wprm-recipe-image-container'),
|
377 |
-
button = image_container.find('.wprm-recipe-image-add');
|
378 |
-
|
379 |
-
var data = {
|
380 |
-
action: 'wprm_get_thumbnail',
|
381 |
-
security: wprm_modal.nonce,
|
382 |
-
image_id: image_id
|
383 |
-
};
|
384 |
-
|
385 |
-
wprm_admin.start_loader(button);
|
386 |
-
|
387 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
388 |
-
wprm_admin.stop_loader(button);
|
389 |
-
|
390 |
-
if (out.success) {
|
391 |
-
wprm_admin.set_media_image(image_container, image_id, out.data.image_url);
|
392 |
-
}
|
393 |
-
}, 'json');
|
394 |
-
}
|
395 |
-
|
396 |
-
while(true) {
|
397 |
-
var uid = Math.floor(Math.random() * 99999);
|
398 |
-
if(!wprm_admin.editing_recipe_instructions.hasOwnProperty(uid)) {
|
399 |
-
clone.data('uid', uid);
|
400 |
-
wprm_admin.editing_recipe_instructions[uid] = {};
|
401 |
-
return uid;
|
402 |
-
}
|
403 |
-
}
|
404 |
-
};
|
405 |
-
|
406 |
-
wprm_admin.add_instruction_group = function(name) {
|
407 |
-
name = name || '';
|
408 |
-
|
409 |
-
var clone = jQuery('.wprm-recipe-instructions-placeholder').find('.wprm-recipe-instruction-group').clone();
|
410 |
-
jQuery('.wprm-recipe-instructions').append(clone);
|
411 |
-
clone.find('input:first').val(name).focus();
|
412 |
-
};
|
413 |
-
|
414 |
-
wprm_admin.insert_update_recipe = function(button) {
|
415 |
-
// Default author display
|
416 |
-
|
417 |
-
var author_display = jQuery('#wprm-recipe-author-display').val();
|
418 |
-
|
419 |
-
if(author_display == 'default') {
|
420 |
-
author_display = jQuery('#wprm-recipe-author-display').find('option:first').data('default');
|
421 |
-
}
|
422 |
-
|
423 |
-
// Recipe Details
|
424 |
-
var recipe = {
|
425 |
-
image_id: jQuery('#wprm-recipe-image-id').val(),
|
426 |
-
name: jQuery('#wprm-recipe-name').val(),
|
427 |
-
summary: jQuery('#wprm-recipe-summary').val(),
|
428 |
-
author_display: author_display,
|
429 |
-
author_name: jQuery('#wprm-recipe-author-name').val(),
|
430 |
-
author_link: jQuery('#wprm-recipe-author-link').val(),
|
431 |
-
servings: jQuery('#wprm-recipe-servings').val(),
|
432 |
-
servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
|
433 |
-
prep_time: jQuery('#wprm-recipe-prep-time').val(),
|
434 |
-
cook_time: jQuery('#wprm-recipe-cook-time').val(),
|
435 |
-
total_time: jQuery('#wprm-recipe-total-time').val(),
|
436 |
-
nutrition: {
|
437 |
-
calories: jQuery('#wprm-recipe-calories').val()
|
438 |
-
},
|
439 |
-
tags: {
|
440 |
-
course: jQuery('#wprm-recipe-tag-course').val(),
|
441 |
-
cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
|
442 |
-
}
|
443 |
-
};
|
444 |
-
|
445 |
-
// Recipe Tags
|
446 |
-
recipe.tags = {};
|
447 |
-
jQuery('.wprm-recipe-tags').each(function() {
|
448 |
-
recipe.tags[jQuery(this).data('key')] = jQuery(this).val();
|
449 |
-
});
|
450 |
-
|
451 |
-
// Recipe Ingredients
|
452 |
-
recipe.ingredients = wprm_admin.get_ingredients();
|
453 |
-
|
454 |
-
// Recipe Instructions
|
455 |
-
var instructions = [];
|
456 |
-
var instruction_group = {
|
457 |
-
name: '',
|
458 |
-
instructions: []
|
459 |
-
};
|
460 |
-
jQuery('.wprm-recipe-instructions').find('tr').each(function() {
|
461 |
-
var row = jQuery(this);
|
462 |
-
if (row.hasClass('wprm-recipe-instruction-group')) {
|
463 |
-
// Add current instruction group to instructions
|
464 |
-
instructions.push(instruction_group);
|
465 |
-
|
466 |
-
instruction_group = {
|
467 |
-
name: row.find('.wprm-recipe-instruction-group-name').val(),
|
468 |
-
instructions: []
|
469 |
-
};
|
470 |
-
} else {
|
471 |
-
instruction_group.instructions.push({
|
472 |
-
text: row.find('textarea.wprm-recipe-instruction-text').val(),
|
473 |
-
image: row.find('.wprm-recipe-instruction-image').val()
|
474 |
-
});
|
475 |
-
}
|
476 |
-
});
|
477 |
-
// Add remaining instruction group
|
478 |
-
instructions.push(instruction_group);
|
479 |
-
|
480 |
-
recipe.instructions = instructions;
|
481 |
-
|
482 |
-
// Recipe Notes
|
483 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get('wprm_recipe_notes') && !tinyMCE.get('wprm_recipe_notes').isHidden()) {
|
484 |
-
recipe.notes = tinyMCE.get('wprm_recipe_notes').getContent();
|
485 |
-
} else {
|
486 |
-
recipe.notes = jQuery('#wprm_recipe_notes').val();
|
487 |
-
}
|
488 |
-
|
489 |
-
// Add any Premium fields
|
490 |
-
if(typeof wprmp_admin !== 'undefined') {
|
491 |
-
recipe = wprmp_admin.insert_update_recipe(recipe);
|
492 |
-
}
|
493 |
-
|
494 |
-
// Ajax call to recipe saver
|
495 |
-
var data = {
|
496 |
-
action: 'wprm_save_recipe',
|
497 |
-
security: wprm_modal.nonce,
|
498 |
-
recipe_id: wprm_admin.editing_recipe,
|
499 |
-
recipe: recipe
|
500 |
-
};
|
501 |
-
|
502 |
-
jQuery('.wprm-button-action-save').prop('disabled', true);
|
503 |
-
wprm_admin.start_loader(button);
|
504 |
-
|
505 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
506 |
-
wprm_admin.stop_loader(button);
|
507 |
-
jQuery('.wprm-button-action-save').prop('disabled', false);
|
508 |
-
|
509 |
-
if (out.success) {
|
510 |
-
if (wprm_admin.editing_recipe === 0) {
|
511 |
-
wprm_admin.editing_recipe = out.data.id;
|
512 |
-
}
|
513 |
-
|
514 |
-
if(!button.hasClass('wprm-button-action-save')) {
|
515 |
-
if ('insert' === wprm_admin.editing_recipe_type) {
|
516 |
-
wprm_admin.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
|
517 |
-
} else if(wprm_admin.active_editor_id) {
|
518 |
-
// Refresh content in editor to reload recipe preview
|
519 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get(wprm_admin.active_editor_id) && !tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
520 |
-
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
521 |
-
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
522 |
-
}
|
523 |
-
}
|
524 |
-
|
525 |
-
if(jQuery('.wprm-manage-datatable').length > 0) {
|
526 |
-
jQuery('.wprm-manage-datatable').DataTable().ajax.reload(null, false);
|
527 |
-
}
|
528 |
-
|
529 |
-
wprm_admin.close_modal();
|
530 |
-
}
|
531 |
-
}
|
532 |
-
}, 'json');
|
533 |
-
};
|
534 |
-
|
535 |
-
wprm_admin.get_ingredients = function() {
|
536 |
-
var ingredients = [];
|
537 |
-
var ingredient_group = {
|
538 |
-
name: '',
|
539 |
-
ingredients: []
|
540 |
-
};
|
541 |
-
jQuery('.wprm-recipe-ingredients').find('tr').each(function() {
|
542 |
-
var row = jQuery(this);
|
543 |
-
if (row.hasClass('wprm-recipe-ingredient-group')) {
|
544 |
-
// Add current ingredient group to ingredients
|
545 |
-
ingredients.push(ingredient_group);
|
546 |
-
|
547 |
-
ingredient_group = {
|
548 |
-
name: row.find('.wprm-recipe-ingredient-group-name').val(),
|
549 |
-
ingredients: []
|
550 |
-
};
|
551 |
-
} else {
|
552 |
-
var uid = row.data('uid'),
|
553 |
-
ingredient = {};
|
554 |
-
|
555 |
-
// Get original values.
|
556 |
-
if(wprm_admin.editing_recipe_ingredients.hasOwnProperty(uid)) {
|
557 |
-
ingredient = wprm_admin.editing_recipe_ingredients[uid];
|
558 |
-
}
|
559 |
-
|
560 |
-
// Update ingredients.
|
561 |
-
ingredient['amount'] = row.find('.wprm-recipe-ingredient-amount').val();
|
562 |
-
ingredient['unit'] = row.find('.wprm-recipe-ingredient-unit').val();
|
563 |
-
ingredient['name'] = row.find('.wprm-recipe-ingredient-name').val();
|
564 |
-
ingredient['notes'] = row.find('.wprm-recipe-ingredient-notes').val();
|
565 |
-
|
566 |
-
// Unit Conversion.
|
567 |
-
var converted = jQuery('#wprm-ingredient-conversion-' + uid);
|
568 |
-
|
569 |
-
if (converted.length > 0) {
|
570 |
-
var amount = converted.find('.wprmuc-system-2-amount').val(),
|
571 |
-
unit = converted.find('.wprmuc-system-2-unit').val();
|
572 |
-
|
573 |
-
ingredient['converted'] = {
|
574 |
-
2: {
|
575 |
-
amount: amount,
|
576 |
-
unit: unit,
|
577 |
-
}
|
578 |
-
};
|
579 |
-
}
|
580 |
-
|
581 |
-
// Add ingredient to group.
|
582 |
-
ingredient_group.ingredients.push(ingredient);
|
583 |
-
}
|
584 |
-
});
|
585 |
-
|
586 |
-
// Add remaining ingredient group
|
587 |
-
ingredients.push(ingredient_group);
|
588 |
-
|
589 |
-
return ingredients;
|
590 |
-
};
|
591 |
-
|
592 |
-
jQuery(document).ready(function($) {
|
593 |
-
// Check for changes made
|
594 |
-
jQuery('.wprm-modal').on('change', 'input, textarea, #wprm-recipe-author-display, .wprm-recipe-tags, #wprm-ingredient-links-type', function() {
|
595 |
-
wprm_admin.changes_made = true;
|
596 |
-
});
|
597 |
-
|
598 |
-
// Recipe and Instruction Image handler
|
599 |
-
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-add', function(e) {
|
600 |
-
wprm_admin.select_media_image(jQuery(this).parents('.wprm-recipe-image-container'));
|
601 |
-
});
|
602 |
-
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-remove', function(e) {
|
603 |
-
wprm_admin.remove_media_image(jQuery(this).parents('.wprm-recipe-image-container'));
|
604 |
-
});
|
605 |
-
|
606 |
-
// Initialize rich editor
|
607 |
-
wprm_admin.init_rich_editor();
|
608 |
-
|
609 |
-
// Author
|
610 |
-
jQuery('#wprm-recipe-author-display').select2_wprm({
|
611 |
-
width: '95%'
|
612 |
-
});
|
613 |
-
|
614 |
-
jQuery(document).on('change', '#wprm-recipe-author-display', function() {
|
615 |
-
var author_display = jQuery(this).val(),
|
616 |
-
default_display = jQuery(this).find('option:first').data('default');
|
617 |
-
|
618 |
-
if(author_display == 'custom' || (author_display == 'default' && default_display == 'custom')) {
|
619 |
-
jQuery('#wprm-recipe-author-name-container').show();
|
620 |
-
jQuery('#wprm-recipe-author-link-container').show();
|
621 |
-
} else {
|
622 |
-
jQuery('#wprm-recipe-author-name-container').hide();
|
623 |
-
jQuery('#wprm-recipe-author-link-container').hide();
|
624 |
-
}
|
625 |
-
});
|
626 |
-
jQuery('#wprm-recipe-author-display').change();
|
627 |
-
|
628 |
-
// Recipe Times
|
629 |
-
jQuery('.wprm-recipe-time').on('keyup change', function() {
|
630 |
-
var container = jQuery(this),
|
631 |
-
prep_time_container = jQuery('#wprm-recipe-prep-time'),
|
632 |
-
prep_time = prep_time_container.val(),
|
633 |
-
cook_time_container = jQuery('#wprm-recipe-cook-time'),
|
634 |
-
cook_time = cook_time_container.val(),
|
635 |
-
total_time_container = jQuery('#wprm-recipe-total-time'),
|
636 |
-
total_time = total_time_container.val();
|
637 |
-
|
638 |
-
if (container.is('#wprm-recipe-prep-time')) wprm_admin.prep_time_set = true;
|
639 |
-
if (container.is('#wprm-recipe-cook-time')) wprm_admin.cook_time_set = true;
|
640 |
-
if (container.is('#wprm-recipe-total-time')) wprm_admin.total_time_set = true;
|
641 |
-
|
642 |
-
if (prep_time && cook_time && !wprm_admin.total_time_set) total_time_container.val(parseInt(prep_time) + parseInt(cook_time));
|
643 |
-
if (total_time && prep_time && !wprm_admin.cook_time_set) cook_time_container.val(parseInt(total_time) - parseInt(prep_time));
|
644 |
-
if (total_time && cook_time && !wprm_admin.prep_time_set) prep_time_container.val(parseInt(total_time) - parseInt(cook_time));
|
645 |
-
});
|
646 |
-
|
647 |
-
// Recipe Tags
|
648 |
-
jQuery('.wprm-recipe-tags').select2_wprm({
|
649 |
-
width: '95%',
|
650 |
-
tags: true
|
651 |
-
});
|
652 |
-
|
653 |
-
// Add Recipe Ingredients and Instructions
|
654 |
-
jQuery('.wprm-recipe-ingredients-add').on('click', function() {
|
655 |
-
wprm_admin.add_ingredient();
|
656 |
-
});
|
657 |
-
jQuery('.wprm-recipe-ingredients-add-group').on('click', function() {
|
658 |
-
wprm_admin.add_ingredient_group();
|
659 |
-
});
|
660 |
-
jQuery('.wprm-recipe-instructions-add').on('click', function() {
|
661 |
-
wprm_admin.add_instruction('');
|
662 |
-
});
|
663 |
-
jQuery('.wprm-recipe-instructions-add-group').on('click', function() {
|
664 |
-
wprm_admin.add_instruction_group();
|
665 |
-
});
|
666 |
-
|
667 |
-
// Add new ingredient/instruction on TAB
|
668 |
-
jQuery('.wprm-recipe-ingredients').on('keydown', '.wprm-recipe-ingredient-notes, .wprm-recipe-ingredient-group-name', function(e) {
|
669 |
-
var keyCode = e.keyCode || e.which,
|
670 |
-
input = jQuery(this);
|
671 |
-
|
672 |
-
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
673 |
-
e.preventDefault();
|
674 |
-
wprm_admin.add_ingredient();
|
675 |
-
}
|
676 |
-
});
|
677 |
-
jQuery('.wprm-recipe-instructions').on('keydown', '.wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name', function(e) {
|
678 |
-
var keyCode = e.keyCode || e.which,
|
679 |
-
input = jQuery(this);
|
680 |
-
|
681 |
-
if (!e.shiftKey && keyCode == 9 && jQuery(this).parents('tr').is('tr:last-child')) {
|
682 |
-
e.preventDefault();
|
683 |
-
wprm_admin.add_instruction();
|
684 |
-
}
|
685 |
-
});
|
686 |
-
|
687 |
-
// Remove Recipe Ingredients and Instructions
|
688 |
-
jQuery('.wprm-recipe-ingredients-instructions-form').on('click', '.wprm-recipe-ingredients-instructions-delete', function() {
|
689 |
-
jQuery(this).parents('tr').remove();
|
690 |
-
});
|
691 |
-
|
692 |
-
// Sort Recipe Ingredients and Instructions
|
693 |
-
jQuery('.wprm-recipe-ingredients, .wprm-recipe-instructions').sortable({
|
694 |
-
opacity: 0.6,
|
695 |
-
revert: true,
|
696 |
-
cursor: 'move',
|
697 |
-
handle: '.wprm-recipe-ingredients-instructions-sort',
|
698 |
-
});
|
699 |
-
|
700 |
-
// Save recipe button.
|
701 |
-
jQuery('.wprm-button-action-save').on('click', function() {
|
702 |
-
wprm_admin.insert_update_recipe(jQuery(this));
|
703 |
-
});
|
704 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/recipe-snippets.js
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
var wprm_admin = wprm_admin || {};
|
2 |
-
|
3 |
-
wprm_admin.insert_jump_to_recipe = function(button) {
|
4 |
-
var id = parseInt(jQuery('#wprm-recipe-jump-id').val()),
|
5 |
-
text = wprm_admin.shortcode_escape(jQuery('#wprm-recipe-jump-text').val()),
|
6 |
-
shortcode = '[wprm-recipe-jump';
|
7 |
-
|
8 |
-
if (id > 0) {
|
9 |
-
shortcode += ' id="' + id + '"';
|
10 |
-
}
|
11 |
-
|
12 |
-
if (text) {
|
13 |
-
shortcode += ' text="' + text + '"';
|
14 |
-
}
|
15 |
-
|
16 |
-
shortcode += ']';
|
17 |
-
|
18 |
-
wprm_admin.add_text_to_editor(shortcode);
|
19 |
-
wprm_admin.close_modal();
|
20 |
-
};
|
21 |
-
|
22 |
-
wprm_admin.insert_print_recipe = function(button) {
|
23 |
-
var id = parseInt(jQuery('#wprm-recipe-print-id').val()),
|
24 |
-
text = wprm_admin.shortcode_escape(jQuery('#wprm-recipe-print-text').val()),
|
25 |
-
shortcode = '[wprm-recipe-print';
|
26 |
-
|
27 |
-
if (id > 0) {
|
28 |
-
shortcode += ' id="' + id + '"';
|
29 |
-
}
|
30 |
-
|
31 |
-
if (text) {
|
32 |
-
shortcode += ' text="' + text + '"';
|
33 |
-
}
|
34 |
-
|
35 |
-
shortcode += ']';
|
36 |
-
|
37 |
-
wprm_admin.add_text_to_editor(shortcode);
|
38 |
-
wprm_admin.close_modal();
|
39 |
-
};
|
40 |
-
|
41 |
-
wprm_admin.reset_snippets = function(args) {
|
42 |
-
jQuery('#wprm-recipe-jump-id').val('0').trigger('change');
|
43 |
-
jQuery('#wprm-recipe-jump-text').val('');
|
44 |
-
|
45 |
-
jQuery('#wprm-recipe-print-id').val('0').trigger('change');
|
46 |
-
jQuery('#wprm-recipe-print-text').val('');
|
47 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/admin/settings.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
-
|
|
|
|
|
2 |
|
3 |
jQuery(document).ready(function($) {
|
4 |
jQuery('.wprm-settings').find('select').select2_wprm();
|
1 |
+
import '../../../vendor/select2/js/select2.min.js';
|
2 |
+
import '../../../vendor/select2/css/select2.min.css';
|
3 |
+
import '../../css/admin/settings.scss';
|
4 |
|
5 |
jQuery(document).ready(function($) {
|
6 |
jQuery('.wprm-settings').find('select').select2_wprm();
|
assets/js/admin/shortcode-tinymce.js
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
(function() {
|
2 |
-
tinymce.PluginManager.add('wprecipemaker', function(editor, url) {
|
3 |
-
function replaceShortcodes(content) {
|
4 |
-
return content.replace(/\[wprm-recipe ([^\]]*)\]/g, function(match) {
|
5 |
-
return html(match);
|
6 |
-
});
|
7 |
-
}
|
8 |
-
|
9 |
-
function html(data) {
|
10 |
-
var id = data.match(/id="?'?(\d+)/i);
|
11 |
-
|
12 |
-
if(!id) {
|
13 |
-
return data;
|
14 |
-
}
|
15 |
-
|
16 |
-
data = window.encodeURIComponent(data);
|
17 |
-
|
18 |
-
var ajax_data = {
|
19 |
-
action: 'wprm_shortcode_preview',
|
20 |
-
security: wprm_modal.nonce,
|
21 |
-
recipe_id: id[1]
|
22 |
-
};
|
23 |
-
|
24 |
-
jQuery.post(wprm_modal.ajax_url, ajax_data, function(preview) {
|
25 |
-
var content = jQuery(editor.iframeElement).contents().find('#tinymce').html();
|
26 |
-
content = content.replace('>Loading WP Recipe Maker #' + id[1] + '<', '>' + preview + '<');
|
27 |
-
editor.setContent(content);
|
28 |
-
}, 'html');
|
29 |
-
|
30 |
-
return '<span class="wprm-placeholder" contentEditable="false"> </span><div class="wprm-shortcode" style="display: block; cursor: pointer; margin: 5px; padding: 10px; border: 1px solid #999;" contentEditable="false" ' +
|
31 |
-
'data-wprm-recipe="' + id[1] + '" data-wprm-shortcode="' + data + '" data-mce-resize="false" data-mce-placeholder="1">Loading WP Recipe Maker #' + id[1] + '</div><span class="wprm-placeholder" contentEditable="false"> </span>';
|
32 |
-
}
|
33 |
-
|
34 |
-
function restoreShortcodes(content) {
|
35 |
-
function getAttr(str, name) {
|
36 |
-
name = new RegExp(name + '=\"([^\"]+)\"').exec(str);
|
37 |
-
return name ? window.decodeURIComponent(name[1]) : '';
|
38 |
-
}
|
39 |
-
|
40 |
-
content = content.replace(/<p><span class="wprm-(?=(.*?span>))\1\s*<\/p>/g, '');
|
41 |
-
content = content.replace(/<span class="wprm-.*?span>/g, '');
|
42 |
-
|
43 |
-
return content.replace(/(?:<p(?: [^>]+)?>)*(<div [^>]+>[\s\S]*?<\/div>)(?:<\/p>)*/g, function(match, div) {
|
44 |
-
var data = getAttr(div, 'data-wprm-shortcode');
|
45 |
-
|
46 |
-
if (data) {
|
47 |
-
return '<p>' + data + '</p>';
|
48 |
-
}
|
49 |
-
|
50 |
-
return match;
|
51 |
-
});
|
52 |
-
}
|
53 |
-
|
54 |
-
editor.on('mouseup', function(event) {
|
55 |
-
var dom = editor.dom,
|
56 |
-
node = event.target,
|
57 |
-
shortcode = jQuery(node).hasClass('wprm-shortcode') ? jQuery(node) : jQuery(node).parents('.wprm-shortcode');
|
58 |
-
|
59 |
-
if (event.button !== 2 && shortcode.length > 0) {
|
60 |
-
if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
61 |
-
if (confirm(wprm_modal.text.shortcode_remove)) {
|
62 |
-
editor.dom.remove(node.parentNode);
|
63 |
-
}
|
64 |
-
} else {
|
65 |
-
var id = jQuery(shortcode).data('wprm-recipe');
|
66 |
-
wprm_admin.open_modal(editor.id, {
|
67 |
-
recipe_id: id
|
68 |
-
});
|
69 |
-
}
|
70 |
-
}
|
71 |
-
});
|
72 |
-
|
73 |
-
editor.on('BeforeSetContent', function(event) {
|
74 |
-
event.content = event.content.replace(/(<p>)?\s*<span class="wprm-placeholder" data-mce-contenteditable="false"> <\/span>\s*(<\/p>)?/gi,'');
|
75 |
-
event.content = event.content.replace(/^(\s*<p>)(\s*\[wprm-recipe)/, '$1<span class="wprm-placeholder" contentEditable="false"> </span>$2');
|
76 |
-
event.content = replaceShortcodes(event.content);
|
77 |
-
});
|
78 |
-
|
79 |
-
editor.on('PostProcess', function(event) {
|
80 |
-
if (event.get) {
|
81 |
-
event.content = restoreShortcodes(event.content);
|
82 |
-
}
|
83 |
-
});
|
84 |
-
});
|
85 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/{admin → other}/shortcode-button-tinymce.js
RENAMED
@@ -16,7 +16,7 @@
|
|
16 |
});
|
17 |
|
18 |
ed.addCommand('wp_recipe_maker', function() {
|
19 |
-
|
20 |
});
|
21 |
},
|
22 |
|
16 |
});
|
17 |
|
18 |
ed.addCommand('wp_recipe_maker', function() {
|
19 |
+
WPRecipeMaker.admin.Modal.open(ed.id);
|
20 |
});
|
21 |
},
|
22 |
|
assets/js/other/shortcode-tinymce.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
tinymce.PluginManager.add('wprecipemaker', function(editor, url) {
|
3 |
+
function replaceShortcodes(content) {
|
4 |
+
return content.replace(/\[wprm-recipe ([^\]]*)\]/g, function(match) {
|
5 |
+
return html(match);
|
6 |
+
});
|
7 |
+
}
|
8 |
+
|
9 |
+
function html(data) {
|
10 |
+
var id = data.match(/id="?'?(\d+)/i);
|
11 |
+
|
12 |
+
if(!id) {
|
13 |
+
return data;
|
14 |
+
}
|
15 |
+
|
16 |
+
data = window.encodeURIComponent(data);
|
17 |
+
|
18 |
+
var ajax_data = {
|
19 |
+
action: 'wprm_shortcode_preview',
|
20 |
+
security: wprm_temp_admin.nonce,
|
21 |
+
recipe_id: id[1]
|
22 |
+
};
|
23 |
+
|
24 |
+
jQuery.post(wprm_temp_admin.ajax_url, ajax_data, function(preview) {
|
25 |
+
var content = jQuery(editor.iframeElement).contents().find('#tinymce').html();
|
26 |
+
content = content.replace('>Loading WP Recipe Maker #' + id[1] + '<', '>' + preview + '<');
|
27 |
+
editor.setContent(content);
|
28 |
+
}, 'html');
|
29 |
+
|
30 |
+
return '<span class="wprm-placeholder" contentEditable="false"> </span><div class="wprm-shortcode" style="display: block; cursor: pointer; margin: 5px; padding: 10px; border: 1px solid #999;" contentEditable="false" ' +
|
31 |
+
'data-wprm-recipe="' + id[1] + '" data-wprm-shortcode="' + data + '" data-mce-resize="false" data-mce-placeholder="1">Loading WP Recipe Maker #' + id[1] + '</div><span class="wprm-placeholder" contentEditable="false"> </span>';
|
32 |
+
}
|
33 |
+
|
34 |
+
function restoreShortcodes(content) {
|
35 |
+
function getAttr(str, name) {
|
36 |
+
name = new RegExp(name + '=\"([^\"]+)\"').exec(str);
|
37 |
+
return name ? window.decodeURIComponent(name[1]) : '';
|
38 |
+
}
|
39 |
+
|
40 |
+
content = content.replace(/<p><span class="wprm-(?=(.*?span>))\1\s*<\/p>/g, '');
|
41 |
+
content = content.replace(/<span class="wprm-.*?span>/g, '');
|
42 |
+
|
43 |
+
return content.replace(/(?:<p(?: [^>]+)?>)*(<div [^>]+>[\s\S]*?<\/div>)(?:<\/p>)*/g, function(match, div) {
|
44 |
+
var data = getAttr(div, 'data-wprm-shortcode');
|
45 |
+
|
46 |
+
if (data) {
|
47 |
+
return '<p>' + data + '</p>';
|
48 |
+
}
|
49 |
+
|
50 |
+
return match;
|
51 |
+
});
|
52 |
+
}
|
53 |
+
|
54 |
+
editor.on('mouseup', function(event) {
|
55 |
+
var dom = editor.dom,
|
56 |
+
node = event.target,
|
57 |
+
shortcode = jQuery(node).hasClass('wprm-shortcode') ? jQuery(node) : jQuery(node).parents('.wprm-shortcode');
|
58 |
+
|
59 |
+
if (event.button !== 2 && shortcode.length > 0) {
|
60 |
+
if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
61 |
+
if (confirm(wprm_temp_admin.modal.text.shortcode_remove)) {
|
62 |
+
editor.dom.remove(node.parentNode);
|
63 |
+
}
|
64 |
+
} else {
|
65 |
+
var id = jQuery(shortcode).data('wprm-recipe');
|
66 |
+
WPRecipeMaker.admin.Modal.open(editor.id, {
|
67 |
+
recipe_id: id
|
68 |
+
});
|
69 |
+
}
|
70 |
+
}
|
71 |
+
});
|
72 |
+
|
73 |
+
editor.on('BeforeSetContent', function(event) {
|
74 |
+
event.content = event.content.replace(/(<p>)?\s*<span class="wprm-placeholder" data-mce-contenteditable="false"> <\/span>\s*(<\/p>)?/gi,'');
|
75 |
+
event.content = event.content.replace(/^(\s*<p>)(\s*\[wprm-recipe)/, '$1<span class="wprm-placeholder" contentEditable="false"> </span>$2');
|
76 |
+
event.content = replaceShortcodes(event.content);
|
77 |
+
});
|
78 |
+
|
79 |
+
editor.on('PostProcess', function(event) {
|
80 |
+
if (event.get) {
|
81 |
+
event.content = restoreShortcodes(event.content);
|
82 |
+
}
|
83 |
+
});
|
84 |
+
});
|
85 |
+
})();
|
assets/js/public.js
CHANGED
@@ -1,88 +1,7 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
var color = jQuery('.comment-form-wprm-rating').data('color');
|
9 |
-
|
10 |
-
jQuery(document).on('mouseenter', '.comment-form-wprm-rating .wprm-rating-star', function() {
|
11 |
-
jQuery(this).prevAll().andSelf().each(function() {
|
12 |
-
jQuery(this).find('polygon').css('fill', color);
|
13 |
-
});
|
14 |
-
jQuery(this).nextAll().each(function() {
|
15 |
-
jQuery(this).find('polygon').css('fill', 'none');
|
16 |
-
});
|
17 |
-
});
|
18 |
-
jQuery(document).on('mouseleave', '.comment-form-wprm-rating .wprm-rating-star', function() {
|
19 |
-
jQuery(this).siblings().andSelf().each(function() {
|
20 |
-
jQuery(this).find('polygon').css('fill', '');
|
21 |
-
});
|
22 |
-
});
|
23 |
-
jQuery(document).on('click', '.comment-form-wprm-rating .wprm-rating-star', function() {
|
24 |
-
var star = jQuery(this),
|
25 |
-
rating = star.data('rating'),
|
26 |
-
input = star.parents('.comment-form-wprm-rating').find('#wprm-comment-rating'),
|
27 |
-
current_rating = input.val();
|
28 |
-
|
29 |
-
if (current_rating == rating) {
|
30 |
-
input.val('');
|
31 |
-
|
32 |
-
jQuery(this).siblings('').andSelf().each(function() {
|
33 |
-
jQuery(this).removeClass('rated');
|
34 |
-
});
|
35 |
-
} else {
|
36 |
-
input.val(rating);
|
37 |
-
|
38 |
-
jQuery(this).prevAll().andSelf().each(function() {
|
39 |
-
jQuery(this).addClass('rated');
|
40 |
-
});
|
41 |
-
jQuery(this).nextAll().each(function() {
|
42 |
-
jQuery(this).removeClass('rated');
|
43 |
-
});
|
44 |
-
}
|
45 |
-
});
|
46 |
-
} else {
|
47 |
-
// Hide when no recipe is found.
|
48 |
-
jQuery('.comment-form-wprm-rating').hide();
|
49 |
-
}
|
50 |
-
});
|
51 |
-
}
|
52 |
-
|
53 |
-
var wprm = wprm || {};
|
54 |
-
|
55 |
-
wprm.print_recipe = function(recipe_id, servings, system) {
|
56 |
-
var print_window = window.open(wprm_public.home_url + 'wprm_print/' + recipe_id, '_blank');
|
57 |
-
print_window.onload = function() {
|
58 |
-
print_window.focus();
|
59 |
-
print_window.document.title = document.title;
|
60 |
-
print_window.history.pushState('', 'Print Recipe', location.href.replace(location.hash,""));
|
61 |
-
print_window.wprm.set_print_system(system);
|
62 |
-
print_window.wprm.set_print_servings(servings);
|
63 |
-
print_window.print();
|
64 |
-
};
|
65 |
-
};
|
66 |
-
|
67 |
-
jQuery(document).ready(function($) {
|
68 |
-
jQuery('.wprm-recipe-print').on('click', function(e) {
|
69 |
-
e.preventDefault();
|
70 |
-
|
71 |
-
var recipe = jQuery(this).parents('.wprm-recipe-container'),
|
72 |
-
servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings')),
|
73 |
-
system = 1,
|
74 |
-
recipe_id = recipe.data('recipe-id');
|
75 |
-
|
76 |
-
if('undefined' !== typeof wprmpuc) {
|
77 |
-
system = wprmpuc.get_active_system(recipe);
|
78 |
-
}
|
79 |
-
|
80 |
-
wprm.print_recipe(recipe_id, servings, system);
|
81 |
-
});
|
82 |
-
jQuery('.wprm-print-recipe-shortcode').on('click', function(e) {
|
83 |
-
e.preventDefault();
|
84 |
-
|
85 |
-
var recipe_id = jQuery(this).data('recipe-id');
|
86 |
-
wprm.print_recipe(recipe_id, false, 1);
|
87 |
-
});
|
88 |
-
});
|
1 |
+
import './public/comment-rating';
|
2 |
+
import './public/print';
|
3 |
|
4 |
+
import '../css/public/comments.scss';
|
5 |
+
import '../css/public/print.scss';
|
6 |
+
import '../css/public/snippets.scss';
|
7 |
+
import '../css/public/template_reset.scss';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/public.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
var wprm=wprm||{};wprm_public.settings.features_comment_ratings&&jQuery(document).ready(function(e){if(jQuery(".wprm-recipe-container").length>0||jQuery("body.wp-admin").length>0){jQuery(".comment-form-wprm-rating").show();var r=jQuery(".comment-form-wprm-rating").data("color");jQuery(document).on("mouseenter",".comment-form-wprm-rating .wprm-rating-star",function(){jQuery(this).prevAll().andSelf().each(function(){jQuery(this).find("polygon").css("fill",r)}),jQuery(this).nextAll().each(function(){jQuery(this).find("polygon").css("fill","none")})}),jQuery(document).on("mouseleave",".comment-form-wprm-rating .wprm-rating-star",function(){jQuery(this).siblings().andSelf().each(function(){jQuery(this).find("polygon").css("fill","")})}),jQuery(document).on("click",".comment-form-wprm-rating .wprm-rating-star",function(){var e=jQuery(this),r=e.data("rating"),n=e.parents(".comment-form-wprm-rating").find("#wprm-comment-rating");n.val()==r?(n.val(""),jQuery(this).siblings("").andSelf().each(function(){jQuery(this).removeClass("rated")})):(n.val(r),jQuery(this).prevAll().andSelf().each(function(){jQuery(this).addClass("rated")}),jQuery(this).nextAll().each(function(){jQuery(this).removeClass("rated")}))})}else jQuery(".comment-form-wprm-rating").hide()}),(wprm=wprm||{}).print_recipe=function(e,r,n){var t=window.open(wprm_public.home_url+"wprm_print/"+e,"_blank");t.onload=function(){t.focus(),t.document.title=document.title,t.history.pushState("","Print Recipe",location.href.replace(location.hash,"")),t.wprm.set_print_system(n),t.wprm.set_print_servings(r),t.print()}},jQuery(document).ready(function(e){jQuery(".wprm-recipe-print").on("click",function(e){e.preventDefault();var r=jQuery(this).parents(".wprm-recipe-container"),n=parseInt(r.find(".wprm-recipe-servings").data("servings")),t=1,i=r.data("recipe-id");"undefined"!=typeof wprmpuc&&(t=wprmpuc.get_active_system(r)),wprm.print_recipe(i,n,t)}),jQuery(".wprm-print-recipe-shortcode").on("click",function(e){e.preventDefault();var r=jQuery(this).data("recipe-id");wprm.print_recipe(r,!1,1)})});
|
|
assets/js/public/comment-rating.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
|
2 |
|
3 |
-
if (
|
4 |
jQuery(document).ready(function($) {
|
5 |
if (jQuery('.wprm-recipe-container').length > 0 || jQuery('body.wp-admin').length > 0) {
|
6 |
jQuery('.comment-form-wprm-rating').show();
|
1 |
+
let comment_ratings_setting = typeof window.wprm_public !== 'undefined' ? wprm_public.settings.features_comment_ratings : wprm_temp_admin.settings.features_comment_ratings;
|
2 |
|
3 |
+
if (comment_ratings_setting) {
|
4 |
jQuery(document).ready(function($) {
|
5 |
if (jQuery('.wprm-recipe-container').length > 0 || jQuery('body.wp-admin').length > 0) {
|
6 |
jQuery('.comment-form-wprm-rating').show();
|
assets/js/public/print.js
CHANGED
@@ -1,36 +1,32 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
};
|
14 |
|
15 |
jQuery(document).ready(function($) {
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
e.preventDefault();
|
32 |
-
|
33 |
-
var recipe_id = jQuery(this).data('recipe-id');
|
34 |
-
wprm.print_recipe(recipe_id, false, 1);
|
35 |
-
});
|
36 |
});
|
1 |
+
import { get_active_system } from '../../../../wp-recipe-maker-premium/addons-pro/unit-conversion/assets/js/shared/unit-conversion';
|
2 |
|
3 |
+
function print_recipe(recipe_id, servings, system) {
|
4 |
+
var print_window = window.open(wprm_public.home_url + 'wprm_print/' + recipe_id, '_blank');
|
5 |
+
print_window.onload = function() {
|
6 |
+
print_window.focus();
|
7 |
+
print_window.document.title = document.title;
|
8 |
+
print_window.history.pushState('', 'Print Recipe', location.href.replace(location.hash,""));
|
9 |
+
print_window.set_print_system(system);
|
10 |
+
print_window.set_print_servings(servings);
|
11 |
+
print_window.print();
|
12 |
+
};
|
13 |
};
|
14 |
|
15 |
jQuery(document).ready(function($) {
|
16 |
+
jQuery('.wprm-recipe-print').on('click', function(e) {
|
17 |
+
e.preventDefault();
|
18 |
|
19 |
+
var recipe = jQuery(this).parents('.wprm-recipe-container'),
|
20 |
+
servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings')),
|
21 |
+
system = get_active_system(recipe),
|
22 |
+
recipe_id = recipe.data('recipe-id');
|
23 |
|
24 |
+
print_recipe(recipe_id, servings, system);
|
25 |
+
});
|
26 |
+
jQuery('.wprm-print-recipe-shortcode').on('click', function(e) {
|
27 |
+
e.preventDefault();
|
28 |
|
29 |
+
var recipe_id = jQuery(this).data('recipe-id');
|
30 |
+
print_recipe(recipe_id, false, 1);
|
31 |
+
});
|
|
|
|
|
|
|
|
|
|
|
32 |
});
|
dist/admin.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.select2_wprm-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2_wprm-container .select2_wprm-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2_wprm-container .select2_wprm-selection--single .select2_wprm-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2_wprm-container .select2_wprm-selection--single .select2_wprm-selection__clear{position:relative}.select2_wprm-container[dir=rtl] .select2_wprm-selection--single .select2_wprm-selection__rendered{padding-right:8px;padding-left:20px}.select2_wprm-container .select2_wprm-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2_wprm-container .select2_wprm-selection--multiple .select2_wprm-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2_wprm-container .select2_wprm-search--inline{float:left}.select2_wprm-container .select2_wprm-search--inline .select2_wprm-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2_wprm-container .select2_wprm-search--inline .select2_wprm-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2_wprm-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2_wprm-results{display:block}.select2_wprm-results__options{list-style:none;margin:0;padding:0}.select2_wprm-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2_wprm-results__option[aria-selected]{cursor:pointer}.select2_wprm-container--open .select2_wprm-dropdown{left:0}.select2_wprm-container--open .select2_wprm-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2_wprm-container--open .select2_wprm-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2_wprm-search--dropdown{display:block;padding:4px}.select2_wprm-search--dropdown .select2_wprm-search__field{padding:4px;width:100%;box-sizing:border-box}.select2_wprm-search--dropdown .select2_wprm-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2_wprm-search--dropdown.select2_wprm-search--hide{display:none}.select2_wprm-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2_wprm-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2_wprm-container--default .select2_wprm-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2_wprm-container--default .select2_wprm-selection--single .select2_wprm-selection__rendered{color:#444;line-height:28px}.select2_wprm-container--default .select2_wprm-selection--single .select2_wprm-selection__clear{cursor:pointer;float:right;font-weight:700}.select2_wprm-container--default .select2_wprm-selection--single .select2_wprm-selection__placeholder{color:#999}.select2_wprm-container--default .select2_wprm-selection--single .select2_wprm-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2_wprm-container--default .select2_wprm-selection--single .select2_wprm-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--single .select2_wprm-selection__clear{float:left}.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--single .select2_wprm-selection__arrow{left:1px;right:auto}.select2_wprm-container--default.select2_wprm-container--disabled .select2_wprm-selection--single{background-color:#eee;cursor:default}.select2_wprm-container--default.select2_wprm-container--disabled .select2_wprm-selection--single .select2_wprm-selection__clear{display:none}.select2_wprm-container--default.select2_wprm-container--open .select2_wprm-selection--single .select2_wprm-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2_wprm-container--default .select2_wprm-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__rendered li{list-style:none}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__placeholder{color:#999;margin-top:5px;float:left}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2_wprm-container--default .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove:hover{color:#333}.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-search--inline,.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__choice,.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__placeholder{float:right}.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__choice{margin-left:5px;margin-right:auto}.select2_wprm-container--default[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove{margin-left:2px;margin-right:auto}.select2_wprm-container--default.select2_wprm-container--focus .select2_wprm-selection--multiple{border:1px solid #000;outline:0}.select2_wprm-container--default.select2_wprm-container--disabled .select2_wprm-selection--multiple{background-color:#eee;cursor:default}.select2_wprm-container--default.select2_wprm-container--disabled .select2_wprm-selection__choice__remove{display:none}.select2_wprm-container--default.select2_wprm-container--open.select2_wprm-container--above .select2_wprm-selection--multiple,.select2_wprm-container--default.select2_wprm-container--open.select2_wprm-container--above .select2_wprm-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2_wprm-container--default.select2_wprm-container--open.select2_wprm-container--below .select2_wprm-selection--multiple,.select2_wprm-container--default.select2_wprm-container--open.select2_wprm-container--below .select2_wprm-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2_wprm-container--default .select2_wprm-search--dropdown .select2_wprm-search__field{border:1px solid #aaa}.select2_wprm-container--default .select2_wprm-search--inline .select2_wprm-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2_wprm-container--default .select2_wprm-results>.select2_wprm-results__options{max-height:200px;overflow-y:auto}.select2_wprm-container--default .select2_wprm-results__option[role=group]{padding:0}.select2_wprm-container--default .select2_wprm-results__option[aria-disabled=true]{color:#999}.select2_wprm-container--default .select2_wprm-results__option[aria-selected=true]{background-color:#ddd}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option{padding-left:1em}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__group{padding-left:0}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option{margin-left:-1em;padding-left:2em}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option{margin-left:-2em;padding-left:3em}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option{margin-left:-3em;padding-left:4em}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option{margin-left:-4em;padding-left:5em}.select2_wprm-container--default .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option .select2_wprm-results__option{margin-left:-5em;padding-left:6em}.select2_wprm-container--default .select2_wprm-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2_wprm-container--default .select2_wprm-results__group{cursor:default;display:block;padding:6px}.select2_wprm-container--classic .select2_wprm-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(180deg,#fff 50%,#eee);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0)}.select2_wprm-container--classic .select2_wprm-selection--single:focus{border:1px solid #5897fb}.select2_wprm-container--classic .select2_wprm-selection--single .select2_wprm-selection__rendered{color:#444;line-height:28px}.select2_wprm-container--classic .select2_wprm-selection--single .select2_wprm-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2_wprm-container--classic .select2_wprm-selection--single .select2_wprm-selection__placeholder{color:#999}.select2_wprm-container--classic .select2_wprm-selection--single .select2_wprm-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(180deg,#eee 50%,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFCCCCCC",GradientType=0)}.select2_wprm-container--classic .select2_wprm-selection--single .select2_wprm-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2_wprm-container--classic[dir=rtl] .select2_wprm-selection--single .select2_wprm-selection__clear{float:left}.select2_wprm-container--classic[dir=rtl] .select2_wprm-selection--single .select2_wprm-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2_wprm-container--classic.select2_wprm-container--open .select2_wprm-selection--single{border:1px solid #5897fb}.select2_wprm-container--classic.select2_wprm-container--open .select2_wprm-selection--single .select2_wprm-selection__arrow{background:transparent;border:none}.select2_wprm-container--classic.select2_wprm-container--open .select2_wprm-selection--single .select2_wprm-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2_wprm-container--classic.select2_wprm-container--open.select2_wprm-container--above .select2_wprm-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(180deg,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF",endColorstr="#FFEEEEEE",GradientType=0)}.select2_wprm-container--classic.select2_wprm-container--open.select2_wprm-container--below .select2_wprm-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(180deg,#eee 50%,#fff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE",endColorstr="#FFFFFFFF",GradientType=0)}.select2_wprm-container--classic .select2_wprm-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2_wprm-container--classic .select2_wprm-selection--multiple:focus{border:1px solid #5897fb}.select2_wprm-container--classic .select2_wprm-selection--multiple .select2_wprm-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2_wprm-container--classic .select2_wprm-selection--multiple .select2_wprm-selection__clear{display:none}.select2_wprm-container--classic .select2_wprm-selection--multiple .select2_wprm-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2_wprm-container--classic .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2_wprm-container--classic .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove:hover{color:#555}.select2_wprm-container--classic[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2_wprm-container--classic[dir=rtl] .select2_wprm-selection--multiple .select2_wprm-selection__choice__remove{margin-left:2px;margin-right:auto}.select2_wprm-container--classic.select2_wprm-container--open .select2_wprm-selection--multiple{border:1px solid #5897fb}.select2_wprm-container--classic.select2_wprm-container--open.select2_wprm-container--above .select2_wprm-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2_wprm-container--classic.select2_wprm-container--open.select2_wprm-container--below .select2_wprm-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2_wprm-container--classic .select2_wprm-search--dropdown .select2_wprm-search__field{border:1px solid #aaa;outline:0}.select2_wprm-container--classic .select2_wprm-search--inline .select2_wprm-search__field{outline:0;box-shadow:none}.select2_wprm-container--classic .select2_wprm-dropdown{background-color:#fff;border:1px solid transparent}.select2_wprm-container--classic .select2_wprm-dropdown--above{border-bottom:none}.select2_wprm-container--classic .select2_wprm-dropdown--below{border-top:none}.select2_wprm-container--classic .select2_wprm-results>.select2_wprm-results__options{max-height:200px;overflow-y:auto}.select2_wprm-container--classic .select2_wprm-results__option[role=group]{padding:0}.select2_wprm-container--classic .select2_wprm-results__option[aria-disabled=true]{color:grey}.select2_wprm-container--classic .select2_wprm-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2_wprm-container--classic .select2_wprm-results__group{cursor:default;display:block;padding:6px}.select2_wprm-container--classic.select2_wprm-container--open .select2_wprm-dropdown{border-color:#5897fb}@-webkit-keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}@keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}.medium-editor-anchor-preview{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;line-height:1.4;max-width:280px;position:absolute;text-align:center;top:0;word-break:break-all;word-wrap:break-word;visibility:hidden;z-index:2000}.medium-editor-anchor-preview a{color:#fff;display:inline-block;margin:5px 5px 10px}.medium-editor-anchor-preview-active{visibility:visible}.medium-editor-dragover{background:#ddd}.medium-editor-image-loading{-webkit-animation:medium-editor-image-loading 1s infinite ease-in-out;animation:medium-editor-image-loading 1s infinite ease-in-out;background-color:#333;border-radius:100%;display:inline-block;height:40px;width:40px}.medium-editor-placeholder{position:relative}.medium-editor-placeholder:after{content:attr(data-placeholder)!important;font-style:italic;position:absolute;left:0;top:0;white-space:pre;padding:inherit;margin:inherit}.medium-editor-placeholder-relative{position:relative}.medium-editor-placeholder-relative:after{content:attr(data-placeholder)!important;font-style:italic;position:relative;white-space:pre;padding:inherit;margin:inherit}.medium-toolbar-arrow-over:before,.medium-toolbar-arrow-under:after{border-style:solid;content:"";display:block;height:0;left:50%;margin-left:-8px;position:absolute;width:0}.medium-toolbar-arrow-under:after{border-width:8px 8px 0}.medium-toolbar-arrow-over:before{border-width:0 8px 8px;top:-8px}.medium-editor-toolbar{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;position:absolute;top:0;visibility:hidden;z-index:2000}.medium-editor-toolbar ul{margin:0;padding:0}.medium-editor-toolbar li{float:left;list-style:none;margin:0;padding:0}.medium-editor-toolbar li button{box-sizing:border-box;cursor:pointer;display:block;font-size:14px;line-height:1.33;margin:0;padding:15px;text-decoration:none}.medium-editor-toolbar li button:focus{outline:none}.medium-editor-toolbar li .medium-editor-action-underline{text-decoration:underline}.medium-editor-toolbar li .medium-editor-action-pre{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px;font-weight:100;padding:15px 0}.medium-editor-toolbar-active{visibility:visible}.medium-editor-sticky-toolbar{position:fixed;top:1px}.medium-editor-relative-toolbar{position:relative}.medium-editor-toolbar-active.medium-editor-stalker-toolbar{-webkit-animation:medium-editor-pop-upwards .16s forwards linear;animation:medium-editor-pop-upwards .16s forwards linear}.medium-editor-action-bold{font-weight:bolder}.medium-editor-action-italic{font-style:italic}.medium-editor-toolbar-form{display:none}.medium-editor-toolbar-form a,.medium-editor-toolbar-form input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.medium-editor-toolbar-form .medium-editor-toolbar-form-row{line-height:14px;margin-left:5px;padding-bottom:5px}.medium-editor-toolbar-form .medium-editor-toolbar-input,.medium-editor-toolbar-form label{border:none;box-sizing:border-box;font-size:14px;margin:0;padding:6px;width:316px;display:inline-block}.medium-editor-toolbar-form .medium-editor-toolbar-input:focus,.medium-editor-toolbar-form label:focus{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;box-shadow:none;outline:0}.medium-editor-toolbar-form a{display:inline-block;font-size:24px;font-weight:bolder;margin:0 10px;text-decoration:none}.medium-editor-toolbar-form-active{display:block}.medium-editor-toolbar-actions:after{clear:both;content:"";display:table}.medium-editor-element{word-wrap:break-word;min-height:30px}.medium-editor-element img{max-width:100%}.medium-editor-element sub{vertical-align:sub}.medium-editor-element sup{vertical-align:super}.medium-editor-hidden{display:none}.medium-toolbar-arrow-under:after{border-color:#000 transparent transparent;top:40px}.medium-toolbar-arrow-over:before{border-color:transparent transparent #000}.medium-editor-toolbar{background-color:#000;border:none;border-radius:50px}.medium-editor-toolbar li button{background-color:transparent;border:none;box-sizing:border-box;color:#ccc;height:40px;min-width:40px;padding:5px 12px;-webkit-transition:background-color .2s ease-in,color .2s ease-in;transition:background-color .2s ease-in,color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#000;color:#a2d7c7}.medium-editor-toolbar li .medium-editor-button-first{border-bottom-left-radius:50px;border-top-left-radius:50px;padding-left:24px}.medium-editor-toolbar li .medium-editor-button-last{border-bottom-right-radius:50px;border-right:none;border-top-right-radius:50px;padding-right:24px}.medium-editor-toolbar li .medium-editor-button-active{background-color:#000;color:#a2d7c7}.medium-editor-toolbar-form{background:#000;border-radius:50px;color:#ccc;overflow:hidden}.medium-editor-toolbar-form .medium-editor-toolbar-input{background:#000;box-sizing:border-box;color:#ccc;height:40px;padding-left:16px;width:220px}.medium-editor-toolbar-form .medium-editor-toolbar-input::-webkit-input-placeholder{color:#f8f5f3;color:hsla(24,26%,96%,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-moz-placeholder,.medium-editor-toolbar-form .medium-editor-toolbar-input::-moz-placeholder{color:#f8f5f3;color:hsla(24,26%,96%,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-ms-input-placeholder{color:#f8f5f3;color:hsla(24,26%,96%,.8)}.medium-editor-toolbar-form a{color:#ccc;-webkit-transform:translateY(2px);transform:translateY(2px)}.medium-editor-toolbar-form .medium-editor-toolbar-close{margin-right:16px}.medium-editor-toolbar-anchor-preview{background:#000;border-radius:50px;padding:5px 12px}.medium-editor-anchor-preview a{color:#ccc;text-decoration:none}.medium-editor-toolbar-actions button,.medium-editor-toolbar-actions li{border-radius:50px}.wprm-import p{max-width:600px}.wprm-import .wprm-import-error{max-width:600px;border:1px solid darkred;background-color:#ff9f9f;padding:10px}.wprm-import .wprm-import-recipes{width:100%}.wprm-import .wprm-import-recipes input[type=checkbox]{vertical-align:top}.wprm-import .wprm-import-recipes a{text-decoration:none}.wprm-import .wprm-import-recipes .dashicons.dashicons-visibility{font-size:18px}.wprm-import .wprm-import-recipes td:first-child{width:2%}.wprm-import .wprm-import-recipes td:nth-child(2){width:30%}.wprm-import #wprm-import-progress-container{width:100%;max-width:300px;height:20px;margin:10px 0;border:1px solid #000;background-color:#fff}.wprm-import #wprm-import-progress-bar{width:0;height:100%;background-color:#4484ce}.wprm-import #wprm-import-finished{display:none}table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable tfoot th,table.dataTable thead th{font-weight:700}table.dataTable thead td,table.dataTable thead th{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead td:active,table.dataTable thead th:active{outline:none}table.dataTable tfoot td,table.dataTable tfoot th{padding:10px 18px 6px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:100%}table.dataTable thead .sorting{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7XQMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC)}table.dataTable thead .sorting_asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}table.dataTable thead .sorting_asc_disabled{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAW0lEQVQoz2NgoCm4w3Vnwh02wspK7/y6k01Ikdadx3f+37l9RxmfIsY7c4GKQHDiHUbcyhzvvIMq+3THBpci3jv7oIpAcMcdduzKEu/8vPMdDn/eiWQYBYMKAAC3ykIEuYQJUgAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc_disabled{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAWUlEQVQoz2NgGAWDCtyJvPPzznc4/HknEbsy9js77vyHw313eHGZZ3PnE1TRuzuOuK1lvDMRqmzuHUZ87lO+cxuo6PEdLUIeyb7z604pYf+y3Zlwh4u2YQoAc7ZCBHH4jigAAAAASUVORK5CYII=)}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody td,table.dataTable tbody th{padding:8px 10px}table.dataTable.display tbody td,table.dataTable.display tbody th,table.dataTable.row-border tbody td,table.dataTable.row-border tbody th{border-top:1px solid #ddd}table.dataTable.display tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.row-border tbody tr:first-child th{border-top:none}table.dataTable.cell-border tbody td,table.dataTable.cell-border tbody th{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr td:first-child,table.dataTable.cell-border tbody tr th:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child td,table.dataTable.cell-border tbody tr:first-child th{border-top:none}table.dataTable.display tbody tr.odd,table.dataTable.stripe tbody tr.odd{background-color:#f9f9f9}table.dataTable.display tbody tr.odd.selected,table.dataTable.stripe tbody tr.odd.selected{background-color:#abb9d3}table.dataTable.display tbody tr:hover,table.dataTable.hover tbody tr:hover{background-color:#f5f5f5}table.dataTable.display tbody tr:hover.selected,table.dataTable.hover tbody tr:hover.selected{background-color:#a9b7d1}table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3,table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3{background-color:#f9f9f9}table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3,table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3{background-color:#acbad4}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:#f5f5f5}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b3cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a7b5ce}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b6d0}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#f9f9f9}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fbfbfb}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fdfdfd}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad4}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#adbbd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ebebeb}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#eee}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap td,table.dataTable.nowrap th{white-space:nowrap}table.dataTable.compact thead td,table.dataTable.compact thead th{padding:4px 17px 4px 4px}table.dataTable.compact tbody td,table.dataTable.compact tbody th,table.dataTable.compact tfoot td,table.dataTable.compact tfoot th{padding:4px}table.dataTable td.dt-left,table.dataTable th.dt-left{text-align:left}table.dataTable td.dataTables_empty,table.dataTable td.dt-center,table.dataTable th.dt-center{text-align:center}table.dataTable td.dt-right,table.dataTable th.dt-right{text-align:right}table.dataTable td.dt-justify,table.dataTable th.dt-justify{text-align:justify}table.dataTable td.dt-nowrap,table.dataTable th.dt-nowrap{white-space:nowrap}table.dataTable tfoot td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable thead th.dt-head-left{text-align:left}table.dataTable tfoot td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable thead th.dt-head-center{text-align:center}table.dataTable tfoot td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable thead th.dt-head-right{text-align:right}table.dataTable tfoot td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable thead th.dt-head-justify{text-align:justify}table.dataTable tfoot td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable thead th.dt-head-nowrap{white-space:nowrap}table.dataTable tbody td.dt-body-left,table.dataTable tbody th.dt-body-left{text-align:left}table.dataTable tbody td.dt-body-center,table.dataTable tbody th.dt-body-center{text-align:center}table.dataTable tbody td.dt-body-right,table.dataTable tbody th.dt-body-right{text-align:right}table.dataTable tbody td.dt-body-justify,table.dataTable tbody th.dt-body-justify{text-align:justify}table.dataTable tbody td.dt-body-nowrap,table.dataTable tbody th.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable td,table.dataTable th{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:.5em 1em;margin-left:2px;text-align:center;text-decoration:none!important;cursor:pointer;*cursor:hand;color:#333!important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333!important;border:1px solid #979797;background-color:#fff;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(100%,#dcdcdc));background:-webkit-linear-gradient(top,#fff,#dcdcdc);background:-moz-linear-gradient(top,#fff 0,#dcdcdc 100%);background:-ms-linear-gradient(top,#fff 0,#dcdcdc 100%);background:-o-linear-gradient(top,#fff 0,#dcdcdc 100%);background:linear-gradient(180deg,#fff 0,#dcdcdc)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover{cursor:default;color:#666!important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:#fff!important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#585858),color-stop(100%,#111));background:-webkit-linear-gradient(top,#585858,#111);background:-moz-linear-gradient(top,#585858 0,#111 100%);background:-ms-linear-gradient(top,#585858 0,#111 100%);background:-o-linear-gradient(top,#585858 0,#111 100%);background:linear-gradient(180deg,#585858 0,#111)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#2b2b2b),color-stop(100%,#0c0c0c));background:-webkit-linear-gradient(top,#2b2b2b,#0c0c0c);background:-moz-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:-ms-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:-o-linear-gradient(top,#2b2b2b 0,#0c0c0c 100%);background:linear-gradient(180deg,#2b2b2b 0,#0c0c0c);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:#fff;background:-webkit-gradient(linear,left top,right top,color-stop(0,hsla(0,0%,100%,0)),color-stop(25%,hsla(0,0%,100%,.9)),color-stop(75%,hsla(0,0%,100%,.9)),color-stop(100%,hsla(0,0%,100%,0)));background:-webkit-linear-gradient(left,hsla(0,0%,100%,0),hsla(0,0%,100%,.9) 25%,hsla(0,0%,100%,.9) 75%,hsla(0,0%,100%,0));background:-moz-linear-gradient(left,hsla(0,0%,100%,0) 0,hsla(0,0%,100%,.9) 25%,hsla(0,0%,100%,.9) 75%,hsla(0,0%,100%,0) 100%);background:-ms-linear-gradient(left,hsla(0,0%,100%,0) 0,hsla(0,0%,100%,.9) 25%,hsla(0,0%,100%,.9) 75%,hsla(0,0%,100%,0) 100%);background:-o-linear-gradient(left,hsla(0,0%,100%,0) 0,hsla(0,0%,100%,.9) 25%,hsla(0,0%,100%,.9) 75%,hsla(0,0%,100%,0) 100%);background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,hsla(0,0%,100%,.9) 25%,hsla(0,0%,100%,.9) 75%,hsla(0,0%,100%,0))}.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_paginate,.dataTables_wrapper .dataTables_processing{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing{height:0;overflow:hidden;margin:0!important;padding:0!important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollBody>table,.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width:767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width:640px){.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_length{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}}.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);-moz-transform:scale(0);-o-transform:scale(0);-ms-transform:scale(0);transform:scale(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);-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-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-swing{opacity:0;-webkit-transform:rotate(4deg);-moz-transform:rotate(4deg);-o-transform:rotate(4deg);-ms-transform:rotate(4deg);transform:rotate(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:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);-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);-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-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}to{opacity:1}}.tooltipster-update-fade{animation:tooltipster-fading .4s}@keyframes tooltipster-rotating{25%{transform:rotate(-2deg)}75%{transform:rotate(2deg)}to{transform:rotate(0)}}.tooltipster-update-rotate{animation:tooltipster-rotating .6s}@keyframes tooltipster-scaling{50%{transform:scale(1.1)}to{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}.wprm-manage .wprm-manage-header{margin-top:20px}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container,.wprm-manage .wprm-manage-recipes-filters .wprm-manage-recipes-filter{margin-left:5px;z-index:100;max-width:100%}.wprm-manage .wprm-manage-datatable{display:none}.wprm-manage .wprm-manage-datatable .wprm-icon{cursor:pointer;color:#444}.wprm-manage .dataTables_wrapper{margin-top:20px}.wprm-manage .dataTables_wrapper .wprm-manage-datatable{display:table}.wprm-manage .wprm-manage-recipes-rating-details{font-size:.7em}.wprm-manage .wprm-manage-recipes-seo{margin:0 auto;width:15px;height:15px;border:1px solid #444;border-radius:50%}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-bad{background-color:#e74c3c}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-warning{background-color:#e67e22}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-rating{background-color:#f1c40f}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-good{background-color:#27ae60}.wprm-manage .wprm-manage-recipes-seo:hover{cursor:pointer}.wprm-manage .wprm-manage-recipes-seo-tooltip{display:none}.wprm-manage-custom-taxonomies-actions-tooltip,.wprm-manage-ingredients-actions-tooltip,.wprm-manage-recipes-actions-tooltip,.wprm-manage-taxonomies-actions-tooltip{text-align:right;min-width:250px;min-height:70px;font-size:14px}.wprm-manage-custom-taxonomies-actions-tooltip .tooltip-header,.wprm-manage-ingredients-actions-tooltip .tooltip-header,.wprm-manage-recipes-actions-tooltip .tooltip-header,.wprm-manage-taxonomies-actions-tooltip .tooltip-header{margin-bottom:5px;font-weight:700}.wprm-manage-custom-taxonomies-actions-tooltip a,.wprm-manage-ingredients-actions-tooltip a,.wprm-manage-recipes-actions-tooltip a,.wprm-manage-taxonomies-actions-tooltip a{color:#fff;display:block;text-decoration:none}.wprm-manage-custom-taxonomies-actions-tooltip a:hover,.wprm-manage-ingredients-actions-tooltip a:hover,.wprm-manage-recipes-actions-tooltip a:hover,.wprm-manage-taxonomies-actions-tooltip a:hover{text-decoration:underline}.wprm-giveaway-notice{border:1px solid #006400;background-color:rgba(0,255,0,.15);padding:10px;margin-bottom:10px}.wprm-feedback-notice{border:1px solid #0085ba;background-color:rgba(0,133,186,.15);padding:10px;margin-bottom:10px}.wprm-feedback-notice button{margin:5px 5px 0 0!important}.wprm-easyrecipe-warning{display:none;border:1px solid darkred;background-color:rgba(255,0,0,.15);padding:10px;padding-bottom:0;margin-bottom:10px}.mce-floatpanel{z-index:100101!important}.select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-anchor-preview,.medium-editor-toolbar{z-index:100080}.medium-editor-anchor-preview{font-size:12px}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-hint{max-width:400px;margin-bottom:20px}.wprm-modal-hint .wprm-modal-hint-header{font-weight:700;font-variant:small-caps}.wprm-modal-hint .wprm-modal-hint-text{font-style:italic}.wprm-modal-container{display:none}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;text-decoration:none!important;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\F158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-close:hover .wprm-modal-icon:before{color:#00a0d2}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-modal-content :-moz-placeholder,.wprm-modal-content ::-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router{display:none}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu-hidden{padding:5px 5px 0 10px;font-style:italic}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-frame .hidden{display:none}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router:not(.active){display:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-content-tab{margin:20px}.wprm-frame-content-tab:not(.active){display:none}.wprm-frame-toolbar{left:200px;bottom:0}.wprm-frame-toolbar,.wprm-toolbar{position:absolute;right:0;height:60px;z-index:100}.wprm-toolbar{top:0;left:0;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-button-action-save{display:none}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width:900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar,.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width:640px),screen and (max-height:400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width:480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-form{max-width:600px}.wprm-recipe-form .wprm-recipe-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-form .wprm-recipe-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-form .wprm-recipe-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-form label{display:block;font-weight:700;margin-bottom:5px}.wprm-recipe-form input[type=number],.wprm-recipe-form input[type=text]{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-form input[type=number][type=number],.wprm-recipe-form input[type=text][type=number]{max-width:50px}.wprm-recipe-form input[type=number].select2_wprm-search__field,.wprm-recipe-form input[type=text].select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-form select{width:100%}.wprm-recipe-form textarea{width:100%;resize:vertical}@media only screen and (max-width:480px){.wprm-recipe-form .wprm-recipe-form-container-halfs,.wprm-recipe-form .wprm-recipe-form-container-thirds{display:block;width:100%}}.wprm-recipe-import-text-form .import-text-buttons{margin-bottom:10px}.wprm-recipe-import-text-form .import-text-step{display:none}.wprm-recipe-import-text-form .import-text-step#import-text-step-input{display:block}.wprm-recipe-import-text-form #import-text-highlight-sandbox,.wprm-recipe-import-text-form .import-text-input{margin-top:10px}.wprm-recipe-import-text-form #import-text-ingredient-groups label,.wprm-recipe-import-text-form #import-text-instruction-groups label{display:inline;font-weight:400}.wprm-recipe-import-text-form .import-text-group-warning{margin-top:10px;display:none}.wprm-recipe-import-text-form #import-text-highlight-sandbox{display:none;max-height:400px;overflow:scroll;padding:10px;border:1px dashed #999}.wprm-loader{display:none}.wprm-loader,.wprm-loader:after,.wprm-loader:before{border-radius:50%;width:1.5em;height:1.5em;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation:load7 1.8s infinite ease-in-out;animation:load7 1.8s infinite ease-in-out}.wprm-loader{color:#444;font-size:10px;margin:20px auto;position:relative;text-indent:-9999em;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}.wprm-loader:after,.wprm-loader:before{content:"";position:absolute;top:0}.wprm-loader:before{left:-2.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.wprm-loader:after{left:2.5em}@-webkit-keyframes load7{0%,80%,to{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes load7{0%,80%,to{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}.wprm-recipe-details-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input#wprm-recipe-author-link,.wprm-recipe-details-form input#wprm-recipe-author-name{max-width:none}.wprm-recipe-details-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width:480px){.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:first-child,.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:first-child,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:first-child,.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:first-child,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:700;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}.wprm-settings select{min-width:200px}.wprm-settings .select2_wprm-container{z-index:99000}.wprm-settings #template_font_size{width:60px}.wprm-settings .template-preview-container .template-preview{float:left;text-align:center;width:250px;height:230px;overflow:hidden;margin:5px}.wprm-settings .template-preview-container .template-name{font-weight:700;line-height:30px}.wprm-settings .template-preview-container .template-screenshot{width:250px}.wprm-settings .template-preview-container .template-no-screenshot{width:250px;height:200px;line-height:200px;border:1px dashed #999;box-sizing:border-box}.wprm-addons p{max-width:650px}.wprm-addons ul{list-style-type:square}.wprm-addons .wprm-drip-form{margin:20px 0}.wprm-addons .wprm-drip-form input{width:100%;max-width:400px;margin:10px 0}.wprm-addons .wprm-drip-form input[type=submit]{max-width:250px;margin-bottom:0}.wprm-addons .wprm-drip-form .wprm-disclaimer{font-size:.8em}.comment-form-wprm-rating label{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.comment-form-wprm-rating .wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.comment-form-wprm-rating .wprm-rating-star.rated svg polygon{fill:#000}.wprm-faq p{max-width:650px}.wprm-faq ul{list-style-type:square}.wprm-faq .wprm-drip-form{margin:20px 0}.wprm-faq .wprm-drip-form input{width:100%;max-width:400px;margin:10px 0}.wprm-faq .wprm-drip-form input[type=submit]{max-width:350px;margin-bottom:0}.wprm-faq .wprm-drip-form .wprm-disclaimer{font-size:.8em}.wprm-badge{background:#fff url(assets/9db239b0b8817856fa53552be937ab40.png) no-repeat;background-position:center 20px;-webkit-background-size:128px 128px;background-size:128px 128px;color:#333;font-size:14px;text-align:center;font-weight:600;margin:5px 0 0;padding-top:155px;height:25px;display:inline-block;width:150px;text-rendering:optimizeLegibility;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.2);box-shadow:0 1px 3px rgba(0,0,0,.2)}.about-wrap .wprm-badge{position:absolute;top:0;right:0}@media only screen and (max-width:500px){.about-wrap .wprm-badge{position:relative;margin-bottom:1.5em;width:100%}}
|
dist/admin.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var WPRecipeMaker=WPRecipeMaker||{};WPRecipeMaker.admin=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=17)}([function(t,e){t.exports=window.jQuery},function(t,e,n){"use strict";(function(t){var i=n(2),o=n(25),r={changes_made:!1,container:!1,active_editor_id:!1,actions:{},recipe:i.a,init:function(t){this.container=t,Object(o.a)(this),this.recipe.init()},open:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(".wprm-menu-item").show(),t(".wprm-menu-hidden").hide(),this.active_editor_id=e,t(".wprm-modal-container").show();var i=t(".wprm-router").find(".wprm-menu-item");t(i).each(function(){var e=t(this).data("init");e&&"function"==typeof r.actions[e]&&r.actions[e](n)}),t(".wprm-menu").find(".wprm-menu-item").first().click(),this.changes_made=!1},close:function(){this.active_editor_id=!1,t(".wprm-menu").removeClass("visible"),t(".wprm-modal-container").hide()},disable_menu:function(){t(".wprm-frame-menu").find(".wprm-menu-item").hide(),t(".wprm-menu-hidden").show()}};e.a=r}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var i=n(3),o=n(19),r=n(7),a={id:0,type:"insert",fields:!1,ingredient:{},instructions:{},prep_time_set:!1,cook_time_set:!1,total_time_set:!1,init:function(){Object(o.a)(this)},clear:function(){if(i.remove_media_image(t(".wprm-recipe-image-container")),t("#wprm-recipe-name").val(""),r.a.clear(),t("#wprm-recipe-author-display").val("default").change(),t("#wprm-recipe-author-name").val(""),t("#wprm-recipe-author-link").val(""),t("#wprm-recipe-servings").val(""),t("#wprm-recipe-servings-unit").val(""),t("#wprm-recipe-calories").val(""),t("#wprm-recipe-prep-time").val(""),t("#wprm-recipe-cook-time").val(""),t("#wprm-recipe-total-time").val(""),this.prep_time_set=!1,this.cook_time_set=!1,this.total_time_set=!1,t(".wprm-recipe-tags").val(null).trigger("change"),t(".wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete, .wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete").each(function(){t(this).click()}),t(".wprm-recipe-ingredients-add").click(),t(".wprm-recipe-instructions-add").click(),"undefined"!=typeof tinyMCE&&tinyMCE.get("wprm_recipe_notes")&&!tinyMCE.get("wprm_recipe_notes").isHidden()){tinyMCE.get("wprm_recipe_notes").focus(!0),t(".wprm-easyrecipe-warning").hide();try{tinyMCE.activeEditor.setContent("")}catch(e){t(".wprm-easyrecipe-warning").show()}}else t("#wprm_recipe_notes").val("")},set:function(e){parseInt(e.image_id)>0&&i.set_media_image(t(".wprm-recipe-details-form .wprm-recipe-image-container"),e.image_id,e.image_url),t("#wprm-recipe-name").val(e.name),r.a.set(e.summary),t("#wprm-recipe-servings-unit").val(e.servings_unit),t("#wprm-recipe-author-display").val(e.author_display).change(),t("#wprm-recipe-author-name").val(e.author_name),t("#wprm-recipe-author-link").val(e.author_link);var n=parseInt(e.servings)>0?parseInt(e.servings):"",o=e.nutrition.calories?parseFloat(e.nutrition.calories):"",a=parseInt(e.prep_time)>0?parseInt(e.prep_time):"",s=parseInt(e.cook_time)>0?parseInt(e.cook_time):"",l=parseInt(e.total_time)>0?parseInt(e.total_time):"";t("#wprm-recipe-servings").val(n),t("#wprm-recipe-calories").val(o),t("#wprm-recipe-prep-time").val(a),t("#wprm-recipe-cook-time").val(s),t("#wprm-recipe-total-time").val(l),a&&(this.prep_time_set=!0),s&&(this.cook_time_set=!0),l&&(this.total_time_set=!0);for(var c in e.tags)e.tags.hasOwnProperty(c)&&this.setTags(e,c);this.setIngredients(e.ingredients),this.setInstructions(e.instructions),"undefined"!=typeof tinyMCE&&tinyMCE.get("wprm_recipe_notes")&&!tinyMCE.get("wprm_recipe_notes").isHidden()?(tinyMCE.get("wprm_recipe_notes").focus(!0),tinyMCE.activeEditor.setContent(e.notes)):t("#wprm_recipe_notes").val(e.notes)},setTags:function(e,n){for(var i=[],o=t("#wprm-recipe-tag-"+n),r=0,a=e.tags[n].length;r<a;r++){var s=e.tags[n][r];i.push(s.term_id),0===o.find("option[value="+s.term_id+"]").length&&o.append('<option value="'+s.term_id+'">'+s.name+"</option>")}o.val(i).trigger("change")},setIngredients:function(e){t(".wprm-recipe-ingredients .wprm-recipe-ingredients-instructions-delete").each(function(){t(this).click()});var n,i,o,r,s;for(n=0,i=e.length;n<i;n++)for(o=e[n],(n>0||""!==o.name)&&a.addIngredientGroup(o.name),r=0,s=o.ingredients.length;r<s;r++){var l=o.ingredients[r],c=a.addIngredient(l.amount,l.unit,l.name,l.notes);a.ingredients[c]=l}},setInstructions:function(e){t(".wprm-recipe-instructions .wprm-recipe-ingredients-instructions-delete").each(function(){t(this).click()});var n,i,o,r,s;for(n=0,i=e.length;n<i;n++)for(o=e[n],(n>0||""!==o.name)&&a.addInstructionGroup(o.name),r=0,s=o.instructions.length;r<s;r++){var l=o.instructions[r],c=a.addInstruction(l.text,l.image);a.instructions[c]=l}},get:function(){var e=t("#wprm-recipe-author-display").val();"default"==e&&(e=t("#wprm-recipe-author-display").find("option:first").data("default"));var n={image_id:t("#wprm-recipe-image-id").val(),name:t("#wprm-recipe-name").val(),summary:t("#wprm-recipe-summary").val(),author_display:e,author_name:t("#wprm-recipe-author-name").val(),author_link:t("#wprm-recipe-author-link").val(),servings:t("#wprm-recipe-servings").val(),servings_unit:t("#wprm-recipe-servings-unit").val(),prep_time:t("#wprm-recipe-prep-time").val(),cook_time:t("#wprm-recipe-cook-time").val(),total_time:t("#wprm-recipe-total-time").val(),nutrition:{calories:t("#wprm-recipe-calories").val()},tags:{course:t("#wprm-recipe-tag-course").val(),cuisine:t("#wprm-recipe-tag-cuisine").val()}};n.tags={},t(".wprm-recipe-tags").each(function(){n.tags[t(this).data("key")]=t(this).val()}),n.ingredients=this.getIngredients();var i=[],o={name:"",instructions:[]};return t(".wprm-recipe-instructions").find("tr").each(function(){var e=t(this);e.hasClass("wprm-recipe-instruction-group")?(i.push(o),o={name:e.find(".wprm-recipe-instruction-group-name").val(),instructions:[]}):o.instructions.push({text:e.find("textarea.wprm-recipe-instruction-text").val(),image:e.find(".wprm-recipe-instruction-image").val()})}),i.push(o),n.instructions=i,"undefined"!=typeof tinyMCE&&tinyMCE.get("wprm_recipe_notes")&&!tinyMCE.get("wprm_recipe_notes").isHidden()?n.notes=tinyMCE.get("wprm_recipe_notes").getContent():n.notes=t("#wprm_recipe_notes").val(),n},getIngredients:function(){var e=[],n={name:"",ingredients:[]};return t(".wprm-recipe-ingredients").find("tr").each(function(){var i=t(this);if(i.hasClass("wprm-recipe-ingredient-group"))e.push(n),n={name:i.find(".wprm-recipe-ingredient-group-name").val(),ingredients:[]};else{var o=i.data("uid"),r={};a.ingredients.hasOwnProperty(o)&&(r=a.ingredients[o]),r.amount=i.find(".wprm-recipe-ingredient-amount").val(),r.unit=i.find(".wprm-recipe-ingredient-unit").val(),r.name=i.find(".wprm-recipe-ingredient-name").val(),r.notes=i.find(".wprm-recipe-ingredient-notes").val();var s=t("#wprm-ingredient-conversion-"+o);if(s.length>0){var l=s.find(".wprmuc-system-2-amount").val(),c=s.find(".wprmuc-system-2-unit").val();r.converted={2:{amount:l,unit:c}}}n.ingredients.push(r)}}),e.push(n),e},addIngredient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=t(".wprm-recipe-ingredients-placeholder").find(".wprm-recipe-ingredient").clone();for(t(".wprm-recipe-ingredients").append(r),r.find(".wprm-recipe-ingredient-amount").val(e).focus(),r.find(".wprm-recipe-ingredient-unit").val(n),r.find(".wprm-recipe-ingredient-name").val(i),r.find(".wprm-recipe-ingredient-notes").val(o);;){var s=Math.floor(99999*Math.random());if(!a.ingredients.hasOwnProperty(s))return r.data("uid",s),a.ingredients[s]={},s}},addIngredientGroup:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t(".wprm-recipe-ingredients-placeholder").find(".wprm-recipe-ingredient-group").clone();t(".wprm-recipe-ingredients").append(n),n.find("input:first").val(e).focus()},addInstruction:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=t(".wprm-recipe-instructions-placeholder").find(".wprm-recipe-instruction").clone();if(o.find(".wprm-recipe-instruction-text").addClass("wprm-rich-editor"),t(".wprm-recipe-instructions").append(o),o.find(".wprm-recipe-instruction-text").val(e),r.a.init(),o.find(".wprm-recipe-instruction-text").focus(),parseInt(n)>0){var s=o.find(".wprm-recipe-image-container"),l=s.find(".wprm-recipe-image-add"),c={action:"wprm_get_thumbnail",security:wprm_temp_admin.nonce,image_id:n};i.start_loader(l),t.post(wprm_temp_admin.ajax_url,c,function(t){i.stop_loader(l),t.success&&i.set_media_image(s,n,t.data.image_url)},"json")}for(;;){var u=Math.floor(99999*Math.random());if(!a.instructions.hasOwnProperty(u))return o.data("uid",u),a.instructions[u]={},u}},addInstructionGroup:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t(".wprm-recipe-instructions-placeholder").find(".wprm-recipe-instruction-group").clone();t(".wprm-recipe-instructions").append(n),n.find("input:first").val(e).focus()}};e.a=a}).call(e,n(0))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){function i(t){return String(t).replace(/["]/g,function(t){return d[t]})}function o(e){if(e=" "+e+" ",u.a.active_editor_id)if("undefined"==typeof tinyMCE||!tinyMCE.get(u.a.active_editor_id)||tinyMCE.get(u.a.active_editor_id).isHidden()){var n=t("textarea#"+u.a.active_editor_id).val();t("textarea#"+u.a.active_editor_id).val(n+e)}else tinyMCE.get(u.a.active_editor_id).focus(!0),tinyMCE.activeEditor.selection.collapse(!1),tinyMCE.activeEditor.execCommand("mceInsertContent",!1,e)}function r(t){var e=wp.media({title:wprm_temp_admin.modal.text.media_title,button:{text:wprm_temp_admin.modal.text.media_button},multiple:!1});e.on("select",function(){var n=e.state().get("selection").first().toJSON();a(t,n.id,n.url)}),e.open()}function a(t,e,n){t.find(".wprm-recipe-image-preview").html(""),t.find(".wprm-recipe-image-preview").append('<img src="'+n+'" />'),t.find("input").val(e),t.find(".wprm-recipe-image-add").addClass("hidden"),t.find(".wprm-recipe-image-remove").removeClass("hidden"),u.a.changes_made=!0}function s(t){t.find(".wprm-recipe-image-preview").html(""),t.find("input").val(""),t.find(".wprm-recipe-image-add").removeClass("hidden"),t.find(".wprm-recipe-image-remove").addClass("hidden"),u.a.changes_made=!0}function l(t){t.prop("disabled",!0).css("width",t.outerWidth()).data("text",t.html()).html("...")}function c(t){t.prop("disabled",!1).css("width","").html(t.data("text"))}e.shortcode_escape=i,e.add_text_to_editor=o,e.select_media_image=r,e.set_media_image=a,e.remove_media_image=s,e.start_loader=l,e.stop_loader=c;var u=n(1),d={'"':"'","[":"{","]":"}"}}.call(e,n(0))},function(t,e,n){(function(t){(void 0!==window.wprm_public?wprm_public.settings.features_comment_ratings:wprm_temp_admin.settings.features_comment_ratings)&&t(document).ready(function(e){if(t(".wprm-recipe-container").length>0||t("body.wp-admin").length>0){t(".comment-form-wprm-rating").show();var n=t(".comment-form-wprm-rating").data("color");t(document).on("mouseenter",".comment-form-wprm-rating .wprm-rating-star",function(){t(this).prevAll().andSelf().each(function(){t(this).find("polygon").css("fill",n)}),t(this).nextAll().each(function(){t(this).find("polygon").css("fill","none")})}),t(document).on("mouseleave",".comment-form-wprm-rating .wprm-rating-star",function(){t(this).siblings().andSelf().each(function(){t(this).find("polygon").css("fill","")})}),t(document).on("click",".comment-form-wprm-rating .wprm-rating-star",function(){var e=t(this),n=e.data("rating"),i=e.parents(".comment-form-wprm-rating").find("#wprm-comment-rating");i.val()==n?(i.val(""),t(this).siblings("").andSelf().each(function(){t(this).removeClass("rated")})):(i.val(n),t(this).prevAll().andSelf().each(function(){t(this).addClass("rated")}),t(this).nextAll().each(function(){t(this).removeClass("rated")}))})}else t(".comment-form-wprm-rating").hide()})}).call(e,n(0))},function(t,e,n){(function(i){var o,r,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};/*! select2_wprm 4.0.3 | https://github.com/select2_wprm/select2_wprm/blob/master/LICENSE.md */
|
2 |
+
!function(i){r=[n(0)],o=i,void 0!==(a="function"==typeof o?o.apply(e,r):o)&&(t.exports=a)}(function(t){var e=function(){if(t&&t.fn&&t.fn.select2_wprm&&t.fn.select2_wprm.amd)var e=t.fn.select2_wprm.amd;var e;return function(){if(!e||!e.requirejs){e?n=e:e={};var t,n,i;!function(e){function o(t,e){return y.call(t,e)}function r(t,e){var n,i,o,r,a,s,l,c,u,d,h,p=e&&e.split("/"),f=b.map,m=f&&f["*"]||{};if(t&&"."===t.charAt(0))if(e){for(t=t.split("/"),a=t.length-1,b.nodeIdCompat&&x.test(t[a])&&(t[a]=t[a].replace(x,"")),t=p.slice(0,p.length-1).concat(t),u=0;u<t.length;u+=1)if("."===(h=t[u]))t.splice(u,1),u-=1;else if(".."===h){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((p||m)&&f){for(n=t.split("/"),u=n.length;u>0;u-=1){if(i=n.slice(0,u).join("/"),p)for(d=p.length;d>0;d-=1)if((o=f[p.slice(0,d).join("/")])&&(o=o[i])){r=o,s=u;break}if(r)break;!l&&m&&m[i]&&(l=m[i],c=u)}!r&&l&&(r=l,s=c),r&&(n.splice(0,s,r),t=n.join("/"))}return t}function a(t,n){return function(){var i=C.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),f.apply(e,i.concat([t,n]))}}function l(t){return function(e){return r(e,t)}}function c(t){return function(e){v[t]=e}}function u(t){if(o(_,t)){var n=_[t];delete _[t],w[t]=!0,p.apply(e,n)}if(!o(v,t)&&!o(w,t))throw new Error("No "+t);return v[t]}function d(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function h(t){return function(){return b&&b.config&&b.config[t]||{}}}var p,f,m,g,v={},_={},b={},w={},y=Object.prototype.hasOwnProperty,C=[].slice,x=/\.js$/;m=function(t,e){var n,i=d(t),o=i[0];return t=i[1],o&&(o=r(o,e),n=u(o)),o?t=n&&n.normalize?n.normalize(t,l(e)):r(t,e):(t=r(t,e),i=d(t),o=i[0],t=i[1],o&&(n=u(o))),{f:o?o+"!"+t:t,n:t,pr:o,p:n}},g={require:function(t){return a(t)},exports:function(t){var e=v[t];return void 0!==e?e:v[t]={}},module:function(t){return{id:t,uri:"",exports:v[t],config:h(t)}}},p=function(t,n,i,r){var l,d,h,p,f,b,y=[],C=void 0===i?"undefined":s(i);if(r=r||t,"undefined"===C||"function"===C){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if(p=m(n[f],r),"require"===(d=p.f))y[f]=g.require(t);else if("exports"===d)y[f]=g.exports(t),b=!0;else if("module"===d)l=y[f]=g.module(t);else if(o(v,d)||o(_,d)||o(w,d))y[f]=u(d);else{if(!p.p)throw new Error(t+" missing "+d);p.p.load(p.n,a(r,!0),c(d),{}),y[f]=v[d]}h=i?i.apply(v[t],y):void 0,t&&(l&&l.exports!==e&&l.exports!==v[t]?v[t]=l.exports:h===e&&b||(v[t]=h))}else t&&(v[t]=i)},t=n=f=function(t,n,i,o,r){if("string"==typeof t)return g[t]?g[t](n):u(m(t,n).f);if(!t.splice){if(b=t,b.deps&&f(b.deps,b.callback),!n)return;n.splice?(t=n,n=i,i=null):t=e}return n=n||function(){},"function"==typeof i&&(i=o,o=r),o?p(e,t,n,i):setTimeout(function(){p(e,t,n,i)},4),f},f.config=function(t){return f(t)},t._defined=v,i=function(t,e,n){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(n=e,e=[]),o(v,t)||o(_,t)||(_[t]=[t,e,n])},i.amd={jQuery:!0}}(),e.requirejs=t,e.require=n,e.define=i}}(),e.define("almond",function(){}),e.define("jquery",[],function(){var e=t||i;return null==e&&console&&console.error&&console.error("select2_wprm: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before select2_wprm on your web page."),e}),e.define("select2_wprm/utils",["jquery"],function(t){function e(t){var e=t.prototype,n=[];for(var i in e)"function"==typeof e[i]&&"constructor"!==i&&n.push(i);return n}var n={};n.Extend=function(t,e){function n(){this.constructor=t}var i={}.hasOwnProperty;for(var o in e)i.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},n.Decorate=function(t,n){function i(){var e=Array.prototype.unshift,i=n.prototype.constructor.length,o=t.prototype.constructor;i>0&&(e.call(arguments,t.prototype.constructor),o=n.prototype.constructor),o.apply(this,arguments)}function o(){this.constructor=i}var r=e(n),a=e(t);n.displayName=t.displayName,i.prototype=new o;for(var s=0;s<a.length;s++){var l=a[s];i.prototype[l]=t.prototype[l]}for(var c=0;c<r.length;c++){var u=r[c];i.prototype[u]=function(t){var e=function(){};t in i.prototype&&(e=i.prototype[t]);var o=n.prototype[t];return function(){return Array.prototype.unshift.call(arguments,e),o.apply(this,arguments)}}(u)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(t,e){this.listeners=this.listeners||{},t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e]},i.prototype.trigger=function(t){var e=Array.prototype.slice,n=e.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=t,t in this.listeners&&this.invoke(this.listeners[t],e.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(t,e){for(var n=0,i=t.length;i>n;n++)t[n].apply(this,e)},n.Observable=i,n.generateChars=function(t){for(var e="",n=0;t>n;n++)e+=Math.floor(36*Math.random()).toString(36);return e},n.bind=function(t,e){return function(){t.apply(e,arguments)}},n._convertData=function(t){for(var e in t){var n=e.split("-"),i=t;if(1!==n.length){for(var o=0;o<n.length;o++){var r=n[o];r=r.substring(0,1).toLowerCase()+r.substring(1),r in i||(i[r]={}),o==n.length-1&&(i[r]=t[e]),i=i[r]}delete t[e]}}return t},n.hasScroll=function(e,n){var i=t(n),o=n.style.overflowX,r=n.style.overflowY;return(o!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===o||"scroll"===r||i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth)},n.escapeMarkup=function(t){var e={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},n.appendMany=function(e,n){if("1.7"===t.fn.jquery.substr(0,3)){var i=t();t.map(n,function(t){i=i.add(t)}),n=i}e.append(n)},n}),e.define("select2_wprm/results",["jquery","./utils"],function(t,e){function n(t,e,i){this.$element=t,this.data=i,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<ul class="select2_wprm-results__options" role="tree"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e,e},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(e){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=t('<li role="treeitem" aria-live="assertive" class="select2_wprm-results__option"></li>'),o=this.options.get("translations").get(e.message);i.append(n(o(e.args))),i[0].className+=" select2_wprm-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2_wprm-results__message").remove()},n.prototype.append=function(t){this.hideLoading();var e=[];if(null==t.results||0===t.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));t.results=this.sort(t.results);for(var n=0;n<t.results.length;n++){var i=t.results[n],o=this.option(i);e.push(o)}this.$results.append(e)},n.prototype.position=function(t,e){e.find(".select2_wprm-results").append(t)},n.prototype.sort=function(t){return this.options.get("sorter")(t)},n.prototype.highlightFirstItem=function(){var t=this.$results.find(".select2_wprm-results__option[aria-selected]"),e=t.filter("[aria-selected=true]");e.length>0?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var e=this;this.data.current(function(n){var i=t.map(n,function(t){return t.id.toString()});e.$results.find(".select2_wprm-results__option[aria-selected]").each(function(){var e=t(this),n=t.data(this,"data"),o=""+n.id;null!=n.element&&n.element.selected||null==n.element&&t.inArray(o,i)>-1?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},n.prototype.showLoading=function(t){this.hideLoading();var e=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:e(t)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(e){var n=document.createElement("li");n.className="select2_wprm-results__option";var i={role:"treeitem","aria-selected":"false"};e.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==e.id&&delete i["aria-selected"],null!=e._resultId&&(n.id=e._resultId),e.title&&(n.title=e.title),e.children&&(i.role="group",i["aria-label"]=e.text,delete i["aria-selected"]);for(var o in i){var r=i[o];n.setAttribute(o,r)}if(e.children){var a=t(n),s=document.createElement("strong");s.className="select2_wprm-results__group",t(s),this.template(e,s);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var h=t("<ul></ul>",{class:"select2_wprm-results__options select2_wprm-results__options--nested"});h.append(l),a.append(s),a.append(h)}else this.template(e,n);return t.data(n,"data",e),n},n.prototype.bind=function(e,n){var i=this,o=e.id+"-results";this.$results.attr("id",o),e.on("results:all",function(t){i.clear(),i.append(t.data),e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("results:append",function(t){i.append(t.data),e.isOpen()&&i.setClasses()}),e.on("query",function(t){i.hideMessages(),i.showLoading(t)}),e.on("select",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("unselect",function(){e.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),e.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),e.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=i.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t=i.getHighlightedResults();if(0!==t.length){var e=t.data("data");"true"==t.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:e})}}),e.on("results:previous",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t);if(0!==n){var o=n-1;0===t.length&&(o=0);var r=e.eq(o);r.trigger("mouseenter");var a=i.$results.offset().top,s=r.offset().top,l=i.$results.scrollTop()+(s-a);0===o?i.$results.scrollTop(0):0>s-a&&i.$results.scrollTop(l)}}),e.on("results:next",function(){var t=i.getHighlightedResults(),e=i.$results.find("[aria-selected]"),n=e.index(t),o=n+1;if(!(o>=e.length)){var r=e.eq(o);r.trigger("mouseenter");var a=i.$results.offset().top+i.$results.outerHeight(!1),s=r.offset().top+r.outerHeight(!1),l=i.$results.scrollTop()+s-a;0===o?i.$results.scrollTop(0):s>a&&i.$results.scrollTop(l)}}),e.on("results:focus",function(t){t.element.addClass("select2_wprm-results__option--highlighted")}),e.on("results:message",function(t){i.displayMessage(t)}),t.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-e+t.deltaY,o=t.deltaY>0&&e-t.deltaY<=0,r=t.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):r&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2_wprm-results__option[aria-selected]",function(e){var n=t(this),o=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:e,data:o}):i.trigger("close",{})):void i.trigger("select",{originalEvent:e,data:o})}),this.$results.on("mouseenter",".select2_wprm-results__option[aria-selected]",function(e){var n=t(this).data("data");i.getHighlightedResults().removeClass("select2_wprm-results__option--highlighted"),i.trigger("results:focus",{data:n,element:t(this)})})},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2_wprm-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]"),n=e.index(t),i=this.$results.offset().top,o=t.offset().top,r=this.$results.scrollTop()+(o-i),a=o-i;r-=2*t.outerHeight(!1),2>=n?this.$results.scrollTop(0):(a>this.$results.outerHeight()||0>a)&&this.$results.scrollTop(r)}},n.prototype.template=function(e,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),r=i(e,n);null==r?n.style.display="none":"string"==typeof r?n.innerHTML=o(r):t(n).append(r)},n}),e.define("select2_wprm/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2_wprm/selection/base",["jquery","../utils","../keys"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('<span class="select2_wprm-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e,e},i.prototype.bind=function(t,e){var i=this,o=(t.id,t.id+"-results");this.container=t,this.$selection.on("focus",function(t){i.trigger("focus",t)}),this.$selection.on("blur",function(t){i._handleBlur(t)}),this.$selection.on("keydown",function(t){i.trigger("keypress",t),t.which===n.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){i.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){i.update(t.data)}),t.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(t)}),t.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(t)}),t.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),t.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(e){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||t.contains(n.$selection[0],document.activeElement)||n.trigger("blur",e)},1)},i.prototype._attachCloseHandler=function(e){t(document.body).on("mousedown.select2_wprm."+e.id,function(e){var n=t(e.target),i=n.closest(".select2_wprm");t(".select2_wprm.select2_wprm-container--open").each(function(){var e=t(this);this!=i[0]&&e.data("element").select2_wprm("close")})})},i.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2_wprm."+e.id)},i.prototype.position=function(t,e){e.find(".selection").append(t)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},i}),e.define("select2_wprm/selection/single",["jquery","./base","../utils","../keys"],function(t,e,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,e),o.prototype.render=function(){var t=o.__super__.render.call(this);return t.addClass("select2_wprm-selection--single"),t.html('<span class="select2_wprm-selection__rendered"></span><span class="select2_wprm-selection__arrow" role="presentation"><b role="presentation"></b></span>'),t},o.prototype.bind=function(t,e){var n=this;o.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2_wprm-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(t){1===t.which&&n.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(t){}),this.$selection.on("blur",function(t){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(t){n.update(t.data)})},o.prototype.clear=function(){this.$selection.find(".select2_wprm-selection__rendered").empty()},o.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},o.prototype.selectionContainer=function(){return t("<span></span>")},o.prototype.update=function(t){if(0===t.length)return void this.clear();var e=t[0],n=this.$selection.find(".select2_wprm-selection__rendered"),i=this.display(e,n);n.empty().append(i),n.prop("title",e.title||e.text)},o}),e.define("select2_wprm/selection/multiple",["jquery","./base","../utils"],function(t,e,n){function i(t,e){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,e),i.prototype.render=function(){var t=i.__super__.render.call(this);return t.addClass("select2_wprm-selection--multiple"),t.html('<ul class="select2_wprm-selection__rendered"></ul>'),t},i.prototype.bind=function(e,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){o.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2_wprm-selection__choice__remove",function(e){if(!o.options.get("disabled")){var n=t(this),i=n.parent(),r=i.data("data");o.trigger("unselect",{originalEvent:e,data:r})}})},i.prototype.clear=function(){this.$selection.find(".select2_wprm-selection__rendered").empty()},i.prototype.display=function(t,e){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(t,e))},i.prototype.selectionContainer=function(){return t('<li class="select2_wprm-selection__choice"><span class="select2_wprm-selection__choice__remove" role="presentation">×</span></li>')},i.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],i=0;i<t.length;i++){var o=t[i],r=this.selectionContainer(),a=this.display(o,r);r.append(a),r.prop("title",o.title||o.text),r.data("data",o),e.push(r)}var s=this.$selection.find(".select2_wprm-selection__rendered");n.appendMany(s,e)}},i}),e.define("select2_wprm/selection/placeholder",["../utils"],function(t){function e(t,e,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n)}return e.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},e.prototype.createPlaceholder=function(t,e){var n=this.selectionContainer();return n.html(this.display(e)),n.addClass("select2_wprm-selection__placeholder").removeClass("select2_wprm-selection__choice"),n},e.prototype.update=function(t,e){var n=1==e.length&&e[0].id!=this.placeholder.id;if(e.length>1||n)return t.call(this,e);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2_wprm-selection__rendered").append(i)},e}),e.define("select2_wprm/selection/allowClear",["jquery","../keys"],function(t,e){function n(){}return n.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("select2_wprm: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2_wprm-selection__clear",function(t){i._handleClear(t)}),e.on("keypress",function(t){i._handleKeyboardClear(t,e)})},n.prototype._handleClear=function(t,e){if(!this.options.get("disabled")){var n=this.$selection.find(".select2_wprm-selection__clear");if(0!==n.length){e.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var r={data:i[o]};if(this.trigger("unselect",r),r.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(t,n,i){i.isOpen()||(n.which==e.DELETE||n.which==e.BACKSPACE)&&this._handleClear(n)},n.prototype.update=function(e,n){if(e.call(this,n),!(this.$selection.find(".select2_wprm-selection__placeholder").length>0||0===n.length)){var i=t('<span class="select2_wprm-selection__clear">×</span>');i.data("data",n),this.$selection.find(".select2_wprm-selection__rendered").prepend(i)}},n}),e.define("select2_wprm/selection/search",["jquery","../utils","../keys"],function(t,e,n){function i(t,e,n){t.call(this,e,n)}return i.prototype.render=function(e){var n=t('<li class="select2_wprm-search select2_wprm-search--inline"><input class="select2_wprm-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=e.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(t,e,i){var o=this;t.call(this,e,i),e.on("open",function(){o.$search.trigger("focus")}),e.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),e.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),e.on("disable",function(){o.$search.prop("disabled",!0)}),e.on("focus",function(t){o.$search.trigger("focus")}),e.on("results:focus",function(t){o.$search.attr("aria-activedescendant",t.id)}),this.$selection.on("focusin",".select2_wprm-search--inline",function(t){o.trigger("focus",t)}),this.$selection.on("focusout",".select2_wprm-search--inline",function(t){o._handleBlur(t)}),this.$selection.on("keydown",".select2_wprm-search--inline",function(t){if(t.stopPropagation(),o.trigger("keypress",t),o._keyUpPrevented=t.isDefaultPrevented(),t.which===n.BACKSPACE&&""===o.$search.val()){var e=o.$searchContainer.prev(".select2_wprm-selection__choice");if(e.length>0){var i=e.data("data");o.searchRemoveChoice(i),t.preventDefault()}}});var r=document.documentMode,a=r&&11>=r;this.$selection.on("input.searchcheck",".select2_wprm-search--inline",function(t){return a?void o.$selection.off("input.search input.searchcheck"):void o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2_wprm-search--inline",function(t){if(a&&"input"===t.type)return void o.$selection.off("input.search input.searchcheck");var e=t.which;e!=n.SHIFT&&e!=n.CTRL&&e!=n.ALT&&e!=n.TAB&&o.handleSearch(t)})},i.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},i.prototype.update=function(t,e){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2_wprm-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";t=""!==this.$search.attr("placeholder")?this.$selection.find(".select2_wprm-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em",this.$search.css("width",t)},i}),e.define("select2_wprm/selection/eventRelay",["jquery"],function(t){function e(){}return e.prototype.bind=function(e,n,i){var o=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting"],a=["opening","closing","selecting","unselecting"];e.call(this,n,i),n.on("*",function(e,n){if(-1!==t.inArray(e,r)){n=n||{};var i=t.Event("select2_wprm:"+e,{params:n});o.$element.trigger(i),-1!==t.inArray(e,a)&&(n.prevented=i.isDefaultPrevented())}})},e}),e.define("select2_wprm/translation",["jquery","require"],function(t,e){function n(t){this.dict=t||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(t){return this.dict[t]},n.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},n._cache={},n.loadPath=function(t){if(!(t in n._cache)){var i=e(t);n._cache[t]=i}return new n(n._cache[t])},n}),e.define("select2_wprm/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2_wprm/data/base",["../utils"],function(t){function e(t,n){e.__super__.constructor.call(this)}return t.Extend(e,t.Observable),e.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},e.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},e.prototype.bind=function(t,e){},e.prototype.destroy=function(){},e.prototype.generateResultId=function(e,n){var i=e.id+"-result-";return i+=t.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+t.generateChars(4)},e}),e.define("select2_wprm/data/select",["./base","../utils","jquery"],function(t,e,n){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,t),i.prototype.current=function(t){var e=[],i=this;this.$element.find(":selected").each(function(){var t=n(this),o=i.item(t);e.push(o)}),t(e)},i.prototype.select=function(t){var e=this;if(t.selected=!0,n(t.element).is("option"))return t.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var o=[];t=[t],t.push.apply(t,i);for(var r=0;r<t.length;r++){var a=t[r].id;-1===n.inArray(a,o)&&o.push(a)}e.$element.val(o),e.$element.trigger("change")});else{var i=t.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(t){var e=this;if(this.$element.prop("multiple"))return t.selected=!1,n(t.element).is("option")?(t.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var o=[],r=0;r<i.length;r++){var a=i[r].id;a!==t.id&&-1===n.inArray(a,o)&&o.push(a)}e.$element.val(o),e.$element.trigger("change")})},i.prototype.bind=function(t,e){var n=this;this.container=t,t.on("select",function(t){n.select(t.data)}),t.on("unselect",function(t){n.unselect(t.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(t,e){var i=[],o=this;this.$element.children().each(function(){var e=n(this);if(e.is("option")||e.is("optgroup")){var r=o.item(e),a=o.matches(t,r);null!==a&&i.push(a)}}),e({results:i})},i.prototype.addOptions=function(t){e.appendMany(this.$element,t)},i.prototype.option=function(t){var e;t.children?(e=document.createElement("optgroup"),e.label=t.text):(e=document.createElement("option"),void 0!==e.textContent?e.textContent=t.text:e.innerText=t.text),t.id&&(e.value=t.id),t.disabled&&(e.disabled=!0),t.selected&&(e.selected=!0),t.title&&(e.title=t.title);var i=n(e),o=this._normalizeItem(t);return o.element=e,n.data(e,"data",o),i},i.prototype.item=function(t){var e={};if(null!=(e=n.data(t[0],"data")))return e;if(t.is("option"))e={id:t.val(),text:t.text(),disabled:t.prop("disabled"),selected:t.prop("selected"),title:t.prop("title")};else if(t.is("optgroup")){e={text:t.prop("label"),children:[],title:t.prop("title")};for(var i=t.children("option"),o=[],r=0;r<i.length;r++){var a=n(i[r]),s=this.item(a);o.push(s)}e.children=o}return e=this._normalizeItem(e),e.element=t[0],n.data(t[0],"data",e),e},i.prototype._normalizeItem=function(t){n.isPlainObject(t)||(t={id:t,text:t}),t=n.extend({},{text:""},t);var e={selected:!1,disabled:!1};return null!=t.id&&(t.id=t.id.toString()),null!=t.text&&(t.text=t.text.toString()),null==t._resultId&&t.id&&null!=this.container&&(t._resultId=this.generateResultId(this.container,t)),n.extend({},e,t)},i.prototype.matches=function(t,e){return this.options.get("matcher")(t,e)},i}),e.define("select2_wprm/data/array",["./select","../utils","jquery"],function(t,e,n){function i(t,e){var n=e.get("data")||[];i.__super__.constructor.call(this,t,e),this.addOptions(this.convertToOptions(n))}return e.Extend(i,t),i.prototype.select=function(t){var e=this.$element.find("option").filter(function(e,n){return n.value==t.id.toString()});0===e.length&&(e=this.option(t),this.addOptions(e)),i.__super__.select.call(this,t)},i.prototype.convertToOptions=function(t){for(var i=this,o=this.$element.find("option"),r=o.map(function(){return i.item(n(this)).id}).get(),a=[],s=0;s<t.length;s++){var l=this._normalizeItem(t[s]);if(n.inArray(l.id,r)>=0){var c=o.filter(function(t){return function(){return n(this).val()==t.id}}(l)),u=this.item(c),d=n.extend(!0,{},l,u),h=this.option(d);c.replaceWith(h)}else{var p=this.option(l);if(l.children){var f=this.convertToOptions(l.children);e.appendMany(p,f)}a.push(p)}}return a},i}),e.define("select2_wprm/data/ajax",["./array","../utils","jquery"],function(t,e,n){function i(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,t,e)}return e.Extend(i,t),i.prototype._applyDefaults=function(t){var e={data:function(t){return n.extend({},t,{q:t.term})},transport:function(t,e,i){var o=n.ajax(t);return o.then(e),o.fail(i),o}};return n.extend({},e,t,!0)},i.prototype.processResults=function(t){return t},i.prototype.query=function(t,e){function i(){var i=r.transport(r,function(i){var r=o.processResults(i,t);o.options.get("debug")&&window.console&&console.error&&(r&&r.results&&n.isArray(r.results)||console.error("select2_wprm: The AJAX results did not return an array in the `results` key of the response.")),e(r)},function(){i.status&&"0"===i.status||o.trigger("results:message",{message:"errorLoading"})});o._request=i}var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var r=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof r.url&&(r.url=r.url.call(this.$element,t)),"function"==typeof r.data&&(r.data=r.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),e.define("select2_wprm/data/tags",["jquery"],function(t){function e(e,n,i){var o=i.get("tags"),r=i.get("createTag");void 0!==r&&(this.createTag=r);var a=i.get("insertTag");if(void 0!==a&&(this.insertTag=a),e.call(this,n,i),t.isArray(o))for(var s=0;s<o.length;s++){var l=o[s],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return e.prototype.query=function(t,e,n){function i(t,r){for(var a=t.results,s=0;s<a.length;s++){var l=a[s],c=null!=l.children&&!i({results:l.children},!0);if(l.text===e.term||c)return!r&&(t.data=a,void n(t))}if(r)return!0;var u=o.createTag(e);if(null!=u){var d=o.option(u);d.attr("data-select2_wprm-tag",!0),o.addOptions([d]),o.insertTag(a,u)}t.results=a,n(t)}var o=this;return this._removeOldTags(),null==e.term||null!=e.page?void t.call(this,e,n):void t.call(this,e,i)},e.prototype.createTag=function(e,n){var i=t.trim(n.term);return""===i?null:{id:i,text:i}},e.prototype.insertTag=function(t,e,n){e.unshift(n)},e.prototype._removeOldTags=function(e){(this._lastTag,this.$element.find("option[data-select2_wprm-tag]")).each(function(){this.selected||t(this).remove()})},e}),e.define("select2_wprm/data/tokenizer",["jquery"],function(t){function e(t,e,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),t.call(this,e,n)}return e.prototype.bind=function(t,e,n){t.call(this,e,n),this.$search=e.dropdown.$search||e.selection.$search||n.find(".select2_wprm-search__field")},e.prototype.query=function(e,n,i){function o(e){var n=a._normalizeItem(e);if(!a.$element.find("option").filter(function(){return t(this).val()===n.id}).length){var i=a.option(n);i.attr("data-select2_wprm-tag",!0),a._removeOldTags(),a.addOptions([i])}r(n)}function r(t){a.trigger("select",{data:t})}var a=this;n.term=n.term||"";var s=this.tokenizer(n,this.options,o);s.term!==n.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),n.term=s.term),e.call(this,n,i)},e.prototype.tokenizer=function(e,n,i,o){for(var r=i.get("tokenSeparators")||[],a=n.term,s=0,l=this.createTag||function(t){return{id:t.term,text:t.term}};s<a.length;){var c=a[s];if(-1!==t.inArray(c,r)){var u=a.substr(0,s),d=t.extend({},n,{term:u}),h=l(d);null!=h?(o(h),a=a.substr(s+1)||"",s=0):s++}else s++}return{term:a}},e}),e.define("select2_wprm/data/minimumInputLength",[],function(){function t(t,e,n){this.minimumInputLength=n.get("minimumInputLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){return e.term=e.term||"",e.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:e.term,params:e}}):void t.call(this,e,n)},t}),e.define("select2_wprm/data/maximumInputLength",[],function(){function t(t,e,n){this.maximumInputLength=n.get("maximumInputLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){return e.term=e.term||"",this.maximumInputLength>0&&e.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):void t.call(this,e,n)},t}),e.define("select2_wprm/data/maximumSelectionLength",[],function(){function t(t,e,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),t.call(this,e,n)}return t.prototype.query=function(t,e,n){var i=this;this.current(function(o){var r=null!=o?o.length:0;return i.maximumSelectionLength>0&&r>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void t.call(i,e,n)})},t}),e.define("select2_wprm/dropdown",["jquery","./utils"],function(t,e){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2_wprm-dropdown"><span class="select2_wprm-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e,e},n.prototype.bind=function(){},n.prototype.position=function(t,e){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2_wprm/dropdown/search",["jquery","../utils"],function(t,e){function n(){}return n.prototype.render=function(e){var n=e.call(this),i=t('<span class="select2_wprm-search select2_wprm-search--dropdown"><input class="select2_wprm-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(e,n,i){var o=this;e.call(this,n,i),this.$search.on("keydown",function(t){o.trigger("keypress",t),o._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(e){t(this).off("keyup")}),this.$search.on("keyup input",function(t){o.handleSearch(t)}),n.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),n.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),n.on("focus",function(){n.isOpen()&&o.$search.focus()}),n.on("results:all",function(t){null!=t.query.term&&""!==t.query.term||(o.showSearch(t)?o.$searchContainer.removeClass("select2_wprm-search--hide"):o.$searchContainer.addClass("select2_wprm-search--hide"))})},n.prototype.handleSearch=function(t){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},n.prototype.showSearch=function(t,e){return!0},n}),e.define("select2_wprm/dropdown/hidePlaceholder",[],function(){function t(t,e,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),t.call(this,e,n,i)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var n=e.slice(0),i=e.length-1;i>=0;i--){var o=e[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},t}),e.define("select2_wprm/dropdown/infiniteScroll",["jquery"],function(t){function e(t,e,n,i){this.lastParams={},t.call(this,e,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,n,i){var o=this;e.call(this,n,i),n.on("query",function(t){o.lastParams=t,o.loading=!0}),n.on("query:append",function(t){o.lastParams=t,o.loading=!0}),this.$results.on("scroll",function(){var e=t.contains(document.documentElement,o.$loadingMore[0]);!o.loading&&e&&o.$results.offset().top+o.$results.outerHeight(!1)+50>=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1)&&o.loadMore()})},e.prototype.loadMore=function(){this.loading=!0;var e=t.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},e.prototype.createLoadingMore=function(){var e=t('<li class="select2_wprm-results__option select2_wprm-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return e.html(n(this.lastParams)),e},e}),e.define("select2_wprm/dropdown/attachBody",["jquery","../utils"],function(t,e){function n(e,n,i){this.$dropdownParent=i.get("dropdownParent")||t(document.body),e.call(this,n,i)}return n.prototype.bind=function(t,e,n){var i=this,o=!1;t.call(this,e,n),e.on("open",function(){i._showDropdown(),i._attachPositioningHandler(e),o||(o=!0,e.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),e.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),e.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},n.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(t,e,n){e.attr("class",n.attr("class")),e.removeClass("select2_wprm"),e.addClass("select2_wprm-container--open"),e.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(e){var n=t("<span></span>"),i=e.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var o=this,r="scroll.select2_wprm."+i.id,a="resize.select2_wprm."+i.id,s="orientationchange.select2_wprm."+i.id,l=this.$container.parents().filter(e.hasScroll);l.each(function(){t(this).data("select2_wprm-scroll-position",{x:t(this).scrollLeft(),y:t(this).scrollTop()})}),l.on(r,function(e){var n=t(this).data("select2_wprm-scroll-position");t(this).scrollTop(n.y)}),t(window).on(r+" "+a+" "+s,function(t){o._positionDropdown(),o._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.select2_wprm."+i.id,r="resize.select2_wprm."+i.id,a="orientationchange.select2_wprm."+i.id;this.$container.parents().filter(e.hasScroll).off(o),t(window).off(o+" "+r+" "+a)},n.prototype._positionDropdown=function(){var e=t(window),n=this.$dropdown.hasClass("select2_wprm-dropdown--above"),i=this.$dropdown.hasClass("select2_wprm-dropdown--below"),o=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var a={height:this.$container.outerHeight(!1)};a.top=r.top,a.bottom=r.top+a.height;var s={height:this.$dropdown.outerHeight(!1)},l={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},c=l.top<r.top-s.height,u=l.bottom>r.bottom+s.height,d={left:r.left,top:a.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var p=h.offset();d.top-=p.top,d.left-=p.left,n||i||(o="below"),u||!c||n?!c&&u&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(d.top=a.top-p.top-s.height),null!=o&&(this.$dropdown.removeClass("select2_wprm-dropdown--below select2_wprm-dropdown--above").addClass("select2_wprm-dropdown--"+o),this.$container.removeClass("select2_wprm-container--below select2_wprm-container--above").addClass("select2_wprm-container--"+o)),this.$dropdownContainer.css(d)},n.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},n.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),e.define("select2_wprm/dropdown/minimumResultsForSearch",[],function(){function t(e){for(var n=0,i=0;i<e.length;i++){var o=e[i];o.children?n+=t(o.children):n++}return n}function e(t,e,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),t.call(this,e,n,i)}return e.prototype.showSearch=function(e,n){return!(t(n.data.results)<this.minimumResultsForSearch)&&e.call(this,n)},e}),e.define("select2_wprm/dropdown/selectOnClose",[],function(){function t(){}return t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("close",function(t){i._handleSelectOnClose(t)})},t.prototype._handleSelectOnClose=function(t,e){if(e&&null!=e.originalselect2_wprmEvent){var n=e.originalselect2_wprmEvent;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var o=i.data("data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},t}),e.define("select2_wprm/dropdown/closeOnSelect",[],function(){function t(){}return t.prototype.bind=function(t,e,n){var i=this;t.call(this,e,n),e.on("select",function(t){i._selectTriggered(t)}),e.on("unselect",function(t){i._selectTriggered(t)})},t.prototype._selectTriggered=function(t,e){var n=e.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalselect2_wprmEvent:e})},t}),e.define("select2_wprm/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var e=t.input.length-t.maximum,n="Please delete "+e+" character";return 1!=e&&(n+="s"),n},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var e="You can only select "+t.maximum+" item";return 1!=t.maximum&&(e+="s"),e},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),e.define("select2_wprm/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(t,e,n,i,o,r,a,s,l,c,u,d,h,p,f,m,g,v,_,b,w,y,C,x,S,T,E,D,A){function k(){this.reset()}return k.prototype.apply=function(d){if(d=t.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=p:d.dataAdapter=h,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,_)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,b)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,m)),(null!=d.tokenSeparators||null!=d.tokenizer)&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null!=d.query){var A=e(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,A)}if(null!=d.initSelection){var k=e(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,k)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,C)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,E))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=w;else{var N=c.Decorate(w,y);d.dropdownAdapter=N}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,T)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,D)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var R=e(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,R)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,S)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=o:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,r)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var O=e(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,O)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var I=d.language.split("-"),L=I[0];d.language=[d.language,L]}else d.language=[d.language];if(t.isArray(d.language)){var P=new u;d.language.push("en");for(var M=d.language,$=0;$<M.length;$++){var F=M[$],H={};try{H=u.loadPath(F)}catch(t){try{F=this.defaults.amdLanguageBase+F,H=u.loadPath(F)}catch(t){d.debug&&window.console&&console.warn&&console.warn('select2_wprm: The language file for "'+F+'" could not be automatically loaded. A fallback will be used instead.');continue}}P.extend(H)}d.translations=P}else{var B=u.loadPath(this.defaults.amdLanguageBase+"en"),j=new u(d.language);j.extend(B),d.translations=j}return d},k.prototype.reset=function(){function e(t){function e(t){return d[t]||t}return t.replace(/[^\u0000-\u007E]/g,e)}function n(i,o){if(""===t.trim(i.term))return o;if(o.children&&o.children.length>0){for(var r=t.extend(!0,{},o),a=o.children.length-1;a>=0;a--)null==n(i,o.children[a])&&r.children.splice(a,1);return r.children.length>0?r:n(i,r)}var s=e(o.text).toUpperCase(),l=e(i.term).toUpperCase();return s.indexOf(l)>-1?o:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:A,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},k.prototype.set=function(e,n){var i=t.camelCase(e),o={};o[i]=n;var r=c._convertData(o);t.extend(this.defaults,r)},new k}),e.define("select2_wprm/options",["require","jquery","./defaults","./utils"],function(t,e,n,i){function o(e,o){if(this.options=e,null!=o&&this.fromElement(o),this.options=n.apply(this.options),o&&o.is("input")){var r=t(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,r)}}return o.prototype.fromElement=function(t){var n=["select2_wprm"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.language&&(t.prop("lang")?this.options.language=t.prop("lang").toLowerCase():t.closest("[lang]").prop("lang")&&(this.options.language=t.closest("[lang]").prop("lang"))),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),t.data("select2_wprmTags")&&(this.options.debug&&window.console&&console.warn&&console.warn('select2_wprm: The `data-select2_wprm-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of select2_wprm.'),t.data("data",t.data("select2_wprmTags")),t.data("tags",!0)),t.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("select2_wprm: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of select2_wprm."),t.attr("ajax--url",t.data("ajaxUrl")),t.data("ajax--url",t.data("ajaxUrl")));var o={};o=e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset?e.extend(!0,{},t[0].dataset,t.data()):t.data();var r=e.extend(!0,{},o);r=i._convertData(r);for(var a in r)e.inArray(a,n)>-1||(e.isPlainObject(this.options[a])?e.extend(this.options[a],r[a]):this.options[a]=r[a]);return this},o.prototype.get=function(t){return this.options[t]},o.prototype.set=function(t,e){this.options[t]=e},o}),e.define("select2_wprm/core",["jquery","./options","./utils","./keys"],function(t,e,n,i){var o=function t(n,i){null!=n.data("select2_wprm")&&n.data("select2_wprm").destroy(),this.$element=n,this.id=this._generateId(n),i=i||{},this.options=new e(i,n),t.__super__.constructor.call(this);var o=n.attr("tabindex")||0;n.data("old-tabindex",o),n.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(n,this.options);var a=this.render();this._placeContainer(a);var s=this.options.get("selectionAdapter");this.selection=new s(n,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var l=this.options.get("dropdownAdapter");this.dropdown=new l(n,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var c=this.options.get("resultsAdapter");this.results=new c(n,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){u.trigger("selection:update",{data:t})}),n.addClass("select2_wprm-hidden-accessible"),n.attr("aria-hidden","true"),this._syncAttributes(),n.data("select2_wprm",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(t){var e="";return e=null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+n.generateChars(2):n.generateChars(4),e=e.replace(/(:|\.|\[|\]|,)/g,""),e="select2_wprm-"+e},o.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},o.prototype._resolveWidth=function(t,e){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var i=this._resolveWidth(t,"style");return null!=i?i:this._resolveWidth(t,"element")}if("element"==e){var o=t.outerWidth(!1);return 0>=o?"auto":o+"px"}if("style"==e){var r=t.attr("style");if("string"!=typeof r)return null;for(var a=r.split(";"),s=0,l=a.length;l>s;s+=1){var c=a[s].replace(/\s/g,""),u=c.match(n);if(null!==u&&u.length>=1)return u[1]}return null}return e},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2_wprm",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2_wprm",function(t){e.trigger("focus",t)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){t.each(n,e._syncA),t.each(n,e._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},o.prototype._registerDataEvents=function(){var t=this;this.dataAdapter.on("*",function(e,n){t.trigger(e,n)})},o.prototype._registerSelectionEvents=function(){var e=this,n=["toggle","focus"];this.selection.on("toggle",function(){e.toggleDropdown()}),this.selection.on("focus",function(t){e.focus(t)}),this.selection.on("*",function(i,o){-1===t.inArray(i,n)&&e.trigger(i,o)})},o.prototype._registerDropdownEvents=function(){var t=this;this.dropdown.on("*",function(e,n){t.trigger(e,n)})},o.prototype._registerResultsEvents=function(){var t=this;this.results.on("*",function(e,n){t.trigger(e,n)})},o.prototype._registerEvents=function(){var t=this;this.on("open",function(){t.$container.addClass("select2_wprm-container--open")}),this.on("close",function(){t.$container.removeClass("select2_wprm-container--open")}),this.on("enable",function(){t.$container.removeClass("select2_wprm-container--disabled")}),this.on("disable",function(){t.$container.addClass("select2_wprm-container--disabled")}),this.on("blur",function(){t.$container.removeClass("select2_wprm-container--focus")}),this.on("query",function(e){t.isOpen()||t.trigger("open",{}),this.dataAdapter.query(e,function(n){t.trigger("results:all",{data:n,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(n){t.trigger("results:append",{data:n,query:e})})}),this.on("keypress",function(e){var n=e.which;t.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&e.altKey?(t.close(),e.preventDefault()):n===i.ENTER?(t.trigger("results:select",{}),e.preventDefault()):n===i.SPACE&&e.ctrlKey?(t.trigger("results:toggle",{}),e.preventDefault()):n===i.UP?(t.trigger("results:previous",{}),e.preventDefault()):n===i.DOWN&&(t.trigger("results:next",{}),e.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&e.altKey)&&(t.open(),e.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._syncSubtree=function(t,e){var n=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&e.addedNodes.length>0)for(var o=0;o<e.addedNodes.length;o++){var r=e.addedNodes[o];r.selected&&(n=!0)}else e.removedNodes&&e.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(t){i.trigger("selection:update",{data:t})})}},o.prototype.trigger=function(t,e){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===e&&(e={}),t in i){var r=i[t],a={prevented:!1,name:t,args:e};if(n.call(this,r,a),a.prevented)return void(e.prevented=!0)}n.call(this,t,e)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.trigger("query",{})},o.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},o.prototype.isOpen=function(){return this.$container.hasClass("select2_wprm-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("select2_wprm-container--focus")},o.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2_wprm-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('select2_wprm: The `select2_wprm("enable")` method has been deprecated and will be removed in later select2_wprm versions. Use $element.prop("disabled") instead.'),(null==t||0===t.length)&&(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('select2_wprm: Data can no longer be set using `select2_wprm("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},o.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('select2_wprm: The `select2_wprm("val")` method has been deprecated and will be removed in later select2_wprm versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var n=e[0];t.isArray(n)&&(n=t.map(n,function(t){return t.toString()})),this.$element.val(n).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2_wprm"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2_wprm-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2_wprm"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var e=t('<span class="select2_wprm select2_wprm-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2_wprm-container--"+this.options.get("theme")),e.data("element",this.$element),e},o}),e.define("jquery-mousewheel",["jquery"],function(t){return t}),e.define("jquery.select2_wprm",["jquery","jquery-mousewheel","./select2_wprm/core","./select2_wprm/defaults"],function(t,e,n,i){if(null==t.fn.select2_wprm){var o=["open","close","destroy"];t.fn.select2_wprm=function(e){if(e=e||{},"object"==(void 0===e?"undefined":s(e)))return this.each(function(){var i=t.extend(!0,{},e);new n(t(this),i)}),this;if("string"==typeof e){var i,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t(this).data("select2_wprm");null==n&&window.console&&console.error&&console.error("The select2_wprm('"+e+"') method was called on an element that is not using select2_wprm."),i=n[e].apply(n,r)}),t.inArray(e,o)>-1?this:i}throw new Error("Invalid arguments for select2_wprm: "+e)}}return null==t.fn.select2_wprm.defaults&&(t.fn.select2_wprm.defaults=i),n}),{define:e.define,require:e.require}}(),n=e.require("jquery.select2_wprm");return t.fn.select2_wprm.amd=e,n})}).call(e,n(0))},function(t,e){},function(t,e,n){"use strict";var i=n(20),o=n.n(i),r=n(8),a=n.n(r),s=n(22),l=(n.n(s),n(23)),c=(n.n(l),n(24)),u=n(1),d={editor:!1,clear:function(){this.editor.resetContent()},set:function(t){this.editor.setContent(t)},init:function(){if(this.editor)this.editor.addElements(".wprm-rich-editor");else{o.a.init(),Object(c.b)();var t={placeholder:{text:wprm_temp_admin.modal.text.medium_editor_placeholder,hideOnClick:!0},autoLink:!0,anchorPreview:{showWhenToolbarIsVisible:!1},imageDragging:!1,toolbar:{buttons:["bold","italic","underline","subscript","superscript"]},extensions:{}};t.toolbar.buttons.push("links"),t.extensions.links=new this.extensions.links,wprm_temp_admin.addons.premium&&(t.toolbar.buttons.push("adjustable_servings"),t.toolbar.buttons.push("timer"),t.extensions.adjustable_servings=new this.extensions.adjustable_servings,t.extensions.timer=new this.extensions.timer),this.editor=new a.a(".wprm-rich-editor",t),this.editor.subscribe("editableInput",function(){u.a.changes_made=!0})}},extensions:{adjustable_servings:a.a.Extension.extend({name:"adjustable_servings",init:function(){this.button=this.document.createElement("button"),this.button.classList.add("medium-editor-action"),this.button.innerHTML="<b>Adjustable</b>",this.button.title="Adjustable Quantity",this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},handleClick:function(t){var e=o.a.getSelection(),n=e.getRangeAt(0),i=n.cloneRange(),r=n.cloneRange(),a=n.getDocument().createTextNode("[adjustable]"),s=n.getDocument().createTextNode("[/adjustable]");r.collapse(!1),r.insertNode(s),r.detach(),n.setEndAfter(s),n.insertNode(a),o.a.getSelection().setSingleRange(i)}}),timer:a.a.Extension.extend({name:"timer",init:function(){this.button=this.document.createElement("button"),this.button.classList.add("medium-editor-action"),this.button.innerHTML="<b>Timer</b>",this.button.title="Timer",this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},handleClick:function(t){var e=o.a.getSelection(),n=e.getRangeAt(0),i=n.cloneRange(),r=n.cloneRange(),a=n.getDocument().createTextNode("[timer minutes=0]"),s=n.getDocument().createTextNode("[/timer]");r.collapse(!1),r.insertNode(s),r.detach(),n.setEndAfter(s),n.insertNode(a),o.a.getSelection().setSingleRange(i)}}),links:c.a}};e.a=d},function(t,e,n){(function(i){var o;/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
3 |
+
"classList"in document.createElement("_")||function(t){"use strict";if("Element"in t){var e=t.Element.prototype,n=Object,i=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},r=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},a=function(t,e){if(""===e)throw new r("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new r("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},s=function(t){for(var e=i.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},l=s.prototype=[],c=function(){return new s(this)};if(r.prototype=Error.prototype,l.item=function(t){return this[t]||null},l.contains=function(t){return t+="",-1!==a(this,t)},l.add=function(){var t,e=arguments,n=0,i=e.length,o=!1;do{t=e[n]+"",-1===a(this,t)&&(this.push(t),o=!0)}while(++n<i);o&&this._updateClassName()},l.remove=function(){var t,e,n=arguments,i=0,o=n.length,r=!1;do{for(t=n[i]+"",e=a(this,t);-1!==e;)this.splice(e,1),r=!0,e=a(this,t)}while(++i<o);r&&this._updateClassName()},l.toggle=function(t,e){t+="";var n=this.contains(t),i=n?!0!==e&&"remove":!1!==e&&"add";return i&&this[i](t),!0===e||!1===e?e:!n},l.toString=function(){return this.join(" ")},n.defineProperty){var u={get:c,enumerable:!0,configurable:!0};try{n.defineProperty(e,"classList",u)}catch(t){-2146823252===t.number&&(u.enumerable=!1,n.defineProperty(e,"classList",u))}}else n.prototype.__defineGetter__&&e.__defineGetter__("classList",c)}}(self),/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
4 |
+
function(t){"use strict";if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},i=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},o=n.prototype,r=i.prototype,a=t.FileReaderSync,s=function(t){this.code=this[this.name=t]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=l.length,u=t.URL||t.webkitURL||t,d=u.createObjectURL,h=u.revokeObjectURL,p=u,f=t.btoa,m=t.atob,g=t.ArrayBuffer,v=t.Uint8Array,_=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(i.fake=r.fake=!0;c--;)s.prototype[l[c]]=c+1;return u.createObjectURL||(p=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(_),n.origin=e&&e[1])),n}),p.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof i?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):f?e+";base64,"+f(t.data):e+","+encodeURIComponent(t.data)):d?d.call(u,t):void 0},p.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&h&&h.call(u,t)},o.append=function(t){var n=this.data;if(v&&(t instanceof g||t instanceof v)){for(var o="",r=new v(t),l=0,c=r.length;l<c;l++)o+=String.fromCharCode(r[l]);n.push(o)}else if("Blob"===e(t)||"File"===e(t)){if(!a)throw new s("NOT_READABLE_ERR");var u=new a;n.push(u.readAsBinaryString(t))}else t instanceof i?"base64"===t.encoding&&m?n.push(m(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},o.getBlob=function(t){return arguments.length||(t=null),new i(this.data.join(""),t,"raw")},o.toString=function(){return"[object BlobBuilder]"},r.slice=function(t,e,n){var o=arguments.length;return o<3&&(n=null),new i(this.data.slice(t,o>1?e:this.data.length),n,this.encoding)},r.toString=function(){return"[object Blob]"},r.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var i=n?n.type||"":"",o=new e;if(t)for(var r=0,a=t.length;r<a;r++)Uint8Array&&t[r]instanceof Uint8Array?o.append(t[r].buffer):o.append(t[r]);var s=o.getBlob(i);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=n(new t.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this),function(r,a){"use strict";"object"==typeof t&&void 0!==i&&i&&i.versions&&i.versions.electron||"object"!=typeof t?void 0!==(o=function(){return a}.call(e,n,e,t))&&(t.exports=o):t.exports=a}(0,function(){"use strict";function t(t,e){return this.init(t,e)}return t.extensions={},function(e){function n(t,e){var n,i=Array.prototype.slice.call(arguments,2);e=e||{};for(var o=0;o<i.length;o++){var r=i[o];if(r)for(n in r)r.hasOwnProperty(n)&&void 0!==r[n]&&(t||!1===e.hasOwnProperty(n))&&(e[n]=r[n])}return e}var i=!1;try{var o=document.createElement("div"),r=document.createTextNode(" ");o.appendChild(r),i=o.contains(r)}catch(t){}var a={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:e.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(t){return!!(a.isMac&&t.metaKey||!a.isMac&&t.ctrlKey)},isKey:function(t,e){var n=a.getKeyCode(t);return!1===Array.isArray(e)?n===e:-1!==e.indexOf(n)},getKeyCode:function(t){var e=t.which;return null===e&&(e=null!==t.charCode?t.charCode:t.keyCode),e},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var t=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},defaults:function(){var t=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},createLink:function(t,e,n,i){var o=t.createElement("a");return a.moveTextRangeIntoElement(e[0],e[e.length-1],o),o.setAttribute("href",n),i&&("_blank"===i&&o.setAttribute("rel","noopener noreferrer"),o.setAttribute("target",i)),o},findOrCreateMatchingTextNodes:function(t,e,n){for(var i=t.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),o=[],r=0,s=!1,l=null,c=null;null!==(l=i.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!s&&n.start<r+l.nodeValue.length&&(s=!0,c=a.splitStartNodeIfNeeded(l,n.start,r)),s&&a.splitEndNodeIfNeeded(l,c,n.end,r),s&&r===n.end)break;if(s&&r>n.end+1)throw new Error("PerformLinking overshot the target!");s&&o.push(c||l),r+=l.nodeValue.length,null!==c&&(r+=c.nodeValue.length,i.nextNode()),c=null}else"img"===l.tagName.toLowerCase()&&(!s&&n.start<=r&&(s=!0),s&&o.push(l));return o},splitStartNodeIfNeeded:function(t,e,n){return e!==n?t.splitText(e-n):null},splitEndNodeIfNeeded:function(t,e,n,i){var o,r;o=i+t.nodeValue.length+(e?e.nodeValue.length:0)-1,r=n-i-(e?t.nodeValue.length:0),o>=n&&i!==o&&0!==r&&(e||t).splitText(r)},splitByBlockElements:function(e){if(3!==e.nodeType&&1!==e.nodeType)return[];var n=[],i=t.util.blockContainerElementNames.join(",");if(3===e.nodeType||0===e.querySelectorAll(i).length)return[e];for(var o=0;o<e.childNodes.length;o++){var r=e.childNodes[o];if(3===r.nodeType)n.push(r);else if(1===r.nodeType){var a=r.querySelectorAll(i);0===a.length?n.push(r):n=n.concat(t.util.splitByBlockElements(r))}}return n},findAdjacentTextNodeWithContent:function(t,e,n){var i,o=!1,r=n.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);for(i=r.nextNode();i;){if(i===e)o=!0;else if(o&&3===i.nodeType&&i.nodeValue&&i.nodeValue.trim().length>0)break;i=r.nextNode()}return i},findPreviousSibling:function(t){if(!t||a.isMediumEditorElement(t))return!1;for(var e=t.previousSibling;!e&&!a.isMediumEditorElement(t.parentNode);)t=t.parentNode,e=t.previousSibling;return e},isDescendant:function(t,e,n){if(!t||!e)return!1;if(t===e)return!!n;if(1!==t.nodeType)return!1;if(i||3!==e.nodeType)return t.contains(e);for(var o=e.parentNode;null!==o;){if(o===t)return!0;o=o.parentNode}return!1},isElement:function(t){return!(!t||1!==t.nodeType)},throttle:function(t,e){var n,i,o,r=null,a=0,s=function(){a=Date.now(),r=null,o=t.apply(n,i),r||(n=i=null)};return e||0===e||(e=50),function(){var l=Date.now(),c=e-(l-a);return n=this,i=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),a=l,o=t.apply(n,i),r||(n=i=null)):r||(r=setTimeout(s,c)),o}},traverseUp:function(t,e){if(!t)return!1;do{if(1===t.nodeType){if(e(t))return t;if(a.isMediumEditorElement(t))return!1}t=t.parentNode}while(t);return!1},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(e,n){var i,o,r,s,l,c,u,d=!1,h=["insertHTML",!1,n];if(!t.util.isEdge&&e.queryCommandSupported("insertHTML"))try{return e.execCommand.apply(e,h)}catch(t){}if(i=e.getSelection(),i.rangeCount){if(o=i.getRangeAt(0),u=o.commonAncestorContainer,a.isMediumEditorElement(u)&&!u.firstChild)o.selectNode(u.appendChild(e.createTextNode("")));else if(3===u.nodeType&&0===o.startOffset&&o.endOffset===u.nodeValue.length||3!==u.nodeType&&u.innerHTML===o.toString()){for(;!a.isMediumEditorElement(u)&&u.parentNode&&1===u.parentNode.childNodes.length&&!a.isMediumEditorElement(u.parentNode);)u=u.parentNode;o.selectNode(u)}for(o.deleteContents(),r=e.createElement("div"),r.innerHTML=n,s=e.createDocumentFragment();r.firstChild;)l=r.firstChild,c=s.appendChild(l);o.insertNode(s),c&&(o=o.cloneRange(),o.setStartAfter(c),o.collapse(!0),t.selection.selectRange(e,o)),d=!0}return e.execCommand.callListeners&&e.execCommand.callListeners(h,d),d},execFormatBlock:function(e,n){var i,o=a.getTopBlockContainer(t.selection.getSelectionStart(e));if("blockquote"===n){if(o&&(i=Array.prototype.slice.call(o.childNodes),i.some(function(t){return a.isBlockContainer(t)})))return e.execCommand("outdent",!1,null);if(a.isIE)return e.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),a.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(a.isIE&&"<p>"===n)return e.execCommand("outdent",!1,n);if((a.isFF||a.isEdge)&&"p"===n)return i=Array.prototype.slice.call(o.childNodes),i.some(function(t){return!a.isBlockContainer(t)})&&e.execCommand("formatBlock",!1,n),e.execCommand("outdent",!1,n)}return e.execCommand("formatBlock",!1,n)},setTargetBlank:function(t,e){var n,i=e||!1;if("a"===t.nodeName.toLowerCase())t.target="_blank",t.rel="noopener noreferrer";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==i&&i!==t[n].attributes.href.value||(t[n].target="_blank",t[n].rel="noopener noreferrer")},removeTargetBlank:function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("target"),t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&(t[n].removeAttribute("target"),t[n].removeAttribute("rel"))},addClassToAnchors:function(t,e){var n,i,o=e.split(" ");if("a"===t.nodeName.toLowerCase())for(i=0;i<o.length;i+=1)t.classList.add(o[i]);else{var r=t.getElementsByTagName("a");if(0===r.length){var s=a.getClosestTag(t,"a");t=s?[s]:[]}else t=r;for(n=0;n<t.length;n+=1)for(i=0;i<o.length;i+=1)t[n].classList.add(o[i])}},isListItem:function(t){if(!t)return!1;if("li"===t.nodeName.toLowerCase())return!0;for(var e=t.parentNode,n=e.nodeName.toLowerCase();"li"===n||!a.isBlockContainer(e)&&"div"!==n;){if("li"===n)return!0;if(!(e=e.parentNode))return!1;n=e.nodeName.toLowerCase()}return!1},cleanListDOM:function(e,n){if("li"===n.nodeName.toLowerCase()){var i=n.parentElement;"p"===i.parentElement.nodeName.toLowerCase()&&(a.unwrap(i.parentElement,e),t.selection.moveCursor(e,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(t,e,n){for(var i=e,o=null,r=!n;i!==t;){var a,s=i.parentNode,l=s.cloneNode(!1),c=r?i:s.firstChild;for(o&&(r?l.appendChild(o):a=o),o=l;c;){var u=c.nextSibling;c===i?(c.hasChildNodes()?c=c.cloneNode(!1):c.parentNode.removeChild(c),c.textContent&&o.appendChild(c),c=r?u:null):(c.parentNode.removeChild(c),(c.hasChildNodes()||c.textContent)&&o.appendChild(c),c=u)}a&&o.appendChild(a),i=s}return o},moveTextRangeIntoElement:function(t,e,n){if(!t||!e)return!1;var i=a.findCommonRoot(t,e);if(!i)return!1;if(e===t){var o=t.parentNode,r=t.nextSibling;return o.removeChild(t),n.appendChild(t),r?o.insertBefore(n,r):o.appendChild(n),n.hasChildNodes()}for(var s,l,c,u=[],d=0;d<i.childNodes.length;d++)if(c=i.childNodes[d],s){if(a.isDescendant(c,e,!0)){l=c;break}u.push(c)}else a.isDescendant(c,t,!0)&&(s=c);var h=l.nextSibling,p=i.ownerDocument.createDocumentFragment();return s===t?(s.parentNode.removeChild(s),p.appendChild(s)):p.appendChild(a.splitOffDOMTree(s,t)),u.forEach(function(t){t.parentNode.removeChild(t),p.appendChild(t)}),l===e?(l.parentNode.removeChild(l),p.appendChild(l)):p.appendChild(a.splitOffDOMTree(l,e,!0)),n.appendChild(p),l.parentNode===i?i.insertBefore(n,l):h?i.insertBefore(n,h):i.appendChild(n),n.hasChildNodes()},depthOfNode:function(t){for(var e=0,n=t;null!==n.parentNode;)n=n.parentNode,e++;return e},findCommonRoot:function(t,e){for(var n=a.depthOfNode(t),i=a.depthOfNode(e),o=t,r=e;n!==i;)n>i?(o=o.parentNode,n-=1):(r=r.parentNode,i-=1);for(;o!==r;)o=o.parentNode,r=r.parentNode;return o},isElementAtBeginningOfBlock:function(t){for(var e,n;!a.isBlockContainer(t)&&!a.isMediumEditorElement(t);){for(n=t;n=n.previousSibling;)if(e=3===n.nodeType?n.nodeValue:n.textContent,e.length>0)return!1;t=t.parentNode}return!0},isMediumEditorElement:function(t){return t&&t.getAttribute&&!!t.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(t){return a.traverseUp(t,function(t){return a.isMediumEditorElement(t)})},isBlockContainer:function(t){return t&&3!==t.nodeType&&-1!==a.blockContainerElementNames.indexOf(t.nodeName.toLowerCase())},getClosestBlockContainer:function(t){return a.traverseUp(t,function(t){return a.isBlockContainer(t)||a.isMediumEditorElement(t)})},getTopBlockContainer:function(t){var e=!!a.isBlockContainer(t)&&t;return a.traverseUp(t,function(t){return a.isBlockContainer(t)&&(e=t),!(e||!a.isMediumEditorElement(t)||(e=t,0))}),e},getFirstSelectableLeafNode:function(t){for(;t&&t.firstChild;)t=t.firstChild;if(t=a.traverseUp(t,function(t){return-1===a.emptyElementNames.indexOf(t.nodeName.toLowerCase())}),"table"===t.nodeName.toLowerCase()){var e=t.querySelector("th, td");e&&(t=e)}return t},getFirstTextNode:function(t){return a.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),a._getFirstTextNode(t)},_getFirstTextNode:function(t){if(3===t.nodeType)return t;for(var e=0;e<t.childNodes.length;e++){var n=a._getFirstTextNode(t.childNodes[e]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(t){return-1===t.indexOf("://")?"http://"+t:t},warn:function(){void 0!==e.console&&"function"==typeof e.console.warn&&e.console.warn.apply(e.console,arguments)},deprecated:function(t,e,n){var i=t+" is deprecated, please use "+e+" instead.";n&&(i+=" Will be removed in "+n),a.warn(i)},deprecatedMethod:function(t,e,n,i){a.deprecated(t,e,i),"function"==typeof this[e]&&this[e].apply(this,n)},cleanupAttrs:function(t,e){e.forEach(function(e){t.removeAttribute(e)})},cleanupTags:function(t,e){-1!==e.indexOf(t.nodeName.toLowerCase())&&t.parentNode.removeChild(t)},unwrapTags:function(e,n){-1!==n.indexOf(e.nodeName.toLowerCase())&&t.util.unwrap(e,document)},getClosestTag:function(t,e){return a.traverseUp(t,function(t){return t.nodeName.toLowerCase()===e.toLowerCase()})},unwrap:function(t,e){for(var n=e.createDocumentFragment(),i=Array.prototype.slice.call(t.childNodes),o=0;o<i.length;o++)n.appendChild(i[o]);n.childNodes.length?t.parentNode.replaceChild(n,t):t.parentNode.removeChild(t)},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}};t.util=a}(window),function(){var e=function(e){t.util.extend(this,e)};e.extend=function(e){var n,i=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return i.apply(this,arguments)},t.util.extend(n,i);var o=function(){this.constructor=n};return o.prototype=i.prototype,n.prototype=new o,e&&t.util.extend(n.prototype,e),n},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(t){return this.base.options[t]}},["execAction","on","off","subscribe","trigger"].forEach(function(t){e.prototype[t]=function(){return this.base[t].apply(this.base,arguments)}}),t.Extension=e}(),function(){function e(e){return t.util.isBlockContainer(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(e,n){var i,o,r=n.getSelection();return 0!==r.rangeCount&&(i=r.getRangeAt(0),o=i.commonAncestorContainer,t.util.traverseUp(o,e))},getSelectionElement:function(e){return this.findMatchingSelectionParent(function(e){return t.util.isMediumEditorElement(e)},e)},exportSelection:function(t,e){if(!t)return null;var n=null,i=e.getSelection();if(i.rangeCount>0){var o,r=i.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(t),a.setEnd(r.startContainer,r.startOffset),o=a.toString().length,n={start:o,end:o+r.toString().length},this.doesRangeStartWithImages(r,e)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(t,n,r.endContainer,r.endOffset);if(s&&(n.trailingImageCount=s),0!==o){var l=this.getIndexRelativeToAdjacentEmptyBlocks(e,t,r.startContainer,r.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(t,e,n,i){if(t&&e){var o=n.createRange();o.setStart(e,0),o.collapse(!0);var r,a=e,s=[],l=0,c=!1,u=!1,d=0,h=!1,p=!1,f=null;for((i||t.startsWithImage||void 0!==t.emptyBlocksIndex)&&(p=!0);!h&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||u){if(t.trailingImageCount&&u&&("img"===a.nodeName.toLowerCase()&&d++,d===t.trailingImageCount)){for(var m=0;a.parentNode.childNodes[m]!==a;)m++;o.setEnd(a.parentNode,m+1),h=!0}if(!h&&1===a.nodeType)for(var g=a.childNodes.length-1;g>=0;)s.push(a.childNodes[g]),g-=1}else r=l+a.length,!c&&t.start>=l&&t.start<=r&&(p||t.start<r?(o.setStart(a,t.start-l),c=!0):f=a),c&&t.end>=l&&t.end<=r&&(t.trailingImageCount?u=!0:(o.setEnd(a,t.end-l),h=!0)),l=r;h||(a=s.pop())}!c&&f&&(o.setStart(f,f.length),o.setEnd(f,f.length)),void 0!==t.emptyBlocksIndex&&(o=this.importSelectionMoveCursorPastBlocks(n,e,t.emptyBlocksIndex,o)),i&&(o=this.importSelectionMoveCursorPastAnchor(t,o)),this.selectRange(n,o)}},importSelectionMoveCursorPastAnchor:function(e,n){var i=function(t){return"a"===t.nodeName.toLowerCase()};if(e.start===e.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&t.util.traverseUp(n.startContainer,i)){for(var o=n.startContainer,r=n.startContainer.parentNode;null!==r&&"a"!==r.nodeName.toLowerCase();)r.childNodes[r.childNodes.length-1]!==o?r=null:(o=r,r=r.parentNode);if(null!==r&&"a"===r.nodeName.toLowerCase()){for(var a=null,s=0;null===a&&s<r.parentNode.childNodes.length;s++)r.parentNode.childNodes[s]===r&&(a=s);n.setStart(r.parentNode,a+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,i,o,r){var a,s,l=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,e,!1),c=r.startContainer,u=0;for(o=o||1,a=3===c.nodeType&&t.util.isBlockContainer(c.previousSibling)?c.previousSibling:t.util.getClosestBlockContainer(c);l.nextNode();)if(s){if(s=l.currentNode,++u===o)break;if(s.textContent.length>0)break}else a===l.currentNode&&(s=l.currentNode);return s||(s=a),r.setStart(t.util.getFirstSelectableLeafNode(s),0),r},getIndexRelativeToAdjacentEmptyBlocks:function(n,i,o,r){if(o.textContent.length>0&&r>0)return-1;var a=o;if(3!==a.nodeType&&(a=o.childNodes[r]),a){if(!t.util.isElementAtBeginningOfBlock(a))return-1;var s=t.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var l=t.util.getClosestBlockContainer(o),c=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,e,!1),u=0;c.nextNode();){var d=""===c.currentNode.textContent;if((d||u>0)&&(u+=1),c.currentNode===l)return u;d||(u=0)}return u},doesRangeStartWithImages:function(t,e){if(0!==t.startOffset||1!==t.startContainer.nodeType)return!1;if("img"===t.startContainer.nodeName.toLowerCase())return!0;var n=t.startContainer.querySelector("img");if(!n)return!1;for(var i=e.createTreeWalker(t.startContainer,NodeFilter.SHOW_ALL,null,!1);i.nextNode();){var o=i.currentNode;if(o===n)break;if(o.nodeValue)return!1}return!0},getTrailingImageCount:function(t,e,n,i){if(0===i||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var o=n.childNodes[i-1];o.hasChildNodes();)o=o.lastChild;for(var r,a=t,s=[],l=0,c=!1,u=!1,d=!1,h=0;!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||u){if("img"===a.nodeName.toLowerCase()&&h++,a===o)d=!0;else if(1===a.nodeType)for(var p=a.childNodes.length-1;p>=0;)s.push(a.childNodes[p]),p-=1}else h=0,r=l+a.length,!c&&e.start>=l&&e.start<=r&&(c=!0),c&&e.end>=l&&e.end<=r&&(u=!0),l=r;d||(a=s.pop())}return h},selectionContainsContent:function(t){var e=t.getSelection();if(!e||e.isCollapsed||!e.rangeCount)return!1;if(""!==e.toString().trim())return!0;var n=this.getSelectedParentElement(e.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(t){var e,n=this.findMatchingSelectionParent(function(t){var n=t&&t.getAttribute("contenteditable");return"true"===n&&(e=!0),"#text"!==t.nodeName&&"false"===n},t);return!e&&n},getSelectionHtml:function(t){var e,n,i,o="",r=t.getSelection();if(r.rangeCount){for(i=t.createElement("div"),e=0,n=r.rangeCount;e<n;e+=1)i.appendChild(r.getRangeAt(e).cloneContents());o=i.innerHTML}return o},getCaretOffsets:function(t,e){var n,i;return e||(e=window.getSelection().getRangeAt(0)),n=e.cloneRange(),i=e.cloneRange(),n.selectNodeContents(t),n.setEnd(e.endContainer,e.endOffset),i.selectNodeContents(t),i.setStart(e.endContainer,e.endOffset),{left:n.toString().length,right:i.toString().length}},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(t){return t?this.rangeSelectsSingleNode(t)&&3!==t.startContainer.childNodes[t.startOffset].nodeType?t.startContainer.childNodes[t.startOffset]:3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer:null},getSelectedElements:function(t){var e,n,i,o=t.getSelection();if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(e=o.getRangeAt(0),3===e.commonAncestorContainer.nodeType){for(n=[],i=e.commonAncestorContainer;i.parentNode&&1===i.parentNode.childNodes.length;)n.push(i.parentNode),i=i.parentNode;return n}return[].filter.call(e.commonAncestorContainer.getElementsByTagName("*"),function(t){return"function"!=typeof o.containsNode||o.containsNode(t,!0)})},selectNode:function(t,e){var n=e.createRange();n.selectNodeContents(t),this.selectRange(e,n)},select:function(t,e,n,i,o){var r=t.createRange();return r.setStart(e,n),i?r.setEnd(i,o):r.collapse(!0),this.selectRange(t,r),r},clearSelection:function(t,e){e?t.getSelection().collapseToStart():t.getSelection().collapseToEnd()},moveCursor:function(t,e,n){this.select(t,e,n)},getSelectionRange:function(t){var e=t.getSelection();return 0===e.rangeCount?null:e.getRangeAt(0)},selectRange:function(t,e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)},getSelectionStart:function(t){var e=t.getSelection().anchorNode;return e&&3===e.nodeType?e.parentNode:e}};t.selection=n}(),function(){function e(e,n){return!!e&&e.some(function(e){if("function"!=typeof e.getInteractionElements)return!1;var i=e.getInteractionElements();return!!i&&(Array.isArray(i)||(i=[i]),i.some(function(e){return t.util.isDescendant(e,n,!0)}))})}var n=function(t){this.base=t,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(e,n,i,o){var r=this.base.options.contentWindow,a=this.base.options.ownerDocument;e=t.util.isElement(e)||[r,a].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){t.addEventListener(n,i,o),this.events.push([t,n,i,o])}.bind(this))},detachDOMEvent:function(e,n,i,o){var r,a,s=this.base.options.contentWindow,l=this.base.options.ownerDocument;e&&(e=t.util.isElement(e)||[s,l].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){-1!==(r=this.indexOfListener(t,n,i,o))&&(a=this.events.splice(r,1)[0],a[0].removeEventListener(a[1],a[2],a[3]))}.bind(this)))},indexOfListener:function(t,e,n,i){var o,r,a;for(o=0,r=this.events.length;o<r;o+=1)if(a=this.events[o],a[0]===t&&a[1]===e&&a[2]===n&&a[3]===i)return o;return-1},detachAllDOMEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},detachAllEventsFromElement:function(t){for(var e=this.events.filter(function(e){return e&&e[0].getAttribute&&e[0].getAttribute("medium-editor-index")===t.getAttribute("medium-editor-index")}),n=0,i=e.length;n<i;n++){var o=e[n];this.detachDOMEvent(o[0],o[1],o[2],o[3])}},attachAllEventsToElement:function(t){this.listeners.editableInput&&(this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(e){this.attachDOMEvent(t,e.name,e.handler.bind(this))},this)},enableCustomEvent:function(t){void 0!==this.disabledEvents[t]&&delete this.disabledEvents[t]},disableCustomEvent:function(t){this.disabledEvents[t]=!0},attachCustomEvent:function(t,e){this.setupListener(t),this.customEvents[t]||(this.customEvents[t]=[]),this.customEvents[t].push(e)},detachCustomEvent:function(t,e){var n=this.indexOfCustomListener(t,e);-1!==n&&this.customEvents[t].splice(n,1)},indexOfCustomListener:function(t,e){return this.customEvents[t]&&this.customEvents[t].length?this.customEvents[t].indexOf(e):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(t,e,n){this.customEvents[t]&&!this.disabledEvents[t]&&this.customEvents[t].forEach(function(t){t(e,n)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(t){t.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(t){this.handleDocumentExecCommand(t)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var t=this.options.ownerDocument;if(this.execCommandListener&&t.execCommand.listeners){var e=t.execCommand.listeners.indexOf(this.execCommandListener);-1!==e&&t.execCommand.listeners.splice(e,1),t.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var t=this.options.ownerDocument;if(!t.execCommand.listeners){var e=function(e,n){t.execCommand.listeners&&t.execCommand.listeners.forEach(function(t){t({command:e[0],value:e[2],args:e,result:n})})},n=function(){var n=t.execCommand.orig.apply(this,arguments);if(!t.execCommand.listeners)return n;var i=Array.prototype.slice.call(arguments);return e(i,n),n};n.orig=t.execCommand,n.listeners=[],n.callListeners=e,t.execCommand=n}},unwrapExecCommand:function(){var t=this.options.ownerDocument;t.execCommand.orig&&(t.execCommand=t.execCommand.orig)},setupListener:function(t){if(!this.listeners[t]){switch(t){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(t){this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[t]=!0}},attachToEachElement:function(t,e){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(n){this.attachDOMEvent(n,t,e.bind(this))},this),this.eventsCache.push({name:t,handler:e})},cleanupElement:function(t){var e=t.getAttribute("medium-editor-index");e&&(this.detachAllEventsFromElement(t),this.contentCache&&delete this.contentCache[e])},focusElement:function(t){t.focus(),this.updateFocus(t,{target:t,type:"focus"})},updateFocus:function(n,i){var o,r=this.base.getFocusedElement();r&&"click"===i.type&&this.lastMousedownTarget&&(t.util.isDescendant(r,this.lastMousedownTarget,!0)||e(this.base.extensions,this.lastMousedownTarget))&&(o=r),o||this.base.elements.some(function(e){return!o&&t.util.isDescendant(e,n,!0)&&(o=e),!!o},this);var a=!t.util.isDescendant(r,n,!0)&&!e(this.base.extensions,n);o!==r&&(r&&a&&(r.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,r)),o&&(o.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,o))),a&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(t,e){if(this.contentCache){var n=t.getAttribute("medium-editor-index"),i=t.innerHTML;i!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",e,t),this.contentCache[n]=i}},handleDocumentSelectionChange:function(e){if(e.currentTarget&&e.currentTarget.activeElement){var n,i=e.currentTarget.activeElement;this.base.elements.some(function(e){return!!t.util.isDescendant(e,i,!0)&&(n=e,!0)},this),n&&this.updateInput(n,{target:i,currentTarget:n})}},handleDocumentExecCommand:function(){var t=this.base.getFocusedElement();t&&this.updateInput(t,{target:t,currentTarget:t})},handleBodyClick:function(t){this.updateFocus(t.target,t)},handleBodyFocus:function(t){this.updateFocus(t.target,t)},handleBodyMousedown:function(t){this.lastMousedownTarget=t.target},handleInput:function(t){this.updateInput(t.currentTarget,t)},handleClick:function(t){this.triggerCustomEvent("editableClick",t,t.currentTarget)},handleBlur:function(t){this.triggerCustomEvent("editableBlur",t,t.currentTarget)},handleKeypress:function(t){if(this.triggerCustomEvent("editableKeypress",t,t.currentTarget),this.keypressUpdateInput){var e={target:t.target,currentTarget:t.currentTarget};setTimeout(function(){this.updateInput(e.currentTarget,e)}.bind(this),0)}},handleKeyup:function(t){this.triggerCustomEvent("editableKeyup",t,t.currentTarget)},handleMouseover:function(t){this.triggerCustomEvent("editableMouseover",t,t.currentTarget)},handleDragging:function(t){this.triggerCustomEvent("editableDrag",t,t.currentTarget)},handleDrop:function(t){this.triggerCustomEvent("editableDrop",t,t.currentTarget)},handlePaste:function(t){this.triggerCustomEvent("editablePaste",t,t.currentTarget)},handleKeydown:function(e){return this.triggerCustomEvent("editableKeydown",e,e.currentTarget),t.util.isKey(e,t.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.ENTER)||e.ctrlKey&&t.util.isKey(e,t.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",e,e.currentTarget):t.util.isKey(e,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",e,e.currentTarget):void 0}},t.Events=n}(),function(){var e=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(n){e.isBuiltInButton(n)?t.Extension.call(this,this.defaults[n]):t.Extension.call(this,n)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var t=this.document.createElement("button"),e=this.contentDefault,n=this.getAria(),i=this.getEditorOption("buttonLabels");return t.classList.add("medium-editor-action"),t.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(e){t.classList.add(e)}),t.setAttribute("data-action",this.getAction()),n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach(function(e){t.setAttribute(e,this.attrs[e])},this),"fontawesome"===i&&this.contentFA&&(e=this.contentFA),t.innerHTML=e,t},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.getAction();e&&this.execAction(e)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var t=null;return this.useQueryState&&(t=this.base.queryCommandState(this.getAction())),t},isAlreadyApplied:function(t){var e,n,i=!1,o=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(o&&o.length>0&&(i=-1!==o.indexOf(t.nodeName.toLowerCase())),!i&&this.style&&(e=this.style.value.split("|"),n=this.window.getComputedStyle(t,null).getPropertyValue(this.style.prop),e.forEach(function(t){this.knownState||((i=-1!==n.indexOf(t))||"text-decoration"!==this.style.prop)&&(this.knownState=i)},this)),i)}});e.isBuiltInButton=function(e){return"string"==typeof e&&t.extensions.button.prototype.defaults.hasOwnProperty(e)},t.extensions.button=e}(),function(){t.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}}(),function(){var e=t.extensions.button.extend({init:function(){t.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.hideToolbarDefaultActions()},setToolbarPosition:function(){var t=this.base.getExtensionByName("toolbar");t&&t.setToolbarPosition()}});t.extensions.form=e}(),function(){var e=t.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(e){e.preventDefault(),e.stopPropagation();var n=t.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||t.util.getClosestTag(t.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(e){t.util.isKey(e,t.util.keyCode.K)&&t.util.isMetaCtrlKey(e)&&!e.shiftKey&&this.handleClick(e)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(e){var n=this.getInput(),i=this.getAnchorTargetCheckbox(),o=this.getAnchorButtonCheckbox();if(e=e||{value:""},"string"==typeof e&&(e={value:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),t.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=e.value,n.focus(),i&&(i.checked="_blank"===e.target),o){var r=e.buttonClass?e.buttonClass.split(" "):[];o.checked=-1!==r.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",t&&t.checked&&(n.target="_blank"),e&&e.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],i=e[1];return n+(void 0===i?"":"="+this.ensureEncodedUriComponent(i))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,n=e.test(t),i="",o=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,r=t.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),a=r[1],s=r[2],l=r[3];if(o.test(t))return"tel:"+t;if(!n){var c=a.split("/")[0];(c.match(/.+(\.|:).+/)||"localhost"===c)&&(i="http://")}return i+this.ensureEncodedUri(a)+(void 0===s?"":"?"+this.ensureEncodedQuery(s))+(void 0===l?"":"#"+l)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),i=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(i,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document,e=t.createElement("div");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),e.innerHTML=this.getTemplate(),this.attachFormEvents(e),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(e){if(e.keyCode===t.util.keyCode.ENTER)return e.preventDefault(),void this.doFormSave();e.keyCode===t.util.keyCode.ESCAPE&&(e.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}});t.extensions.anchor=e}(),function(){var e=t.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var t=this.document.createElement("div");return t.id="medium-editor-anchor-preview-"+this.getEditorId(),t.className="medium-editor-anchor-preview",t.innerHTML=this.getTemplate(),this.on(t,"click",this.handleClick.bind(this)),t},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(t){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!t.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=t.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=t.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=t,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(t){t=t||this.activeAnchor;var e,n,i,o,r,a=this.window.innerWidth,s=this.anchorPreview.offsetHeight,l=t.getBoundingClientRect(),c=this.diffLeft,u=this.diffTop,d=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,p={};e=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(c=f.diffLeft,u=f.diffTop),n=c-e,h?(o=d.getBoundingClientRect(),["top","left"].forEach(function(t){p[t]=l[t]-o[t]}),p.width=l.width,p.height=l.height,l=p,a=o.width,r=d.scrollTop):r=this.window.pageYOffset,i=l.left+l.width/2,r+=s+l.top+l.height-u-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(r)+"px",this.anchorPreview.style.right="initial",i<e?(this.anchorPreview.style.left=n+e+"px",this.anchorPreview.style.right="initial"):a-i<e?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+i+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(t){var e=this.base.getExtensionByName("anchor"),n=this.activeAnchor;e&&n&&(t.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var t={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};e.showForm(t),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(e){var n=t.util.getClosestTag(e.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var i=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&i&&i.isDisplayed&&i.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});t.extensions.anchorPreview=e}(),function(){function e(e){return!t.util.getClosestTag(e,"a")}var n,i,o,r,a;n=[" ","\t","\n","\r"," "," "," "," "," ","\u2028","\u2029"],i="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+i+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+i+"))",r=new RegExp("^("+i+")$","i"),a=new RegExp(o,"gi");var s=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var t=0,e=0;e<this.window._mediumEditors.length;e++){var n=this.window._mediumEditors[e];null!==n&&void 0!==n.getExtensionByName("autoLink")&&t++}return 1===t},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(t,e){this.performLinking(e)},onKeypress:function(e){this.disableEventHandling||t.util.isKey(e,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var t=this.base.exportSelection();this.performLinking(e.target)&&this.base.importSelection(t,!0)}catch(t){window.console&&window.console.error("Failed to perform linking",t),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(e){var n=t.util.splitByBlockElements(e),i=!1;0===n.length&&(n=[e]);for(var o=0;o<n.length;o++)i=this.removeObsoleteAutoLinkSpans(n[o])||i,i=this.performLinkingWithinElement(n[o])||i;return this.base.events.updateInput(e,{target:e,currentTarget:e}),i},removeObsoleteAutoLinkSpans:function(n){if(!n||3===n.nodeType)return!1;for(var i=n.querySelectorAll('span[data-auto-link="true"]'),o=!1,r=0;r<i.length;r++){var a=i[r].textContent;if(-1===a.indexOf("://")&&(a=t.util.ensureUrlHasProtocol(a)),i[r].getAttribute("data-href")!==a&&e(i[r])){o=!0;var s=a.replace(/\s+$/,"");if(i[r].getAttribute("data-href")===s){var l=a.length-s.length,c=t.util.splitOffDOMTree(i[r],this.splitTextBeforeEnd(i[r],l));i[r].parentNode.insertBefore(c,i[r].nextSibling)}else t.util.unwrap(i[r],this.document)}}return o},splitTextBeforeEnd:function(t,e){for(var n=this.document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),i=!0;i;)i=null!==n.lastChild();for(var o,r,a;e>0&&null!==a;)o=n.currentNode,r=o.nodeValue,r.length>e?(a=o.splitText(r.length-e),e=0):(a=n.previousNode(),e-=r.length);return a},performLinkingWithinElement:function(e){for(var n=this.findLinkableText(e),i=0;i<n.length;i++){var o=t.util.findOrCreateMatchingTextNodes(this.document,e,n[i]);this.shouldNotLink(o)||this.createAutoLink(o,n[i].href)}return!1},shouldNotLink:function(e){for(var n=!1,i=0;i<e.length&&!1===n;i++)n=!!t.util.traverseUp(e[i],function(t){return"a"===t.nodeName.toLowerCase()||t.getAttribute&&"true"===t.getAttribute("data-auto-link")});return n},findLinkableText:function(t){for(var e=t.textContent,i=null,o=[];null!==(i=a.exec(e));){var s=!0,l=i.index+i[0].length;s=!(0!==i.index&&-1===n.indexOf(e[i.index-1])||l!==e.length&&-1===n.indexOf(e[l])),(s=s&&(-1!==i[0].indexOf("/")||r.test(i[0].split(".").pop().split("?").shift())))&&o.push({href:i[0],start:i.index,end:l})}return o},createAutoLink:function(e,n){n=t.util.ensureUrlHasProtocol(n);var i=t.util.createLink(this.document,e,n,this.getEditorOption("targetBlank")?"_blank":null),o=this.document.createElement("span");for(o.setAttribute("data-auto-link","true"),o.setAttribute("data-href",n),i.insertBefore(o,i.firstChild);i.childNodes.length>1;)o.appendChild(i.childNodes[1])}});t.extensions.autoLink=s}(),function(){function e(e){var i=t.util.getContainerEditorElement(e);Array.prototype.slice.call(i.parentElement.querySelectorAll("."+n)).forEach(function(t){t.classList.remove(n)})}var n="medium-editor-dragover",i=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy";var i=t.target.classList?t.target:t.target.parentElement;e(i),"dragover"===t.type&&i.classList.add(n)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),this.base.selectElement(t.target);var n=this.base.exportSelection();n.start=n.end,this.base.importSelection(n),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files).forEach(function(t){this.isAllowedFile(t)&&t.type.match("image")&&this.insertImageFile(t)},this),e(t.target)},isAllowedFile:function(t){return this.allowedTypes.some(function(e){return!!t.type.match(e)})},insertImageFile:function(e){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(e),n.addEventListener("load",function(e){var n=this.document.createElement("img");n.src=e.target.result,t.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});t.extensions.fileDragging=i}(),function(){var e=t.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(t){var e=t.key.charCodeAt(0);this.keys[e]||(this.keys[e]=[]),this.keys[e].push(t)},this)},handleKeydown:function(e){var n=t.util.getKeyCode(e);if(this.keys[n]){var i=t.util.isMetaCtrlKey(e),o=!!e.shiftKey,r=!!e.altKey;this.keys[n].forEach(function(t){t.meta!==i||t.shift!==o||t.alt!==r&&void 0!==t.alt||(e.preventDefault(),e.stopPropagation(),"function"==typeof t.command?t.command.apply(this):!1!==t.command&&this.execAction(t.command))},this)}}});t.extensions.keyboardCommands=e}(),function(){var e=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontName")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(t){var e=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var t,e=this.document,n=e.createElement("div"),i=e.createElement("select"),o=e.createElement("a"),r=e.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a<this.fonts.length;a++)t=e.createElement("option"),t.innerHTML=this.fonts[a],t.value=this.fonts[a],i.appendChild(t);return i.className="medium-editor-toolbar-select",n.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),r.setAttribute("href","#"),r.className="medium-editor-toobar-save",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",n.appendChild(r),this.on(r,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",n.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){t.selection.getSelectedElements(this.document).forEach(function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("face")&&t.removeAttribute("face")})},handleFontChange:function(){var t=this.getSelect().value;""===t?this.clearFontName():this.execAction("fontName",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}});t.extensions.fontName=e}(),function(){var e=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontSize")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(t){var e=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var t=this.document,e=t.createElement("div"),n=t.createElement("input"),i=t.createElement("a"),o=t.createElement("a");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(e,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",e.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),o.setAttribute("href","#"),o.className="medium-editor-toobar-save",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",e.appendChild(o),this.on(o,"click",this.handleSaveClick.bind(this),!0),i.setAttribute("href","#"),i.className="medium-editor-toobar-close",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",e.appendChild(i),this.on(i,"click",this.handleCloseClick.bind(this)),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){t.selection.getSelectedElements(this.document).forEach(function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("size")&&t.removeAttribute("size")})},handleSliderChange:function(){var t=this.getInput().value;"4"===t?this.clearFontSize():this.execAction("fontSize",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}});t.extensions.fontSize=e}(),function(){function e(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function n(t,e,n){var i=t.clipboardData||e.clipboardData||n.dataTransfer,o={};if(!i)return o;if(i.getData){var r=i.getData("Text");r&&r.length>0&&(o["text/plain"]=r)}if(i.types)for(var a=0;a<i.types.length;a++){var s=i.types[a];o[s]=i.getData(s)}return o}var i=null,o=null,r=function(t){t.stopPropagation()},a=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(t){this.on(t,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(t,e){this.on(e,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(t,e){if(!t.defaultPrevented){var i=n(t,this.window,this.document),o=i["text/html"],r=i["text/plain"];this.window.clipboardData&&void 0===t.clipboardData&&!o&&(o=r),(o||r)&&(t.preventDefault(),this.doPaste(o,r,e))}},doPaste:function(e,n,i){var o,r,a="";if(this.cleanPastedHTML&&e)return this.cleanPaste(e);if(n){if(this.getEditorOption("disableReturn")||i&&i.getAttribute("data-disable-return"))a=t.util.htmlEntities(n);else if(o=n.split(/[\r\n]+/g),o.length>1)for(r=0;r<o.length;r+=1)""!==o[r]&&(a+="<p>"+t.util.htmlEntities(o[r])+"</p>");else a=t.util.htmlEntities(o[0]);t.util.insertHTMLCommand(this.document,a)}},handlePasteBinPaste:function(t){if(t.defaultPrevented)return void this.removePasteBin();var e=n(t,this.window,this.document),i=e["text/html"],r=e["text/plain"],a=o;if(!this.cleanPastedHTML||i)return t.preventDefault(),this.removePasteBin(),this.doPaste(i,r,a),void this.trigger("editablePaste",{currentTarget:a,target:a},a);setTimeout(function(){this.cleanPastedHTML&&(i=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(i,r,a),this.trigger("editablePaste",{currentTarget:a,target:a},a)}.bind(this),0)},handleKeydown:function(e,n){t.util.isKey(e,t.util.keyCode.V)&&t.util.isMetaCtrlKey(e)&&(e.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(e){var n,a=t.selection.getSelectionRange(this.document),s=this.window.pageYOffset;o=e,a&&(n=a.getClientRects(),n.length?s+=n[0].top:void 0!==a.startContainer.getBoundingClientRect?s+=a.startContainer.getBoundingClientRect().top:s+=a.getBoundingClientRect().top),i=a;var l=this.document.createElement("div");l.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),l.setAttribute("style","border: 1px red solid; position: absolute; top: "+s+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),l.setAttribute("contentEditable",!0),l.innerHTML="%ME_PASTEBIN%",this.document.body.appendChild(l),this.on(l,"focus",r),this.on(l,"focusin",r),this.on(l,"focusout",r),l.focus(),t.selection.selectNode(l,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(l,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==i&&(t.selection.selectRange(this.document,i),i=null),null!==o&&(o=null);var e=this.getPasteBin();e&&e&&(this.off(e,"focus",r),this.off(e,"focusin",r),this.off(e,"focusout",r),this.off(e,"paste",this.boundHandlePaste),e.parentElement.removeChild(e))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var t=this.getPasteBin();if(!t)return!1;if(t.firstChild&&"mcepastebin"===t.firstChild.id)return!1;var e=t.innerHTML;return!(!e||"%ME_PASTEBIN%"===e)&&e},cleanPaste:function(t){var n,i,o,r,a=/<p|<br|<div/.test(t),s=[].concat(this.preCleanReplacements||[],e(),this.cleanReplacements||[]);for(n=0;n<s.length;n+=1)t=t.replace(s[n][0],s[n][1]);if(!a)return this.pasteHTML(t);for(o=this.document.createElement("div"),o.innerHTML="<p>"+t.split("<br><br>").join("</p><p>")+"</p>",i=o.querySelectorAll("a,p,div,br"),n=0;n<i.length;n+=1)switch(r=i[n],r.innerHTML=r.innerHTML.replace(/\n/gi," "),r.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(r);break;case"br":this.filterLineBreak(r)}this.pasteHTML(o.innerHTML)},pasteHTML:function(e,n){n=t.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var i,o,r,a,s=this.document.createDocumentFragment();for(s.appendChild(this.document.createElement("body")),a=s.querySelector("body"),a.innerHTML=e,this.cleanupSpans(a),i=a.querySelectorAll("*"),r=0;r<i.length;r+=1)o=i[r],"a"===o.nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(o),t.util.cleanupAttrs(o,n.cleanAttrs),t.util.cleanupTags(o,n.cleanTags),t.util.unwrapTags(o,n.unwrapTags);t.util.insertHTMLCommand(this.document,a.innerHTML.replace(/ /g," "))},isCommonBlock:function(t){return t&&("p"===t.nodeName.toLowerCase()||"div"===t.nodeName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.textContent)&&t.parentNode&&t.parentNode.removeChild(t)},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?this.removeWithParent(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?t.parentNode&&1===t.parentNode.childElementCount&&""===t.parentNode.textContent&&this.removeWithParent(t):this.removeWithParent(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))},cleanupSpans:function(e){var n,i,o,r=e.querySelectorAll(".replace-with"),a=function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")};for(n=0;n<r.length;n+=1)i=r[n],o=this.document.createElement(i.classList.contains("bold")?"b":"i"),i.classList.contains("bold")&&i.classList.contains("italic")?o.innerHTML="<i>"+i.innerHTML+"</i>":o.innerHTML=i.innerHTML,i.parentNode.replaceChild(o,i);for(r=e.querySelectorAll("span"),n=0;n<r.length;n+=1){if(i=r[n],t.util.traverseUp(i,a))return!1;t.util.unwrap(i,this.document)}}});t.extensions.paste=a}(),function(){var e=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(t,e){this.initElement(e)},initElement:function(t){t.getAttribute("data-placeholder")||t.setAttribute("data-placeholder",this.text),this.updatePlaceholder(t)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(t,e){this.cleanupElement(e)},cleanupElement:function(t){t.getAttribute("data-placeholder")===this.text&&t.removeAttribute("data-placeholder")},showPlaceholder:function(e){e&&(t.util.isFF&&0===e.childNodes.length?(e.classList.add("medium-editor-placeholder-relative"),e.classList.remove("medium-editor-placeholder")):(e.classList.add("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(t){t&&(t.classList.remove("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(t,e){if(t.querySelector("img, blockquote, ul, ol, table")||""!==t.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(t);e||this.showPlaceholder(t)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(t,e){var n=this.hideOnClick&&e===this.base.getFocusedElement();this.updatePlaceholder(e,n)},handleFocus:function(t,e){this.hidePlaceholder(e)},handleBlur:function(t,e){this.updatePlaceholder(e)}});t.extensions.placeholder=e}(),function(){var e=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(t,e){return this.base.extensions.forEach(function(n){if(n!==this)return t.apply(e||this,arguments)},this)},createToolbar:function(){var t=this.document.createElement("div");return t.id="medium-editor-toolbar-"+this.getEditorId(),t.className="medium-editor-toolbar",this.static?t.className+=" static-toolbar":this.relativeContainer?t.className+=" medium-editor-relative-toolbar":t.className+=" medium-editor-stalker-toolbar",t.appendChild(this.createToolbarButtons()),this.forEachExtension(function(e){e.hasForm&&t.appendChild(e.getForm())}),this.attachEventHandlers(),t},createToolbarButtons:function(){var e,n,i,o,r,a,s=this.document.createElement("ul");return s.id="medium-editor-toolbar-actions"+this.getEditorId(),s.className="medium-editor-toolbar-actions",s.style.display="block",this.buttons.forEach(function(i){"string"==typeof i?(r=i,a=null):(r=i.name,a=i),(o=this.base.addBuiltInExtension(r,a))&&"function"==typeof o.getButton&&(n=o.getButton(this.base),e=this.document.createElement("li"),t.util.isElement(n)?e.appendChild(n):e.innerHTML=n,s.appendChild(e))},this),i=s.querySelectorAll("button"),i.length>0&&(i[0].classList.add(this.firstButtonClass),i[i.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=t.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(e){if(e&&e.target&&t.util.isDescendant(this.getToolbarElement(),e.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension(function(t){t.hasForm&&t.isDisplayed()&&t.hideForm()})},multipleBlockElementsSelected:function(){var e=/<[^\/>][^>]*><\/[^>]+>/gim,n=new RegExp("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=t.selection.getSelectionHtml(this.document).replace(e,""),o=i.match(n);return!!o&&o.length>1},modifySelection:function(){var e=this.window.getSelection(),n=e.getRangeAt(0);if(this.standardizeSelectionStart&&n.startContainer.nodeValue&&n.startOffset===n.startContainer.nodeValue.length){var i=t.util.findAdjacentTextNodeWithContent(t.selection.getSelectionElement(this.window),n.startContainer,this.document);if(i){for(var o=0;0===i.nodeValue.substr(o,1).trim().length;)o+=1;n=t.selection.select(this.document,i,o,n.endContainer,n.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var e=t.selection.getSelectionElement(this.window);return!e||-1===this.getEditorElements().indexOf(e)||e.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!t.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(t){"function"==typeof t.isActive&&"function"==typeof t.setInactive&&t.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var e,n=[],i=null,o=t.selection.getSelectionRange(this.document),r=function(t){"function"==typeof t.checkState?t.checkState(e):"function"==typeof t.isActive&&"function"==typeof t.isAlreadyApplied&&"function"==typeof t.setActive&&!t.isActive()&&t.isAlreadyApplied(e)&&t.setActive()};if(o&&(this.forEachExtension(function(t){if("function"==typeof t.queryCommandState&&null!==(i=t.queryCommandState()))return void(i&&"function"==typeof t.setActive&&t.setActive());n.push(t)}),e=t.selection.getSelectedParentElement(o),this.getEditorElements().some(function(n){return t.util.isDescendant(n,e,!0)})))for(;e&&(n.forEach(r),!t.util.isMediumEditorElement(e));)e=e.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var t=this.base.getFocusedElement(),e=this.window.getSelection();if(!t)return this;!this.static&&e.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(t):this.positionToolbar(e)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(t){this.getToolbarElement().style.left="0";var e,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,o=this.getToolbarElement(),r=t.getBoundingClientRect(),a=r.top+n,s=r.left+r.width/2,l=o.offsetHeight,c=o.offsetWidth,u=c/2;switch(this.sticky?n>a+t.offsetHeight-l-this.stickyTopOffset?(o.style.top=a+t.offsetHeight-l+"px",o.classList.remove("medium-editor-sticky-toolbar")):n>a-l-this.stickyTopOffset?(o.classList.add("medium-editor-sticky-toolbar"),o.style.top=this.stickyTopOffset+"px"):(o.classList.remove("medium-editor-sticky-toolbar"),o.style.top=a-l+"px"):o.style.top=a-l+"px",this.align){case"left":e=r.left;break;case"right":e=r.right-c;break;case"center":e=s-u}e<0?e=0:e+c>i&&(e=i-Math.ceil(c)-1),o.style.left=e+"px"},positionToolbar:function(t){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var e=t.getRangeAt(0),n=e.getBoundingClientRect();(!n||0===n.height&&0===n.width&&e.startContainer===e.endContainer)&&(n=1===e.startContainer.nodeType&&e.startContainer.querySelector("img")?e.startContainer.querySelector("img").getBoundingClientRect():e.startContainer.getBoundingClientRect());var i,o,r=this.window.innerWidth,a=this.getToolbarElement(),s=a.offsetHeight,l=a.offsetWidth,c=l/2,u=this.diffLeft-c,d=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,p={},f={};h?(o=d.getBoundingClientRect(),["top","left"].forEach(function(t){f[t]=n[t]-o[t]}),f.width=n.width,f.height=n.height,n=f,r=o.width,p.top=d.scrollTop):p.top=this.window.pageYOffset,i=n.left+n.width/2,p.top+=n.top-s,n.top<50?(a.classList.add("medium-toolbar-arrow-over"),a.classList.remove("medium-toolbar-arrow-under"),p.top+=50+n.height-this.diffTop):(a.classList.add("medium-toolbar-arrow-under"),a.classList.remove("medium-toolbar-arrow-over"),p.top+=this.diffTop),i<c?(p.left=u+c,p.right="initial"):r-i<c?(p.left="auto",p.right=0):(p.left=u+i,p.right="initial"),["top","left","right"].forEach(function(t){a.style[t]=p[t]+(isNaN(p[t])?"":"px")})}});t.extensions.toolbar=e}(),function(){var e=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy","dragover"===t.type?t.target.classList.add("medium-editor-dragover"):"dragleave"===t.type&&t.target.classList.remove("medium-editor-dragover")},handleDrop:function(e){var n;e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&(n=Array.prototype.slice.call(e.dataTransfer.files,0),n.some(function(e){if(e.type.match("image")){var n,i;n=new FileReader,n.readAsDataURL(e),i="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+i+'" />'),n.onload=function(){var t=this.document.getElementById(i);t&&(t.removeAttribute("id"),t.removeAttribute("class"),t.src=n.result)}.bind(this)}}.bind(this))),e.target.classList.remove("medium-editor-dragover")}});t.extensions.imageDragging=e}(),function(){function e(e){var n=t.selection.getSelectionStart(this.options.ownerDocument),i=n.textContent,o=t.selection.getCaretOffsets(n);(void 0===i[o.left-1]||""===i[o.left-1].trim()||void 0!==i[o.left]&&""===i[o.left].trim())&&e.preventDefault()}function n(e,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))e.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var i=t.selection.getSelectionStart(this.options.ownerDocument);(i&&""===i.textContent.trim()&&"li"!==i.nodeName.toLowerCase()||i.previousElementSibling&&"br"!==i.previousElementSibling.nodeName.toLowerCase()&&""===i.previousElementSibling.textContent.trim())&&e.preventDefault()}}function i(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(e.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(n)&&(e.preventDefault(),e.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(e){var n,i=t.selection.getSelectionStart(this.options.ownerDocument),o=i.nodeName.toLowerCase(),r=/^(\s+|<br\/?>)?$/i,a=/h\d/i;t.util.isKey(e,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&i.previousElementSibling&&a.test(o)&&0===t.selection.getCaretOffsets(i).left?t.util.isKey(e,t.util.keyCode.BACKSPACE)&&r.test(i.previousElementSibling.innerHTML)?(i.previousElementSibling.parentNode.removeChild(i.previousElementSibling),e.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(e,t.util.keyCode.ENTER)&&(n=this.options.ownerDocument.createElement("p"),n.innerHTML="<br>",i.previousElementSibling.parentNode.insertBefore(n,i),e.preventDefault()):t.util.isKey(e,t.util.keyCode.DELETE)&&i.nextElementSibling&&i.previousElementSibling&&!a.test(o)&&r.test(i.innerHTML)&&a.test(i.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,i.nextElementSibling),i.previousElementSibling.parentNode.removeChild(i),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&"li"===o&&r.test(i.innerHTML)&&!i.previousElementSibling&&!i.parentElement.previousElementSibling&&i.nextElementSibling&&"li"===i.nextElementSibling.nodeName.toLowerCase()?(n=this.options.ownerDocument.createElement("p"),n.innerHTML="<br>",i.parentElement.parentElement.insertBefore(n,i.parentElement),t.selection.moveCursor(this.options.ownerDocument,n),i.parentElement.removeChild(i),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&!1!==t.util.getClosestTag(i,"blockquote")&&0===t.selection.getCaretOffsets(i).left?(e.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(e,t.util.keyCode.ENTER)&&!1!==t.util.getClosestTag(i,"blockquote")&&0===t.selection.getCaretOffsets(i).right?(n=this.options.ownerDocument.createElement("p"),n.innerHTML="<br>",i.parentElement.insertBefore(n,i.nextSibling),t.selection.moveCursor(this.options.ownerDocument,n),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(i.parentElement)&&!i.previousElementSibling&&i.nextElementSibling&&r.test(i.innerHTML)&&(e.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,i.nextSibling),i.parentElement.removeChild(i))}function r(e){var n,i=t.selection.getSelectionStart(this.options.ownerDocument);i&&(t.util.isMediumEditorElement(i)&&0===i.children.length&&!t.util.isBlockContainer(i)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!t.util.isKey(e,t.util.keyCode.ENTER)||t.util.isListItem(i)||t.util.isBlockContainer(i)||(n=i.nodeName.toLowerCase(),"a"===n?this.options.ownerDocument.execCommand("unlink",!1,null):e.shiftKey||e.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(t,e){var n=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=e.innerHTML.trim())}function s(t){t._mediumEditors||(t._mediumEditors=[null]),this.id||(this.id=t._mediumEditors.length),t._mediumEditors[this.id]=this}function l(t){t._mediumEditors&&t._mediumEditors[this.id]&&(t._mediumEditors[this.id]=null)}function c(e,n,i){var o=[];if(e||(e=[]),"string"==typeof e&&(e=n.querySelectorAll(e)),t.util.isElement(e)&&(e=[e]),i)for(var r=0;r<e.length;r++){var a=e[r];!t.util.isElement(a)||a.getAttribute("data-medium-editor-element")||a.getAttribute("medium-editor-textarea-id")||o.push(a)}else o=Array.prototype.slice.apply(e);return o}function u(t){var e=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');e&&(e.classList.remove("medium-editor-hidden"),e.removeAttribute("medium-editor-textarea-id")),t.parentNode&&t.parentNode.removeChild(t)}function d(t,e){return Object.keys(e).forEach(function(n){void 0===t[n]&&(t[n]=e[n])}),t}function h(t,e,n){return t=d(t,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n}),"function"==typeof t.init&&t.init(),t.name||(t.name=e),t}function p(){return!this.elements.every(function(t){return!!t.getAttribute("data-disable-toolbar")})&&!1!==this.options.toolbar}function f(){return!!p.call(this)&&!1!==this.options.anchorPreview}function m(){return!1!==this.options.placeholder}function g(){return!1!==this.options.autoLink}function v(){return!1!==this.options.imageDragging}function _(){return!1!==this.options.keyboardCommands}function b(){return!this.options.extensions.imageDragging}function w(t){for(var e=this.options.ownerDocument.createElement("div"),n=Date.now(),i="medium-editor-"+n,o=t.attributes;this.options.ownerDocument.getElementById(i);)n++,i="medium-editor-"+n;e.className=t.className,e.id=i,e.innerHTML=t.value,t.setAttribute("medium-editor-textarea-id",i);for(var r=0,a=o.length;r<a;r++)e.hasAttribute(o[r].nodeName)||e.setAttribute(o[r].nodeName,o[r].value);return t.form&&this.on(t.form,"reset",function(t){t.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(i))}.bind(this)),t.classList.add("medium-editor-hidden"),t.parentNode.insertBefore(e,t),e}function y(e,i){if(!e.getAttribute("data-medium-editor-element")){"textarea"===e.nodeName.toLowerCase()&&(e=w.call(this,e),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=a.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||e.getAttribute("data-disable-editing")||(e.setAttribute("contentEditable",!0),e.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(e.getAttribute("data-disable-return")||e.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||e.getAttribute("data-disable-return")||this.on(e,"keyup",r.bind(this));var o=t.util.guid();e.setAttribute("data-medium-editor-element",!0),e.classList.add("medium-editor-element"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline",!0),e.setAttribute("data-medium-editor-editor-index",i),e.setAttribute("medium-editor-index",o),D[o]=e.innerHTML,this.events.attachAllEventsToElement(e)}return e}function C(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",e.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function x(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(t){"toolbar"!==t&&this.options.extensions[t]&&this.extensions.push(h(this.options.extensions[t],t,this))},this),b.call(this)){var e=this.options.fileDragging;e||(e={},v.call(this)||(e.allowedTypes=[])),this.addBuiltInExtension("fileDragging",e)}var n={paste:!0,"anchor-preview":f.call(this),autoLink:g.call(this),keyboardCommands:_.call(this),placeholder:m.call(this)};Object.keys(n).forEach(function(t){n[t]&&this.addBuiltInExtension(t)},this);var i=this.options.extensions.toolbar;if(!i&&p.call(this)){var o=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});i=new t.extensions.toolbar(o)}i&&this.extensions.push(h(i,"toolbar",this))}function S(e,n){var i=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return n&&i.forEach(function(e){n.hasOwnProperty(e[0])&&void 0!==n[e[0]]&&t.util.deprecated(e[0],e[1],"v6.0.0")}),t.util.defaults({},n,e)}function T(e,n){var i,o,r=/^append-(.+)$/gi,a=/justify([A-Za-z]*)$/g;if(i=r.exec(e))return t.util.execFormatBlock(this.options.ownerDocument,i[1]);if("fontSize"===e)return n.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),o=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,o);if("fontName"===e)return n.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),o=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,o);if("createLink"===e)return this.createLink(n);if("image"===e){var s=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,s)}if("html"===e){var l=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,l)}if(a.exec(e)){var c=this.options.ownerDocument.execCommand(e,!1,null),u=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return u&&E.call(this,t.util.getTopBlockContainer(u)),c}return o=n&&n.value,this.options.ownerDocument.execCommand(e,!1,o)}function E(e){if(e){var n,i=Array.prototype.slice.call(e.childNodes).filter(function(t){var e="div"===t.nodeName.toLowerCase();return e&&!n&&(n=t.style.textAlign),e});i.length&&(this.saveSelection(),i.forEach(function(e){if(e.style.textAlign===n){var i=e.lastChild;if(i){t.util.unwrap(e,this.options.ownerDocument);var o=this.options.ownerDocument.createElement("BR");i.parentNode.insertBefore(o,i.nextSibling)}}},this),e.style.textAlign=n,this.restoreSelection())}}var D={};t.prototype={init:function(t,e){return this.options=S.call(this,this.defaults,e),this.origElements=t,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,x.call(this),C.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(t){"function"==typeof t.destroy&&t.destroy()},this),this.events.destroy(),this.elements.forEach(function(t){this.options.spellcheck&&(t.innerHTML=t.innerHTML),t.removeAttribute("contentEditable"),t.removeAttribute("spellcheck"),t.removeAttribute("data-medium-editor-element"),t.classList.remove("medium-editor-element"),t.removeAttribute("role"),t.removeAttribute("aria-multiline"),t.removeAttribute("medium-editor-index"),t.removeAttribute("data-medium-editor-editor-index"),t.getAttribute("medium-editor-textarea-id")&&u(t)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(t,e,n,i){return this.events.attachDOMEvent(t,e,n,i),this},off:function(t,e,n,i){return this.events.detachDOMEvent(t,e,n,i),this},subscribe:function(t,e){return this.events.attachCustomEvent(t,e),this},unsubscribe:function(t,e){return this.events.detachCustomEvent(t,e),this},trigger:function(t,e,n){return this.events.triggerCustomEvent(t,e,n),this},delay:function(t){var e=this;return setTimeout(function(){e.isActive&&t()},this.options.delay)},serialize:function(){var t,e,n={},i=this.elements.length;for(t=0;t<i;t+=1)e=""!==this.elements[t].id?this.elements[t].id:"element-"+t,n[e]={value:this.elements[t].innerHTML.trim()};return n},getExtensionByName:function(t){var e;return this.extensions&&this.extensions.length&&this.extensions.some(function(n){return n.name===t&&(e=n,!0)}),e},addBuiltInExtension:function(e,n){var i,o=this.getExtensionByName(e);if(o)return o;switch(e){case"anchor":i=t.util.extend({},this.options.anchor,n),o=new t.extensions.anchor(i);break;case"anchor-preview":o=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":o=new t.extensions.autoLink;break;case"fileDragging":o=new t.extensions.fileDragging(n);break;case"fontname":o=new t.extensions.fontName(this.options.fontName);break;case"fontsize":o=new t.extensions.fontSize(n);break;case"keyboardCommands":o=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":o=new t.extensions.paste(this.options.paste);break;case"placeholder":o=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(e)&&(n?(i=t.util.defaults({},n,t.extensions.button.prototype.defaults[e]),o=new t.extensions.button(i)):o=new t.extensions.button(e))}return o&&this.extensions.push(h(o,e,this)),o},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var t=this.getExtensionByName("toolbar");return t&&t.checkState(),this},queryCommandState:function(t){var e,n=/^full-(.+)$/gi,i=null;(e=n.exec(t))&&(t=e[1]);try{i=this.options.ownerDocument.queryCommandState(t)}catch(t){i=null}return i},execAction:function(e,n){var i,o;return i=/^full-(.+)$/gi.exec(e),i?(this.saveSelection(),this.selectAllContents(),o=T.call(this,i[1],n),this.restoreSelection()):o=T.call(this,e,n),"insertunorderedlist"!==e&&"insertorderedlist"!==e||t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),o},getSelectedParentElement:function(e){return void 0===e&&(e=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(e)},selectAllContents:function(){var e=t.selection.getSelectionElement(this.options.contentWindow);if(e){for(;1===e.children.length;)e=e.children[0];this.selectElement(e)}},selectElement:function(e){t.selection.selectNode(e,this.options.ownerDocument);var n=t.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var t;return this.elements.some(function(e){return!t&&e.getAttribute("data-medium-focused")&&(t=e),!!t},this),t},exportSelection:function(){var e=t.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(e),i=null;return n>=0&&(i=t.selection.exportSelection(e,this.options.ownerDocument)),null!==i&&0!==n&&(i.editableElementIndex=n),i},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(e,n){if(e){var i=this.elements[e.editableElementIndex||0];t.selection.importSelection(e,i,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(e){var n,i=t.selection.getSelectionElement(this.options.contentWindow),o={};if(-1!==this.elements.indexOf(i)){try{if(this.events.disableCustomEvent("editableInput"),e.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),(n=e.url||e.value)&&n.trim().length>0){var r=this.options.contentWindow.getSelection();if(r){var a,s,l,c,u=r.getRangeAt(0),d=u.commonAncestorContainer;if(3===u.endContainer.nodeType&&3!==u.startContainer.nodeType&&0===u.startOffset&&u.startContainer.firstChild===u.endContainer&&(d=u.endContainer),s=t.util.getClosestBlockContainer(u.startContainer),l=t.util.getClosestBlockContainer(u.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var h=s||i,p=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),p.appendChild(h.cloneNode(!0)),i===h?t.selection.select(this.options.ownerDocument,h.firstChild,0,h.lastChild,3===h.lastChild.nodeType?h.lastChild.nodeValue.length:h.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,h,0,h,h.childNodes.length);var f=this.exportSelection();c=t.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,p,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex}),0===c.length&&(p=this.options.ownerDocument.createDocumentFragment(),p.appendChild(d.cloneNode(!0)),c=[p.firstChild.firstChild,p.firstChild.lastChild]),t.util.createLink(this.options.ownerDocument,c,n.trim());var m=(p.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.util.insertHTMLCommand(this.options.ownerDocument,p.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=m,a.end-=m,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===e.target?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n),e.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),e.buttonClass)}}if(this.options.targetBlank||"_blank"===e.target||e.buttonClass){o=this.options.ownerDocument.createEvent("HTMLEvents"),o.initEvent("input",!0,!0,this.options.contentWindow);for(var g=0,v=this.elements.length;g<v;g+=1)this.elements[g].dispatchEvent(o)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",o,i)}},cleanPaste:function(t){this.getExtensionByName("paste").cleanPaste(t)},pasteHTML:function(t,e){this.getExtensionByName("paste").pasteHTML(t,e)},setContent:function(t,e){if(e=e||0,this.elements[e]){var n=this.elements[e];n.innerHTML=t,this.checkContentChanged(n)}},getContent:function(t){return t=t||0,this.elements[t]?this.elements[t].innerHTML.trim():null},checkContentChanged:function(e){e=e||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(e,{target:e,currentTarget:e})},resetContent:function(t){if(t){var e=this.elements.indexOf(t);return void(-1!==e&&this.setContent(D[t.getAttribute("medium-editor-index")],e))}this.elements.forEach(function(t,e){this.setContent(D[t.getAttribute("medium-editor-index")],e)},this)},addElements:function(t){var e=c(t,this.options.ownerDocument,!0);if(0===e.length)return!1;e.forEach(function(t){t=y.call(this,t,this.id),this.elements.push(t),this.trigger("addElement",{target:t,currentTarget:t},t)},this)},removeElements:function(t){var e=c(t,this.options.ownerDocument),n=e.map(function(t){return t.getAttribute("medium-editor-textarea-id")&&t.parentNode?t.parentNode.querySelector('div[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]'):t});this.elements=this.elements.filter(function(t){return-1===n.indexOf(t)||(this.events.cleanupElement(t),t.getAttribute("medium-editor-textarea-id")&&u(t),this.trigger("removeElement",{target:t,currentTarget:t},t),!1)},this)}},t.getEditorFromElement=function(t){var e=t.getAttribute("data-medium-editor-editor-index"),n=t&&t.ownerDocument&&(t.ownerDocument.defaultView||t.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[e]?n._mediumEditors[e]:null}}(),function(){t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}(),t.parseVersionString=function(t){var e=t.split("-"),n=e[0].split("."),i=e.length>1?e[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:i,toString:function(){return[n[0],n[1],n[2]].join(".")+(i?"-"+i:"")}}},t.version=t.parseVersionString.call(this,{version:"5.23.3"}.version),t}())}).call(e,n(21))},function(t,e,n){var i,o;/*! DataTables 1.10.16
|
5 |
+
* ©2008-2017 SpryMedia Ltd - datatables.net/license
|
6 |
+
*/
|
7 |
+
!function(r){"use strict";i=[n(0)],void 0!==(o=function(t){return r(t,window,document)}.apply(e,i))&&(t.exports=o)}(function(t,e,n,i){"use strict";function o(e){var n,i,r={};t.each(e,function(t,a){(n=t.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(n[1]+" ")&&(i=t.replace(n[0],n[2].toLowerCase()),r[i]=t,"o"===n[1]&&o(e[t]))}),e._hungarianMap=r}function r(e,n,a){e._hungarianMap||o(e);var s;t.each(n,function(o,l){(s=e._hungarianMap[o])===i||!a&&n[s]!==i||("o"===s.charAt(0)?(n[s]||(n[s]={}),t.extend(!0,n[s],n[o]),r(e[s],n[s],a)):n[s]=n[o])})}function a(t){var e=Gt.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&It(t,t,"sZeroRecords","sEmptyTable"),!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&It(t,t,"sZeroRecords","sLoadingRecords"),t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var i=t.sDecimal;i&&zt(i)}function s(t){fe(t,"ordering","bSort"),fe(t,"orderMulti","bSortMulti"),fe(t,"orderClasses","bSortClasses"),fe(t,"orderCellsTop","bSortCellsTop"),fe(t,"order","aaSorting"),fe(t,"orderFixed","aaSortingFixed"),fe(t,"paging","bPaginate"),fe(t,"pagingType","sPaginationType"),fe(t,"pageLength","iDisplayLength"),fe(t,"searching","bFilter"),"boolean"==typeof t.sScrollX&&(t.sScrollX=t.sScrollX?"100%":""),"boolean"==typeof t.scrollX&&(t.scrollX=t.scrollX?"100%":"");var e=t.aoSearchCols;if(e)for(var n=0,i=e.length;n<i;n++)e[n]&&r(Gt.models.oSearch,e[n])}function l(e){fe(e,"orderable","bSortable"),fe(e,"orderData","aDataSort"),fe(e,"orderSequence","asSorting"),fe(e,"orderDataType","sortDataType");var n=e.aDataSort;"number"!=typeof n||t.isArray(n)||(e.aDataSort=[n])}function c(n){if(!Gt.__browser){var i={};Gt.__browser=i;var o=t("<div/>").css({position:"fixed",top:0,left:-1*t(e).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(t("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t("<div/>").css({width:"100%",height:10}))).appendTo("body"),r=o.children(),a=r.children();i.barWidth=r[0].offsetWidth-r[0].clientWidth,i.bScrollOversize=100===a[0].offsetWidth&&100!==r[0].clientWidth,i.bScrollbarLeft=1!==Math.round(a.offset().left),i.bBounding=!!o[0].getBoundingClientRect().width,o.remove()}t.extend(n.oBrowser,Gt.__browser),n.oScroll.iBarWidth=Gt.__browser.barWidth}function u(t,e,n,o,r,a){var s,l=o,c=!1;for(n!==i&&(s=n,c=!0);l!==r;)t.hasOwnProperty(l)&&(s=c?e(s,t[l],l,t):t[l],c=!0,l+=a);return s}function d(e,i){var o=Gt.defaults.column,r=e.aoColumns.length,a=t.extend({},Gt.models.oColumn,o,{nTh:i||n.createElement("th"),sTitle:o.sTitle?o.sTitle:i?i.innerHTML:"",aDataSort:o.aDataSort?o.aDataSort:[r],mData:o.mData?o.mData:r,idx:r});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[r]=t.extend({},Gt.models.oSearch,s[r]),h(e,r,t(i).data())}function h(e,n,o){var a=e.aoColumns[n],s=e.oClasses,c=t(a.nTh);if(!a.sWidthOrig){a.sWidthOrig=c.attr("width")||null;var u=(c.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);u&&(a.sWidthOrig=u[1])}o!==i&&null!==o&&(l(o),r(Gt.defaults.column,o),o.mDataProp===i||o.mData||(o.mData=o.mDataProp),o.sType&&(a._sManualType=o.sType),o.className&&!o.sClass&&(o.sClass=o.className),o.sClass&&c.addClass(o.sClass),t.extend(a,o),It(a,o,"sWidth","sWidthOrig"),o.iDataSort!==i&&(a.aDataSort=[o.iDataSort]),It(a,o,"aDataSort"));var d=a.mData,h=D(d),p=a.mRender?D(a.mRender):null,f=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};a._bAttrSrc=t.isPlainObject(d)&&(f(d.sort)||f(d.type)||f(d.filter)),a._setter=null,a.fnGetData=function(t,e,n){var o=h(t,e,i,n);return p&&e?p(o,e,t,n):o},a.fnSetData=function(t,e,n){return A(d)(t,e,n)},"number"!=typeof d&&(e._rowReadObject=!0),e.oFeatures.bSort||(a.bSortable=!1,c.addClass(s.sSortableNone));var m=-1!==t.inArray("asc",a.asSorting),g=-1!==t.inArray("desc",a.asSorting);a.bSortable&&(m||g)?m&&!g?(a.sSortingClass=s.sSortableAsc,a.sSortingClassJUI=s.sSortJUIAscAllowed):!m&&g?(a.sSortingClass=s.sSortableDesc,a.sSortingClassJUI=s.sSortJUIDescAllowed):(a.sSortingClass=s.sSortable,a.sSortingClassJUI=s.sSortJUI):(a.sSortingClass=s.sSortableNone,a.sSortingClassJUI="")}function p(t){if(!1!==t.oFeatures.bAutoWidth){var e=t.aoColumns;vt(t);for(var n=0,i=e.length;n<i;n++)e[n].nTh.style.width=e[n].sWidth}var o=t.oScroll;""===o.sY&&""===o.sX||mt(t),$t(t,null,"column-sizing",[t])}function f(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function m(e,n){var i=v(e,"bVisible"),o=t.inArray(n,i);return-1!==o?o:null}function g(e){var n=0;return t.each(e.aoColumns,function(e,i){i.bVisible&&"none"!==t(i.nTh).css("display")&&n++}),n}function v(e,n){var i=[];return t.map(e.aoColumns,function(t,e){t[n]&&i.push(e)}),i}function _(t){var e,n,o,r,a,s,l,c,u,d=t.aoColumns,h=t.aoData,p=Gt.ext.type.detect;for(e=0,n=d.length;e<n;e++)if(l=d[e],u=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(o=0,r=p.length;o<r;o++){for(a=0,s=h.length;a<s&&(u[a]===i&&(u[a]=S(t,a,e,"type")),(c=p[o](u[a],t))||o===p.length-1)&&"html"!==c;a++);if(c){l.sType=c;break}}l.sType||(l.sType="string")}}function b(e,n,o,r){var a,s,l,c,u,h,p,f=e.aoColumns;if(n)for(a=n.length-1;a>=0;a--){p=n[a];var m=p.targets!==i?p.targets:p.aTargets;for(t.isArray(m)||(m=[m]),l=0,c=m.length;l<c;l++)if("number"==typeof m[l]&&m[l]>=0){for(;f.length<=m[l];)d(e);r(m[l],p)}else if("number"==typeof m[l]&&m[l]<0)r(f.length+m[l],p);else if("string"==typeof m[l])for(u=0,h=f.length;u<h;u++)("_all"==m[l]||t(f[u].nTh).hasClass(m[l]))&&r(u,p)}if(o)for(a=0,s=o.length;a<s;a++)r(a,o[a])}function w(e,n,o,r){var a=e.aoData.length,s=t.extend(!0,{},Gt.models.oRow,{src:o?"dom":"data",idx:a});s._aData=n,e.aoData.push(s);for(var l=e.aoColumns,c=0,u=l.length;c<u;c++)l[c].sType=null;e.aiDisplayMaster.push(a);var d=e.rowIdFn(n);return d!==i&&(e.aIds[d]=s),!o&&e.oFeatures.bDeferRender||L(e,a,o,r),a}function y(e,n){var i;return n instanceof t||(n=t(n)),n.map(function(t,n){return i=I(e,n),w(e,i.data,n,i.cells)})}function C(t,e){return e._DT_RowIndex!==i?e._DT_RowIndex:null}function x(e,n,i){return t.inArray(i,e.aoData[n].anCells)}function S(t,e,n,o){var r=t.iDraw,a=t.aoColumns[n],s=t.aoData[e]._aData,l=a.sDefaultContent,c=a.fnGetData(s,o,{settings:t,row:e,col:n});if(c===i)return t.iDrawError!=r&&null===l&&(Ot(t,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+e+", column "+n,4),t.iDrawError=r),l;if(c!==s&&null!==c||null===l||o===i){if("function"==typeof c)return c.call(s)}else c=l;return null===c&&"display"==o?"":c}function T(t,e,n,i){var o=t.aoColumns[n],r=t.aoData[e]._aData;o.fnSetData(r,i,{settings:t,row:e,col:n})}function E(e){return t.map(e.match(/(\\.|[^\.])+/g)||[""],function(t){return t.replace(/\\\./g,".")})}function D(e){if(t.isPlainObject(e)){var n={};return t.each(e,function(t,e){e&&(n[t]=D(e))}),function(t,e,o,r){var a=n[e]||n._;return a!==i?a(t,e,o,r):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,n,i,o){return e(t,n,i,o)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){return t[e]};var o=function(e,n,r){var a,s,l,c;if(""!==r)for(var u=E(r),d=0,h=u.length;d<h;d++){if(a=u[d].match(me),s=u[d].match(ge),a){if(u[d]=u[d].replace(me,""),""!==u[d]&&(e=e[u[d]]),l=[],u.splice(0,d+1),c=u.join("."),t.isArray(e))for(var p=0,f=e.length;p<f;p++)l.push(o(e[p],n,c));var m=a[0].substring(1,a[0].length-1);e=""===m?l:l.join(m);break}if(s)u[d]=u[d].replace(ge,""),e=e[u[d]]();else{if(null===e||e[u[d]]===i)return i;e=e[u[d]]}}return e};return function(t,n){return o(t,n,e)}}function A(e){if(t.isPlainObject(e))return A(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,n,i){e(t,"set",n,i)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){t[e]=n};var n=function(e,o,r){for(var a,s,l,c,u,d=E(r),h=d[d.length-1],p=0,f=d.length-1;p<f;p++){if(s=d[p].match(me),l=d[p].match(ge),s){if(d[p]=d[p].replace(me,""),e[d[p]]=[],a=d.slice(),a.splice(0,p+1),u=a.join("."),t.isArray(o))for(var m=0,g=o.length;m<g;m++)c={},n(c,o[m],u),e[d[p]].push(c);else e[d[p]]=o;return}l&&(d[p]=d[p].replace(ge,""),e=e[d[p]](o)),null!==e[d[p]]&&e[d[p]]!==i||(e[d[p]]={}),e=e[d[p]]}h.match(ge)?e=e[h.replace(ge,"")](o):e[h.replace(me,"")]=o};return function(t,i){return n(t,i,e)}}function k(t){return se(t.aoData,"_aData")}function N(t){t.aoData.length=0,t.aiDisplayMaster.length=0,t.aiDisplay.length=0,t.aIds={}}function R(t,e,n){for(var o=-1,r=0,a=t.length;r<a;r++)t[r]==e?o=r:t[r]>e&&t[r]--;-1!=o&&n===i&&t.splice(o,1)}function O(t,e,n,o){var r,a,s=t.aoData[e],l=function(n,i){for(;n.childNodes.length;)n.removeChild(n.firstChild);n.innerHTML=S(t,e,i,"display")};if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var c=s.anCells;if(c)if(o!==i)l(c[o],o);else for(r=0,a=c.length;r<a;r++)l(c[r],r)}else s._aData=I(t,s,o,o===i?i:s._aData).data;s._aSortData=null,s._aFilterData=null;var u=t.aoColumns;if(o!==i)u[o].sType=null;else{for(r=0,a=u.length;r<a;r++)u[r].sType=null;P(t,s)}}function I(e,n,o,r){var a,s,l,c=[],u=n.firstChild,d=0,h=e.aoColumns,p=e._rowReadObject;r=r!==i?r:p?{}:[];var f=function(t,e){if("string"==typeof t){var n=t.indexOf("@");if(-1!==n){var i=t.substring(n+1);A(t)(r,e.getAttribute(i))}}},m=function(e){if(o===i||o===d)if(s=h[d],l=t.trim(e.innerHTML),s&&s._bAttrSrc){var n=A(s.mData._);n(r,l),f(s.mData.sort,e),f(s.mData.type,e),f(s.mData.filter,e)}else p?(s._setter||(s._setter=A(s.mData)),s._setter(r,l)):r[d]=l;d++};if(u)for(;u;)a=u.nodeName.toUpperCase(),"TD"!=a&&"TH"!=a||(m(u),c.push(u)),u=u.nextSibling;else{c=n.anCells;for(var g=0,v=c.length;g<v;g++)m(c[g])}var _=n.firstChild?n:n.nTr;if(_){var b=_.getAttribute("id");b&&A(e.rowId)(r,b)}return{data:r,cells:c}}function L(e,i,o,r){var a,s,l,c,u,d=e.aoData[i],h=d._aData,p=[];if(null===d.nTr){for(a=o||n.createElement("tr"),d.nTr=a,d.anCells=p,a._DT_RowIndex=i,P(e,d),c=0,u=e.aoColumns.length;c<u;c++)l=e.aoColumns[c],s=o?r[c]:n.createElement(l.sCellType),s._DT_CellIndex={row:i,column:c},p.push(s),o&&!l.mRender&&l.mData===c||t.isPlainObject(l.mData)&&l.mData._===c+".display"||(s.innerHTML=S(e,i,c,"display")),l.sClass&&(s.className+=" "+l.sClass),l.bVisible&&!o?a.appendChild(s):!l.bVisible&&o&&s.parentNode.removeChild(s),l.fnCreatedCell&&l.fnCreatedCell.call(e.oInstance,s,S(e,i,c),h,i,c);$t(e,"aoRowCreatedCallback",null,[a,h,i])}d.nTr.setAttribute("role","row")}function P(e,n){var i=n.nTr,o=n._aData;if(i){var r=e.rowIdFn(o);if(r&&(i.id=r),o.DT_RowClass){var a=o.DT_RowClass.split(" ");n.__rowc=n.__rowc?pe(n.__rowc.concat(a)):a,t(i).removeClass(n.__rowc.join(" ")).addClass(o.DT_RowClass)}o.DT_RowAttr&&t(i).attr(o.DT_RowAttr),o.DT_RowData&&t(i).data(o.DT_RowData)}}function M(e){var n,i,o,r,a,s=e.nTHead,l=e.nTFoot,c=0===t("th, td",s).length,u=e.oClasses,d=e.aoColumns;for(c&&(r=t("<tr/>").appendTo(s)),n=0,i=d.length;n<i;n++)a=d[n],o=t(a.nTh).addClass(a.sClass),c&&o.appendTo(r),e.oFeatures.bSort&&(o.addClass(a.sSortingClass),!1!==a.bSortable&&(o.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId),Et(e,a.nTh,n))),a.sTitle!=o[0].innerHTML&&o.html(a.sTitle),Ht(e,"header")(e,o,a,u);if(c&&j(e.aoHeader,s),t(s).find(">tr").attr("role","row"),t(s).find(">tr>th, >tr>td").addClass(u.sHeaderTH),t(l).find(">tr>th, >tr>td").addClass(u.sFooterTH),null!==l){var h=e.aoFooter[0];for(n=0,i=h.length;n<i;n++)a=d[n],a.nTf=h[n].cell,a.sClass&&t(a.nTf).addClass(a.sClass)}}function $(e,n,o){var r,a,s,l,c,u,d,h,p,f=[],m=[],g=e.aoColumns.length;if(n){for(o===i&&(o=!1),r=0,a=n.length;r<a;r++){for(f[r]=n[r].slice(),f[r].nTr=n[r].nTr,s=g-1;s>=0;s--)e.aoColumns[s].bVisible||o||f[r].splice(s,1);m.push([])}for(r=0,a=f.length;r<a;r++){if(d=f[r].nTr)for(;u=d.firstChild;)d.removeChild(u);for(s=0,l=f[r].length;s<l;s++)if(h=1,p=1,m[r][s]===i){for(d.appendChild(f[r][s].cell),m[r][s]=1;f[r+h]!==i&&f[r][s].cell==f[r+h][s].cell;)m[r+h][s]=1,h++;for(;f[r][s+p]!==i&&f[r][s].cell==f[r][s+p].cell;){for(c=0;c<h;c++)m[r+c][s+p]=1;p++}t(f[r][s].cell).attr("rowspan",h).attr("colspan",p)}}}}function F(e){var n=$t(e,"aoPreDrawCallback","preDraw",[e]);if(-1!==t.inArray(!1,n))return void pt(e,!1);var o=[],r=0,a=e.asStripeClasses,s=a.length,l=(e.aoOpenRows.length,e.oLanguage),c=e.iInitDisplayStart,u="ssp"==Bt(e),d=e.aiDisplay;e.bDrawing=!0,c!==i&&-1!==c&&(e._iDisplayStart=u?c:c>=e.fnRecordsDisplay()?0:c,e.iInitDisplayStart=-1);var h=e._iDisplayStart,p=e.fnDisplayEnd();if(e.bDeferLoading)e.bDeferLoading=!1,e.iDraw++,pt(e,!1);else if(u){if(!e.bDestroying&&!q(e))return}else e.iDraw++;if(0!==d.length)for(var f=u?0:h,m=u?e.aoData.length:p,v=f;v<m;v++){var _=d[v],b=e.aoData[_];null===b.nTr&&L(e,_);var w=b.nTr;if(0!==s){var y=a[r%s];b._sRowStripe!=y&&(t(w).removeClass(b._sRowStripe).addClass(y),b._sRowStripe=y)}$t(e,"aoRowCallback",null,[w,b._aData,r,v]),o.push(w),r++}else{var C=l.sZeroRecords;1==e.iDraw&&"ajax"==Bt(e)?C=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(C=l.sEmptyTable),o[0]=t("<tr/>",{class:s?a[0]:""}).append(t("<td />",{valign:"top",colSpan:g(e),class:e.oClasses.sRowEmpty}).html(C))[0]}$t(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],k(e),h,p,d]),$t(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],k(e),h,p,d]);var x=t(e.nTBody);x.children().detach(),x.append(t(o)),$t(e,"aoDrawCallback","draw",[e]),e.bSorted=!1,e.bFiltered=!1,e.bDrawing=!1}function H(t,e){var n=t.oFeatures,i=n.bSort,o=n.bFilter;i&&xt(t),o?Y(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice(),!0!==e&&(t._iDisplayStart=0),t._drawHold=e,F(t),t._drawHold=!1}function B(e){var n=e.oClasses,i=t(e.nTable),o=t("<div/>").insertBefore(i),r=e.oFeatures,a=t("<div/>",{id:e.sTableId+"_wrapper",class:n.sWrapper+(e.nTFoot?"":" "+n.sNoFooter)});e.nHolding=o[0],e.nTableWrapper=a[0],e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,c,u,d,h,p=e.sDom.split(""),f=0;f<p.length;f++){if(s=null,"<"==(l=p[f])){if(c=t("<div/>")[0],"'"==(u=p[f+1])||'"'==u){for(d="",h=2;p[f+h]!=u;)d+=p[f+h],h++;if("H"==d?d=n.sJUIHeader:"F"==d&&(d=n.sJUIFooter),-1!=d.indexOf(".")){var m=d.split(".");c.id=m[0].substr(1,m[0].length-1),c.className=m[1]}else"#"==d.charAt(0)?c.id=d.substr(1,d.length-1):c.className=d;f+=h}a.append(c),a=t(c)}else if(">"==l)a=a.parent();else if("l"==l&&r.bPaginate&&r.bLengthChange)s=ct(e);else if("f"==l&&r.bFilter)s=G(e);else if("r"==l&&r.bProcessing)s=ht(e);else if("t"==l)s=ft(e);else if("i"==l&&r.bInfo)s=it(e);else if("p"==l&&r.bPaginate)s=ut(e);else if(0!==Gt.ext.feature.length)for(var g=Gt.ext.feature,v=0,_=g.length;v<_;v++)if(l==g[v].cFeature){s=g[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]),b[l].push(s),a.append(s)}}o.replaceWith(a),e.nHolding=null}function j(e,n){var i,o,r,a,s,l,c,u,d,h,p,f=t(n).children("tr");for(e.splice(0,e.length),r=0,l=f.length;r<l;r++)e.push([]);for(r=0,l=f.length;r<l;r++)for(i=f[r],u=0,o=i.firstChild;o;){if("TD"==o.nodeName.toUpperCase()||"TH"==o.nodeName.toUpperCase())for(d=1*o.getAttribute("colspan"),h=1*o.getAttribute("rowspan"),d=d&&0!==d&&1!==d?d:1,h=h&&0!==h&&1!==h?h:1,c=function(t,e,n){for(var i=t[e];i[n];)n++;return n}(e,r,u),p=1===d,s=0;s<d;s++)for(a=0;a<h;a++)e[r+a][c+s]={cell:o,unique:p},e[r+a].nTr=i;o=o.nextSibling}}function z(t,e,n){var i=[];n||(n=t.aoHeader,e&&(n=[],j(n,e)));for(var o=0,r=n.length;o<r;o++)for(var a=0,s=n[o].length;a<s;a++)!n[o][a].unique||i[a]&&t.bSortCellsTop||(i[a]=n[o][a].cell);return i}function W(e,n,i){if($t(e,"aoServerParams","serverParams",[n]),n&&t.isArray(n)){var o={},r=/(.*?)\[\]$/;t.each(n,function(t,e){var n=e.name.match(r);if(n){var i=n[0];o[i]||(o[i]=[]),o[i].push(e.value)}else o[e.name]=e.value}),n=o}var a,s=e.ajax,l=e.oInstance,c=function(t){$t(e,null,"xhr",[e,t,e.jqXHR]),i(t)};if(t.isPlainObject(s)&&s.data){a=s.data;var u=t.isFunction(a)?a(n,e):a;n=t.isFunction(a)&&u?u:t.extend(!0,n,u),delete s.data}var d={data:n,success:function(t){var n=t.error||t.sError;n&&Ot(e,0,n),e.json=t,c(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(n,i,o){var r=$t(e,null,"xhr",[e,null,e.jqXHR]);-1===t.inArray(!0,r)&&("parsererror"==i?Ot(e,0,"Invalid JSON response",1):4===n.readyState&&Ot(e,0,"Ajax error",7)),pt(e,!1)}};e.oAjaxData=n,$t(e,null,"preXhr",[e,n]),e.fnServerData?e.fnServerData.call(l,e.sAjaxSource,t.map(n,function(t,e){return{name:e,value:t}}),c,e):e.sAjaxSource||"string"==typeof s?e.jqXHR=t.ajax(t.extend(d,{url:s||e.sAjaxSource})):t.isFunction(s)?e.jqXHR=s.call(l,n,c,e):(e.jqXHR=t.ajax(t.extend(d,s)),s.data=a)}function q(t){return!t.bAjaxDataGet||(t.iDraw++,pt(t,!0),W(t,U(t),function(e){K(t,e)}),!1)}function U(e){var n,i,o,r,a=e.aoColumns,s=a.length,l=e.oFeatures,c=e.oPreviousSearch,u=e.aoPreSearchCols,d=[],h=Ct(e),p=e._iDisplayStart,f=!1!==l.bPaginate?e._iDisplayLength:-1,m=function(t,e){d.push({name:t,value:e})};m("sEcho",e.iDraw),m("iColumns",s),m("sColumns",se(a,"sName").join(",")),m("iDisplayStart",p),m("iDisplayLength",f);var g={draw:e.iDraw,columns:[],order:[],start:p,length:f,search:{value:c.sSearch,regex:c.bRegex}};for(n=0;n<s;n++)o=a[n],r=u[n],i="function"==typeof o.mData?"function":o.mData,g.columns.push({data:i,name:o.sName,searchable:o.bSearchable,orderable:o.bSortable,search:{value:r.sSearch,regex:r.bRegex}}),m("mDataProp_"+n,i),l.bFilter&&(m("sSearch_"+n,r.sSearch),m("bRegex_"+n,r.bRegex),m("bSearchable_"+n,o.bSearchable)),l.bSort&&m("bSortable_"+n,o.bSortable);l.bFilter&&(m("sSearch",c.sSearch),m("bRegex",c.bRegex)),l.bSort&&(t.each(h,function(t,e){g.order.push({column:e.col,dir:e.dir}),m("iSortCol_"+t,e.col),m("sSortDir_"+t,e.dir)}),m("iSortingCols",h.length));var v=Gt.ext.legacy.ajax;return null===v?e.sAjaxSource?d:g:v?d:g}function K(t,e){var n=function(t,n){return e[t]!==i?e[t]:e[n]},o=V(t,e),r=n("sEcho","draw"),a=n("iTotalRecords","recordsTotal"),s=n("iTotalDisplayRecords","recordsFiltered");if(r){if(1*r<t.iDraw)return;t.iDraw=1*r}N(t),t._iRecordsTotal=parseInt(a,10),t._iRecordsDisplay=parseInt(s,10);for(var l=0,c=o.length;l<c;l++)w(t,o[l]);t.aiDisplay=t.aiDisplayMaster.slice(),t.bAjaxDataGet=!1,F(t),t._bInitComplete||st(t,e),t.bAjaxDataGet=!0,pt(t,!1)}function V(e,n){var o=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==i?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===o?n.aaData||n[o]:""!==o?D(o)(n):n}function G(e){var i=e.oClasses,o=e.sTableId,r=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='<input type="search" class="'+i.sFilterInput+'"/>',c=r.sSearch;c=c.match(/_INPUT_/)?c.replace("_INPUT_",l):c+l;var u=t("<div/>",{id:s.f?null:o+"_filter",class:i.sFilter}).append(t("<label/>").append(c)),d=function(){var t=(s.f,this.value?this.value:"");t!=a.sSearch&&(Y(e,{sSearch:t,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive}),e._iDisplayStart=0,F(e))},h=null!==e.searchDelay?e.searchDelay:"ssp"===Bt(e)?400:0,p=t("input",u).val(a.sSearch).attr("placeholder",r.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",h?ye(d,h):d).on("keypress.DT",function(t){if(13==t.keyCode)return!1}).attr("aria-controls",o);return t(e.nTable).on("search.dt.DT",function(t,i){if(e===i)try{p[0]!==n.activeElement&&p.val(a.sSearch)}catch(t){}}),u[0]}function Y(t,e,n){var o=t.oPreviousSearch,r=t.aoPreSearchCols,a=function(t){o.sSearch=t.sSearch,o.bRegex=t.bRegex,o.bSmart=t.bSmart,o.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==i?!t.bEscapeRegex:t.bRegex};if(_(t),"ssp"!=Bt(t)){Q(t,e.sSearch,n,s(e),e.bSmart,e.bCaseInsensitive),a(e);for(var l=0;l<r.length;l++)J(t,r[l].sSearch,l,s(r[l]),r[l].bSmart,r[l].bCaseInsensitive);X(t)}else a(e);t.bFiltered=!0,$t(t,null,"search",[t])}function X(e){for(var n,i,o=Gt.ext.search,r=e.aiDisplay,a=0,s=o.length;a<s;a++){for(var l=[],c=0,u=r.length;c<u;c++)i=r[c],n=e.aoData[i],o[a](e,n._aFilterData,i,n._aData,c)&&l.push(i);r.length=0,t.merge(r,l)}}function J(t,e,n,i,o,r){if(""!==e){for(var a,s=[],l=t.aiDisplay,c=Z(e,i,o,r),u=0;u<l.length;u++)a=t.aoData[l[u]]._aFilterData[n],c.test(a)&&s.push(l[u]);t.aiDisplay=s}}function Q(t,e,n,i,o,r){var a,s,l,c=Z(e,i,o,r),u=t.oPreviousSearch.sSearch,d=t.aiDisplayMaster,h=[];if(0!==Gt.ext.search.length&&(n=!0),s=tt(t),e.length<=0)t.aiDisplay=d.slice();else{for((s||n||u.length>e.length||0!==e.indexOf(u)||t.bSorted)&&(t.aiDisplay=d.slice()),a=t.aiDisplay,l=0;l<a.length;l++)c.test(t.aoData[a[l]]._sFilterRow)&&h.push(a[l]);t.aiDisplay=h}}function Z(e,n,i,o){return e=n?e:ve(e),i&&(e="^(?=.*?"+t.map(e.match(/"[^"]+"|[^ ]+/g)||[""],function(t){if('"'===t.charAt(0)){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")}).join(")(?=.*?")+").*$"),new RegExp(e,o?"i":"")}function tt(t){var e,n,i,o,r,a,s,l,c=t.aoColumns,u=Gt.ext.type.search,d=!1;for(n=0,o=t.aoData.length;n<o;n++)if(l=t.aoData[n],!l._aFilterData){for(a=[],i=0,r=c.length;i<r;i++)e=c[i],e.bSearchable?(s=S(t,n,i,"filter"),u[e.sType]&&(s=u[e.sType](s)),null===s&&(s=""),"string"!=typeof s&&s.toString&&(s=s.toString())):s="",s.indexOf&&-1!==s.indexOf("&")&&(_e.innerHTML=s,s=be?_e.textContent:_e.innerText),s.replace&&(s=s.replace(/[\r\n]/g,"")),a.push(s);l._aFilterData=a,l._sFilterRow=a.join(" "),d=!0}return d}function et(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function nt(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function it(e){var n=e.sTableId,i=e.aanFeatures.i,o=t("<div/>",{class:e.oClasses.sInfo,id:i?null:n+"_info"});return i||(e.aoDrawCallback.push({fn:ot,sName:"information"}),o.attr("role","status").attr("aria-live","polite"),t(e.nTable).attr("aria-describedby",n+"_info")),o[0]}function ot(e){var n=e.aanFeatures.i;if(0!==n.length){var i=e.oLanguage,o=e._iDisplayStart+1,r=e.fnDisplayEnd(),a=e.fnRecordsTotal(),s=e.fnRecordsDisplay(),l=s?i.sInfo:i.sInfoEmpty;s!==a&&(l+=" "+i.sInfoFiltered),l+=i.sInfoPostFix,l=rt(e,l);var c=i.fnInfoCallback;null!==c&&(l=c.call(e.oInstance,e,o,r,a,s,l)),t(n).html(l)}}function rt(t,e){var n=t.fnFormatNumber,i=t._iDisplayStart+1,o=t._iDisplayLength,r=t.fnRecordsDisplay(),a=-1===o;return e.replace(/_START_/g,n.call(t,i)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,r)).replace(/_PAGE_/g,n.call(t,a?1:Math.ceil(i/o))).replace(/_PAGES_/g,n.call(t,a?1:Math.ceil(r/o)))}function at(t){var e,n,i,o=t.iInitDisplayStart,r=t.aoColumns,a=t.oFeatures,s=t.bDeferLoading;if(!t.bInitialised)return void setTimeout(function(){at(t)},200);for(B(t),M(t),$(t,t.aoHeader),$(t,t.aoFooter),pt(t,!0),a.bAutoWidth&&vt(t),e=0,n=r.length;e<n;e++)i=r[e],i.sWidth&&(i.nTh.style.width=yt(i.sWidth));$t(t,null,"preInit",[t]),H(t);var l=Bt(t);("ssp"!=l||s)&&("ajax"==l?W(t,[],function(n){var i=V(t,n);for(e=0;e<i.length;e++)w(t,i[e]);t.iInitDisplayStart=o,H(t),pt(t,!1),st(t,n)},t):(pt(t,!1),st(t)))}function st(t,e){t._bInitComplete=!0,(e||t.oInit.aaData)&&p(t),$t(t,null,"plugin-init",[t,e]),$t(t,"aoInitComplete","init",[t,e])}function lt(t,e){var n=parseInt(e,10);t._iDisplayLength=n,Ft(t),$t(t,null,"length",[t,n])}function ct(e){for(var n=e.oClasses,i=e.sTableId,o=e.aLengthMenu,r=t.isArray(o[0]),a=r?o[0]:o,s=r?o[1]:o,l=t("<select/>",{name:i+"_length","aria-controls":i,class:n.sLengthSelect}),c=0,u=a.length;c<u;c++)l[0][c]=new Option("number"==typeof s[c]?e.fnFormatNumber(s[c]):s[c],a[c]);var d=t("<div><label/></div>").addClass(n.sLength);return e.aanFeatures.l||(d[0].id=i+"_length"),d.children().append(e.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML)),t("select",d).val(e._iDisplayLength).on("change.DT",function(n){lt(e,t(this).val()),F(e)}),t(e.nTable).on("length.dt.DT",function(n,i,o){e===i&&t("select",d).val(o)}),d[0]}function ut(e){var n=e.sPaginationType,i=Gt.ext.pager[n],o="function"==typeof i,r=function(t){F(t)},a=t("<div/>").addClass(e.oClasses.sPaging+n)[0],s=e.aanFeatures;return o||i.fnInit(e,a,r),s.p||(a.id=e.sTableId+"_paginate",e.aoDrawCallback.push({fn:function(t){if(o){var e,n,a=t._iDisplayStart,l=t._iDisplayLength,c=t.fnRecordsDisplay(),u=-1===l,d=u?0:Math.ceil(a/l),h=u?1:Math.ceil(c/l),p=i(d,h);for(e=0,n=s.p.length;e<n;e++)Ht(t,"pageButton")(t,s.p[e],e,p,d,h)}else i.fnUpdate(t,r)},sName:"pagination"})),a}function dt(t,e,n){var i=t._iDisplayStart,o=t._iDisplayLength,r=t.fnRecordsDisplay();0===r||-1===o?i=0:"number"==typeof e?(i=e*o)>r&&(i=0):"first"==e?i=0:"previous"==e?(i=o>=0?i-o:0)<0&&(i=0):"next"==e?i+o<r&&(i+=o):"last"==e?i=Math.floor((r-1)/o)*o:Ot(t,0,"Unknown paging action: "+e,5);var a=t._iDisplayStart!==i;return t._iDisplayStart=i,a&&($t(t,null,"page",[t]),n&&F(t)),a}function ht(e){return t("<div/>",{id:e.aanFeatures.r?null:e.sTableId+"_processing",class:e.oClasses.sProcessing}).html(e.oLanguage.sProcessing).insertBefore(e.nTable)[0]}function pt(e,n){e.oFeatures.bProcessing&&t(e.aanFeatures.r).css("display",n?"block":"none"),$t(e,null,"processing",[e,n])}function ft(e){var n=t(e.nTable);n.attr("role","grid");var i=e.oScroll;if(""===i.sX&&""===i.sY)return e.nTable;var o=i.sX,r=i.sY,a=e.oClasses,s=n.children("caption"),l=s.length?s[0]._captionSide:null,c=t(n[0].cloneNode(!1)),u=t(n[0].cloneNode(!1)),d=n.children("tfoot"),h="<div/>",p=function(t){return t?yt(t):null};d.length||(d=null);var f=t(h,{class:a.sScrollWrapper}).append(t(h,{class:a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:o?p(o):"100%"}).append(t(h,{class:a.sScrollHeadInner}).css({"box-sizing":"content-box",width:i.sXInner||"100%"}).append(c.removeAttr("id").css("margin-left",0).append("top"===l?s:null).append(n.children("thead"))))).append(t(h,{class:a.sScrollBody}).css({position:"relative",overflow:"auto",width:p(o)}).append(n));d&&f.append(t(h,{class:a.sScrollFoot}).css({overflow:"hidden",border:0,width:o?p(o):"100%"}).append(t(h,{class:a.sScrollFootInner}).append(u.removeAttr("id").css("margin-left",0).append("bottom"===l?s:null).append(n.children("tfoot")))));var m=f.children(),g=m[0],v=m[1],_=d?m[2]:null;return o&&t(v).on("scroll.DT",function(t){var e=this.scrollLeft;g.scrollLeft=e,d&&(_.scrollLeft=e)}),t(v).css(r&&i.bCollapse?"max-height":"height",r),e.nScrollHead=g,e.nScrollBody=v,e.nScrollFoot=_,e.aoDrawCallback.push({fn:mt,sName:"scrolling"}),f[0]}function mt(e){var n,o,r,a,s,l,c,u,d,h=e.oScroll,m=h.sX,g=h.sXInner,v=h.sY,_=h.iBarWidth,b=t(e.nScrollHead),w=b[0].style,y=b.children("div"),C=y[0].style,x=y.children("table"),S=e.nScrollBody,T=t(S),E=S.style,D=t(e.nScrollFoot),A=D.children("div"),k=A.children("table"),N=t(e.nTHead),R=t(e.nTable),O=R[0],I=O.style,L=e.nTFoot?t(e.nTFoot):null,P=e.oBrowser,M=P.bScrollOversize,$=se(e.aoColumns,"nTh"),F=[],H=[],B=[],j=[],W=function(t){var e=t.style;e.paddingTop="0",e.paddingBottom="0",e.borderTopWidth="0",e.borderBottomWidth="0",e.height=0},q=S.scrollHeight>S.clientHeight;if(e.scrollBarVis!==q&&e.scrollBarVis!==i)return e.scrollBarVis=q,void p(e);e.scrollBarVis=q,R.children("thead, tfoot").remove(),L&&(l=L.clone().prependTo(R),o=L.find("tr"),a=l.find("tr")),s=N.clone().prependTo(R),n=N.find("tr"),r=s.find("tr"),s.find("th, td").removeAttr("tabindex"),m||(E.width="100%",b[0].style.width="100%"),t.each(z(e,s),function(t,n){c=f(e,t),n.style.width=e.aoColumns[c].sWidth}),L&>(function(t){t.style.width=""},a),d=R.outerWidth(),""===m?(I.width="100%",M&&(R.find("tbody").height()>S.offsetHeight||"scroll"==T.css("overflow-y"))&&(I.width=yt(R.outerWidth()-_)),d=R.outerWidth()):""!==g&&(I.width=yt(g),d=R.outerWidth()),gt(W,r),gt(function(e){B.push(e.innerHTML),F.push(yt(t(e).css("width")))},r),gt(function(e,n){-1!==t.inArray(e,$)&&(e.style.width=F[n])},n),t(r).height(0),L&&(gt(W,a),gt(function(e){j.push(e.innerHTML),H.push(yt(t(e).css("width")))},a),gt(function(t,e){t.style.width=H[e]},o),t(a).height(0)),gt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[e]+"</div>",t.style.width=F[e]},r),L&>(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+j[e]+"</div>",t.style.width=H[e]},a),R.outerWidth()<d?(u=S.scrollHeight>S.offsetHeight||"scroll"==T.css("overflow-y")?d+_:d,M&&(S.scrollHeight>S.offsetHeight||"scroll"==T.css("overflow-y"))&&(I.width=yt(u-_)),""!==m&&""===g||Ot(e,1,"Possible column misalignment",6)):u="100%",E.width=yt(u),w.width=yt(u),L&&(e.nScrollFoot.style.width=yt(u)),v||M&&(E.height=yt(O.offsetHeight+_));var U=R.outerWidth();x[0].style.width=yt(U),C.width=yt(U);var K=R.height()>S.clientHeight||"scroll"==T.css("overflow-y"),V="padding"+(P.bScrollbarLeft?"Left":"Right");C[V]=K?_+"px":"0px",L&&(k[0].style.width=yt(U),A[0].style.width=yt(U),A[0].style[V]=K?_+"px":"0px"),R.children("colgroup").insertBefore(R.children("thead")),T.scroll(),!e.bSorted&&!e.bFiltered||e._drawHold||(S.scrollTop=0)}function gt(t,e,n){for(var i,o,r=0,a=0,s=e.length;a<s;){for(i=e[a].firstChild,o=n?n[a].firstChild:null;i;)1===i.nodeType&&(n?t(i,o,r):t(i,r),r++),i=i.nextSibling,o=n?o.nextSibling:null;a++}}function vt(n){var i,o,r,a=n.nTable,s=n.aoColumns,l=n.oScroll,c=l.sY,u=l.sX,d=l.sXInner,h=s.length,m=v(n,"bVisible"),_=t("th",n.nTHead),b=a.getAttribute("width"),w=a.parentNode,y=!1,C=n.oBrowser,x=C.bScrollOversize,S=a.style.width;for(S&&-1!==S.indexOf("%")&&(b=S),i=0;i<m.length;i++)o=s[m[i]],null!==o.sWidth&&(o.sWidth=_t(o.sWidthOrig,w),y=!0);if(x||!y&&!u&&!c&&h==g(n)&&h==_.length)for(i=0;i<h;i++){var T=f(n,i);null!==T&&(s[T].sWidth=yt(_.eq(i).width()))}else{var E=t(a).clone().css("visibility","hidden").removeAttr("id");E.find("tbody tr").remove();var D=t("<tr/>").appendTo(E.find("tbody"));for(E.find("thead, tfoot").remove(),E.append(t(n.nTHead).clone()).append(t(n.nTFoot).clone()),E.find("tfoot th, tfoot td").css("width",""),_=z(n,E.find("thead")[0]),i=0;i<m.length;i++)o=s[m[i]],_[i].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?yt(o.sWidthOrig):"",o.sWidthOrig&&u&&t(_[i]).append(t("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(n.aoData.length)for(i=0;i<m.length;i++)r=m[i],o=s[r],t(bt(n,r)).clone(!1).append(o.sContentPadding).appendTo(D);t("[name]",E).removeAttr("name");var A=t("<div/>").css(u||c?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(E).appendTo(w);u&&d?E.width(d):u?(E.css("width","auto"),E.removeAttr("width"),E.width()<w.clientWidth&&b&&E.width(w.clientWidth)):c?E.width(w.clientWidth):b&&E.width(b);var k=0;for(i=0;i<m.length;i++){var N=t(_[i]),R=N.outerWidth()-N.width(),O=C.bBounding?Math.ceil(_[i].getBoundingClientRect().width):N.outerWidth();k+=O,s[m[i]].sWidth=yt(O-R)}a.style.width=yt(k),A.remove()}if(b&&(a.style.width=yt(b)),(b||u)&&!n._reszEvt){var I=function(){t(e).on("resize.DT-"+n.sInstance,ye(function(){p(n)}))};x?setTimeout(I,1e3):I(),n._reszEvt=!0}}function _t(e,i){if(!e)return 0;var o=t("<div/>").css("width",yt(e)).appendTo(i||n.body),r=o[0].offsetWidth;return o.remove(),r}function bt(e,n){var i=wt(e,n);if(i<0)return null;var o=e.aoData[i];return o.nTr?o.anCells[n]:t("<td/>").html(S(e,i,n,"display"))[0]}function wt(t,e){for(var n,i=-1,o=-1,r=0,a=t.aoData.length;r<a;r++)n=S(t,r,e,"display")+"",n=n.replace(we,""),n=n.replace(/ /g," "),n.length>i&&(i=n.length,o=r);return o}function yt(t){return null===t?"0px":"number"==typeof t?t<0?"0px":t+"px":t.match(/\d$/)?t+"px":t}function Ct(e){var n,o,r,a,s,l,c,u=[],d=e.aoColumns,h=e.aaSortingFixed,p=t.isPlainObject(h),f=[],m=function(e){e.length&&!t.isArray(e[0])?f.push(e):t.merge(f,e)};for(t.isArray(h)&&m(h),p&&h.pre&&m(h.pre),m(e.aaSorting),p&&h.post&&m(h.post),n=0;n<f.length;n++)for(c=f[n][0],a=d[c].aDataSort,o=0,r=a.length;o<r;o++)s=a[o],l=d[s].sType||"string",f[n]._idx===i&&(f[n]._idx=t.inArray(f[n][1],d[s].asSorting)),u.push({src:c,col:s,dir:f[n][1],index:f[n]._idx,type:l,formatter:Gt.ext.type.order[l+"-pre"]});return u}function xt(t){var e,n,i,o,r,a=[],s=Gt.ext.type.order,l=t.aoData,c=(t.aoColumns,0),u=t.aiDisplayMaster;for(_(t),r=Ct(t),e=0,n=r.length;e<n;e++)o=r[e],o.formatter&&c++,At(t,o.col);if("ssp"!=Bt(t)&&0!==r.length){for(e=0,i=u.length;e<i;e++)a[u[e]]=e;c===r.length?u.sort(function(t,e){var n,i,o,s,c,u=r.length,d=l[t]._aSortData,h=l[e]._aSortData;for(o=0;o<u;o++)if(c=r[o],n=d[c.col],i=h[c.col],0!=(s=n<i?-1:n>i?1:0))return"asc"===c.dir?s:-s;return n=a[t],i=a[e],n<i?-1:n>i?1:0}):u.sort(function(t,e){var n,i,o,c,u,d,h=r.length,p=l[t]._aSortData,f=l[e]._aSortData;for(o=0;o<h;o++)if(u=r[o],n=p[u.col],i=f[u.col],d=s[u.type+"-"+u.dir]||s["string-"+u.dir],0!==(c=d(n,i)))return c;return n=a[t],i=a[e],n<i?-1:n>i?1:0})}t.bSorted=!0}function St(t){for(var e,n,i=t.aoColumns,o=Ct(t),r=t.oLanguage.oAria,a=0,s=i.length;a<s;a++){var l=i[a],c=l.asSorting,u=l.sTitle.replace(/<.*?>/g,""),d=l.nTh;d.removeAttribute("aria-sort"),l.bSortable?(o.length>0&&o[0].col==a?(d.setAttribute("aria-sort","asc"==o[0].dir?"ascending":"descending"),n=c[o[0].index+1]||c[0]):n=c[0],e=u+("asc"===n?r.sSortAscending:r.sSortDescending)):e=u,d.setAttribute("aria-label",e)}}function Tt(e,n,o,r){var a,s=e.aoColumns[n],l=e.aaSorting,c=s.asSorting,u=function(e,n){var o=e._idx;return o===i&&(o=t.inArray(e[1],c)),o+1<c.length?o+1:n?null:0};if("number"==typeof l[0]&&(l=e.aaSorting=[l]),o&&e.oFeatures.bSortMulti){var d=t.inArray(n,se(l,"0"));-1!==d?(a=u(l[d],!0),null===a&&1===l.length&&(a=0),null===a?l.splice(d,1):(l[d][1]=c[a],l[d]._idx=a)):(l.push([n,c[0],0]),l[l.length-1]._idx=0)}else l.length&&l[0][0]==n?(a=u(l[0]),l.length=1,l[0][1]=c[a],l[0]._idx=a):(l.length=0,l.push([n,c[0]]),l[0]._idx=0);H(e),"function"==typeof r&&r(e)}function Et(t,e,n,i){var o=t.aoColumns[n];Pt(e,{},function(e){!1!==o.bSortable&&(t.oFeatures.bProcessing?(pt(t,!0),setTimeout(function(){Tt(t,n,e.shiftKey,i),"ssp"!==Bt(t)&&pt(t,!1)},0)):Tt(t,n,e.shiftKey,i))})}function Dt(e){var n,i,o,r=e.aLastSort,a=e.oClasses.sSortColumn,s=Ct(e),l=e.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,i=r.length;n<i;n++)o=r[n].src,t(se(e.aoData,"anCells",o)).removeClass(a+(n<2?n+1:3));for(n=0,i=s.length;n<i;n++)o=s[n].src,t(se(e.aoData,"anCells",o)).addClass(a+(n<2?n+1:3))}e.aLastSort=s}function At(t,e){var n,i=t.aoColumns[e],o=Gt.ext.order[i.sSortDataType];o&&(n=o.call(t.oInstance,t,e,m(t,e)));for(var r,a,s=Gt.ext.type.order[i.sType+"-pre"],l=0,c=t.aoData.length;l<c;l++)r=t.aoData[l],r._aSortData||(r._aSortData=[]),r._aSortData[e]&&!o||(a=o?n[l]:S(t,l,e,"sort"),r._aSortData[e]=s?s(a):a)}function kt(e){if(e.oFeatures.bStateSave&&!e.bDestroying){var n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.extend(!0,[],e.aaSorting),search:et(e.oPreviousSearch),columns:t.map(e.aoColumns,function(t,n){return{visible:t.bVisible,search:et(e.aoPreSearchCols[n])}})};$t(e,"aoStateSaveParams","stateSaveParams",[e,n]),e.oSavedState=n,e.fnStateSaveCallback.call(e.oInstance,e,n)}}function Nt(e,n,o){var r,a,s=e.aoColumns,l=function(n){if(!n||!n.time)return void o();var l=$t(e,"aoStateLoadParams","stateLoadParams",[e,n]);if(-1!==t.inArray(!1,l))return void o();var c=e.iStateDuration;if(c>0&&n.time<+new Date-1e3*c)return void o();if(n.columns&&s.length!==n.columns.length)return void o();if(e.oLoadedState=t.extend(!0,{},n),n.start!==i&&(e._iDisplayStart=n.start,e.iInitDisplayStart=n.start),n.length!==i&&(e._iDisplayLength=n.length),n.order!==i&&(e.aaSorting=[],t.each(n.order,function(t,n){e.aaSorting.push(n[0]>=s.length?[0,n[1]]:n)})),n.search!==i&&t.extend(e.oPreviousSearch,nt(n.search)),n.columns)for(r=0,a=n.columns.length;r<a;r++){var u=n.columns[r];u.visible!==i&&(s[r].bVisible=u.visible),u.search!==i&&t.extend(e.aoPreSearchCols[r],nt(u.search))}$t(e,"aoStateLoaded","stateLoaded",[e,n]),o()};if(!e.oFeatures.bStateSave)return void o();var c=e.fnStateLoadCallback.call(e.oInstance,e,l);c!==i&&l(c)}function Rt(e){var n=Gt.settings,i=t.inArray(e,se(n,"nTable"));return-1!==i?n[i]:null}function Ot(t,n,i,o){if(i="DataTables warning: "+(t?"table id="+t.sTableId+" - ":"")+i,o&&(i+=". For more information about this error, please see http://datatables.net/tn/"+o),n)e.console&&console.log&&console.log(i);else{var r=Gt.ext,a=r.sErrMode||r.errMode;if(t&&$t(t,null,"error",[t,o,i]),"alert"==a)alert(i);else{if("throw"==a)throw new Error(i);"function"==typeof a&&a(t,o,i)}}}function It(e,n,o,r){if(t.isArray(o))return void t.each(o,function(i,o){t.isArray(o)?It(e,n,o[0],o[1]):It(e,n,o)});r===i&&(r=o),n[o]!==i&&(e[r]=n[o])}function Lt(e,n,i){var o;for(var r in n)n.hasOwnProperty(r)&&(o=n[r],t.isPlainObject(o)?(t.isPlainObject(e[r])||(e[r]={}),t.extend(!0,e[r],o)):i&&"data"!==r&&"aaData"!==r&&t.isArray(o)?e[r]=o.slice():e[r]=o);return e}function Pt(e,n,i){t(e).on("click.DT",n,function(t){e.blur(),i(t)}).on("keypress.DT",n,function(t){13===t.which&&(t.preventDefault(),i(t))}).on("selectstart.DT",function(){return!1})}function Mt(t,e,n,i){n&&t[e].push({fn:n,sName:i})}function $t(e,n,i,o){var r=[];if(n&&(r=t.map(e[n].slice().reverse(),function(t,n){return t.fn.apply(e.oInstance,o)})),null!==i){var a=t.Event(i+".dt");t(e.nTable).trigger(a,o),r.push(a.result)}return r}function Ft(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),i=t._iDisplayLength;e>=n&&(e=n-i),e-=e%i,(-1===i||e<0)&&(e=0),t._iDisplayStart=e}function Ht(e,n){var i=e.renderer,o=Gt.ext.renderer[n];return t.isPlainObject(i)&&i[n]?o[i[n]]||o._:"string"==typeof i?o[i]||o._:o._}function Bt(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function jt(t,e){var n=[],i=je.numbers_length,o=Math.floor(i/2);return e<=i?n=ce(0,e):t<=o?(n=ce(0,i-2),n.push("ellipsis"),n.push(e-1)):t>=e-1-o?(n=ce(e-(i-2),e),n.splice(0,0,"ellipsis"),n.splice(0,0,0)):(n=ce(t-o+2,t+o-1),n.push("ellipsis"),n.push(e-1),n.splice(0,0,"ellipsis"),n.splice(0,0,0)),n.DT_el="span",n}function zt(e){t.each({num:function(t){return ze(t,e)},"num-fmt":function(t){return ze(t,e,te)},"html-num":function(t){return ze(t,e,Jt)},"html-num-fmt":function(t){return ze(t,e,Jt,te)}},function(t,n){qt.type.order[t+e+"-pre"]=n,t.match(/^html\-/)&&(qt.type.search[t+e]=qt.type.search.html)})}function Wt(t){return function(){var e=[Rt(this[Gt.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return Gt.ext.internal[t].apply(this,e)}}var qt,Ut,Kt,Vt,Gt=function(e){this.$=function(t,e){return this.api(!0).$(t,e)},this._=function(t,e){return this.api(!0).rows(t,e).data()},this.api=function(t){return new Ut(t?Rt(this[qt.iApiIndex]):this)},this.fnAddData=function(e,n){var o=this.api(!0),r=t.isArray(e)&&(t.isArray(e[0])||t.isPlainObject(e[0]))?o.rows.add(e):o.row.add(e);return(n===i||n)&&o.draw(),r.flatten().toArray()},this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),n=e.settings()[0],o=n.oScroll;t===i||t?e.draw(!1):""===o.sX&&""===o.sY||mt(n)},this.fnClearTable=function(t){var e=this.api(!0).clear();(t===i||t)&&e.draw()},this.fnClose=function(t){this.api(!0).row(t).child.hide()},this.fnDeleteRow=function(t,e,n){var o=this.api(!0),r=o.rows(t),a=r.settings()[0],s=a.aoData[r[0][0]];return r.remove(),e&&e.call(this,a,s),(n===i||n)&&o.draw(),s},this.fnDestroy=function(t){this.api(!0).destroy(t)},this.fnDraw=function(t){this.api(!0).draw(t)},this.fnFilter=function(t,e,n,o,r,a){var s=this.api(!0);null===e||e===i?s.search(t,n,o,a):s.column(e).search(t,n,o,a),s.draw()},this.fnGetData=function(t,e){var n=this.api(!0);if(t!==i){var o=t.nodeName?t.nodeName.toLowerCase():"";return e!==i||"td"==o||"th"==o?n.cell(t,e).data():n.row(t).data()||null}return n.data().toArray()},this.fnGetNodes=function(t){var e=this.api(!0);return t!==i?e.row(t).node():e.rows().nodes().flatten().toArray()},this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"==n||"TH"==n){var i=e.cell(t).index();return[i.row,i.columnVisible,i.column]}return null},this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()},this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]},this.fnPageChange=function(t,e){var n=this.api(!0).page(t);(e===i||e)&&n.draw(!1)},this.fnSetColumnVis=function(t,e,n){var o=this.api(!0).column(t).visible(e);(n===i||n)&&o.columns.adjust().draw()},this.fnSettings=function(){return Rt(this[qt.iApiIndex])},this.fnSort=function(t){this.api(!0).order(t).draw()},this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)},this.fnUpdate=function(t,e,n,o,r){var a=this.api(!0);return n===i||null===n?a.row(e).data(t):a.cell(e,n).data(t),(r===i||r)&&a.columns.adjust(),(o===i||o)&&a.draw(),0},this.fnVersionCheck=qt.fnVersionCheck;var n=this,o=e===i,u=this.length;o&&(e={}),this.oApi=this.internal=qt.internal;for(var p in Gt.ext.internal)p&&(this[p]=Wt(p));return this.each(function(){var p,f={},m=u>1?Lt(f,e,!0):e,g=0,v=this.getAttribute("id"),_=!1,C=Gt.defaults,x=t(this);if("table"!=this.nodeName.toLowerCase())return void Ot(null,0,"Non-table node initialisation ("+this.nodeName+")",2);s(C),l(C.column),r(C,C,!0),r(C.column,C.column,!0),r(C,t.extend(m,x.data()));var S=Gt.settings;for(g=0,p=S.length;g<p;g++){var T=S[g];if(T.nTable==this||T.nTHead.parentNode==this||T.nTFoot&&T.nTFoot.parentNode==this){var E=m.bRetrieve!==i?m.bRetrieve:C.bRetrieve,A=m.bDestroy!==i?m.bDestroy:C.bDestroy;if(o||E)return T.oInstance;if(A){T.oInstance.fnDestroy();break}return void Ot(T,0,"Cannot reinitialise DataTable",3)}if(T.sTableId==this.id){S.splice(g,1);break}}null!==v&&""!==v||(v="DataTables_Table_"+Gt.ext._unique++,this.id=v);var k=t.extend(!0,{},Gt.models.oSettings,{sDestroyWidth:x[0].style.width,sInstance:v,sTableId:v});k.nTable=this,k.oApi=n.internal,k.oInit=m,S.push(k),k.oInstance=1===n.length?n:x.dataTable(),s(m),m.oLanguage&&a(m.oLanguage),m.aLengthMenu&&!m.iDisplayLength&&(m.iDisplayLength=t.isArray(m.aLengthMenu[0])?m.aLengthMenu[0][0]:m.aLengthMenu[0]),m=Lt(t.extend(!0,{},C),m),It(k.oFeatures,m,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),It(k,m,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),It(k.oScroll,m,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),It(k.oLanguage,m,"fnInfoCallback"),Mt(k,"aoDrawCallback",m.fnDrawCallback,"user"),Mt(k,"aoServerParams",m.fnServerParams,"user"),Mt(k,"aoStateSaveParams",m.fnStateSaveParams,"user"),Mt(k,"aoStateLoadParams",m.fnStateLoadParams,"user"),Mt(k,"aoStateLoaded",m.fnStateLoaded,"user"),Mt(k,"aoRowCallback",m.fnRowCallback,"user"),Mt(k,"aoRowCreatedCallback",m.fnCreatedRow,"user"),Mt(k,"aoHeaderCallback",m.fnHeaderCallback,"user"),Mt(k,"aoFooterCallback",m.fnFooterCallback,"user"),Mt(k,"aoInitComplete",m.fnInitComplete,"user"),Mt(k,"aoPreDrawCallback",m.fnPreDrawCallback,"user"),k.rowIdFn=D(m.rowId),c(k);var N=k.oClasses;if(t.extend(N,Gt.ext.classes,m.oClasses),x.addClass(N.sTable),k.iInitDisplayStart===i&&(k.iInitDisplayStart=m.iDisplayStart,k._iDisplayStart=m.iDisplayStart),null!==m.iDeferLoading){k.bDeferLoading=!0;var R=t.isArray(m.iDeferLoading);k._iRecordsDisplay=R?m.iDeferLoading[0]:m.iDeferLoading,k._iRecordsTotal=R?m.iDeferLoading[1]:m.iDeferLoading}var O=k.oLanguage;t.extend(!0,O,m.oLanguage),O.sUrl&&(t.ajax({dataType:"json",url:O.sUrl,success:function(e){a(e),r(C.oLanguage,e),t.extend(!0,O,e),at(k)},error:function(){at(k)}}),_=!0),null===m.asStripeClasses&&(k.asStripeClasses=[N.sStripeOdd,N.sStripeEven]);var I=k.asStripeClasses,L=x.children("tbody").find("tr").eq(0);-1!==t.inArray(!0,t.map(I,function(t,e){return L.hasClass(t)}))&&(t("tbody tr",this).removeClass(I.join(" ")),k.asDestroyStripes=I.slice());var P,M=[],$=this.getElementsByTagName("thead");if(0!==$.length&&(j(k.aoHeader,$[0]),M=z(k)),null===m.aoColumns)for(P=[],g=0,p=M.length;g<p;g++)P.push(null);else P=m.aoColumns;for(g=0,p=P.length;g<p;g++)d(k,M?M[g]:null);if(b(k,m.aoColumnDefs,P,function(t,e){h(k,t,e)}),L.length){var F=function(t,e){return null!==t.getAttribute("data-"+e)?e:null};t(L[0]).children("th, td").each(function(t,e){var n=k.aoColumns[t];if(n.mData===t){var o=F(e,"sort")||F(e,"order"),r=F(e,"filter")||F(e,"search");null===o&&null===r||(n.mData={_:t+".display",sort:null!==o?t+".@data-"+o:i,type:null!==o?t+".@data-"+o:i,filter:null!==r?t+".@data-"+r:i},h(k,t))}})}var H=k.oFeatures,B=function(){if(m.aaSorting===i){var e=k.aaSorting;for(g=0,p=e.length;g<p;g++)e[g][1]=k.aoColumns[g].asSorting[0]}Dt(k),H.bSort&&Mt(k,"aoDrawCallback",function(){if(k.bSorted){var e=Ct(k),n={};t.each(e,function(t,e){n[e.src]=e.dir}),$t(k,null,"order",[k,e,n]),St(k)}}),Mt(k,"aoDrawCallback",function(){(k.bSorted||"ssp"===Bt(k)||H.bDeferRender)&&Dt(k)},"sc");var n=x.children("caption").each(function(){this._captionSide=t(this).css("caption-side")}),o=x.children("thead");0===o.length&&(o=t("<thead/>").appendTo(x)),k.nTHead=o[0];var r=x.children("tbody");0===r.length&&(r=t("<tbody/>").appendTo(x)),k.nTBody=r[0];var a=x.children("tfoot");if(0===a.length&&n.length>0&&(""!==k.oScroll.sX||""!==k.oScroll.sY)&&(a=t("<tfoot/>").appendTo(x)),0===a.length||0===a.children().length?x.addClass(N.sNoFooter):a.length>0&&(k.nTFoot=a[0],j(k.aoFooter,k.nTFoot)),m.aaData)for(g=0;g<m.aaData.length;g++)w(k,m.aaData[g]);else(k.bDeferLoading||"dom"==Bt(k))&&y(k,t(k.nTBody).children("tr"));k.aiDisplay=k.aiDisplayMaster.slice(),k.bInitialised=!0,!1===_&&at(k)};m.bStateSave?(H.bStateSave=!0,Mt(k,"aoDrawCallback",kt,"state_save"),Nt(k,m,B)):B()}),n=null,this},Yt={},Xt=/[\r\n]/g,Jt=/<.*?>/g,Qt=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,Zt=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),te=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,ee=function(t){return!t||!0===t||"-"===t},ne=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},ie=function(t,e){return Yt[e]||(Yt[e]=new RegExp(ve(e),"g")),"string"==typeof t&&"."!==e?t.replace(/\./g,"").replace(Yt[e],"."):t},oe=function(t,e,n){var i="string"==typeof t;return!!ee(t)||(e&&i&&(t=ie(t,e)),n&&i&&(t=t.replace(te,"")),!isNaN(parseFloat(t))&&isFinite(t))},re=function(t){return ee(t)||"string"==typeof t},ae=function(t,e,n){return!!ee(t)||(re(t)?!!oe(de(t),e,n)||null:null)},se=function(t,e,n){var o=[],r=0,a=t.length;if(n!==i)for(;r<a;r++)t[r]&&t[r][e]&&o.push(t[r][e][n]);else for(;r<a;r++)t[r]&&o.push(t[r][e]);return o},le=function(t,e,n,o){var r=[],a=0,s=e.length;if(o!==i)for(;a<s;a++)t[e[a]][n]&&r.push(t[e[a]][n][o]);else for(;a<s;a++)r.push(t[e[a]][n]);return r},ce=function(t,e){var n,o=[];e===i?(e=0,n=t):(n=e,e=t);for(var r=e;r<n;r++)o.push(r);return o},ue=function(t){for(var e=[],n=0,i=t.length;n<i;n++)t[n]&&e.push(t[n]);return e},de=function(t){return t.replace(Jt,"")},he=function(t){if(t.length<2)return!0;for(var e=t.slice().sort(),n=e[0],i=1,o=e.length;i<o;i++){if(e[i]===n)return!1;n=e[i]}return!0},pe=function(t){if(he(t))return t.slice();var e,n,i,o=[],r=t.length,a=0;t:for(n=0;n<r;n++){for(e=t[n],i=0;i<a;i++)if(o[i]===e)continue t;o.push(e),a++}return o};Gt.util={throttle:function(t,e){var n,o,r=e!==i?e:200;return function(){var e=this,a=+new Date,s=arguments;n&&a<n+r?(clearTimeout(o),o=setTimeout(function(){n=i,t.apply(e,s)},r)):(n=a,t.apply(e,s))}},escapeRegex:function(t){return t.replace(Zt,"\\$1")}};var fe=function(t,e,n){t[e]!==i&&(t[n]=t[e])},me=/\[.*?\]$/,ge=/\(\)$/,ve=Gt.util.escapeRegex,_e=t("<div>")[0],be=_e.textContent!==i,we=/<.*?>/g,ye=Gt.util.throttle,Ce=[],xe=Array.prototype,Se=function(e){var n,i,o=Gt.settings,r=t.map(o,function(t,e){return t.nTable});return e?e.nTable&&e.oApi?[e]:e.nodeName&&"table"===e.nodeName.toLowerCase()?(n=t.inArray(e,r),-1!==n?[o[n]]:null):e&&"function"==typeof e.settings?e.settings().toArray():("string"==typeof e?i=t(e):e instanceof t&&(i=e),i?i.map(function(e){return n=t.inArray(this,r),-1!==n?o[n]:null}).toArray():void 0):[]};Ut=function(e,n){if(!(this instanceof Ut))return new Ut(e,n);var i=[],o=function(t){var e=Se(t);e&&(i=i.concat(e))};if(t.isArray(e))for(var r=0,a=e.length;r<a;r++)o(e[r]);else o(e);this.context=pe(i),n&&t.merge(this,n),this.selector={rows:null,cols:null,opts:null},Ut.extend(this,this,Ce)},Gt.Api=Ut,t.extend(Ut.prototype,{any:function(){return 0!==this.count()},concat:xe.concat,context:[],count:function(){return this.flatten().length},each:function(t){for(var e=0,n=this.length;e<n;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new Ut(e[t],this[t]):null},filter:function(t){var e=[];if(xe.filter)e=xe.filter.call(this,t,this);else for(var n=0,i=this.length;n<i;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new Ut(this.context,e)},flatten:function(){var t=[];return new Ut(this.context,t.concat.apply(t,this.toArray()))},join:xe.join,indexOf:xe.indexOf||function(t,e){for(var n=e||0,i=this.length;n<i;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,n,o){var r,a,s,l,c,u,d,h,p=[],f=this.context,m=this.selector;for("string"==typeof t&&(o=n,n=e,e=t,t=!1),a=0,s=f.length;a<s;a++){var g=new Ut(f[a]);if("table"===e)(r=n.call(g,f[a],a))!==i&&p.push(r);else if("columns"===e||"rows"===e)(r=n.call(g,f[a],this[a],a))!==i&&p.push(r);else if("column"===e||"column-rows"===e||"row"===e||"cell"===e)for(d=this[a],"column-rows"===e&&(u=Ne(f[a],m.opts)),l=0,c=d.length;l<c;l++)h=d[l],(r="cell"===e?n.call(g,f[a],h.row,h.column,a,l):n.call(g,f[a],h,a,l,u))!==i&&p.push(r)}if(p.length||o){var v=new Ut(f,t?p.concat.apply([],p):p),_=v.selector;return _.rows=m.rows,_.cols=m.cols,_.opts=m.opts,v}return this},lastIndexOf:xe.lastIndexOf||function(t,e){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(xe.map)e=xe.map.call(this,t,this);else for(var n=0,i=this.length;n<i;n++)e.push(t.call(this,this[n],n));return new Ut(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:xe.pop,push:xe.push,reduce:xe.reduce||function(t,e){return u(this,t,e,0,this.length,1)},reduceRight:xe.reduceRight||function(t,e){return u(this,t,e,this.length-1,-1,-1)},reverse:xe.reverse,selector:null,shift:xe.shift,slice:function(){return new Ut(this.context,this)},sort:xe.sort,splice:xe.splice,toArray:function(){return xe.slice.call(this)},to$:function(){return t(this)},toJQuery:function(){return t(this)},unique:function(){return new Ut(this.context,pe(this))},unshift:xe.unshift}),Ut.extend=function(e,n,i){if(i.length&&n&&(n instanceof Ut||n.__dt_wrapper)){var o,r,a;for(o=0,r=i.length;o<r;o++)a=i[o],n[a.name]="function"==typeof a.val?function(t,e,n){return function(){var i=e.apply(t,arguments);return Ut.extend(i,i,n.methodExt),i}}(e,a.val,a):t.isPlainObject(a.val)?{}:a.val,n[a.name].__dt_wrapper=!0,Ut.extend(e,n[a.name],a.propExt)}},Ut.register=Kt=function(e,n){if(t.isArray(e))for(var i=0,o=e.length;i<o;i++)Ut.register(e[i],n);else{var r,a,s,l,c=e.split("."),u=Ce;for(r=0,a=c.length;r<a;r++){l=-1!==c[r].indexOf("()"),s=l?c[r].replace("()",""):c[r];var d=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n].name===e)return t[n];return null}(u,s);d||(d={name:s,val:{},methodExt:[],propExt:[]},u.push(d)),r===a-1?d.val=n:u=l?d.methodExt:d.propExt}}},Ut.registerPlural=Vt=function(e,n,o){Ut.register(e,o),Ut.register(n,function(){var e=o.apply(this,arguments);return e===this?this:e instanceof Ut?e.length?t.isArray(e[0])?new Ut(e.context,e[0]):e[0]:i:e})};var Te=function(e,n){if("number"==typeof e)return[n[e]];var i=t.map(n,function(t,e){return t.nTable});return t(i).filter(e).map(function(e){var o=t.inArray(this,i);return n[o]}).toArray()};Kt("tables()",function(t){return t?new Ut(Te(t,this.context)):this}),Kt("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new Ut(n[0]):e}),Vt("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable},1)}),Vt("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody},1)}),Vt("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead},1)}),Vt("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot},1)}),Vt("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper},1)}),Kt("draw()",function(t){return this.iterator("table",function(e){"page"===t?F(e):("string"==typeof t&&(t="full-hold"!==t),H(e,!1===t))})}),Kt("page()",function(t){return t===i?this.page.info().page:this.iterator("table",function(e){dt(e,t)})}),Kt("page.info()",function(t){if(0===this.context.length)return i;var e=this.context[0],n=e._iDisplayStart,o=e.oFeatures.bPaginate?e._iDisplayLength:-1,r=e.fnRecordsDisplay(),a=-1===o;return{page:a?0:Math.floor(n/o),pages:a?1:Math.ceil(r/o),start:n,end:e.fnDisplayEnd(),length:o,recordsTotal:e.fnRecordsTotal(),recordsDisplay:r,serverSide:"ssp"===Bt(e)}}),Kt("page.len()",function(t){return t===i?0!==this.context.length?this.context[0]._iDisplayLength:i:this.iterator("table",function(e){lt(e,t)})});var Ee=function(t,e,n){if(n){var i=new Ut(t);i.one("draw",function(){n(i.ajax.json())})}if("ssp"==Bt(t))H(t,e);else{pt(t,!0);var o=t.jqXHR;o&&4!==o.readyState&&o.abort(),W(t,[],function(n){N(t);for(var i=V(t,n),o=0,r=i.length;o<r;o++)w(t,i[o]);H(t,e),pt(t,!1)})}};Kt("ajax.json()",function(){var t=this.context;if(t.length>0)return t[0].json}),Kt("ajax.params()",function(){var t=this.context;if(t.length>0)return t[0].oAjaxData}),Kt("ajax.reload()",function(t,e){return this.iterator("table",function(n){Ee(n,!1===e,t)})}),Kt("ajax.url()",function(e){var n=this.context;return e===i?0===n.length?i:(n=n[0],n.ajax?t.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource):this.iterator("table",function(n){t.isPlainObject(n.ajax)?n.ajax.url=e:n.ajax=e})}),Kt("ajax.url().load()",function(t,e){return this.iterator("table",function(n){Ee(n,!1===e,t)})});var De=function(e,n,o,r,a){var s,l,c,u,d,h,p=[],f=typeof n;for(n&&"string"!==f&&"function"!==f&&n.length!==i||(n=[n]),c=0,u=n.length;c<u;c++)for(l=n[c]&&n[c].split&&!n[c].match(/[\[\(:]/)?n[c].split(","):[n[c]],d=0,h=l.length;d<h;d++)(s=o("string"==typeof l[d]?t.trim(l[d]):l[d]))&&s.length&&(p=p.concat(s));var m=qt.selector[e];if(m.length)for(c=0,u=m.length;c<u;c++)p=m[c](r,a,p);return pe(p)},Ae=function(e){return e||(e={}),e.filter&&e.search===i&&(e.search=e.filter),t.extend({search:"none",order:"current",page:"all"},e)},ke=function(t){for(var e=0,n=t.length;e<n;e++)if(t[e].length>0)return t[0]=t[e],t[0].length=1,t.length=1,t.context=[t.context[e]],t;return t.length=0,t},Ne=function(e,n){var i,o,r,a=[],s=e.aiDisplay,l=e.aiDisplayMaster,c=n.search,u=n.order,d=n.page;if("ssp"==Bt(e))return"removed"===c?[]:ce(0,l.length);if("current"==d)for(i=e._iDisplayStart,o=e.fnDisplayEnd();i<o;i++)a.push(s[i]);else if("current"==u||"applied"==u)a="none"==c?l.slice():"applied"==c?s.slice():t.map(l,function(e,n){return-1===t.inArray(e,s)?e:null});else if("index"==u||"original"==u)for(i=0,o=e.aoData.length;i<o;i++)"none"==c?a.push(i):(-1===(r=t.inArray(i,s))&&"removed"==c||r>=0&&"applied"==c)&&a.push(i);return a},Re=function(e,n,o){var r;return De("row",n,function(n){var a=ne(n);if(null!==a&&!o)return[a];if(r||(r=Ne(e,o)),null!==a&&-1!==t.inArray(a,r))return[a];if(null===n||n===i||""===n)return r;if("function"==typeof n)return t.map(r,function(t){var i=e.aoData[t];return n(t,i._aData,i.nTr)?t:null});var s=ue(le(e.aoData,r,"nTr"));if(n.nodeName){if(n._DT_RowIndex!==i)return[n._DT_RowIndex];if(n._DT_CellIndex)return[n._DT_CellIndex.row];var l=t(n).closest("*[data-dt-row]");return l.length?[l.data("dt-row")]:[]}if("string"==typeof n&&"#"===n.charAt(0)){var c=e.aIds[n.replace(/^#/,"")];if(c!==i)return[c.idx]}return t(s).filter(n).map(function(){return this._DT_RowIndex}).toArray()},e,o)};Kt("rows()",function(e,n){e===i?e="":t.isPlainObject(e)&&(n=e,e=""),n=Ae(n);var o=this.iterator("table",function(t){return Re(t,e,n)},1);return o.selector.rows=e,o.selector.opts=n,o}),Kt("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||i},1)}),Kt("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return le(t.aoData,e,"_aData")},1)}),Vt("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var i=e.aoData[n];return"search"===t?i._aFilterData:i._aSortData},1)}),Vt("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){O(e,n,t)})}),Vt("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e},1)}),Vt("rows().ids()","row().id()",function(t){for(var e=[],n=this.context,i=0,o=n.length;i<o;i++)for(var r=0,a=this[i].length;r<a;r++){var s=n[i].rowIdFn(n[i].aoData[this[i][r]]._aData);e.push((!0===t?"#":"")+s)}return new Ut(n,e)}),Vt("rows().remove()","row().remove()",function(){var t=this;return this.iterator("row",function(e,n,o){var r,a,s,l,c,u,d=e.aoData,h=d[n];for(d.splice(n,1),r=0,a=d.length;r<a;r++)if(c=d[r],u=c.anCells,null!==c.nTr&&(c.nTr._DT_RowIndex=r),null!==u)for(s=0,l=u.length;s<l;s++)u[s]._DT_CellIndex.row=r;R(e.aiDisplayMaster,n),R(e.aiDisplay,n),R(t[o],n,!1),e._iRecordsDisplay>0&&e._iRecordsDisplay--,Ft(e);var p=e.rowIdFn(h._aData);p!==i&&delete e.aIds[p]}),this.iterator("table",function(t){for(var e=0,n=t.aoData.length;e<n;e++)t.aoData[e].idx=e}),this}),Kt("rows.add()",function(e){var n=this.iterator("table",function(t){var n,i,o,r=[];for(i=0,o=e.length;i<o;i++)n=e[i],n.nodeName&&"TR"===n.nodeName.toUpperCase()?r.push(y(t,n)[0]):r.push(w(t,n));return r},1),i=this.rows(-1);return i.pop(),t.merge(i,n),i}),Kt("row()",function(t,e){return ke(this.rows(t,e))}),Kt("row().data()",function(t){var e=this.context;return t===i?e.length&&this.length?e[0].aoData[this[0]]._aData:i:(e[0].aoData[this[0]]._aData=t,O(e[0],this[0],"data"),this)}),Kt("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null}),Kt("row.add()",function(e){e instanceof t&&e.length&&(e=e[0]);var n=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?y(t,e)[0]:w(t,e)});return this.row(n[0])});var Oe=function(e,n,i,o){var r=[],a=function(n,i){if(t.isArray(n)||n instanceof t)for(var o=0,s=n.length;o<s;o++)a(n[o],i);else if(n.nodeName&&"tr"===n.nodeName.toLowerCase())r.push(n);else{var l=t("<tr><td/></tr>").addClass(i);t("td",l).addClass(i).html(n)[0].colSpan=g(e),r.push(l[0])}};a(i,o),n._details&&n._details.detach(),n._details=t(r),n._detailsShow&&n._details.insertAfter(n.nTr)},Ie=function(t,e){var n=t.context;if(n.length){var o=n[0].aoData[e!==i?e:t[0]];o&&o._details&&(o._details.remove(),o._detailsShow=i,o._details=i)}},Le=function(t,e){var n=t.context;if(n.length&&t.length){var i=n[0].aoData[t[0]];i._details&&(i._detailsShow=e,e?i._details.insertAfter(i.nTr):i._details.detach(),Pe(n[0]))}},Pe=function(t){var e=new Ut(t),n=t.aoData;e.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details"),se(n,"_details").length>0&&(e.on("draw.dt.DT_details",function(i,o){t===o&&e.rows({page:"current"}).eq(0).each(function(t){var e=n[t];e._detailsShow&&e._details.insertAfter(e.nTr)})}),e.on("column-visibility.dt.DT_details",function(e,i,o,r){if(t===i)for(var a,s=g(i),l=0,c=n.length;l<c;l++)a=n[l],a._details&&a._details.children("td[colspan]").attr("colspan",s)}),e.on("destroy.dt.DT_details",function(i,o){if(t===o)for(var r=0,a=n.length;r<a;r++)n[r]._details&&Ie(e,r)}))};Kt("row().child()",function(t,e){var n=this.context;return t===i?n.length&&this.length?n[0].aoData[this[0]]._details:i:(!0===t?this.child.show():!1===t?Ie(this):n.length&&this.length&&Oe(n[0],n[0].aoData[this[0]],t,e),this)}),Kt(["row().child.show()","row().child().show()"],function(t){return Le(this,!0),this}),Kt(["row().child.hide()","row().child().hide()"],function(){return Le(this,!1),this}),Kt(["row().child.remove()","row().child().remove()"],function(){return Ie(this),this}),Kt("row().child.isShown()",function(){var t=this.context;return!(!t.length||!this.length)&&(t[0].aoData[this[0]]._detailsShow||!1)});var Me=/^([^:]+):(name|visIdx|visible)$/,$e=function(t,e,n,i,o){for(var r=[],a=0,s=o.length;a<s;a++)r.push(S(t,o[a],e));return r},Fe=function(e,n,i){var o=e.aoColumns,r=se(o,"sName"),a=se(o,"nTh");return De("column",n,function(n){var s=ne(n);if(""===n)return ce(o.length);if(null!==s)return[s>=0?s:o.length+s];if("function"==typeof n){var l=Ne(e,i);return t.map(o,function(t,i){return n(i,$e(e,i,0,0,l),a[i])?i:null})}var c="string"==typeof n?n.match(Me):"";if(c)switch(c[2]){case"visIdx":case"visible":var u=parseInt(c[1],10);if(u<0){var d=t.map(o,function(t,e){return t.bVisible?e:null});return[d[d.length+u]]}return[f(e,u)];case"name":return t.map(r,function(t,e){return t===c[1]?e:null});default:return[]}if(n.nodeName&&n._DT_CellIndex)return[n._DT_CellIndex.column];var h=t(a).filter(n).map(function(){return t.inArray(this,a)}).toArray();if(h.length||!n.nodeName)return h;var p=t(n).closest("*[data-dt-column]");return p.length?[p.data("dt-column")]:[]},e,i)},He=function(e,n,o){var r,a,s,l,c=e.aoColumns,u=c[n],d=e.aoData;if(o===i)return u.bVisible;if(u.bVisible!==o){if(o){var h=t.inArray(!0,se(c,"bVisible"),n+1);for(a=0,s=d.length;a<s;a++)l=d[a].nTr,r=d[a].anCells,l&&l.insertBefore(r[n],r[h]||null)}else t(se(e.aoData,"anCells",n)).detach();u.bVisible=o,$(e,e.aoHeader),$(e,e.aoFooter),kt(e)}};Kt("columns()",function(e,n){e===i?e="":t.isPlainObject(e)&&(n=e,e=""),n=Ae(n);var o=this.iterator("table",function(t){return Fe(t,e,n)},1);return o.selector.cols=e,o.selector.opts=n,o}),Vt("columns().header()","column().header()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh},1)}),Vt("columns().footer()","column().footer()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf},1)}),Vt("columns().data()","column().data()",function(){return this.iterator("column-rows",$e,1)}),Vt("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData},1)}),Vt("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,i,o,r){return le(e.aoData,r,"search"===t?"_aFilterData":"_aSortData",n)},1)}),Vt("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,i,o){return le(t.aoData,o,"anCells",e)},1)}),Vt("columns().visible()","column().visible()",function(t,e){var n=this.iterator("column",function(e,n){if(t===i)return e.aoColumns[n].bVisible;He(e,n,t)});return t!==i&&(this.iterator("column",function(n,i){$t(n,null,"column-visibility",[n,i,t,e])}),(e===i||e)&&this.columns.adjust()),n}),Vt("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return"visible"===t?m(e,n):n},1)}),Kt("columns.adjust()",function(){return this.iterator("table",function(t){p(t)},1)}),Kt("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return f(n,e);if("fromData"===t||"toVisible"===t)return m(n,e)}}),Kt("column()",function(t,e){return ke(this.columns(t,e))});var Be=function(e,n,o){var r,a,s,l,c,u,d,h=e.aoData,p=Ne(e,o),f=ue(le(h,p,"anCells")),m=t([].concat.apply([],f)),g=e.aoColumns.length;return De("cell",n,function(n){var o="function"==typeof n;if(null===n||n===i||o){for(a=[],s=0,l=p.length;s<l;s++)for(r=p[s],c=0;c<g;c++)u={row:r,column:c},o?(d=h[r],n(u,S(e,r,c),d.anCells?d.anCells[c]:null)&&a.push(u)):a.push(u);return a}if(t.isPlainObject(n))return[n];var f=m.filter(n).map(function(t,e){return{row:e._DT_CellIndex.row,column:e._DT_CellIndex.column}}).toArray();return f.length||!n.nodeName?f:(d=t(n).closest("*[data-dt-row]"),d.length?[{row:d.data("dt-row"),column:d.data("dt-column")}]:[])},e,o)};Kt("cells()",function(e,n,o){if(t.isPlainObject(e)&&(e.row===i?(o=e,e=null):(o=n,n=null)),t.isPlainObject(n)&&(o=n,n=null),null===n||n===i)return this.iterator("table",function(t){return Be(t,e,Ae(o))});var r,a,s,l,c,u=this.columns(n,o),d=this.rows(e,o),h=this.iterator("table",function(t,e){for(r=[],a=0,s=d[e].length;a<s;a++)for(l=0,c=u[e].length;l<c;l++)r.push({row:d[e][a],column:u[e][l]});return r},1);return t.extend(h.selector,{cols:n,rows:e,opts:o}),h}),Vt("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){var o=t.aoData[e];return o&&o.anCells?o.anCells[n]:i},1)}),Kt("cells().data()",function(){return this.iterator("cell",function(t,e,n){return S(t,e,n)},1)}),Vt("cells().cache()","cell().cache()",function(t){return t="search"===t?"_aFilterData":"_aSortData",this.iterator("cell",function(e,n,i){return e.aoData[n][t][i]},1)}),Vt("cells().render()","cell().render()",function(t){return this.iterator("cell",function(e,n,i){return S(e,n,i,t)},1)}),Vt("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:m(t,n)}},1)}),Vt("cells().invalidate()","cell().invalidate()",function(t){return this.iterator("cell",function(e,n,i){O(e,n,t,i)})}),Kt("cell()",function(t,e,n){return ke(this.cells(t,e,n))}),Kt("cell().data()",function(t){var e=this.context,n=this[0];return t===i?e.length&&n.length?S(e[0],n[0].row,n[0].column):i:(T(e[0],n[0].row,n[0].column,t),O(e[0],n[0].row,"data",n[0].column),this)}),Kt("order()",function(e,n){var o=this.context;return e===i?0!==o.length?o[0].aaSorting:i:("number"==typeof e?e=[[e,n]]:e.length&&!t.isArray(e[0])&&(e=Array.prototype.slice.call(arguments)),this.iterator("table",function(t){t.aaSorting=e.slice()}))}),Kt("order.listener()",function(t,e,n){return this.iterator("table",function(i){Et(i,t,e,n)})}),Kt("order.fixed()",function(e){if(!e){var n=this.context,o=n.length?n[0].aaSortingFixed:i;return t.isArray(o)?{pre:o}:o}return this.iterator("table",function(n){n.aaSortingFixed=t.extend(!0,{},e)})}),Kt(["columns().order()","column().order()"],function(e){var n=this;return this.iterator("table",function(i,o){var r=[];t.each(n[o],function(t,n){r.push([n,e])}),i.aaSorting=r})}),Kt("search()",function(e,n,o,r){var a=this.context;return e===i?0!==a.length?a[0].oPreviousSearch.sSearch:i:this.iterator("table",function(i){i.oFeatures.bFilter&&Y(i,t.extend({},i.oPreviousSearch,{sSearch:e+"",bRegex:null!==n&&n,bSmart:null===o||o,bCaseInsensitive:null===r||r}),1)})}),Vt("columns().search()","column().search()",function(e,n,o,r){return this.iterator("column",function(a,s){var l=a.aoPreSearchCols;if(e===i)return l[s].sSearch;a.oFeatures.bFilter&&(t.extend(l[s],{sSearch:e+"",bRegex:null!==n&&n,bSmart:null===o||o,bCaseInsensitive:null===r||r}),Y(a,a.oPreviousSearch,1))})}),Kt("state()",function(){return this.context.length?this.context[0].oSavedState:null}),Kt("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})}),Kt("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),Kt("state.save()",function(){return this.iterator("table",function(t){kt(t)})}),Gt.versionCheck=Gt.fnVersionCheck=function(t){for(var e,n,i=Gt.version.split("."),o=t.split("."),r=0,a=o.length;r<a;r++)if(e=parseInt(i[r],10)||0,n=parseInt(o[r],10)||0,e!==n)return e>n;return!0},Gt.isDataTable=Gt.fnIsDataTable=function(e){var n=t(e).get(0),i=!1;return e instanceof Gt.Api||(t.each(Gt.settings,function(e,o){var r=o.nScrollHead?t("table",o.nScrollHead)[0]:null,a=o.nScrollFoot?t("table",o.nScrollFoot)[0]:null;o.nTable!==n&&r!==n&&a!==n||(i=!0)}),i)},Gt.tables=Gt.fnTables=function(e){var n=!1;t.isPlainObject(e)&&(n=e.api,e=e.visible);var i=t.map(Gt.settings,function(n){if(!e||e&&t(n.nTable).is(":visible"))return n.nTable});return n?new Ut(i):i},Gt.camelToHungarian=r,Kt("$()",function(e,n){var i=this.rows(n).nodes(),o=t(i);return t([].concat(o.filter(e).toArray(),o.find(e).toArray()))}),t.each(["on","one","off"],function(e,n){Kt(n+"()",function(){var e=Array.prototype.slice.call(arguments);e[0]=t.map(e[0].split(/\s/),function(t){return t.match(/\.dt\b/)?t:t+".dt"}).join(" ");var i=t(this.tables().nodes());return i[n].apply(i,e),this})}),Kt("clear()",function(){return this.iterator("table",function(t){N(t)})}),Kt("settings()",function(){return new Ut(this.context,this.context)}),Kt("init()",function(){var t=this.context;return t.length?t[0].oInit:null}),Kt("data()",function(){return this.iterator("table",function(t){return se(t.aoData,"_aData")}).flatten()}),Kt("destroy()",function(n){return n=n||!1,this.iterator("table",function(i){var o,r=i.nTableWrapper.parentNode,a=i.oClasses,s=i.nTable,l=i.nTBody,c=i.nTHead,u=i.nTFoot,d=t(s),h=t(l),p=t(i.nTableWrapper),f=t.map(i.aoData,function(t){return t.nTr});i.bDestroying=!0,$t(i,"aoDestroyCallback","destroy",[i]),n||new Ut(i).columns().visible(!0),p.off(".DT").find(":not(tbody *)").off(".DT"),t(e).off(".DT-"+i.sInstance),s!=c.parentNode&&(d.children("thead").detach(),d.append(c)),u&&s!=u.parentNode&&(d.children("tfoot").detach(),d.append(u)),i.aaSorting=[],i.aaSortingFixed=[],Dt(i),t(f).removeClass(i.asStripeClasses.join(" ")),t("th, td",c).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone),h.children().detach(),h.append(f);var m=n?"remove":"detach";d[m](),p[m](),!n&&r&&(r.insertBefore(s,i.nTableReinsertBefore),d.css("width",i.sDestroyWidth).removeClass(a.sTable),(o=i.asDestroyStripes.length)&&h.children().each(function(e){t(this).addClass(i.asDestroyStripes[e%o])}));var g=t.inArray(i,Gt.settings);-1!==g&&Gt.settings.splice(g,1)})}),t.each(["column","row","cell"],function(t,e){Kt(e+"s().every()",function(t){var n=this.selector.opts,o=this;return this.iterator(e,function(r,a,s,l,c){t.call(o[e](a,"cell"===e?s:n,"cell"===e?n:i),a,s,l,c)})})}),Kt("i18n()",function(e,n,o){var r=this.context[0],a=D(e)(r.oLanguage);return a===i&&(a=n),o!==i&&t.isPlainObject(a)&&(a=a[o]!==i?a[o]:a._),a.replace("%d",o)}),Gt.version="1.10.16",Gt.settings=[],Gt.models={},Gt.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0},Gt.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1},Gt.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null},Gt.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(t){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(t){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:t.extend({},Gt.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"},o(Gt.defaults),Gt.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},o(Gt.defaults.column),Gt.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:i,oAjaxData:i,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Bt(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Bt(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,i=this.aiDisplay.length,o=this.oFeatures,r=o.bPaginate;return o.bServerSide?!1===r||-1===t?e+i:Math.min(e+t,this._iRecordsDisplay):!r||n>i||-1===t?i:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null},Gt.ext=qt={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:Gt.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:Gt.version},t.extend(qt,{afnFiltering:qt.search,aTypes:qt.type.detect,ofnSearch:qt.type.search,oSort:qt.type.order,afnSortData:qt.order,aoFeatures:qt.feature,oApi:qt.internal,oStdClasses:qt.classes,oPagination:qt.pager}),t.extend(Gt.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var je=Gt.ext.pager;t.extend(je,{simple:function(t,e){return["previous","next"]},full:function(t,e){return["first","previous","next","last"]},numbers:function(t,e){return[jt(t,e)]},simple_numbers:function(t,e){return["previous",jt(t,e),"next"]},full_numbers:function(t,e){return["first","previous",jt(t,e),"next","last"]},first_last_numbers:function(t,e){return["first",jt(t,e),"last"]},_numbers:jt,numbers_length:7}),t.extend(!0,Gt.ext.renderer,{pageButton:{_:function(e,o,r,a,s,l){var c,u,d,h=e.oClasses,p=e.oLanguage.oPaginate,f=e.oLanguage.oAria.paginate||{},m=0,g=function(n,i){var o,a,d,v,_=function(t){dt(e,t.data.action,!0)};for(o=0,a=i.length;o<a;o++)if(v=i[o],t.isArray(v)){var b=t("<"+(v.DT_el||"div")+"/>").appendTo(n);g(b,v)}else{switch(c=null,u="",v){case"ellipsis":n.append('<span class="ellipsis">…</span>');break;case"first":c=p.sFirst,u=v+(s>0?"":" "+h.sPageButtonDisabled);break;case"previous":c=p.sPrevious,u=v+(s>0?"":" "+h.sPageButtonDisabled);break;case"next":c=p.sNext,u=v+(s<l-1?"":" "+h.sPageButtonDisabled);break;case"last":c=p.sLast,u=v+(s<l-1?"":" "+h.sPageButtonDisabled);break;default:c=v+1,u=s===v?h.sPageButtonActive:""}null!==c&&(d=t("<a>",{class:h.sPageButton+" "+u,"aria-controls":e.sTableId,"aria-label":f[v],"data-dt-idx":m,tabindex:e.iTabIndex,id:0===r&&"string"==typeof v?e.sTableId+"_"+v:null}).html(c).appendTo(n),Pt(d,{action:v},_),m++)}};try{d=t(o).find(n.activeElement).data("dt-idx")}catch(t){}g(t(o).empty(),a),d!==i&&t(o).find("[data-dt-idx="+d+"]").focus()}}}),t.extend(Gt.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return oe(t,n)?"num"+n:null},function(t,e){if(t&&!(t instanceof Date)&&!Qt.test(t))return null;var n=Date.parse(t);return null!==n&&!isNaN(n)||ee(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return oe(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return ae(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return ae(t,n,!0)?"html-num-fmt"+n:null},function(t,e){return ee(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]),t.extend(Gt.ext.type.search,{html:function(t){return ee(t)?t:"string"==typeof t?t.replace(Xt," ").replace(Jt,""):""},string:function(t){return ee(t)?t:"string"==typeof t?t.replace(Xt," "):t}});var ze=function(t,e,n,i){return 0===t||t&&"-"!==t?(e&&(t=ie(t,e)),t.replace&&(n&&(t=t.replace(n,"")),i&&(t=t.replace(i,""))),1*t):-1/0};t.extend(qt.type.order,{"date-pre":function(t){return Date.parse(t)||-1/0},"html-pre":function(t){return ee(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return ee(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return t<e?-1:t>e?1:0},"string-desc":function(t,e){return t<e?1:t>e?-1:0}}),zt(""),t.extend(!0,Gt.ext.renderer,{header:{_:function(e,n,i,o){t(e.nTable).on("order.dt.DT",function(t,r,a,s){if(e===r){var l=i.idx;n.removeClass(i.sSortingClass+" "+o.sSortAsc+" "+o.sSortDesc).addClass("asc"==s[l]?o.sSortAsc:"desc"==s[l]?o.sSortDesc:i.sSortingClass)}})},jqueryui:function(e,n,i,o){t("<div/>").addClass(o.sSortJUIWrapper).append(n.contents()).append(t("<span/>").addClass(o.sSortIcon+" "+i.sSortingClassJUI)).appendTo(n),t(e.nTable).on("order.dt.DT",function(t,r,a,s){if(e===r){var l=i.idx;n.removeClass(o.sSortAsc+" "+o.sSortDesc).addClass("asc"==s[l]?o.sSortAsc:"desc"==s[l]?o.sSortDesc:i.sSortingClass),n.find("span."+o.sSortIcon).removeClass(o.sSortJUIAsc+" "+o.sSortJUIDesc+" "+o.sSortJUI+" "+o.sSortJUIAscAllowed+" "+o.sSortJUIDescAllowed).addClass("asc"==s[l]?o.sSortJUIAsc:"desc"==s[l]?o.sSortJUIDesc:i.sSortingClassJUI)}})}}});var We=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t};return Gt.render={number:function(t,e,n,i,o){return{display:function(r){if("number"!=typeof r&&"string"!=typeof r)return r;var a=r<0?"-":"",s=parseFloat(r);if(isNaN(s))return We(r);s=s.toFixed(n),r=Math.abs(s);var l=parseInt(r,10),c=n?e+(r-l).toFixed(n).substring(2):"";return a+(i||"")+l.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+c+(o||"")}}},text:function(){return{display:We}}},t.extend(Gt.ext.internal,{_fnExternApiFunc:Wt,_fnBuildAjax:W,_fnAjaxUpdate:q,_fnAjaxParameters:U,_fnAjaxUpdateDraw:K,_fnAjaxDataSrc:V,_fnAddColumn:d,_fnColumnOptions:h,_fnAdjustColumnSizing:p,_fnVisibleToColumnIndex:f,_fnColumnIndexToVisible:m,_fnVisbleColumns:g,_fnGetColumns:v,_fnColumnTypes:_,_fnApplyColumnDefs:b,_fnHungarianMap:o,_fnCamelToHungarian:r,_fnLanguageCompat:a,_fnBrowserDetect:c,_fnAddData:w,_fnAddTr:y,_fnNodeToDataIndex:C,_fnNodeToColumnIndex:x,_fnGetCellData:S,_fnSetCellData:T,_fnSplitObjNotation:E,_fnGetObjectDataFn:D,_fnSetObjectDataFn:A,_fnGetDataMaster:k,_fnClearTable:N,_fnDeleteIndex:R,_fnInvalidate:O,_fnGetRowElements:I,_fnCreateTr:L,_fnBuildHead:M,_fnDrawHead:$,_fnDraw:F,_fnReDraw:H,_fnAddOptionsHtml:B,_fnDetectHeader:j,_fnGetUniqueThs:z,_fnFeatureHtmlFilter:G,_fnFilterComplete:Y,_fnFilterCustom:X,_fnFilterColumn:J,_fnFilter:Q,_fnFilterCreateSearch:Z,_fnEscapeRegex:ve,_fnFilterData:tt,_fnFeatureHtmlInfo:it,_fnUpdateInfo:ot,_fnInfoMacros:rt,_fnInitialise:at,_fnInitComplete:st,_fnLengthChange:lt,_fnFeatureHtmlLength:ct,_fnFeatureHtmlPaginate:ut,_fnPageChange:dt,_fnFeatureHtmlProcessing:ht,_fnProcessingDisplay:pt,_fnFeatureHtmlTable:ft,_fnScrollDraw:mt,_fnApplyToChildren:gt,_fnCalculateColumnWidths:vt,_fnThrottle:ye,_fnConvertToWidth:_t,_fnGetWidestNode:bt,_fnGetMaxLenString:wt,_fnStringToCss:yt,_fnSortFlatten:Ct,_fnSort:xt,_fnSortAria:St,_fnSortListener:Tt,_fnSortAttachListener:Et,_fnSortingClasses:Dt,_fnSortData:At,_fnSaveState:kt,_fnLoadState:Nt,_fnSettingsFromNode:Rt,_fnLog:Ot,_fnMap:It,_fnBindAction:Pt,_fnCallbackReg:Mt,_fnCallbackFire:$t,_fnLengthOverflow:Ft,_fnRenderer:Ht,_fnDataSource:Bt,_fnRowAttributes:P,_fnCalculateEnd:function(){}}),t.fn.dataTable=Gt,Gt.$=t,t.fn.dataTableSettings=Gt.settings,t.fn.dataTableExt=Gt.ext,t.fn.DataTable=function(e){return t(this).dataTable(e).api()},t.each(Gt,function(e,n){t.fn.DataTable[e]=n}),t.fn.dataTable})},,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(n(18),n(26)),o=(n.n(i),n(27),n(32),n(40),n(46),n(48)),r=(n.n(o),n(49)),a=(n.n(r),n(50)),s=(n.n(a),n(4)),l=(n.n(s),n(1)),c=n(2),u=n(3);n.d(e,"Modal",function(){return l.a}),n.d(e,"Recipe",function(){return c.a}),n.d(e,"utils",function(){return u})},function(t,e,n){"use strict";(function(t){var e=n(1);t(document).ready(function(n){t(document).on("click",".wprm-modal-button",function(){var n=t(this).data("editor");e.a.open(n)}),t(document).on("click",".wprm-modal-edit-button",function(){var n=t(this).data("editor"),i=t(this).data("recipe");e.a.open(n,{recipe_id:i})})})}).call(e,n(0))},function(t,e,n){"use strict";(function(t){function i(e){t(".wprm-modal").on("change","input, textarea, #wprm-recipe-author-display, .wprm-recipe-tags, #wprm-ingredient-links-type",function(){s.a.changes_made=!0}),t(".wprm-recipe-details-form, .wprm-recipe-instructions-form").on("click",".wprm-recipe-image-add",function(e){a.select_media_image(t(this).parents(".wprm-recipe-image-container"))}),t(".wprm-recipe-details-form, .wprm-recipe-instructions-form").on("click",".wprm-recipe-image-remove",function(e){a.remove_media_image(t(this).parents(".wprm-recipe-image-container"))}),c.a.init(),t("#wprm-recipe-author-display").select2_wprm({width:"95%"}),t(document).on("change","#wprm-recipe-author-display",function(){var e=t(this).val(),n=t(this).find("option:first").data("default");"custom"==e||"default"==e&&"custom"==n?(t("#wprm-recipe-author-name-container").show(),t("#wprm-recipe-author-link-container").show()):(t("#wprm-recipe-author-name-container").hide(),t("#wprm-recipe-author-link-container").hide())}),t("#wprm-recipe-author-display").change(),t(".wprm-recipe-time").on("keyup change",function(){var e=t(this),n=t("#wprm-recipe-prep-time"),i=n.val(),o=t("#wprm-recipe-cook-time"),r=o.val(),a=t("#wprm-recipe-total-time"),s=a.val();e.is("#wprm-recipe-prep-time")&&(l.a.prep_time_set=!0),e.is("#wprm-recipe-cook-time")&&(l.a.cook_time_set=!0),e.is("#wprm-recipe-total-time")&&(l.a.total_time_set=!0),i&&r&&!l.a.total_time_set&&a.val(parseInt(i)+parseInt(r)),s&&i&&!l.a.cook_time_set&&o.val(parseInt(s)-parseInt(i)),s&&r&&!l.a.prep_time_set&&n.val(parseInt(s)-parseInt(r))}),t(".wprm-recipe-tags").select2_wprm({width:"95%",tags:!0}),t(".wprm-recipe-ingredients-add").on("click",function(){l.a.addIngredient()}),t(".wprm-recipe-ingredients-add-group").on("click",function(){l.a.addIngredientGroup()}),t(".wprm-recipe-instructions-add").on("click",function(){l.a.addInstruction()}),t(".wprm-recipe-instructions-add-group").on("click",function(){l.a.addInstructionGroup()}),t(".wprm-recipe-ingredients").on("keydown",".wprm-recipe-ingredient-notes, .wprm-recipe-ingredient-group-name",function(e){var n=e.keyCode||e.which;t(this),!e.shiftKey&&9==n&&t(this).parents("tr").is("tr:last-child")&&(e.preventDefault(),l.a.addIngredient())}),t(".wprm-recipe-instructions").on("keydown",".wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name",function(e){var n=e.keyCode||e.which;t(this),!e.shiftKey&&9==n&&t(this).parents("tr").is("tr:last-child")&&(e.preventDefault(),l.a.addInstruction())}),t(".wprm-recipe-ingredients-instructions-form").on("click",".wprm-recipe-ingredients-instructions-delete",function(){t(this).parents("tr").remove()}),t(".wprm-recipe-ingredients, .wprm-recipe-instructions").sortable({opacity:.6,revert:!0,cursor:"move",handle:".wprm-recipe-ingredients-instructions-sort"}),t(".wprm-button-action-save").on("click",function(){s.a.actions.insert_update_recipe(t(this))})}e.a=i;var o=n(5),r=(n.n(o),n(6)),a=(n.n(r),n(3)),s=n(1),l=n(2),c=n(7)}).call(e,n(0))},function(t,e,n){var i,o;!function(r,a){i=r,void 0!==(o="function"==typeof i?i.call(e,n,e,t):i)&&(t.exports=o)}(function(){function t(t,e){var n=typeof t[e];return n==w||!(n!=b||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=b||!t[e])}function n(t,e){return typeof t[e]!=y}function i(t){return function(e,n){for(var i=n.length;i--;)if(!t(e,n[i]))return!1;return!0}}function o(t){return t&&E(t,T)&&A(t,S)}function r(t){return e(t,"body")?t.body:t.getElementsByTagName("body")[0]}function a(e){typeof console!=y&&t(console,"log")&&console.log(e)}function s(t,e){R&&e?alert(t):a(t)}function l(t){I.initialized=!0,I.supported=!1,s("Rangy is not supported in this environment. Reason: "+t,I.config.alertOnFail)}function c(t){s("Rangy warning: "+t,I.config.alertOnWarn)}function u(t){return t.message||t.description||String(t)}function d(){if(R&&!I.initialized){var e,n=!1,i=!1;t(document,"createRange")&&(e=document.createRange(),E(e,x)&&A(e,C)&&(n=!0));var s=r(document);if(!s||"body"!=s.nodeName.toLowerCase())return void l("No body element found");if(s&&t(s,"createTextRange")&&(e=s.createTextRange(),o(e)&&(i=!0)),!n&&!i)return void l("Neither Range nor TextRange are available");I.initialized=!0,I.features={implementsDomRange:n,implementsTextRange:i};var c,d;for(var h in N)(c=N[h])instanceof m&&c.init(c,I);for(var p=0,f=M.length;p<f;++p)try{M[p](I)}catch(t){d="Rangy init listener threw an exception. Continuing. Detail: "+u(t),a(d)}}}function h(t,e,n){n&&(t+=" in module "+n.name),I.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function p(t,e,n,i){t[e]=function(){return h(e,n,i),t[n].apply(t,O.toArray(arguments))}}function f(t){t=t||window,d();for(var e=0,n=$.length;e<n;++e)$[e](t)}function m(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function g(t,e,n){var i=new m(t,e,function(e){if(!e.initialized){e.initialized=!0;try{n(I,e),e.supported=!0}catch(e){var i="Module '"+t+"' failed to load: "+u(e);a(i),e.stack&&a(e.stack)}}});return N[t]=i,i}function v(){}function _(){}var b="object",w="function",y="undefined",C=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],x=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],S=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],T=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"],E=i(t),D=i(e),A=i(n),k=[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,i=t.length;n<i;++n)e(t[n],n)},N={},R=typeof window!=y&&typeof document!=y,O={isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:E,areHostObjects:D,areHostProperties:A,isTextRange:o,getBody:r,forEach:k},I={version:"1.3.0",initialized:!1,isBrowser:R,supported:!0,util:O,features:{},modules:N,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==y||rangyAutoInitialize}};I.fail=l,I.warn=c;var L;!{}.hasOwnProperty?l("hasOwnProperty not supported"):(O.extend=L=function(t,e,n){var i,o;for(var r in e)e.hasOwnProperty(r)&&(i=t[r],o=e[r],n&&null!==i&&"object"==typeof i&&null!==o&&"object"==typeof o&&L(i,o,!0),t[r]=o);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},O.createOptions=function(t,e){var n={};return L(n,e),t&&L(n,t),n}),R||l("Rangy can only run in a browser"),function(){var t;if(R){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,i=t.length;n<i;++n)e[n]=t[n];return e}),O.toArray=t}();var P;R&&(t(document,"addEventListener")?P=function(t,e,n){t.addEventListener(e,n,!1)}:t(document,"attachEvent")?P=function(t,e,n){t.attachEvent("on"+e,n)}:l("Document does not have required addEventListener or attachEvent method"),O.addListener=P);var M=[];O.deprecationNotice=h,O.createAliasForDeprecatedMethod=p,I.init=d,I.addInitListener=function(t){I.initialized?t(I):M.push(t)};var $=[];I.addShimListener=function(t){$.push(t)},R&&(I.shim=I.createMissingNativeApi=f,p(I,"createMissingNativeApi","shim")),m.prototype={init:function(){for(var t,e,n=this.dependencies||[],i=0,o=n.length;i<o;++i){if(e=n[i],!((t=N[e])&&t instanceof m))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){I.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){I.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},I.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var i=g(t,n,e);I.initialized&&I.supported&&i.init()},I.createCoreModule=function(t,e,n){g(t,e,n)},I.RangePrototype=v,I.rangePrototype=new v,I.selectionPrototype=new _,I.createCoreModule("DomUtil",[],function(t,e){function n(t){var e;return typeof t.namespaceURI==R||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function i(t){var e=t.parentNode;return 1==e.nodeType?e:null}function o(t){for(var e=0;t=t.previousSibling;)++e;return e}function r(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function a(t,e){var n,i=[];for(n=t;n;n=n.parentNode)i.push(n);for(n=e;n;n=n.parentNode)if(M(i,n))return n;return null}function s(t,e,n){for(var i=n?e:e.parentNode;i;){if(i===t)return!0;i=i.parentNode}return!1}function l(t,e){return s(t,e,!0)}function c(t,e,n){for(var i,o=n?t:t.parentNode;o;){if((i=o.parentNode)===e)return o;o=i}return null}function u(t){var e=t.nodeType;return 3==e||4==e||8==e}function d(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function h(t,e){var n=e.nextSibling,i=e.parentNode;return n?i.insertBefore(t,n):i.appendChild(t),t}function p(t,e,n){var i=t.cloneNode(!1);if(i.deleteData(0,e),t.deleteData(e,t.length-e),h(i,t),n)for(var r,a=0;r=n[a++];)r.node==t&&r.offset>e?(r.node=i,r.offset-=e):r.node==t.parentNode&&r.offset>o(t)&&++r.offset;return i}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=R)return t.ownerDocument;if(typeof t.document!=R)return t.document;if(t.parentNode)return f(t.parentNode);throw e.createError("getDocument: no document found for node")}function m(t){var n=f(t);if(typeof n.defaultView!=R)return n.defaultView;if(typeof n.parentWindow!=R)return n.parentWindow;throw e.createError("Cannot get a window object for node")}function g(t){if(typeof t.contentDocument!=R)return t.contentDocument;if(typeof t.contentWindow!=R)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function v(t){if(typeof t.contentWindow!=R)return t.contentWindow;if(typeof t.contentDocument!=R)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function _(t){return t&&O.isHostMethod(t,"setTimeout")&&O.isHostObject(t,"document")}function b(t,e,n){var i;if(t?O.isHostProperty(t,"nodeType")?i=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?g(t):f(t):_(t)&&(i=t.document):i=document,!i)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return i}function w(t){for(var e;e=t.parentNode;)t=e;return t}function y(t,n,i,r){var s,l,u,d,h;if(t==i)return n===r?0:n<r?-1:1;if(s=c(i,t,!0))return n<=o(s)?-1:1;if(s=c(t,i,!0))return o(s)<r?-1:1;if(!(l=a(t,i)))throw new Error("comparePoints error: nodes have no common ancestor");if(u=t===l?l:c(t,l,!0),d=i===l?l:c(i,l,!0),u===d)throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(h=l.firstChild;h;){if(h===u)return-1;if(h===d)return 1;h=h.nextSibling}}function C(t){try{return t.parentNode,!1}catch(t){return!0}}function x(t){if(!t)return"[No node]";if($&&C(t))return"[Broken node]";if(u(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+o(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function S(t){for(var e,n=f(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function T(t,e,n){var i=I(t),o=t.createElement("div");o.contentEditable=""+!!n,e&&(o.innerHTML=e);var r=i.firstChild;return r?i.insertBefore(o,r):i.appendChild(o),o}function E(t){return t.parentNode.removeChild(t)}function D(t){this.root=t,this._next=t}function A(t){return new D(t)}function k(t,e){this.node=t,this.offset=e}function N(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}var R="undefined",O=t.util,I=O.getBody;O.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),O.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var L=document.createElement("div");O.areHostMethods(L,["insertBefore","appendChild","cloneNode"]||!O.areHostObjects(L,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),O.isHostProperty(L,"innerHTML")||e.fail("Element is missing innerHTML property");var P=document.createTextNode("test");O.areHostMethods(P,["splitText","deleteData","insertData","appendData","cloneNode"]||!O.areHostObjects(L,["previousSibling","nextSibling","childNodes","parentNode"])||!O.areHostProperties(P,["data"]))||e.fail("Incomplete Text Node implementation");var M=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1},$=!1;!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",$=C(n),t.features.crashyTextNodes=$}();var F;typeof window.getComputedStyle!=R?F=function(t,e){return m(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=R?F=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),D.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},k.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+x(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},N.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},N.prototype.toString=function(){return this.message},t.dom={arrayContains:M,isHtmlNamespace:n,parentElement:i,getNodeIndex:o,getNodeLength:r,getCommonAncestor:a,isAncestorOf:s,isOrIsAncestorOf:l,getClosestAncestorIn:c,isCharacterDataNode:u,isTextOrCommentNode:d,insertAfter:h,splitDataNode:p,getDocument:f,getWindow:m,getIframeWindow:v,getIframeDocument:g,getBody:I,isWindow:_,getContentDocument:b,getRootContainer:w,comparePoints:y,isBrokenNode:C,inspectNode:x,getComputedStyleProperty:F,createTestElement:T,removeNode:E,fragmentFromNodeChildren:S,createIterator:A,DomPosition:k},t.DOMException=N}),I.createCoreModule("DomRange",["DomUtil"],function(t,e){function n(t,e){return 3!=t.nodeType&&(j(t,e.startContainer)||j(t,e.endContainer))}function i(t){return t.document||z(t.startContainer)}function o(t){return G(t.startContainer)}function r(t){return new $(t.parentNode,B(t))}function a(t){return new $(t.parentNode,B(t)+1)}function s(t,e,n){var i=11==t.nodeType?t.firstChild:t;return H(e)?n==e.length?P.insertAfter(t,e):e.parentNode.insertBefore(t,0==n?e:q(e,n)):n>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[n]),i}function l(t,e,n){if(T(t),T(e),i(e)!=i(t))throw new F("WRONG_DOCUMENT_ERR");var o=W(t.startContainer,t.startOffset,e.endContainer,e.endOffset),r=W(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?o<=0&&r>=0:o<0&&r>0}function c(t){for(var e,n,o,r=i(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(o=t.getSubtreeIterator(),n.appendChild(c(o)),o.detach()),10==n.nodeType)throw new F("HIERARCHY_REQUEST_ERR");r.appendChild(n)}return r}function u(t,e,n){var i,o;n=n||{stop:!1};for(var r,a;r=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(r))return void(n.stop=!0);if(a=t.getSubtreeIterator(),u(a,e,n),a.detach(),n.stop)return}else for(i=P.createIterator(r);o=i.next();)if(!1===e(o))return void(n.stop=!0)}function d(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(e=t.getSubtreeIterator(),d(e),e.detach()):t.remove()}function h(t){for(var e,n,o=i(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(h(n)),n.detach()):t.remove(),10==e.nodeType)throw new F("HIERARCHY_REQUEST_ERR");o.appendChild(e)}return o}function p(t,e,n){var i,o=!(!e||!e.length),r=!!n;o&&(i=new RegExp("^("+e.join("|")+")$"));var a=[];return u(new m(t,!1),function(e){if((!o||i.test(e.nodeType))&&(!r||n(e))){var s=t.startContainer;if(e!=s||!H(s)||t.startOffset!=s.length){var l=t.endContainer;e==l&&H(l)&&0==t.endOffset||a.push(e)}}}),a}function f(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+P.inspectNode(t.startContainer)+":"+t.startOffset+", "+P.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function m(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&H(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||H(this.sc)?U(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||H(this.ec)?U(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}function g(t){return function(e,n){for(var i,o=n?e:e.parentNode;o;){if(i=o.nodeType,V(t,i))return o;o=o.parentNode}return null}}function v(t,e){if(ot(t,e))throw new F("INVALID_NODE_TYPE_ERR")}function _(t,e){if(!V(e,t.nodeType))throw new F("INVALID_NODE_TYPE_ERR")}function b(t,e){if(e<0||e>(H(t)?t.length:t.childNodes.length))throw new F("INDEX_SIZE_ERR")}function w(t,e){if(nt(t,!0)!==nt(e,!0))throw new F("WRONG_DOCUMENT_ERR")}function y(t){if(it(t,!0))throw new F("NO_MODIFICATION_ALLOWED_ERR")}function C(t,e){if(!t)throw new F(e)}function x(t,e){return e<=(H(t)?t.length:t.childNodes.length)}function S(t){return!!t.startContainer&&!!t.endContainer&&!(Y&&(P.isBrokenNode(t.startContainer)||P.isBrokenNode(t.endContainer)))&&G(t.startContainer)==G(t.endContainer)&&x(t.startContainer,t.startOffset)&&x(t.endContainer,t.endOffset)}function T(t){if(!S(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}function E(t,e){T(t);var n=t.startContainer,i=t.startOffset,o=t.endContainer,r=t.endOffset,a=n===o;H(o)&&r>0&&r<o.length&&q(o,r,e),H(n)&&i>0&&i<n.length&&(n=q(n,i,e),a?(r-=i,o=n):o==n.parentNode&&r>=B(n)&&r++,i=0),t.setStartAndEnd(n,i,o,r)}function D(t){T(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}function A(t){t.START_TO_START=ct,t.START_TO_END=ut,t.END_TO_END=dt,t.END_TO_START=ht,t.NODE_BEFORE=pt,t.NODE_AFTER=ft,t.NODE_BEFORE_AND_AFTER=mt,t.NODE_INSIDE=gt}function k(t){A(t),A(t.prototype)}function N(t,e){return function(){T(this);var n,i,o=this.startContainer,r=this.startOffset,s=this.commonAncestorContainer,l=new m(this,!0);o!==s&&(n=U(o,s,!0),i=a(n),o=i.node,r=i.offset),u(l,y),l.reset();var c=t(l);return l.detach(),e(this,o,r,o,r),c}}function R(e,i){function o(t,e){return function(n){_(n,J),_(G(n),Q);var i=(t?r:a)(n);(e?s:l)(this,i.node,i.offset)}}function s(t,e,n){var o=t.endContainer,r=t.endOffset;e===t.startContainer&&n===t.startOffset||(G(e)==G(o)&&1!=W(e,n,o,r)||(o=e,r=n),i(t,e,n,o,r))}function l(t,e,n){var o=t.startContainer,r=t.startOffset;e===t.endContainer&&n===t.endOffset||(G(e)==G(o)&&-1!=W(e,n,o,r)||(o=e,r=n),i(t,o,r,e,n))}var c=function(){};c.prototype=t.rangePrototype,e.prototype=new c,M.extend(e.prototype,{setStart:function(t,e){v(t,!0),b(t,e),s(this,t,e)},setEnd:function(t,e){v(t,!0),b(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],n=t[1],o=e,r=n;switch(t.length){case 3:r=t[2];break;case 4:o=t[2],r=t[3]}i(this,e,n,o,r)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:o(!0,!0),setStartAfter:o(!1,!0),setEndBefore:o(!0,!1),setEndAfter:o(!1,!1),collapse:function(t){T(this),t?i(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):i(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){v(t,!0),i(this,t,0,t,K(t))},selectNode:function(t){v(t,!1),_(t,J);var e=r(t),n=a(t);i(this,e.node,e.offset,n.node,n.offset)},extractContents:N(h,i),deleteContents:N(d,i),canSurroundContents:function(){T(this),y(this.startContainer),y(this.endContainer);var t=new m(this,!0),e=t._first&&n(t._first,this)||t._last&&n(t._last,this);return t.detach(),!e},splitBoundaries:function(){E(this)},splitBoundariesPreservingPositions:function(t){E(this,t)},normalizeBoundaries:function(){T(this);var t,e=this.startContainer,n=this.startOffset,o=this.endContainer,r=this.endOffset,a=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(o=t,r=t.length,t.appendData(e.data),X(e))},s=function(t){var i=t.previousSibling;if(i&&i.nodeType==t.nodeType){e=t;var a=t.length;if(n=i.length,t.insertData(0,i.data),X(i),e==o)r+=n,o=e;else if(o==t.parentNode){var s=B(t);r==s?(o=t,r=a):r>s&&r--}}},l=!0;if(H(o))r==o.length?a(o):0==r&&(t=o.previousSibling)&&t.nodeType==o.nodeType&&(r=t.length,e==o&&(l=!1),t.appendData(o.data),X(o),o=t);else{if(r>0){var c=o.childNodes[r-1];c&&H(c)&&a(c)}l=!this.collapsed}if(l){if(H(e))0==n?s(e):n==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(o==t&&(o=e,r+=e.length),e.appendData(t.data),X(t));else if(n<e.childNodes.length){var u=e.childNodes[n];u&&H(u)&&s(u)}}else e=o,n=r;i(this,e,n,o,r)},collapseToPoint:function(t,e){v(t,!0),b(t,e),this.setStartAndEnd(t,e)}}),k(e)}function O(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:P.getCommonAncestor(t.startContainer,t.endContainer)}function I(t,e,n,i,o){t.startContainer=e,t.startOffset=n,t.endContainer=i,t.endOffset=o,t.document=P.getDocument(e),O(t)}function L(t){this.startContainer=t,this.startOffset=0,this.endContainer=t,this.endOffset=0,this.document=t,O(this)}var P=t.dom,M=t.util,$=P.DomPosition,F=t.DOMException,H=P.isCharacterDataNode,B=P.getNodeIndex,j=P.isOrIsAncestorOf,z=P.getDocument,W=P.comparePoints,q=P.splitDataNode,U=P.getClosestAncestorIn,K=P.getNodeLength,V=P.arrayContains,G=P.getRootContainer,Y=t.features.crashyTextNodes,X=P.removeNode;m.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,H(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!H(n)||n!==this.sc&&n!==this.ec?n.parentNode&&X(n):(t=n===this.sc?this.so:0,e=n===this.ec?this.eo:n.length,t!=e&&n.deleteData(t,e-t))},isPartiallySelectedSubtree:function(){return n(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)t=this.range.cloneRange(),t.collapse(!1);else{t=new L(i(this.range));var e=this._current,n=e,o=0,r=e,a=K(e);j(e,this.sc)&&(n=this.sc,o=this.so),j(e,this.ec)&&(r=this.ec,a=this.eo),I(t,n,o,r,a)}return new m(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var J=[1,3,4,5,7,8,10],Q=[2,9,11],Z=[5,6,10,12],tt=[1,3,4,5,7,8,10,11],et=[1,3,4,5,7,8],nt=g([9,11]),it=g(Z),ot=g([6,10,12]),rt=document.createElement("style"),at=!1;try{rt.innerHTML="<b>x</b>",at=3==rt.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=at;var st=at?function(t){var e=this.startContainer,n=z(e);if(!e)throw new F("INVALID_STATE_ERR");var i=null;return 1==e.nodeType?i=e:H(e)&&(i=P.parentElement(e)),i=null===i||"HTML"==i.nodeName&&P.isHtmlNamespace(z(i).documentElement)&&P.isHtmlNamespace(i)?n.createElement("body"):i.cloneNode(!1),i.innerHTML=t,P.fragmentFromNodeChildren(i)}:function(t){var e=i(this),n=e.createElement("body");return n.innerHTML=t,P.fragmentFromNodeChildren(n)},lt=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ct=0,ut=1,dt=2,ht=3,pt=0,ft=1,mt=2,gt=3;M.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){T(this),w(this.startContainer,e.startContainer);var n,i,o,r,a=t==ht||t==ct?"start":"end",s=t==ut||t==ct?"start":"end";return n=this[a+"Container"],i=this[a+"Offset"],o=e[s+"Container"],r=e[s+"Offset"],W(n,i,o,r)},insertNode:function(t){if(T(this),_(t,tt),y(this.startContainer),j(t,this.startContainer))throw new F("HIERARCHY_REQUEST_ERR");var e=s(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){T(this);var t,e;if(this.collapsed)return i(this).createDocumentFragment();if(this.startContainer===this.endContainer&&H(this.startContainer))return t=this.startContainer.cloneNode(!0),t.data=t.data.slice(this.startOffset,this.endOffset),e=i(this).createDocumentFragment(),e.appendChild(t),e;var n=new m(this,!0);return t=c(n),n.detach(),t},canSurroundContents:function(){T(this),y(this.startContainer),y(this.endContainer);var t=new m(this,!0),e=t._first&&n(t._first,this)||t._last&&n(t._last,this);return t.detach(),!e},surroundContents:function(t){if(_(t,et),!this.canSurroundContents())throw new F("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);s(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){T(this);for(var t,e=new L(i(this)),n=lt.length;n--;)t=lt[n],e[t]=this[t];return e},toString:function(){T(this);var t=this.startContainer;if(t===this.endContainer&&H(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new m(this,!0);return u(n,function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)}),n.detach(),e.join("")},compareNode:function(t){T(this);var e=t.parentNode,n=B(t);if(!e)throw new F("NOT_FOUND_ERR");var i=this.comparePoint(e,n),o=this.comparePoint(e,n+1);return i<0?o>0?mt:pt:o>0?ft:gt},comparePoint:function(t,e){return T(this),C(t,"HIERARCHY_REQUEST_ERR"),w(t,this.startContainer),W(t,e,this.startContainer,this.startOffset)<0?-1:W(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:st,toHtml:function(){return D(this)},intersectsNode:function(t,e){if(T(this),G(t)!=o(this))return!1;var n=t.parentNode,i=B(t);if(!n)return!0;var r=W(n,i,this.endContainer,this.endOffset),a=W(n,i+1,this.startContainer,this.startOffset);return e?r<=0&&a>=0:r<0&&a>0},isPointInRange:function(t,e){return T(this),C(t,"HIERARCHY_REQUEST_ERR"),w(t,this.startContainer),W(t,e,this.startContainer,this.startOffset)>=0&&W(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return l(this,t,!1)},intersectsOrTouchesRange:function(t){return l(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=W(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=W(this.endContainer,this.endOffset,t.endContainer,t.endOffset),i=this.cloneRange();return-1==e&&i.setStart(t.startContainer,t.startOffset),1==n&&i.setEnd(t.endContainer,t.endOffset),i}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==W(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==W(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new F("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==gt},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,K(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var i=n.pop();return e.setEnd(i,i.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return T(this),p(this,t,e)},getDocument:function(){return i(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var n=i(this),o=t.createRange(n);e=e||P.getBody(n),o.selectNodeContents(e);var r=this.intersection(o),a=0,s=0;return r&&(o.setEnd(r.startContainer,r.startOffset),a=o.toString().length,s=a+r.toString().length),{start:a,end:s,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var i,o,r,a,s=[e],l=!1,c=!1;!c&&(i=s.pop());)if(3==i.nodeType)o=n+i.length,!l&&t.start>=n&&t.start<=o&&(this.setStart(i,t.start-n),l=!0),l&&t.end>=n&&t.end<=o&&(this.setEnd(i,t.end-n),c=!0),n=o;else for(a=i.childNodes,r=a.length;r--;)s.push(a[r])},getName:function(){return"DomRange"},equals:function(t){return L.rangesEqual(this,t)},isValid:function(){return S(this)},inspect:function(){return f(this)},detach:function(){}}),R(L,I),M.extend(L,{rangeProperties:lt,RangeIterator:m,copyComparisonConstants:k,createPrototypeRange:R,inspect:f,toHtml:D,getRangeDocument:i,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=L}),I.createCoreModule("WrappedRange",["DomRange"],function(t,e){var n,i,o=t.dom,r=t.util,a=o.DomPosition,s=t.DomRange,l=o.getBody,c=o.getContentDocument,u=o.isCharacterDataNode;if(t.features.implementsDomRange&&function(){function i(t){for(var e,n=h.length;n--;)e=h[n],t[e]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function a(t,e,n,i,o){var r=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==i||t.endOffset!=o,s=!t.equals(t.nativeRange);(r||a||s)&&(t.setEnd(i,o),t.setStart(e,n))}var u,d,h=s.rangeProperties;n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,i(this)},s.createPrototypeRange(n,a),u=n.prototype,u.selectNode=function(t){this.nativeRange.selectNode(t),i(this)},u.cloneContents=function(){return this.nativeRange.cloneContents()},u.surroundContents=function(t){this.nativeRange.surroundContents(t),i(this)},u.collapse=function(t){this.nativeRange.collapse(t),i(this)},u.cloneRange=function(){return new n(this.nativeRange.cloneRange())},u.refresh=function(){i(this)},u.toString=function(){return this.nativeRange.toString()};var p=document.createTextNode("test");l(document).appendChild(p);var f=document.createRange();f.setStart(p,0),f.setEnd(p,0);try{f.setStart(p,1),u.setStart=function(t,e){this.nativeRange.setStart(t,e),i(this)},u.setEnd=function(t,e){this.nativeRange.setEnd(t,e),i(this)},d=function(t){return function(e){this.nativeRange[t](e),i(this)}}}catch(t){u.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}i(this)},u.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}i(this)},d=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(i){this.nativeRange[e](n),this.nativeRange[t](n)}i(this)}}}u.setStartBefore=d("setStartBefore","setEndBefore"),u.setStartAfter=d("setStartAfter","setEndAfter"),u.setEndBefore=d("setEndBefore","setStartBefore"),u.setEndAfter=d("setEndAfter","setStartAfter"),u.selectNodeContents=function(t){this.setStartAndEnd(t,0,o.getNodeLength(t))},f.selectNodeContents(p),f.setEnd(p,3);var m=document.createRange();m.selectNodeContents(p),m.setEnd(p,4),m.setStart(p,2),-1==f.compareBoundaryPoints(f.START_TO_END,m)&&1==f.compareBoundaryPoints(f.END_TO_START,m)?u.compareBoundaryPoints=function(t,e){return e=e.nativeRange||e,t==e.START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:u.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var g=document.createElement("div");g.innerHTML="123";var v=g.firstChild,_=l(document);_.appendChild(g),f.setStart(v,1),f.setEnd(v,2),f.deleteContents(),"13"==v.data&&(u.deleteContents=function(){this.nativeRange.deleteContents(),i(this)},u.extractContents=function(){var t=this.nativeRange.extractContents();return i(this),t}),_.removeChild(g),_=null,r.isHostMethod(f,"createContextualFragment")&&(u.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(p),u.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return t=c(t,e,"createNativeRange"),t.createRange()}}(),t.features.implementsTextRange){var d=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var i=n.parentElement();n=t.duplicate(),n.collapse(!1);var r=n.parentElement(),a=i==r?i:o.getCommonAncestor(i,r);return a==e?a:o.getCommonAncestor(e,a)},h=function(t){return 0==t.compareEndPoints("StartToEnd",t)},p=function(t,e,n,i,r){var s=t.duplicate();s.collapse(n);var l=s.parentElement();if(o.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var c=new a(l.parentNode,o.getNodeIndex(l));return{boundaryPosition:c,nodeInfo:{nodeIndex:c.offset,containerElement:c.node}}}var d=o.getDocument(l).createElement("span");d.parentNode&&o.removeNode(d);for(var h,p,f,m,g,v=n?"StartToStart":"StartToEnd",_=r&&r.containerElement==l?r.nodeIndex:0,b=l.childNodes.length,w=b,y=w;y==b?l.appendChild(d):l.insertBefore(d,l.childNodes[y]),s.moveToElementText(d),0!=(h=s.compareEndPoints(v,t))&&_!=w;){if(-1==h){if(w==_+1)break;_=y}else w=w==_+1?_:y;y=Math.floor((_+w)/2),l.removeChild(d)}if(g=d.nextSibling,-1==h&&g&&u(g)){s.setEndPoint(n?"EndToStart":"EndToEnd",t);var C;if(/[\r\n]/.test(g.data)){var x=s.duplicate(),S=x.text.replace(/\r\n/g,"\r").length;for(C=x.moveStart("character",S);-1==(h=x.compareEndPoints("StartToEnd",x));)C++,x.moveStart("character",1)}else C=s.text.length;m=new a(g,C)}else p=(i||!n)&&d.previousSibling,f=(i||n)&&d.nextSibling,m=f&&u(f)?new a(f,0):p&&u(p)?new a(p,p.data.length):new a(l,o.getNodeIndex(d));return o.removeNode(d),{boundaryPosition:m,nodeInfo:{nodeIndex:y,containerElement:l}}},f=function(t,e){var n,i,r,a,s=t.offset,c=o.getDocument(t.node),d=l(c).createTextRange(),h=u(t.node);return h?(n=t.node,i=n.parentNode):(a=t.node.childNodes,n=s<a.length?a[s]:null,i=t.node),r=c.createElement("span"),r.innerHTML="&#feff;",n?i.insertBefore(r,n):i.appendChild(r),d.moveToElementText(r),d.collapse(!e),i.removeChild(r),h&&d[e?"moveStart":"moveEnd"]("character",s),d};i=function(t){this.textRange=t,this.refresh()},i.prototype=new s(document),i.prototype.refresh=function(){var t,e,n,i=d(this.textRange);h(this.textRange)?e=t=p(this.textRange,i,!0,!0).boundaryPosition:(n=p(this.textRange,i,!0,!1),t=n.boundaryPosition,e=p(this.textRange,i,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},i.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(i);var m=function(t){if(t.collapsed)return f(new a(t.startContainer,t.startOffset),!0);var e=f(new a(t.startContainer,t.startOffset),!0),n=f(new a(t.endContainer,t.endOffset),!1),i=l(s.getRangeDocument(t)).createTextRange();return i.setEndPoint("StartToStart",e),i.setEndPoint("EndToEnd",n),i};if(i.rangeToTextRange=m,i.prototype.toTextRange=function(){return m(this)},t.WrappedTextRange=i,!t.features.implementsDomRange||t.config.preferTextRange){var g=function(t){return t("return this;")()}(Function);void 0===g.Range&&(g.Range=i),t.createNativeRange=function(t){return t=c(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=i}}t.createRange=function(n){return n=c(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=c(t,e,"createRangyRange"),new s(t)},r.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),r.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener(function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null})}),I.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(t,e){function n(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function i(t,n){if(t){if(E.isWindow(t))return t;if(t instanceof v)return t.win;var i=E.getContentDocument(t,e,n);return E.getWindow(i)}return window}function o(t){return i(t,"getWinSelection").getSelection()}function r(t){return i(t,"getDocSelection").document.selection}function a(t){var e=!1;return t.anchorNode&&(e=1==E.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}function s(t,e,n){var i=n?"end":"start",o=n?"start":"end";t.anchorNode=e[i+"Container"],t.anchorOffset=e[i+"Offset"],t.focusNode=e[o+"Container"],t.focusOffset=e[o+"Offset"]}function l(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function c(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0}function u(e){var n;return e instanceof k?(n=t.createNativeRange(e.getDocument()),n.setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof N?n=e.nativeRange:I.implementsDomRange&&e instanceof E.getWindow(e.startContainer).Range&&(n=e),n}function d(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!E.isAncestorOf(t[0],t[e]))return!1;return!0}function h(t){var n=t.getNodes();if(!d(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function p(t){return!!t&&void 0!==t.text}function f(t,e){var n=new N(e);t._ranges=[n],s(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed}function m(e){if(e._ranges.length=0,"None"==e.docSelection.type)c(e);else{var n=e.docSelection.createRange();if(p(n))f(e,n);else{e.rangeCount=n.length;for(var i,o=L(n.item(0)),r=0;r<e.rangeCount;++r)i=t.createRange(o),i.selectNode(n.item(r)),e._ranges.push(i);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,s(e,e._ranges[e.rangeCount-1],!1)}}}function g(t,n){for(var i=t.docSelection.createRange(),o=h(n),r=L(i.item(0)),a=P(r).createControlRange(),s=0,l=i.length;s<l;++s)a.add(i.item(s));try{a.add(o)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),m(t)}function v(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function _(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0}function b(t,e){for(var n,i,o=Q.length;o--;)if(n=Q[o],i=n.selection,"deleteAll"==e)_(i);else if(n.win==t)return"delete"==e?(Q.splice(o,1),!0):i;return"deleteAll"==e&&(Q.length=0),null}function w(t,n){for(var i,o=L(n[0].startContainer),r=P(o).createControlRange(),a=0,s=n.length;a<s;++a){i=h(n[a]);try{r.add(i)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}r.select(),m(t)}function y(t,e){if(t.win.document!=L(e))throw new R("WRONG_DOCUMENT_ERR")}function C(e){return function(n,i){var o;this.rangeCount?(o=this.getRangeAt(0),o["set"+(e?"Start":"End")](n,i)):(o=t.createRange(this.win.document),o.setStartAndEnd(n,i)),this.setSingleRange(o,this.isBackward())}}function x(t){var e=[],n=new O(t.anchorNode,t.anchorOffset),i=new O(t.focusNode,t.focusOffset),o="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var r=0,a=t.rangeCount;r<a;++r)e[r]=k.inspect(t.getRangeAt(r));return"["+o+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+i.inspect()+"]"}t.config.checkSelectionRanges=!0;var S,T,E=t.dom,D=t.util,A=D.isHostMethod,k=t.DomRange,N=t.WrappedRange,R=t.DOMException,O=E.DomPosition,I=t.features,L=E.getDocument,P=E.getBody,M=k.rangesEqual,$=A(window,"getSelection"),F=D.isHostObject(document,"selection");I.implementsWinGetSelection=$,I.implementsDocSelection=F;var H=F&&(!$||t.config.preferTextRange);if(H)S=r,t.isSelectionValid=function(t){var e=i(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||L(n.createRange().parentElement())==e};else{if(!$)return e.fail("Neither document.selection or window.getSelection() detected."),!1;S=o,t.isSelectionValid=function(){return!0}}t.getNativeSelection=S;var B=S();if(!B)return e.fail("Native selection was null (possibly issue 138?)"),!1;var j=t.createNativeRange(document),z=P(document),W=D.areHostProperties(B,["anchorNode","focusNode","anchorOffset","focusOffset"]);I.selectionHasAnchorAndFocus=W;var q=A(B,"extend");I.selectionHasExtend=q;var U="number"==typeof B.rangeCount;I.selectionHasRangeCount=U;var K=!1,V=!0,G=q?function(e,n){var i=k.getRangeDocument(n),o=t.createRange(i);o.collapseToPoint(n.endContainer,n.endOffset),e.addRange(u(o)),e.extend(n.startContainer,n.startOffset)}:null;D.areHostMethods(B,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof B.rangeCount&&I.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,i=n>1,o=[],r=a(e),s=0;s<n;++s)o[s]=e.getRangeAt(s);var l=E.createTestElement(document,"",!1),c=l.appendChild(document.createTextNode(" ")),u=document.createRange();if(u.setStart(c,1),u.collapse(!0),e.removeAllRanges(),e.addRange(u),V=1==e.rangeCount,e.removeAllRanges(),!i){var d=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(d&&parseInt(d[1])>=36)K=!1;else{var h=u.cloneRange();u.setStart(c,0),h.setEnd(c,3),h.setStart(c,2),e.addRange(u),e.addRange(h),K=2==e.rangeCount}}for(E.removeNode(l),e.removeAllRanges(),s=0;s<n;++s)0==s&&r?G?G(e,o[s]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(o[s])):e.addRange(o[s])}}(),I.selectionSupportsMultipleRanges=K,I.collapsedNonEditableSelectionsSupported=V;var Y,X=!1;z&&A(z,"createControlRange")&&(Y=z.createControlRange(),D.areHostProperties(Y,["item","add"])&&(X=!0)),I.implementsControlRange=X,T=W?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed};var J;A(B,"getRangeAt")?J=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:W&&(J=function(e){var n=L(e.anchorNode),i=t.createRange(n);return i.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),i.collapsed!==this.isCollapsed&&i.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),i}),v.prototype=t.selectionPrototype;var Q=[],Z=function(t){if(t&&t instanceof v)return t.refresh(),t;t=i(t,"getNativeSelection");var e=b(t),n=S(t),o=F?r(t):null;return e?(e.nativeSelection=n,e.docSelection=o,e.refresh()):(e=new v(n,o,t),Q.push({win:t,selection:e})),e};t.getSelection=Z,D.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var tt=v.prototype;if(!H&&W&&D.areHostMethods(B,["removeAllRanges","addRange"])){tt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),c(this)};var et=function(t,e){G(t.nativeSelection,e),t.refresh()};tt.addRange=U?function(e,i){if(X&&F&&"Control"==this.docSelection.type)g(this,e);else if(n(i)&&q)et(this,e);else{var o;K?o=this.rangeCount:(this.removeAllRanges(),o=0);var r=u(e).cloneRange();try{this.nativeSelection.addRange(r)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(t.config.checkSelectionRanges){var a=J(this.nativeSelection,this.rangeCount-1);a&&!M(a,e)&&(e=new N(a))}this._ranges[this.rangeCount-1]=e,s(this,e,ot(this.nativeSelection)),this.isCollapsed=T(this)}else this.refresh()}}:function(t,e){n(e)&&q?et(this,t):(this.nativeSelection.addRange(u(t)),this.refresh())},tt.setRanges=function(t){if(X&&F&&t.length>1)w(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(A(B,"empty")&&A(j,"select")&&X&&H))return e.fail("No means of selecting a Range or TextRange was found"),!1;tt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=L(this.anchorNode);else if("Control"==this.docSelection.type){var e=this.docSelection.createRange();e.length&&(t=L(e.item(0)))}t&&(P(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}c(this)},tt.addRange=function(e){"Control"==this.docSelection.type?g(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,s(this,e,!1))},tt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?w(this,t):e&&this.addRange(t[0])}}tt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new R("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()};var nt;if(H)nt=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=P(e.win.document).createTextRange(),n.collapse(!0)),"Control"==e.docSelection.type?m(e):p(n)?f(e,n):c(e)};else if(A(B,"getRangeAt")&&"number"==typeof B.rangeCount)nt=function(e){if(X&&F&&"Control"==e.docSelection.type)m(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,i=e.rangeCount;n<i;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));s(e,e._ranges[e.rangeCount-1],ot(e.nativeSelection)),e.isCollapsed=T(e)}else c(e)};else{if(!W||"boolean"!=typeof B.isCollapsed||"boolean"!=typeof j.collapsed||!I.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;nt=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=J(n,0),t._ranges=[e],t.rangeCount=1,l(t),t.isCollapsed=T(t)):c(t)}}tt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,i=this.anchorOffset;if(nt(this),t){var o=e.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=i)return!0;for(;o--;)if(!M(e[o],this._ranges[o]))return!0;return!1}};var it=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var i=0,o=n.length;i<o;++i)M(e,n[i])||t.addRange(n[i]);t.rangeCount||c(t)};tt.removeRange=X&&F?function(t){if("Control"==this.docSelection.type){for(var e,n=this.docSelection.createRange(),i=h(t),o=L(n.item(0)),r=P(o).createControlRange(),a=!1,s=0,l=n.length;s<l;++s)e=n.item(s),e!==i||a?r.add(n.item(s)):a=!0;r.select(),m(this)}else it(this,t)}:function(t){it(this,t)};var ot;!H&&W&&I.implementsDomRange?(ot=a,tt.isBackward=function(){return ot(this)}):ot=tt.isBackward=function(){return!1},tt.isBackwards=tt.isBackward,tt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},tt.collapse=function(e,n){y(this,e);var i=t.createRange(e);i.collapseToPoint(e,n),this.setSingleRange(i),this.isCollapsed=!0},tt.collapseToStart=function(){if(!this.rangeCount)throw new R("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},tt.collapseToEnd=function(){if(!this.rangeCount)throw new R("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},tt.selectAllChildren=function(e){y(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},tt.deleteFromDocument=function(){if(X&&F&&"Control"==this.docSelection.type){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),E.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var i=0,o=n.length;i<o;++i)n[i].deleteContents();this.addRange(n[o-1])}}},tt.eachRange=function(t,e){for(var n=0,i=this._ranges.length;n<i;++n)if(t(this.getRangeAt(n)))return e},tt.getAllRanges=function(){var t=[];return this.eachRange(function(e){t.push(e)}),t},tt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},tt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange(function(i){n.push(i[t].apply(i,e||[]))}),n},tt.setStart=C(!0),tt.setEnd=C(!1),t.rangePrototype.select=function(t){Z(this.getDocument()).setSingleRange(this,t)},tt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange(function(n){t(n),e.push(n)}),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},tt.containsNode=function(t,e){return this.eachRange(function(n){return n.containsNode(t,e)},!0)||!1},tt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},tt.moveToBookmark=function(e){for(var n,i,o=[],r=0;n=e.rangeBookmarks[r++];)i=t.createRange(this.win),i.moveToBookmark(n),o.push(i);e.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},tt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},tt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},tt.toHtml=function(){var t=[];return this.eachRange(function(e){t.push(k.toHtml(e))}),t.join("")},I.implementsTextRange&&(tt.getNativeTextRange=function(){var n;if(n=this.docSelection){var i=n.createRange();if(p(i))return i;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),tt.getName=function(){return"WrappedSelection"},tt.inspect=function(){return x(this)},tt.detach=function(){b(this.win,"delete"),_(this)},v.detachAll=function(){b(null,"deleteAll")},v.inspect=x,v.isDirectionBackward=n,t.Selection=v,t.selectionPrototype=tt,t.addShimListener(function(t){void 0===t.getSelection&&(t.getSelection=function(){return Z(t)}),t=null})});var F=!1,H=function(t){F||(F=!0,!I.initialized&&I.config.autoInitialize&&d())};return R&&("complete"==document.readyState?H():(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",H,!1),P(window,"load",H))),I})},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(u===setTimeout)return setTimeout(t,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function r(t){if(d===clearTimeout)return clearTimeout(t);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function a(){m&&p&&(m=!1,p.length?f=p.concat(f):g=-1,f.length&&s())}function s(){if(!m){var t=o(a);m=!0;for(var e=f.length;e;){for(p=f,f=[];++g<e;)p&&p[g].run();g=-1,e=f.length}p=null,m=!1,r(t)}}function l(t,e){this.fun=t,this.array=e}function c(){}var u,d,h=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(t){u=n}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(t){d=i}}();var p,f=[],m=!1,g=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new l(t,e)),1!==f.length||m||o(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e){},function(t,e){},function(t,e,n){"use strict";function i(){r.a.prototype.createLink=function(t){var e,n=r.a.selection.getSelectionElement(this.options.contentWindow),i={};if(-1!==this.elements.indexOf(n)){try{if(this.events.disableCustomEvent("editableInput"),t.url&&r.a.util.deprecated(".url option for createLink",".value","6.0.0"),(e=t.url||t.value)&&e.trim().length>0){var o=this.options.contentWindow.getSelection();if(o){var a,s,l,c,u=o.getRangeAt(0),d=u.commonAncestorContainer;if(3===u.endContainer.nodeType&&3!==u.startContainer.nodeType&&0===u.startOffset&&u.startContainer.firstChild===u.endContainer&&(d=u.endContainer),s=r.a.util.getClosestBlockContainer(u.startContainer),l=r.a.util.getClosestBlockContainer(u.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var h=s||n,p=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),p.appendChild(h.cloneNode(!0)),n===h?r.a.selection.select(this.options.ownerDocument,h.firstChild,0,h.lastChild,3===h.lastChild.nodeType?h.lastChild.nodeValue.length:h.lastChild.childNodes.length):r.a.selection.select(this.options.ownerDocument,h,0,h,h.childNodes.length);var f=this.exportSelection();c=r.a.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,p,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex}),0===c.length&&(p=this.options.ownerDocument.createDocumentFragment(),p.appendChild(d.cloneNode(!0)),c=[p.firstChild.firstChild,p.firstChild.lastChild]),r.a.util.createLink(this.options.ownerDocument,c,e.trim());var m=(p.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;r.a.util.insertHTMLCommand(this.options.ownerDocument,p.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=m,a.end-=m,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,e);this.options.targetBlank||"_blank"===t.target?r.a.util.setTargetBlank(r.a.selection.getSelectionStart(this.options.ownerDocument),e):r.a.util.removeTargetBlank(r.a.selection.getSelectionStart(this.options.ownerDocument),e),"nofollow"===t.rel?r.a.util.setNofollow(r.a.selection.getSelectionStart(this.options.ownerDocument),e):r.a.util.removeNofollow(r.a.selection.getSelectionStart(this.options.ownerDocument),e),t.buttonClass&&r.a.util.addClassToAnchors(r.a.selection.getSelectionStart(this.options.ownerDocument),t.buttonClass)}}if(this.options.targetBlank||"_blank"===t.target||"nofollow"===t.rel||t.buttonClass){i=this.options.ownerDocument.createEvent("HTMLEvents"),i.initEvent("input",!0,!0,this.options.contentWindow);for(var g=0,v=this.elements.length;g<v;g+=1)this.elements[g].dispatchEvent(i)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",i,n)}},r.a.util.setNofollow=function(t,e){var n,i=e||!1;if("a"===t.nodeName.toLowerCase())t.rel="nofollow";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==i&&i!==t[n].attributes.href.value||(t[n].rel="nofollow")},r.a.util.removeNofollow=function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&t[n].removeAttribute("rel")}}e.b=i,n.d(e,"a",function(){return a});var o=n(8),r=n.n(o),a=r.a.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!0,targetCheckboxText:"Open in new tab",nofollowCheckbox:!0,nofollowCheckboxText:"Use nofollow",name:"links",action:"createLink",aria:"link",tagNames:["a"],contentDefault:'<span class="dashicons dashicons-admin-links"></span>',contentFA:'<i class="fa fa-link"></i>',init:function(){r.a.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=r.a.selection.getSelectionRange(this.document);return"a"===e.startContainer.nodeName.toLowerCase()||"a"===e.endContainer.nodeName.toLowerCase()||r.a.util.getClosestTag(r.a.selection.getSelectedParentElement(e),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(t){r.a.util.isKey(t,r.a.util.keyCode.K)&&r.a.util.isMetaCtrlKey(t)&&!t.shiftKey&&this.handleClick(t)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'" style="padding-left: 25px; width: 265px;">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row" style="padding-left: 20px;">','<input type="checkbox" class="medium-editor-toolbar-anchor-target">',"<label>",this.targetCheckboxText,"</label>","</div>"),this.nofollowCheckbox&&t.push('<div class="medium-editor-toolbar-form-row" style="padding-left: 20px;">','<input type="checkbox" class="medium-editor-toolbar-anchor-nofollow">',"<label>",this.nofollowCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return r.a.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){r.a.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(t){var e=this.getInput(),n=this.getAnchorTargetCheckbox(),i=this.getAnchorNofollowCheckbox(),o=this.getAnchorButtonCheckbox();if(t=t||{value:""},"string"==typeof t&&(t={value:t}),this.base.saveSelection(),this.hideToolbarDefaultActions(),r.a.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),e.value=t.value,e.focus(),n&&(n.checked="_blank"===t.target),i&&(i.checked="nofollow"===t.rel),o){var a=t.buttonClass?t.buttonClass.split(" "):[];o.checked=-1!==a.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorNofollowCheckbox(),n=this.getAnchorButtonCheckbox(),i={value:this.getInput().value.trim()};return this.linkValidation&&(i.value=this.checkLinkFormat(i.value)),i.target="_self",t&&t.checked&&(i.target="_blank"),i.rel="",e&&e.checked&&(i.rel="nofollow"),n&&n.checked&&(i.buttonClass=this.customClassOption),i},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],i=e[1];return n+(void 0===i?"":"="+this.ensureEncodedUriComponent(i))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,n=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,i=t.split("?"),o=i[0],r=i[1];return n.test(t)?"tel:"+t:(e.test(t)?"":"http://")+this.ensureEncodedUri(o)+(void 0===r?"":"?"+this.ensureEncodedQuery(r))},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),i=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(i,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document,e=t.createElement("div");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),e.innerHTML=this.getTemplate(),this.attachFormEvents(e),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorNofollowCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-nofollow")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(t){if(t.keyCode===r.a.util.keyCode.ENTER)return t.preventDefault(),void this.doFormSave();t.keyCode===r.a.util.keyCode.ESCAPE&&(t.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}})},function(t,e,n){"use strict";(function(t){function n(e){t(e.container).on("click",".wprm-modal-close, .wprm-modal-backdrop",function(){e.changes_made&&!confirm(wprm_temp_admin.modal.text.modal_close_confirm)||e.close()}),t(".wprm-menu").on("click",".wprm-menu-item",function(){var e=t(this),n=e.data("menu"),i=e.data("tab");t(".wprm-menu").removeClass("visible"),t(".wprm-menu").find(".wprm-menu-item").removeClass("active"),e.addClass("active"),t(".wprm-frame-router").find(".wprm-router").removeClass("active"),t(".wprm-frame-router").find("#wprm-menu-"+n).addClass("active");var o=!1;t(".wprm-router").find(".wprm-menu-item").removeClass("active"),t(".wprm-frame-router").find("#wprm-menu-"+n).find(".wprm-menu-item").each(function(e){0!==e&&t(this).data("tab")!=i||(o=t(this))}),o&&o.click(),t(".wprm-frame-title").find("h1").text(e.text())}),t(e.container).on("click",".wprm-frame-title",function(){t(".wprm-menu").toggleClass("visible")}),t(".wprm-router").on("click",".wprm-menu-item",function(){var e=t(this),n=e.data("tab"),i=e.data("button");t(".wprm-router").find(".wprm-menu-item").removeClass("active"),e.addClass("active"),e.data("callback")?(t(".wprm-button-action").text(i).show(),"wprm-menu-recipe"==e.parents(".wprm-router").attr("id")?t(".wprm-button-action-save").show():t(".wprm-button-action-save").hide()):(t(".wprm-button-action").hide(),t(".wprm-button-action-save").hide()),t(".wprm-frame-content").find(".wprm-frame-content-tab").removeClass("active"),t(".wprm-frame-content").find("#wprm-tab-"+n).addClass("active")}),t(".wprm-button-action").on("click",function(){var n=t(".wprm-router.active").find(".wprm-menu-item.active"),i=n.data("callback");i&&"function"==typeof e.actions[i]&&e.actions[i](t(this))}),t(e.container).keydown(function(t){t.stopPropagation()}),t(".wprm-recipes-dropdown").select2_wprm({width:"250px",ajax:{type:"POST",url:wprm_temp_admin.ajax_url,dataType:"json",delay:250,data:function(t){return{action:"wprm_search_recipes",security:wprm_temp_admin.nonce,search:t.term}},processResults:function(t,e){return{results:t.data.recipes_with_id}},cache:!0},minimumInputLength:1}),t(".wprm-recipes-dropdown-with-first").select2_wprm({width:"250px",ajax:{type:"POST",url:wprm_temp_admin.ajax_url,dataType:"json",delay:250,data:function(t){return{action:"wprm_search_recipes",security:wprm_temp_admin.nonce,search:t.term}},processResults:function(t,e){return{results:[{id:"0",text:wprm_temp_admin.modal.text.first_recipe_on_page}].concat(t.data.recipes_with_id)}},cache:!0},minimumInputLength:1})}e.a=n}).call(e,n(0))},function(t,e,n){(function(t){function e(e){var n={action:"wprm_feedback",security:wprm_temp_admin.nonce,answer:e};t.post(wprm_temp_admin.ajax_url,n)}t(document).ready(function(n){var i=t(".wprm-feedback-notice");i.length>0&&(t("#wprm-feedback-stop").on("click",function(){e("stop"),i.slideUp()}),t("#wprm-feedback-no").on("click",function(){e("no");var t="<strong>How could we make it better?</strong><br/>";t+='Please send any issues or suggestions you have to <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20feedback">support@bootstrapped.ventures</a> and we\'ll see what we can do!',i.html(t)}),t("#wprm-feedback-yes").on("click",function(){e("yes");var t="<strong>Happy to hear!</strong><br/>";t+='It would be really helpful if you could leave us an honest review over at <a href="https://wordpress.org/support/plugin/wp-recipe-maker/reviews/#new-post" target="_blank">wordpress.org</a><br/>',t+='Suggestions to make the plugin even better are also very welcome at <a href="mailto:support@bootstrapped.ventures?subject=WP%20Recipe%20Maker%20suggestions">support@bootstrapped.ventures</a>',i.html(t)}))})}).call(e,n(0))},function(t,e,n){"use strict";var i=n(28),o=(n.n(i),n(29)),r=(n.n(o),n(30));n.n(r),n(31)},function(t,e){},function(t,e,n){(function(t){var e=!1;t(document).ready(function(n){t(".wprm-import-recipes-select-all").on("click",function(e){e.preventDefault(),t(".wprm-import-recipes").find(":checkbox").each(function(){t(this).prop("checked",!0)})}),t(".wprm-import-recipes-select-none").on("click",function(e){e.preventDefault(),t(".wprm-import-recipes").find(":checkbox").each(function(){t(this).prop("checked",!1)})}),t(".wprm-import-recipes").on("click",":checkbox",function(n){if(e&&n.shiftKey){var i=t(".wprm-import-recipes").find(":checkbox"),o=i.index(this),r=i.index(e);i.slice(Math.min(o,r),Math.max(o,r)+1).prop("checked",e.checked)}e=this}),t(".wprm-import-next-page").on("click",function(){var t=window.location.href,e=/(&|\?)p=(\d+)/,n=e.exec(t);if(n){var i=parseInt(n[2]),o="p="+i,r="p="+(i+1);t=t.replace("?"+o,"?"+r),t=t.replace("&"+o,"&"+r)}window.location=t}),t(".wprm-import-reset-page").on("click",function(){var t=window.location.href,e=/(&|\?)p=(\d+)/,n=e.exec(t);if(n){var i=parseInt(n[2]),o="p="+i;t=t.replace("?"+o,"?p=0"),t=t.replace("&"+o,"&p=0")}window.location=t})})}).call(e,n(0))},function(t,e,n){(function(t){function e(){var o={action:"wprm_import_recipes",security:wprm_temp_admin.nonce,importer_uid:wprm_import.importer_uid,post_data:wprm_import.post_data,recipes:i};t.post(wprm_temp_admin.ajax_url,o,function(o){o.success?(i=o.data.recipes_left,n(),i.length>0?e():t("#wprm-import-finished").show()):window.location=o.data.redirect},"json")}function n(){var e=100*(1-i.length/o);t("#wprm-import-progress-bar").css("width",e+"%")}var i=[],o=0;t(document).ready(function(t){void 0!==window.wprm_import&&(i=wprm_import.recipes,o=wprm_import.recipes.length,e())})}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var e=n(1);t(document).ready(function(n){t(document).on("click",".wprm-import-recipes-actions-edit",function(n){n.preventDefault();var i=t(this).data("id");e.a.open(!1,{recipe_id:i})})})}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var e=n(33),i=n(37),o=n(39);n.n(o),t(document).ready(function(n){t(".wprm-manage-datatable").length>0&&(Object(e.a)(),Object(i.a)())})}).call(e,n(0))},function(t,e,n){"use strict";(function(t,i){function o(){for(var t,e={},n=location.search.slice(1),i=/([^&=]+)=([^&]*)/g;t=i.exec(n);)e[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return e}function r(e){var n=o();t(".wprm-manage-recipes-filter").on("change",function(){e.search("").draw()}).each(function(){var e=t(this).data("taxonomy");n.hasOwnProperty(e)&&t(this).val(n[e])}).select2_wprm()}function a(){var e="";t(".wprm-manage-datatable").each(function(){e=t(this).attr("id")}),i.fn.dataTable.ext.errMode="throw",r(t(".wprm-manage-datatable").DataTable({pageLength:10,order:[0,"desc"],serverSide:!0,ajax:{url:wprm_temp_admin.ajax_url,type:"POST",data:function(n){n.action="wprm_manage_datatable",n.security=wprm_temp_admin.nonce,n.table=e;var i=t(".wprm-manage-recipes-filter");if(i.length>0){var o=t("#wprm-manage-recipes_wrapper").find('input[type="search"]').val();i.each(function(){var e=t(this).data("taxonomy"),n=parseInt(t(this).val());n>0&&(o+="{{"+e+"="+n+"}}")}),n.search.value=o}}},drawCallback:function(){t(".wprm-manage-datatable").find("select").select2_wprm(),t(".wprm-manage-ingredients-actions").tooltipster({content:'<div class="wprm-manage-ingredients-actions-tooltip">'+wprm_temp_admin.manage.tooltip.ingredients+"</div>",contentAsHTML:!0,functionBefore:function(){var e=t.tooltipster.instances();t.each(e,function(t,e){e.close()})},functionReady:function(e,n){var i=parseInt(t(n.origin).data("id")),o=parseInt(t(n.origin).data("count")),r=t("#wprm-manage-ingredients-name-"+i).text();t(n.tooltip).find("a").data("id",i),t(n.tooltip).find(".tooltip-header").text("#"+i+" - "+r),o>0&&t(n.tooltip).find(".wprm-manage-ingredients-actions-delete").remove()},interactive:!0,delay:0,side:"left",trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{click:!0,tap:!0}}),t(".wprm-manage-taxonomies-actions").tooltipster({content:'<div class="wprm-manage-taxonomies-actions-tooltip">'+wprm_temp_admin.manage.tooltip.taxonomies+"</div>",contentAsHTML:!0,functionBefore:function(){var e=t.tooltipster.instances();t.each(e,function(t,e){e.close()})},functionReady:function(e,n){var i=parseInt(t(n.origin).data("id")),o=(parseInt(t(n.origin).data("count")),t("#wprm-manage-taxonomies-name-"+i).text());t(n.tooltip).find("a").data("id",i),t(n.tooltip).find(".tooltip-header").text("#"+i+" - "+o)},interactive:!0,delay:0,side:"left",trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{click:!0,tap:!0}}),t(".wprm-manage-recipes-actions").tooltipster({content:'<div class="wprm-manage-recipes-actions-tooltip">'+wprm_temp_admin.manage.tooltip.recipes+"</div>",contentAsHTML:!0,functionBefore:function(){var e=t.tooltipster.instances();t.each(e,function(t,e){e.close()})},functionReady:function(e,n){var i=parseInt(t(n.origin).data("id")),o=t("#wprm-manage-recipes-name-"+i).text();t(n.tooltip).find(".tooltip-header").text("#"+i+" - "+o),t(n.tooltip).find("a").data("id",i)},interactive:!0,delay:0,side:"left",trigger:"custom",triggerOpen:{mouseenter:!0,touchstart:!0},triggerClose:{click:!0,tap:!0}}),t(".wprm-manage-recipes-seo").tooltipster({delay:0,side:"left"})}}))}e.a=a;var s=n(5),l=(n.n(s),n(6)),c=(n.n(l),n(9)),u=(n.n(c),n(34)),d=(n.n(u),n(35)),h=(n.n(d),n(36));n.n(h)}).call(e,n(0),n(0))},function(t,e){},function(t,e,n){var i,o;/*! tooltipster v4.2.5 */!function(r,a){i=[n(0)],void 0!==(o=function(t){return a(t)}.apply(e,i))&&(t.exports=o)}(0,function(t){function e(t){this.$container,this.constraints=null,this.__$tooltip,this.__init(t)}function n(e,n){var i=!0;return t.each(e,function(t,o){return void 0===n[t]||e[t]!==n[t]?(i=!1,!1):void 0}),i}function i(e){var n=e.attr("id"),i=n?a.window.document.getElementById(n):null;return i?i===e[0]:t.contains(a.window.document.body,e[0])}var o={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},r="undefined"!=typeof window?window:null,a={hasTouchCapability:!(!r||!("ontouchstart"in r||r.DocumentTouch&&r.document instanceof r.DocumentTouch||r.navigator.maxTouchPoints)),hasTransitions:function(){if(!r)return!1;var t=r.document.body||r.document.documentElement,e=t.style,n="transition",i=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof e[n])return!0;n=n.charAt(0).toUpperCase()+n.substr(1);for(var o=0;o<i.length;o++)if("string"==typeof e[i[o]+n])return!0;return!1}(),IE:!1,semVer:"4.2.5",window:r},s=function(){this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),this.__instancesLatestArr=[],this.__plugins={},this._env=a};s.prototype={__bridge:function(e,n,i){if(!n[i]){var r=function(){};r.prototype=e;var a=new r;a.__init&&a.__init(n),t.each(e,function(t,e){0!=t.indexOf("__")&&(n[t]?o.debug&&console.log("The "+t+" method of the "+i+" plugin conflicts with another plugin or native methods"):(n[t]=function(){return a[t].apply(a,Array.prototype.slice.apply(arguments))},n[t].bridged=a))}),n[i]=a}return this},__setWindow:function(t){return a.window=t,this},_getRuler:function(t){return new e(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(e){var n=this;if("string"==typeof e){var i=e,o=null;return i.indexOf(".")>0?o=n.__plugins[i]:t.each(n.__plugins,function(t,e){return e.name.substring(e.name.length-i.length-1)=="."+i?(o=e,!1):void 0}),o}if(e.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return n.__plugins[e.name]=e,e.core&&n.__bridge(e.core,n,e.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(e){var n=[];return t(e||".tooltipstered").each(function(){var e=t(this),i=e.data("tooltipster-ns");i&&t.each(i,function(t,i){n.push(e.data(i))})}),n},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(e){return t((e?e+" ":"")+".tooltipstered").toArray()},setDefaults:function(e){return t.extend(o,e),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},t.tooltipster=new s,t.Tooltipster=function(e,n){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=t({}),this.__$emitterPublic=t({}),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(e,n)},t.Tooltipster.prototype={__init:function(e,n){var i=this;if(i._$origin=t(e),i.__options=t.extend(!0,{},o,n),i.__optionsFormat(),!a.IE||a.IE>=i.__options.IEmin){var r=null;if(void 0===i._$origin.data("tooltipster-initialTitle")&&(r=i._$origin.attr("title"),void 0===r&&(r=null),i._$origin.data("tooltipster-initialTitle",r)),null!==i.__options.content)i.__contentSet(i.__options.content);else{var s,l=i._$origin.attr("data-tooltip-content");l&&(s=t(l)),s&&s[0]?i.__contentSet(s.first()):i.__contentSet(r)}i._$origin.removeAttr("title").addClass("tooltipstered"),i.__prepareOrigin(),i.__prepareGC(),t.each(i.__options.plugins,function(t,e){i._plug(e)}),a.hasTouchCapability&&t(a.window.document.body).on("touchmove."+i.__namespace+"-triggerOpen",function(t){i._touchRecordEvent(t)}),i._on("created",function(){i.__prepareTooltip()})._on("repositioned",function(t){i.__lastPosition=t.position})}else i.__options.disabled=!0},__contentInsert:function(){var t=this,e=t._$tooltip.find(".tooltipster-content"),n=t.__Content,i=function(t){n=t};return t._trigger({type:"format",content:t.__Content,format:i}),t.__options.functionFormat&&(n=t.__options.functionFormat.call(t,t,{origin:t._$origin[0]},t.__Content)),"string"!=typeof n||t.__options.contentAsHTML?e.empty().append(n):e.text(n),t},__contentSet:function(e){return e instanceof t&&this.__options.contentCloning&&(e=e.clone(!0)),this.__Content=e,this._trigger({type:"updated",content:e}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var e=this,n=e._$origin,i=e._$origin.is("area");if(i){var o=e._$origin.parent().attr("name");n=t('img[usemap="#'+o+'"]')}var r=n[0].getBoundingClientRect(),s=t(a.window.document),l=t(a.window),c=n,u={available:{document:null,window:null},document:{size:{height:s.height(),width:s.width()}},window:{scroll:{left:a.window.scrollX||a.window.document.documentElement.scrollLeft,top:a.window.scrollY||a.window.document.documentElement.scrollTop},size:{height:l.height(),width:l.width()}},origin:{fixedLineage:!1,offset:{},size:{height:r.bottom-r.top,width:r.right-r.left},usemapImage:i?n[0]:null,windowOffset:{bottom:r.bottom,left:r.left,right:r.right,top:r.top}}};if(i){var d=e._$origin.attr("shape"),h=e._$origin.attr("coords");if(h&&(h=h.split(","),t.map(h,function(t,e){h[e]=parseInt(t)})),"default"!=d)switch(d){case"circle":var p=h[0],f=h[1],m=h[2],g=f-m,v=p-m;u.origin.size.height=2*m,u.origin.size.width=u.origin.size.height,u.origin.windowOffset.left+=v,u.origin.windowOffset.top+=g;break;case"rect":var _=h[0],b=h[1],w=h[2],y=h[3];u.origin.size.height=y-b,u.origin.size.width=w-_,u.origin.windowOffset.left+=_,u.origin.windowOffset.top+=b;break;case"poly":for(var C=0,x=0,S=0,T=0,E="even",D=0;D<h.length;D++){var A=h[D];"even"==E?(A>S&&(S=A,0===D&&(C=S)),C>A&&(C=A),E="odd"):(A>T&&(T=A,1==D&&(x=T)),x>A&&(x=A),E="even")}u.origin.size.height=T-x,u.origin.size.width=S-C,u.origin.windowOffset.left+=C,u.origin.windowOffset.top+=x}}var k=function(t){u.origin.size.height=t.height,u.origin.windowOffset.left=t.left,u.origin.windowOffset.top=t.top,u.origin.size.width=t.width};for(e._trigger({type:"geometry",edit:k,geometry:{height:u.origin.size.height,left:u.origin.windowOffset.left,top:u.origin.windowOffset.top,width:u.origin.size.width}}),u.origin.windowOffset.right=u.origin.windowOffset.left+u.origin.size.width,u.origin.windowOffset.bottom=u.origin.windowOffset.top+u.origin.size.height,u.origin.offset.left=u.origin.windowOffset.left+u.window.scroll.left,u.origin.offset.top=u.origin.windowOffset.top+u.window.scroll.top,u.origin.offset.bottom=u.origin.offset.top+u.origin.size.height,u.origin.offset.right=u.origin.offset.left+u.origin.size.width,u.available.document={bottom:{height:u.document.size.height-u.origin.offset.bottom,width:u.document.size.width},left:{height:u.document.size.height,width:u.origin.offset.left},right:{height:u.document.size.height,width:u.document.size.width-u.origin.offset.right},top:{height:u.origin.offset.top,width:u.document.size.width}},u.available.window={bottom:{height:Math.max(u.window.size.height-Math.max(u.origin.windowOffset.bottom,0),0),width:u.window.size.width},left:{height:u.window.size.height,width:Math.max(u.origin.windowOffset.left,0)},right:{height:u.window.size.height,width:Math.max(u.window.size.width-Math.max(u.origin.windowOffset.right,0),0)},top:{height:Math.max(u.origin.windowOffset.top,0),width:u.window.size.width}};"html"!=c[0].tagName.toLowerCase();){if("fixed"==c.css("position")){u.origin.fixedLineage=!0;break}c=c.parent()}return u},__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=t(a.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=t(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 e=this;return e.__options.selfDestruction?e.__garbageCollector=setInterval(function(){var n=(new Date).getTime();e.__touchEvents=t.grep(e.__touchEvents,function(t,e){return n-t.time>6e4}),i(e._$origin)||e.close(function(){e.destroy()})},2e4):clearInterval(e.__garbageCollector),e},__prepareOrigin:function(){var t=this;if(t._$origin.off("."+t.__namespace+"-triggerOpen"),a.hasTouchCapability&&t._$origin.on("touchstart."+t.__namespace+"-triggerOpen touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen",function(e){t._touchRecordEvent(e)}),t.__options.triggerOpen.click||t.__options.triggerOpen.tap&&a.hasTouchCapability){var e="";t.__options.triggerOpen.click&&(e+="click."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.tap&&a.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&t._open(e)})}if(t.__options.triggerOpen.mouseenter||t.__options.triggerOpen.touchstart&&a.hasTouchCapability){var e="";t.__options.triggerOpen.mouseenter&&(e+="mouseenter."+t.__namespace+"-triggerOpen "),t.__options.triggerOpen.touchstart&&a.hasTouchCapability&&(e+="touchstart."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){!t._touchIsTouchEvent(e)&&t._touchIsEmulatedEvent(e)||(t.__pointerIsOverOrigin=!0,t._openShortly(e))})}if(t.__options.triggerClose.mouseleave||t.__options.triggerClose.touchleave&&a.hasTouchCapability){var e="";t.__options.triggerClose.mouseleave&&(e+="mouseleave."+t.__namespace+"-triggerOpen "),t.__options.triggerClose.touchleave&&a.hasTouchCapability&&(e+="touchend."+t.__namespace+"-triggerOpen touchcancel."+t.__namespace+"-triggerOpen"),t._$origin.on(e,function(e){t._touchIsMeaningfulEvent(e)&&(t.__pointerIsOverOrigin=!1)})}return t},__prepareTooltip:function(){var e=this,n=e.__options.interactive?"auto":"";return e._$tooltip.attr("id",e.__namespace).css({"pointer-events":n,zIndex:e.__options.zIndex}),t.each(e.__previousThemes,function(t,n){e._$tooltip.removeClass(n)}),t.each(e.__options.theme,function(t,n){e._$tooltip.addClass(n)}),e.__previousThemes=t.merge([],e.__options.theme),e},__scrollHandler:function(e){var n=this;if(n.__options.triggerClose.scroll)n._close(e);else if(i(n._$origin)&&i(n._$tooltip)){var o=null;if(e.target===a.window.document)n.__Geometry.origin.fixedLineage||n.__options.repositionOnScroll&&n.reposition(e);else{o=n.__geometry();var r=!1;if("fixed"!=n._$origin.css("position")&&n.__$originParents.each(function(e,n){var i=t(n),a=i.css("overflow-x"),s=i.css("overflow-y");if("visible"!=a||"visible"!=s){var l=n.getBoundingClientRect();if("visible"!=a&&(o.origin.windowOffset.left<l.left||o.origin.windowOffset.right>l.right))return r=!0,!1;if("visible"!=s&&(o.origin.windowOffset.top<l.top||o.origin.windowOffset.bottom>l.bottom))return r=!0,!1}return"fixed"!=i.css("position")&&void 0}),r)n._$tooltip.css("visibility","hidden");else if(n._$tooltip.css("visibility","visible"),n.__options.repositionOnScroll)n.reposition(e);else{var s=o.origin.offset.left-n.__Geometry.origin.offset.left,l=o.origin.offset.top-n.__Geometry.origin.offset.top;n._$tooltip.css({left:n.__lastPosition.coord.left+s,top:n.__lastPosition.coord.top+l})}}n._trigger({type:"scroll",event:e,geo:o})}return n},__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,t.each(this.__timeouts.close,function(t,e){clearTimeout(e)}),this.__timeouts.close=[],this},__trackerStart:function(){var t=this,e=t._$tooltip.find(".tooltipster-content");return t.__options.trackTooltip&&(t.__contentBcr=e[0].getBoundingClientRect()),t.__tracker=setInterval(function(){if(i(t._$origin)&&i(t._$tooltip)){if(t.__options.trackOrigin){var o=t.__geometry(),r=!1;n(o.origin.size,t.__Geometry.origin.size)&&(t.__Geometry.origin.fixedLineage?n(o.origin.windowOffset,t.__Geometry.origin.windowOffset)&&(r=!0):n(o.origin.offset,t.__Geometry.origin.offset)&&(r=!0)),r||(t.__options.triggerClose.mouseleave?t._close():t.reposition())}if(t.__options.trackTooltip){var a=e[0].getBoundingClientRect();a.height===t.__contentBcr.height&&a.width===t.__contentBcr.width||(t.reposition(),t.__contentBcr=a)}}else t._close()},t.__options.trackerInterval),t},_close:function(e,n,i){var o=this,r=!0;if(o._trigger({type:"close",event:e,stop:function(){r=!1}}),r||i){n&&o.__callbacks.close.push(n),o.__callbacks.open=[],o.__timeoutsClear();var s=function(){t.each(o.__callbacks.close,function(t,n){n.call(o,o,{event:e,origin:o._$origin[0]})}),o.__callbacks.close=[]};if("closed"!=o.__state){var l=!0,c=new Date,u=c.getTime(),d=u+o.__options.animationDuration[1];if("disappearing"==o.__state&&d>o.__closingTime&&o.__options.animationDuration[1]>0&&(l=!1),l){o.__closingTime=d,"disappearing"!=o.__state&&o.__stateSet("disappearing");var h=function(){clearInterval(o.__tracker),o._trigger({type:"closing",event:e}),o._$tooltip.off("."+o.__namespace+"-triggerClose").removeClass("tooltipster-dying"),t(a.window).off("."+o.__namespace+"-triggerClose"),o.__$originParents.each(function(e,n){t(n).off("scroll."+o.__namespace+"-triggerClose")}),o.__$originParents=null,t(a.window.document.body).off("."+o.__namespace+"-triggerClose"),o._$origin.off("."+o.__namespace+"-triggerClose"),o._off("dismissable"),o.__stateSet("closed"),o._trigger({type:"after",event:e}),o.__options.functionAfter&&o.__options.functionAfter.call(o,o,{event:e,origin:o._$origin[0]}),s()};a.hasTransitions?(o._$tooltip.css({"-moz-animation-duration":o.__options.animationDuration[1]+"ms","-ms-animation-duration":o.__options.animationDuration[1]+"ms","-o-animation-duration":o.__options.animationDuration[1]+"ms","-webkit-animation-duration":o.__options.animationDuration[1]+"ms","animation-duration":o.__options.animationDuration[1]+"ms","transition-duration":o.__options.animationDuration[1]+"ms"}),o._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),o.__options.animationDuration[1]>0&&o._$tooltip.delay(o.__options.animationDuration[1]),o._$tooltip.queue(h)):o._$tooltip.stop().fadeOut(o.__options.animationDuration[1],h)}}else s()}return o},_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(e,n){var o=this;if(!o.__destroying&&i(o._$origin)&&o.__enabled){var r=!0;if("closed"==o.__state&&(o._trigger({type:"before",event:e,stop:function(){r=!1}}),r&&o.__options.functionBefore&&(r=o.__options.functionBefore.call(o,o,{event:e,origin:o._$origin[0]}))),!1!==r&&null!==o.__Content){n&&o.__callbacks.open.push(n),o.__callbacks.close=[],o.__timeoutsClear();var s,l=function(){"stable"!=o.__state&&o.__stateSet("stable"),t.each(o.__callbacks.open,function(t,e){e.call(o,o,{origin:o._$origin[0],tooltip:o._$tooltip[0]})}),o.__callbacks.open=[]};if("closed"!==o.__state)s=0,"disappearing"===o.__state?(o.__stateSet("appearing"),a.hasTransitions?(o._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),o.__options.animationDuration[0]>0&&o._$tooltip.delay(o.__options.animationDuration[0]),o._$tooltip.queue(l)):o._$tooltip.stop().fadeIn(l)):"stable"==o.__state&&l();else{if(o.__stateSet("appearing"),s=o.__options.animationDuration[0],o.__contentInsert(),o.reposition(e,!0),a.hasTransitions?(o._$tooltip.addClass("tooltipster-"+o.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":o.__options.animationDuration[0]+"ms","-ms-animation-duration":o.__options.animationDuration[0]+"ms","-o-animation-duration":o.__options.animationDuration[0]+"ms","-webkit-animation-duration":o.__options.animationDuration[0]+"ms","animation-duration":o.__options.animationDuration[0]+"ms","transition-duration":o.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=o.__state&&(o._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),o.__options.animationDuration[0]>0&&o._$tooltip.delay(o.__options.animationDuration[0]),o._$tooltip.queue(l))},0)):o._$tooltip.css("display","none").fadeIn(o.__options.animationDuration[0],l),o.__trackerStart(),t(a.window).on("resize."+o.__namespace+"-triggerClose",function(e){var n=t(document.activeElement);(n.is("input")||n.is("textarea"))&&t.contains(o._$tooltip[0],n[0])||o.reposition(e)}).on("scroll."+o.__namespace+"-triggerClose",function(t){o.__scrollHandler(t)}),o.__$originParents=o._$origin.parents(),o.__$originParents.each(function(e,n){t(n).on("scroll."+o.__namespace+"-triggerClose",function(t){o.__scrollHandler(t)})}),o.__options.triggerClose.mouseleave||o.__options.triggerClose.touchleave&&a.hasTouchCapability){o._on("dismissable",function(t){t.dismissable?t.delay?(h=setTimeout(function(){o._close(t.event)},t.delay),o.__timeouts.close.push(h)):o._close(t):clearTimeout(h)});var c=o._$origin,u="",d="",h=null;o.__options.interactive&&(c=c.add(o._$tooltip)),o.__options.triggerClose.mouseleave&&(u+="mouseenter."+o.__namespace+"-triggerClose ",d+="mouseleave."+o.__namespace+"-triggerClose "),o.__options.triggerClose.touchleave&&a.hasTouchCapability&&(u+="touchstart."+o.__namespace+"-triggerClose",d+="touchend."+o.__namespace+"-triggerClose touchcancel."+o.__namespace+"-triggerClose"),c.on(d,function(t){if(o._touchIsTouchEvent(t)||!o._touchIsEmulatedEvent(t)){var e="mouseleave"==t.type?o.__options.delay:o.__options.delayTouch;o._trigger({delay:e[1],dismissable:!0,event:t,type:"dismissable"})}}).on(u,function(t){!o._touchIsTouchEvent(t)&&o._touchIsEmulatedEvent(t)||o._trigger({dismissable:!1,event:t,type:"dismissable"})})}o.__options.triggerClose.originClick&&o._$origin.on("click."+o.__namespace+"-triggerClose",function(t){o._touchIsTouchEvent(t)||o._touchIsEmulatedEvent(t)||o._close(t)}),(o.__options.triggerClose.click||o.__options.triggerClose.tap&&a.hasTouchCapability)&&setTimeout(function(){if("closed"!=o.__state){var e="",n=t(a.window.document.body);o.__options.triggerClose.click&&(e+="click."+o.__namespace+"-triggerClose "),o.__options.triggerClose.tap&&a.hasTouchCapability&&(e+="touchend."+o.__namespace+"-triggerClose"),n.on(e,function(e){o._touchIsMeaningfulEvent(e)&&(o._touchRecordEvent(e),o.__options.interactive&&t.contains(o._$tooltip[0],e.target)||o._close(e))}),o.__options.triggerClose.tap&&a.hasTouchCapability&&n.on("touchstart."+o.__namespace+"-triggerClose",function(t){o._touchRecordEvent(t)})}},0),o._trigger("ready"),o.__options.functionReady&&o.__options.functionReady.call(o,o,{origin:o._$origin[0],tooltip:o._$tooltip[0]})}if(o.__options.timer>0){var h=setTimeout(function(){o._close()},o.__options.timer+s);o.__timeouts.close.push(h)}}}return o},_openShortly:function(t){var e=this,n=!0;if("stable"!=e.__state&&"appearing"!=e.__state&&!e.__timeouts.open&&(e._trigger({type:"start",event:t,stop:function(){n=!1}}),n)){var i=0==t.type.indexOf("touch")?e.__options.delayTouch:e.__options.delay;i[0]?e.__timeouts.open=setTimeout(function(){e.__timeouts.open=null,e.__pointerIsOverOrigin&&e._touchIsMeaningfulEvent(t)?(e._trigger("startend"),e._open(t)):e._trigger("startcancel")},i[0]):(e._trigger("startend"),e._open(t))}return e},_optionsExtract:function(e,n){var i=this,o=t.extend(!0,{},n),r=i.__options[e];return r||(r={},t.each(n,function(t,e){var n=i.__options[t];void 0!==n&&(r[t]=n)})),t.each(o,function(e,n){void 0!==r[e]&&("object"!=typeof n||n instanceof Array||null==n||"object"!=typeof r[e]||r[e]instanceof Array||null==r[e]?o[e]=r[e]:t.extend(o[e],r[e]))}),o},_plug:function(e){var n=t.tooltipster._plugin(e);if(!n)throw new Error('The "'+e+'" plugin is not defined');return n.instance&&t.tooltipster.__bridge(n.instance,this,n.name),this},_touchIsEmulatedEvent:function(t){for(var e=!1,n=(new Date).getTime(),i=this.__touchEvents.length-1;i>=0;i--){var o=this.__touchEvents[i];if(!(n-o.time<500))break;o.target===t.target&&(e=!0)}return e},_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 e=!1,n=this.__touchEvents.length-1;n>=0;n--){var i=this.__touchEvents[n];if("touchmove"==i.type){e=!0;break}if("touchstart"==i.type&&t===i.target)break}return e},_trigger:function(){var e=Array.prototype.slice.apply(arguments);return"string"==typeof e[0]&&(e[0]={type:e[0]}),e[0].instance=this,e[0].origin=this._$origin?this._$origin[0]:null,e[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,e),t.tooltipster._trigger.apply(t.tooltipster,e),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,e),this},_unplug:function(e){var n=this;if(n[e]){var i=t.tooltipster._plugin(e);i.instance&&t.each(i.instance,function(t,i){n[t]&&n[t].bridged===n[e]&&delete n[t]}),n[e].__destroy&&n[e].__destroy(),delete n[e]}return n},close:function(t){return this.__destroyed?this.__destroyError():this._close(null,t),this},content:function(t){var e=this;if(void 0===t)return e.__Content;if(e.__destroyed)e.__destroyError();else if(e.__contentSet(t),null!==e.__Content){if("closed"!==e.__state&&(e.__contentInsert(),e.reposition(),e.__options.updateAnimation))if(a.hasTransitions){var n=e.__options.updateAnimation;e._$tooltip.addClass("tooltipster-update-"+n),setTimeout(function(){"closed"!=e.__state&&e._$tooltip.removeClass("tooltipster-update-"+n)},1e3)}else e._$tooltip.fadeTo(200,.5,function(){"closed"!=e.__state&&e._$tooltip.fadeTo(200,1)})}else e._close();return e},destroy:function(){var e=this;if(e.__destroyed)e.__destroyError();else{"closed"!=e.__state?e.option("animationDuration",0)._close(null,null,!0):e.__timeoutsClear(),e._trigger("destroy"),e.__destroyed=!0,e._$origin.removeData(e.__namespace).off("."+e.__namespace+"-triggerOpen"),t(a.window.document.body).off("."+e.__namespace+"-triggerOpen");var n=e._$origin.data("tooltipster-ns");if(n)if(1===n.length){var i=null;"previous"==e.__options.restoration?i=e._$origin.data("tooltipster-initialTitle"):"current"==e.__options.restoration&&(i="string"==typeof e.__Content?e.__Content:t("<div></div>").append(e.__Content).html()),i&&e._$origin.attr("title",i),e._$origin.removeClass("tooltipstered"),e._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else n=t.grep(n,function(t,n){return t!==e.__namespace}),e._$origin.data("tooltipster-ns",n);e._trigger("destroyed"),e._off(),e.off(),e.__Content=null,e.__$emitterPrivate=null,e.__$emitterPublic=null,e.__options.parent=null,e._$origin=null,e._$tooltip=null,t.tooltipster.__instancesLatestArr=t.grep(t.tooltipster.__instancesLatestArr,function(t,n){return e!==t}),clearInterval(e.__garbageCollector)}return e},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},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(e,n){return void 0===n?this.__options[e]:(this.__destroyed?this.__destroyError():(this.__options[e]=n,this.__optionsFormat(),t.inArray(e,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===e&&this.__prepareGC()),this)},reposition:function(t,e){var n=this;return n.__destroyed?n.__destroyError():"closed"!=n.__state&&i(n._$origin)&&(e||i(n._$tooltip))&&(e||n._$tooltip.detach(),n.__Geometry=n.__geometry(),n._trigger({type:"reposition",event:t,helper:{geo:n.__Geometry}})),n},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}},t.fn.tooltipster=function(){var e=Array.prototype.slice.apply(arguments),n="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof e[0]){var i="#*$~&";return this.each(function(){var o=t(this).data("tooltipster-ns"),r=o?t(this).data(o[0]):null;if(!r)throw new Error("You called Tooltipster's \""+e[0]+'" method on an uninitialized element');if("function"!=typeof r[e[0]])throw new Error('Unknown method "'+e[0]+'"');this.length>1&&"content"==e[0]&&(e[1]instanceof t||"object"==typeof e[1]&&null!=e[1]&&e[1].tagName)&&!r.__options.contentCloning&&r.__options.debug&&console.log(n);var a=r[e[0]](e[1],e[2]);return a!==r||"instance"===e[0]?(i=a,!1):void 0}),"#*$~&"!==i?i:this}t.tooltipster.__instancesLatestArr=[];var r=e[0]&&void 0!==e[0].multiple,a=r&&e[0].multiple||!r&&o.multiple,s=e[0]&&void 0!==e[0].content,l=s&&e[0].content||!s&&o.content,c=e[0]&&void 0!==e[0].contentCloning,u=c&&e[0].contentCloning||!c&&o.contentCloning,d=e[0]&&void 0!==e[0].debug,h=d&&e[0].debug||!d&&o.debug;return this.length>1&&(l instanceof t||"object"==typeof l&&null!=l&&l.tagName)&&!u&&h&&console.log(n),this.each(function(){var n=!1,i=t(this),o=i.data("tooltipster-ns"),r=null;o?a?n=!0:h&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):n=!0,n&&(r=new t.Tooltipster(this,e[0]),o||(o=[]),o.push(r.__namespace),i.data("tooltipster-ns",o),i.data(r.__namespace,r),r.__options.functionInit&&r.__options.functionInit.call(r,r,{origin:this}),r._trigger("init")),t.tooltipster.__instancesLatestArr.push(r)}),this},e.prototype={__init:function(e){this.__$tooltip=e,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=t('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(a.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},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=this.__$tooltip[0].getBoundingClientRect(),e={size:{height:t.height||t.bottom-t.top,width:t.width||t.right-t.left}};if(this.constraints){var n=this.__$tooltip.find(".tooltipster-content"),i=this.__$tooltip.outerHeight(),o=n[0].getBoundingClientRect(),r={height:i<=this.constraints.height,width:t.width<=this.constraints.width&&o.width>=n[0].scrollWidth-1};e.fits=r.height&&r.width}return a.IE&&a.IE<=11&&e.size.width!==a.window.document.documentElement.clientWidth&&(e.size.width=Math.ceil(e.size.width)+1),e}};var l=navigator.userAgent.toLowerCase();-1!=l.indexOf("msie")?a.IE=parseInt(l.split("msie")[1]):-1!==l.toLowerCase().indexOf("trident")&&-1!==l.indexOf(" rv:11")?a.IE=11:-1!=l.toLowerCase().indexOf("edge/")&&(a.IE=parseInt(l.toLowerCase().split("edge/")[1]));var c="tooltipster.sideTip";return t.tooltipster._plugin({name:c,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 e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof t&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var e=t('<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||e.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&e.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&e.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=e,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var e=this;if(e.__options=e.__instance._optionsExtract(c,e.__defaults()),e.__options.position&&(e.__options.side=e.__options.position),"object"!=typeof e.__options.distance&&(e.__options.distance=[e.__options.distance]),e.__options.distance.length<4&&(void 0===e.__options.distance[1]&&(e.__options.distance[1]=e.__options.distance[0]),void 0===e.__options.distance[2]&&(e.__options.distance[2]=e.__options.distance[0]),void 0===e.__options.distance[3]&&(e.__options.distance[3]=e.__options.distance[1]),e.__options.distance={top:e.__options.distance[0],right:e.__options.distance[1],bottom:e.__options.distance[2],left:e.__options.distance[3]}),"string"==typeof e.__options.side){var n={top:"bottom",right:"left",bottom:"top",left:"right"};e.__options.side=[e.__options.side,n[e.__options.side]],"left"==e.__options.side[0]||"right"==e.__options.side[0]?e.__options.side.push("top","bottom"):e.__options.side.push("right","left")}6===t.tooltipster._env.IE&&!0!==e.__options.arrow&&(e.__options.arrow=!1)},__reposition:function(e,n){var i,o=this,r=o.__targetFind(n),a=[];o.__instance._$tooltip.detach();var s=o.__instance._$tooltip.clone(),l=t.tooltipster._getRuler(s),c=!1,u=o.__instance.option("animation");switch(u&&s.removeClass("tooltipster-"+u),t.each(["window","document"],function(i,u){var d=null;if(o.__instance._trigger({container:u,helper:n,satisfied:c,takeTest:function(t){d=t},results:a,type:"positionTest"}),1==d||0!=d&&0==c&&("window"!=u||o.__options.viewportAware))for(var i=0;i<o.__options.side.length;i++){var h={horizontal:0,vertical:0},p=o.__options.side[i];"top"==p||"bottom"==p?h.vertical=o.__options.distance[p]:h.horizontal=o.__options.distance[p],o.__sideChange(s,p),t.each(["natural","constrained"],function(t,i){if(d=null,o.__instance._trigger({container:u,event:e,helper:n,mode:i,results:a,satisfied:c,side:p,takeTest:function(t){d=t},type:"positionTest"}),1==d||0!=d&&0==c){var s={container:u,distance:h,fits:null,mode:i,outerSize:null,side:p,size:null,target:r[p],whole:null},f="natural"==i?l.free():l.constrain(n.geo.available[u][p].width-h.horizontal,n.geo.available[u][p].height-h.vertical),m=f.measure();if(s.size=m.size,s.outerSize={height:m.size.height+h.vertical,width:m.size.width+h.horizontal},"natural"==i?n.geo.available[u][p].width>=s.outerSize.width&&n.geo.available[u][p].height>=s.outerSize.height?s.fits=!0:s.fits=!1:s.fits=m.fits,"window"==u&&(s.fits?s.whole="top"==p||"bottom"==p?n.geo.origin.windowOffset.right>=o.__options.minIntersection&&n.geo.window.size.width-n.geo.origin.windowOffset.left>=o.__options.minIntersection:n.geo.origin.windowOffset.bottom>=o.__options.minIntersection&&n.geo.window.size.height-n.geo.origin.windowOffset.top>=o.__options.minIntersection:s.whole=!1),a.push(s),s.whole)c=!0;else if("natural"==s.mode&&(s.fits||s.size.width<=n.geo.available[u][p].width))return!1}})}}),o.__instance._trigger({edit:function(t){a=t},event:e,helper:n,results:a,type:"positionTested"}),a.sort(function(t,e){if(t.whole&&!e.whole)return-1;if(!t.whole&&e.whole)return 1;if(t.whole&&e.whole){var n=o.__options.side.indexOf(t.side),i=o.__options.side.indexOf(e.side);return i>n?-1:n>i?1:"natural"==t.mode?-1:1}if(t.fits&&!e.fits)return-1;if(!t.fits&&e.fits)return 1;if(t.fits&&e.fits){var n=o.__options.side.indexOf(t.side),i=o.__options.side.indexOf(e.side);return i>n?-1:n>i?1:"natural"==t.mode?-1:1}return"document"==t.container&&"bottom"==t.side&&"natural"==t.mode?-1:1}),i=a[0],i.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=n.geo.origin.windowOffset.left-i.outerSize.width;break;case"right":i.coord.left=n.geo.origin.windowOffset.right+i.distance.horizontal;break;case"top":i.coord.top=n.geo.origin.windowOffset.top-i.outerSize.height;break;case"bottom":i.coord.top=n.geo.origin.windowOffset.bottom+i.distance.vertical}"window"==i.container?"top"==i.side||"bottom"==i.side?i.coord.left<0?n.geo.origin.windowOffset.right-this.__options.minIntersection>=0?i.coord.left=0:i.coord.left=n.geo.origin.windowOffset.right-this.__options.minIntersection-1:i.coord.left>n.geo.window.size.width-i.size.width&&(n.geo.origin.windowOffset.left+this.__options.minIntersection<=n.geo.window.size.width?i.coord.left=n.geo.window.size.width-i.size.width:i.coord.left=n.geo.origin.windowOffset.left+this.__options.minIntersection+1-i.size.width):i.coord.top<0?n.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?i.coord.top=0:i.coord.top=n.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:i.coord.top>n.geo.window.size.height-i.size.height&&(n.geo.origin.windowOffset.top+this.__options.minIntersection<=n.geo.window.size.height?i.coord.top=n.geo.window.size.height-i.size.height:i.coord.top=n.geo.origin.windowOffset.top+this.__options.minIntersection+1-i.size.height):(i.coord.left>n.geo.window.size.width-i.size.width&&(i.coord.left=n.geo.window.size.width-i.size.width),i.coord.left<0&&(i.coord.left=0)),o.__sideChange(s,i.side),n.tooltipClone=s[0],n.tooltipParent=o.__instance.option("parent").parent[0],n.mode=i.mode,n.whole=i.whole,n.origin=o.__instance._$origin[0],n.tooltip=o.__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 d=t.extend(!0,{},i);if(o.__instance._trigger({edit:function(t){i=t},event:e,helper:n,position:d,type:"position"}),o.__options.functionPosition){var h=o.__options.functionPosition.call(o,o.__instance,n,d);h&&(i=h)}l.destroy();var p,f;"top"==i.side||"bottom"==i.side?(p={prop:"left",val:i.target-i.coord.left},f=i.size.width-this.__options.minIntersection):(p={prop:"top",val:i.target-i.coord.top},f=i.size.height-this.__options.minIntersection),p.val<this.__options.minIntersection?p.val=this.__options.minIntersection:p.val>f&&(p.val=f);var m;m=n.geo.origin.fixedLineage?n.geo.origin.windowOffset:{left:n.geo.origin.windowOffset.left+n.geo.window.scroll.left,top:n.geo.origin.windowOffset.top+n.geo.window.scroll.top},i.coord={left:m.left+(i.coord.left-n.geo.origin.windowOffset.left),top:m.top+(i.coord.top-n.geo.origin.windowOffset.top)},o.__sideChange(o.__instance._$tooltip,i.side),n.geo.origin.fixedLineage?o.__instance._$tooltip.css("position","fixed"):o.__instance._$tooltip.css("position",""),o.__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(p.prop,p.val),o.__instance._$tooltip.appendTo(o.__instance.option("parent")),o.__instance._trigger({type:"repositioned",event:e,position:i})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},n=this.__instance._$origin[0].getClientRects();if(n.length>1&&1==this.__instance._$origin.css("opacity")&&(this.__instance._$origin.css("opacity",.99),n=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1)),n.length<2)e.top=Math.floor(t.geo.origin.windowOffset.left+t.geo.origin.size.width/2),e.bottom=e.top,e.left=Math.floor(t.geo.origin.windowOffset.top+t.geo.origin.size.height/2),e.right=e.left;else{var i=n[0];e.top=Math.floor(i.left+(i.right-i.left)/2),i=n.length>2?n[Math.ceil(n.length/2)-1]:n[0],e.right=Math.floor(i.top+(i.bottom-i.top)/2),i=n[n.length-1],e.bottom=Math.floor(i.left+(i.right-i.left)/2),i=n.length>2?n[Math.ceil((n.length+1)/2)-1]:n[n.length-1],e.left=Math.floor(i.top+(i.bottom-i.top)/2)}return e}}}),t})},function(t,e){},function(t,e,n){"use strict";(function(t){function i(){t(document).on("click",".wprm-manage-recipes-seo",function(e){e.preventDefault();var n=t(this).data("id");r.a.open(!1,{recipe_id:n})}),t(document).on("change",".wprm-manage-ingredients-link-nofollow",function(e){e.preventDefault();var n=t(this).data("id"),i=t(this).val();o.e(n,"ingredient_link_nofollow",i)}),t(document).on("click",".wprm-manage-ingredients-actions-rename",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-ingredients-name-"+n).text(),r=prompt('What do you want to rename "'+i+'" to?',i).trim();r&&o.d(n,"ingredient",r)}),t(document).on("click",".wprm-manage-ingredients-actions-link",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-ingredients-name-"+n).text(),r=t("#wprm-manage-ingredients-link-"+n),a=r.text(),s=prompt('What do you want the link for "'+i+'" to be?',a).trim();o.e(n,"ingredient_link",s)}),t(document).on("click",".wprm-manage-ingredients-actions-merge",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-ingredients-name-"+n).text(),r=parseInt(prompt('What is the ID of the ingredient that you want to merge "'+i+'" into?',""));r&&o.a(n,"ingredient",r)}),t(document).on("click",".wprm-manage-taxonomies-actions-rename",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-taxonomies-name-"+n).text(),r=t(".wprm-manage-taxonomies").data("taxonomy"),a=prompt('What do you want to rename "'+i+'" to?',i).trim();a&&o.d(n,r,a)}),t(document).on("click",".wprm-manage-taxonomies-actions-merge",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-taxonomies-name-"+n).text(),r=t(".wprm-manage-taxonomies").data("taxonomy"),a=parseInt(prompt('What is the ID of the term that you want to merge "'+i+'" into?',""));a&&o.a(n,r,a)}),t(document).on("click",".wprm-manage-ingredients-actions-delete",function(e){e.preventDefault();var n=t(this).data("id");o.a(n,"ingredient",0)}),t(document).on("click",".wprm-manage-taxonomies-actions-delete",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-taxonomies-name-"+n).text(),r=t(".wprm-manage-taxonomies").data("taxonomy");confirm('Are you sure you want to delete "'+i+'"?')&&o.a(n,r,0)}),t(document).on("click",".wprm-manage-recipes-actions-edit",function(e){e.preventDefault();var n=t(this).data("id");r.a.open(!1,{recipe_id:n})}),t(document).on("click",".wprm-manage-recipes-actions-delete",function(e){e.preventDefault();var n=t(this).data("id"),i=t("#wprm-manage-recipes-name-"+n).text();confirm('Are you sure you want to delete "'+i+'"?')&&o.b(n)}),t(document).on("click",".wprm-manage-ingredients-bulk-delete",function(e){e.preventDefault();var n=t(".wprm-manage-ingredients-bulk:checkbox:checked"),i=[];n.each(function(){i.push(parseInt(t(this).val()))}),i.length>0&&o.c(i,"ingredient",0)})}e.a=i;var o=n(38),r=n(1)}).call(e,n(0))},function(t,e,n){"use strict";(function(t){function n(e,n,i){var o={action:"wprm_rename_term",security:wprm_temp_admin.nonce,term_id:e,taxonomy:n,new_name:i};t.post(wprm_temp_admin.ajax_url,o,function(){t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1)})}function i(e,n,i){var o={action:"wprm_update_term_metadata",security:wprm_temp_admin.nonce,term_id:e,field:n,value:i};t.post(wprm_temp_admin.ajax_url,o,function(){t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1)})}function o(e,n,i){var o={action:"wprm_delete_or_merge_term",security:wprm_temp_admin.nonce,term_id:e,taxonomy:n,new_term_id:i};t.post(wprm_temp_admin.ajax_url,o,function(){t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1)})}function r(e,n){var i={action:"wprm_delete_terms",security:wprm_temp_admin.nonce,term_ids:e,taxonomy:n};t.post(wprm_temp_admin.ajax_url,i,function(){t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1)})}function a(e){var n={action:"wprm_delete_recipe",security:wprm_temp_admin.nonce,recipe_id:e};t.post(wprm_temp_admin.ajax_url,n,function(){t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1)})}e.d=n,e.e=i,e.a=o,e.c=r,e.b=a}).call(e,n(0))},function(t,e){},function(t,e,n){"use strict";(function(t){var e=n(1),i=(n(41),n(43),n(44),n(45));n.n(i),t(document).ready(function(n){var i=t(".wprm-modal-container");i&&e.a.init(i)})}).call(e,n(0))},function(t,e,n){"use strict";(function(t){function e(){t(".wprm-button-import-text-reset").removeAttr("disabled"),t(".wprm-button-import-text-clear").removeAttr("disabled"),t(".wprm-button-import-text-next").removeAttr("disabled"),h="input",t("#import-text-highlight-sandbox").textHighlighter(),p=t("#import-text-highlight-sandbox").getHighlighter()}function i(){o(!0),t("#import-text-highlight-sandbox").text(""),f={},m=!1,t(".wprm-button-import-text-reset").attr("disabled","disabled"),t(".wprm-button-import-text-clear").attr("disabled","disabled"),t(".wprm-button-import-text-next").attr("disabled","disabled"),t(".import-text-step").hide(),t("#import-text-step-input").show(),t("#import-text-highlight-sandbox").hide()}function o(e){(e||"input"==h)&&t("#import-text-input-recipe").val(""),(e||"ingredient-groups"==h)&&t("#import-text-ingredient-groups").find("input").attr("checked",!1),(e||"instruction-groups"==h)&&t("#import-text-instruction-groups").find("input").attr("checked",!1),p.removeHighlights()}function r(){if("input"==h)f.raw=t("#import-text-input-recipe").val(),t("#import-text-highlight-sandbox").html(f.raw.replace(/\r?\n/g,"<br/>")).show(),h="name";else if("name"==h)f.name=s(),h="summary";else if("summary"==h)f.summary=s(),t("#import-text-highlight-sandbox").show(),h="ingredients";else if("ingredients"==h){var e=p.getHighlights();f.ingredients_raw=e,t("#import-text-ingredient-groups").html("");for(var n=0,i=e.length;n<i;n++){var o=t(e[n]).text().trim();o=o.replace(/^(\d\.\s+|[a-z]\)\s+|•\s+|[A-Z]\.\s+|[IVX]+\.\s+)/g,"");var r='<div class="import-text-ingredient"><input type="checkbox" id="ingredient-'+n+'"> <label for="ingredient-'+n+'">'+o+"</label></div>";t("#import-text-ingredient-groups").append(r)}t(".import-text-group-warning").hide(),0==e.length?(t("#import-text-highlight-sandbox").show(),f.ingredients=[],h="instructions"):(t("#import-text-highlight-sandbox").hide(),h="ingredient-groups")}else if("ingredient-groups"==h){var e=[],c={name:"",ingredients:[]};t("#import-text-ingredient-groups").find(".import-text-ingredient").each(function(){var n=t(this).find("input").is(":checked"),i=t(this).find("label").text();n?(e.push(c),c={name:i,ingredients:[]}):c.ingredients.push({raw:i})}),e.push(c),f.ingredients=[];var u={action:"wprm_parse_ingredients",security:wprm_temp_admin.nonce,ingredients:e};m=!0,t.post(wprm_temp_admin.ajax_url,u,function(t){m=!1,t.success&&(f.ingredients=t.data.ingredients)},"json"),t("#import-text-highlight-sandbox").show(),h="instructions"}else if("instructions"==h){var d=p.getHighlights();f.instructions_raw=d,t("#import-text-instruction-groups").html("");for(var n=0,i=d.length;n<i;n++){var o=t(d[n]).text().trim();o=o.replace(/^(\d\.\s+|[a-z]\)\s+|•\s+|[A-Z]\.\s+|[IVX]+\.\s+)/g,"");var g='<div class="import-text-instruction"><input type="checkbox" id="instruction-'+n+'"> <label for="instruction-'+n+'">'+o+"</label></div>";t("#import-text-instruction-groups").append(g)}t(".import-text-group-warning").hide(),0==d.length?(t("#import-text-highlight-sandbox").show(),f.instructions=[],h="notes"):(t("#import-text-highlight-sandbox").hide(),h="instruction-groups")}else if("instruction-groups"==h){var d=[],v={name:"",instructions:[]};t("#import-text-instruction-groups").find(".import-text-instruction").each(function(){var e=t(this).find("input").is(":checked"),n=t(this).find("label").text();e?(d.push(v),v={name:n,instructions:[]}):v.instructions.push({text:n})}),d.push(v),f.instructions=d,t("#import-text-highlight-sandbox").show(),h="notes"}else"notes"==h?(f.notes=s(),t("#import-text-highlight-sandbox").hide(),t(".wprm-button-import-text-reset").attr("disabled","disabled"),t(".wprm-button-import-text-clear").attr("disabled","disabled"),t(".wprm-button-import-text-next").attr("disabled","disabled"),m?(h="waiting",a()):(t(".wprm-button-import-text-reset").removeAttr("disabled"),l(),h="finished")):"waiting"==h&&(m||(t(".wprm-button-import-text-reset").removeAttr("disabled"),l(),h="finished"));t(".import-text-step").hide(),t("#import-text-step-"+h).show(),p.removeHighlights()}function a(){m?setTimeout(a,200):r()}function s(){for(var e=p.getHighlights(),n="",i=0,o=e.length;i<o;i++)i>0&&(n+=" "),n+=t(e[i]).text().trim();return n}function l(){f.name&&t("#wprm-recipe-name").val(f.name),f.summary&&d.a.set(f.summary),f.notes&&("undefined"!=typeof tinyMCE&&tinyMCE.get("wprm_recipe_notes")&&!tinyMCE.get("wprm_recipe_notes").isHidden()?(tinyMCE.get("wprm_recipe_notes").focus(!0),tinyMCE.activeEditor.setContent(f.notes)):t("#wprm_recipe_notes").val(f.notes)),f.instructions.length>0&&u.a.setInstructions(f.instructions),f.ingredients.length>0&&u.a.setIngredients(f.ingredients)}var c=n(42),u=(n.n(c),n(1),n(2)),d=n(7),h="",p=void 0,f={},m=!1;t(document).ready(function(n){t("#import-text-input-recipe").on("keydown change",function(){e()}),t(".wprm-button-import-text-reset").on("click",function(){confirm(wprm_temp_admin.modal.text.import_text_reset)&&i()}),t(".wprm-button-import-text-clear").on("click",function(){o(!1)}),t(".wprm-button-import-text-next").on("click",function(){r()}),t(".import-text-input-groups").on("change","input",function(){var e=t(this).parents(".import-text-input-groups");e.find("input").length==e.find("input:checked").length&&t(".import-text-group-warning").show()})})}).call(e,n(0))},function(t,e,n){(function(t){!function(t){function e(t,e){return c(t).color()===c(e).color()}function n(t,e){t=t||{};for(var n in e)e.hasOwnProperty(n)&&void 0===t[n]&&(t[n]=e[n]);return t}function i(t){return t.filter(function(t,e,n){return n.indexOf(t)===e})}function o(t,e){t.sort(function(t,n){return c(e?n:t).parents().length-c(e?t:n).parents().length})}function r(t){var e=[],n={},i=[];return t.forEach(function(t){var i=t.getAttribute("data-timestamp");void 0===n[i]&&(n[i]=[],e.push(i)),n[i].push(t)}),e.forEach(function(t){var e=n[t];i.push({chunks:e,timestamp:t,toString:function(){return e.map(function(t){return t.textContent}).join("")}})}),i}function a(t,e){t.addEventListener("mouseup",e.highlightHandler.bind(e)),t.addEventListener("touchend",e.highlightHandler.bind(e))}function s(t,e){if(!t)throw"Missing anchor element";this.el=t,this.options=n(e,{color:"#ffff7b",highlightedClass:"highlighted",contextClass:"highlighter-context",onRemoveHighlight:function(){return!0},onBeforeHighlight:function(){return!0},onAfterHighlight:function(){}}),c(this.el).addClass(this.options.contextClass),a(this.el,this)}var l="SCRIPT STYLE SELECT OPTION BUTTON OBJECT APPLET VIDEO AUDIO CANVAS EMBED PARAM METER PROGRESS".split(" "),c=function t(e){return{addClass:function(t){e.classList?e.classList.add(t):e.className+=" "+t},removeClass:function(t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","gi")," ")},prepend:function(t){t=Array.prototype.slice.call(t);for(var n=t.length;n--;)e.insertBefore(t[n],e.firstChild)},append:function(t){t=Array.prototype.slice.call(t);for(var n=0,i=t.length;n<i;++n)e.appendChild(t[n])},insertAfter:function(t){return t.parentNode.insertBefore(e,t.nextSibling)},insertBefore:function(t){return t.parentNode.insertBefore(e,t)},remove:function(){e.parentNode.removeChild(e),e=null},contains:function(t){return e!==t&&e.contains(t)},wrap:function(t){return e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),t},unwrap:function(){var n,i=Array.prototype.slice.call(e.childNodes);return i.forEach(function(e){n=e.parentNode,t(e).insertBefore(e.parentNode),t(n).remove()}),i},parents:function(){for(var t,n=[];t=e.parentNode;)n.push(t),e=t;return n},normalizeTextNodes:function(){if(e){if(3===e.nodeType)for(;e.nextSibling&&3===e.nextSibling.nodeType;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else t(e.firstChild).normalizeTextNodes();t(e.nextSibling).normalizeTextNodes()}},color:function(){return e.style.backgroundColor},fromHTML:function(t){var e=document.createElement("div");return e.innerHTML=t,e.childNodes},getRange:function(){var n,i=t(e).getSelection();return 0<i.rangeCount&&(n=i.getRangeAt(0)),n},removeAllRanges:function(){t(e).getSelection().removeAllRanges()},getSelection:function(){return t(e).getWindow().getSelection()},getWindow:function(){return t(e).getDocument().defaultView},getDocument:function(){return e.ownerDocument||e}}};s.prototype.destroy=function(){var t=this.el;t.removeEventListener("mouseup",this.highlightHandler.bind(this)),t.removeEventListener("touchend",this.highlightHandler.bind(this)),c(this.el).removeClass(this.options.contextClass)},s.prototype.highlightHandler=function(){this.doHighlight()},s.prototype.doHighlight=function(t){var e,n,i=c(this.el).getRange();i&&!i.collapsed&&(!0===this.options.onBeforeHighlight(i)&&(n=+new Date,e=s.createWrapper(this.options),e.setAttribute("data-timestamp",n),e=this.highlightRange(i,e),e=this.normalizeHighlights(e),this.options.onAfterHighlight(i,e,n)),t||c(this.el).removeAllRanges())},s.prototype.highlightRange=function(t,e){var n;if(!t||t.collapsed)return[];var i=t.startContainer;n=t.endContainer;var o=t.commonAncestorContainer,r=!0;if(0===t.endOffset){for(;!n.previousSibling&&n.parentNode!==o;)n=n.parentNode;n=n.previousSibling}else 3===n.nodeType?t.endOffset<n.nodeValue.length&&n.splitText(t.endOffset):0<t.endOffset&&(n=n.childNodes.item(t.endOffset-1));3===i.nodeType?t.startOffset===i.nodeValue.length?r=!1:0<t.startOffset&&(i=i.splitText(t.startOffset),n===i.previousSibling&&(n=i)):i=t.startOffset<i.childNodes.length?i.childNodes.item(t.startOffset):i.nextSibling;var a,s=r,r=!1,o=[];do{s&&3===i.nodeType&&(-1===l.indexOf(i.parentNode.tagName)&&""!==i.nodeValue.trim()&&(s=e.cloneNode(!0),s.setAttribute("data-highlighted",!0),a=i.parentNode,c(this.el).contains(a)||a===this.el)&&(s=c(i).wrap(s),o.push(s)),s=!1),i!==n||n.hasChildNodes()&&s||(r=!0),i.tagName&&-1<l.indexOf(i.tagName)&&(n.parentNode===i&&(r=!0),s=!1),s&&i.hasChildNodes()?i=i.firstChild:i.nextSibling?(i=i.nextSibling,s=!0):(i=i.parentNode,s=!1)}while(!r);return o},s.prototype.normalizeHighlights=function(t){return this.flattenNestedHighlights(t),this.mergeSiblingHighlights(t),t=t.filter(function(t){return t.parentElement?t:null}),t=i(t),t.sort(function(t,e){return t.offsetTop-e.offsetTop||t.offsetLeft-e.offsetLeft}),t},s.prototype.flattenNestedHighlights=function(t){var n,i=this;o(t,!0);do{n=function(){var n=!1;return t.forEach(function(o,r){var a=o.parentElement,s=a.previousSibling,l=a.nextSibling;i.isHighlight(a)&&(e(a,o)?(a.replaceChild(o.firstChild,o),t[r]=a,n=!0):(o.nextSibling||(c(o).insertBefore(l||a),n=!0),o.previousSibling||(c(o).insertAfter(s||a),n=!0),a.hasChildNodes()||c(a).remove()))}),n}()}while(n)},s.prototype.mergeSiblingHighlights=function(t){function n(t,n){return n&&1===n.nodeType&&e(t,n)&&i.isHighlight(n)}var i=this;t.forEach(function(t){var e=t.previousSibling,i=t.nextSibling;n(t,e)&&(c(t).prepend(e.childNodes),c(e).remove()),n(t,i)&&(c(t).append(i.childNodes),c(i).remove()),c(t).normalizeTextNodes()})},s.prototype.setColor=function(t){this.options.color=t},s.prototype.getColor=function(){return this.options.color},s.prototype.removeHighlights=function(t){function e(t){c(t).unwrap().forEach(function(t){var e=t.previousSibling,n=t.nextSibling;e&&3===e.nodeType&&(t.nodeValue=e.nodeValue+t.nodeValue,c(e).remove()),n&&3===n.nodeType&&(t.nodeValue+=n.nodeValue,c(n).remove())})}t=this.getHighlights({container:t||this.el});var n=this;o(t,!0),t.forEach(function(t){!0===n.options.onRemoveHighlight(t)&&e(t)})},s.prototype.getHighlights=function(t){t=n(t,{container:this.el,andSelf:!0,grouped:!1});var e=t.container.querySelectorAll("[data-highlighted]"),e=Array.prototype.slice.call(e);return!0===t.andSelf&&t.container.hasAttribute("data-highlighted")&&e.push(t.container),t.grouped&&(e=r(e)),e},s.prototype.isHighlight=function(t){return t&&1===t.nodeType&&t.hasAttribute("data-highlighted")},s.prototype.serializeHighlights=function(){var t=this.getHighlights(),e=this.el,n=[];return o(t,!1),t.forEach(function(t){var i,o=0,r=t.textContent.length,a=t,s=[];do{i=Array.prototype.slice.call(a.parentNode.childNodes),s.unshift(i.indexOf(a)),a=a.parentNode}while(a!==e||!a);a=t.cloneNode(!0),a.innerHTML="",a=a.outerHTML,t.previousSibling&&3===t.previousSibling.nodeType&&(o=t.previousSibling.length),n.push([a,t.textContent,s.join(":"),o,r])}),JSON.stringify(n)},s.prototype.deserializeHighlights=function(t){var e,n=[],i=this;if(!t)return n;try{e=JSON.parse(t)}catch(t){throw"Can't parse JSON: "+t}return e.forEach(function(t){try{for(var e,o,r,a=t[0],s=t[2].split(":"),l=t[3],u=t[4],d=s.pop(),h=i.el;r=s.shift();)h=h.childNodes[r];h.childNodes[d-1]&&3===h.childNodes[d-1].nodeType&&--d,h=h.childNodes[d],e=h.splitText(l),e.splitText(u),e.nextSibling&&!e.nextSibling.nodeValue&&c(e.nextSibling).remove(),e.previousSibling&&!e.previousSibling.nodeValue&&c(e.previousSibling).remove(),o=c(e).wrap(c().fromHTML(a)[0]),n.push(o)}catch(t){console&&console.warn&&console.warn("Can't deserialize highlight descriptor. Cause: "+t)}}),n},s.prototype.find=function(t,e){var n=c(this.el).getWindow(),i=n.scrollX,o=n.scrollY,r=void 0===e||e;if(c(this.el).removeAllRanges(),n.find)for(;n.find(t,r);)this.doHighlight(!0);else if(n.document.body.createTextRange){var a=n.document.body.createTextRange();for(a.moveToElementText(this.el);a.findText(t,1,r?4:0)&&(c(this.el).contains(a.parentElement())||a.parentElement()===this.el);)a.select(),this.doHighlight(!0),a.collapse(!1)}c(this.el).removeAllRanges(),n.scrollTo(i,o)},s.createWrapper=function(t){var e=document.createElement("span");return e.style.backgroundColor=t.color,e.className=t.highlightedClass,e},t.TextHighlighter=s}(window),function(t){function e(t,e){return function(){e.call(this,t)}}t.fn.getHighlighter=function(){return this.data("textHighlighter")},t.fn.textHighlighter=function(n){return this.each(function(){var i,o=this;t.data(o,"textHighlighter")||(i=new TextHighlighter(o,n),i.destroy=e(i.destroy,function(e){e.call(i),t(o).removeData("textHighlighter")}),t.data(o,"textHighlighter",i))})}}(t)}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var e=n(1),i=n(3);e.a.actions.reset_snippets=function(e){t("#wprm-recipe-jump-id").val("0").trigger("change"),t("#wprm-recipe-jump-text").val(""),t("#wprm-recipe-print-id").val("0").trigger("change"),t("#wprm-recipe-print-text").val("")},e.a.actions.insert_jump_to_recipe=function(n){var o=parseInt(t("#wprm-recipe-jump-id").val()),r=i.shortcode_escape(t("#wprm-recipe-jump-text").val()),a="[wprm-recipe-jump";o>0&&(a+=' id="'+o+'"'),r&&(a+=' text="'+r+'"'),a+="]",i.add_text_to_editor(a),e.a.close()},e.a.actions.insert_print_recipe=function(n){var o=parseInt(t("#wprm-recipe-print-id").val()),r=i.shortcode_escape(t("#wprm-recipe-print-text").val()),a="[wprm-recipe-print";o>0&&(a+=' id="'+o+'"'),r&&(a+=' text="'+r+'"'),a+="]",i.add_text_to_editor(a),e.a.close()}}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var e=n(3),i=n(1),o=n(2);i.a.actions.set_recipe=function(n){var r=n.recipe_id?n.recipe_id:0,a=n.clone_recipe_id?n.clone_recipe_id:0;if(o.a.id=r,o.a.type=0===r?"insert":"update",o.a.fields=!1,o.a.ingredients={},o.a.instructions={},o.a.clear(),"insert"===o.a.type){var s=t(".wprm-button-action"),l=t(".wprm-button-action-save");if(t(".wprm-router.active").find(".wprm-menu-item").each(function(){t(this).data("button",wprm_temp_admin.modal.text.action_button_insert)}),s.text(wprm_temp_admin.modal.text.action_button_insert),l.show(),a){var c={action:"wprm_get_recipe",security:wprm_temp_admin.nonce,recipe_id:a};e.start_loader(s),e.start_loader(l),t.post(wprm_temp_admin.ajax_url,c,function(t){e.stop_loader(s),e.stop_loader(l),t.success&&(o.a.fields=t.data.recipe,o.a.set(t.data.recipe),i.a.changes_made=!1)},"json")}}else{var s=t(".wprm-button-action"),l=t(".wprm-button-action-save");t(".wprm-router.active").find(".wprm-menu-item").each(function(){t(this).data("button",wprm_temp_admin.modal.text.action_button_update)}),s.text(wprm_temp_admin.modal.text.action_button_update),l.show(),i.a.disable_menu();var c={action:"wprm_get_recipe",security:wprm_temp_admin.nonce,recipe_id:r};e.start_loader(s),e.start_loader(l),t.post(wprm_temp_admin.ajax_url,c,function(n){e.stop_loader(s),e.stop_loader(l),n.success&&(o.a.fields=n.data.recipe,o.a.set(n.data.recipe),i.a.changes_made=!1,t(".wprm-frame-title").find("h1").text(wprm_temp_admin.modal.text.edit_recipe))},"json")}},i.a.actions.insert_update_recipe=function(n){var r=o.a.get(),a={action:"wprm_save_recipe",security:wprm_temp_admin.nonce,recipe_id:o.a.id,recipe:r};t(".wprm-button-action-save").prop("disabled",!0),e.start_loader(n),t.post(wprm_temp_admin.ajax_url,a,function(r){e.stop_loader(n),t(".wprm-button-action-save").prop("disabled",!1),r.success&&(0===o.a.id&&(o.a.id=r.data.id),n.hasClass("wprm-button-action-save")||("insert"===o.a.type?e.add_text_to_editor('[wprm-recipe id="'+r.data.id+'"]'):i.a.active_editor_id&&"undefined"!=typeof tinyMCE&&tinyMCE.get(i.a.active_editor_id)&&!tinyMCE.get(i.a.active_editor_id).isHidden()&&(tinyMCE.get(i.a.active_editor_id).focus(!0),tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent())),t(".wprm-manage-datatable").length>0&&t(".wprm-manage-datatable").DataTable().ajax.reload(null,!1),i.a.close()))},"json")},i.a.actions.edit_recipe=function(e){var n=parseInt(t("#wprm-edit-recipe-id").val());if(0!=n){var o=i.a.active_editor_id;i.a.close(),i.a.open(o,{recipe_id:n})}},i.a.actions.insert_recipe=function(n){var o=parseInt(t("#wprm-insert-recipe-id").val());if(0!=o){var r='[wprm-recipe id="'+o+'"]';e.add_text_to_editor(r),i.a.close()}}}).call(e,n(0))},function(t,e){},function(t,e,n){"use strict";(function(t){var e=n(5),i=(n.n(e),n(6)),o=(n.n(i),n(47));n.n(o),t(document).ready(function(e){t(".wprm-settings").find("select").select2_wprm(),t(".wprm-settings").find(".wprm-color").wpColorPicker(),t("#reset_settings_to_default").on("click",function(){t(this).is(":checked")&&alert("Warning: having this checked will reset all your settings to default again")})})}).call(e,n(0))},function(t,e){},function(t,e){},function(t,e){},function(t,e){}]);
|
dist/assets/9db239b0b8817856fa53552be937ab40.png
ADDED
Binary file
|
dist/print.css
ADDED
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* This is the core CSS of Tooltipster */
|
2 |
+
|
3 |
+
/* GENERAL STRUCTURE RULES (do not edit this section) */
|
4 |
+
|
5 |
+
.tooltipster-base {
|
6 |
+
/* this ensures that a constrained height set by functionPosition,
|
7 |
+
if greater that the natural height of the tooltip, will be enforced
|
8 |
+
in browsers that support display:flex */
|
9 |
+
display: flex;
|
10 |
+
pointer-events: none;
|
11 |
+
/* this may be overriden in JS for fixed position origins */
|
12 |
+
position: absolute;
|
13 |
+
}
|
14 |
+
|
15 |
+
.tooltipster-box {
|
16 |
+
/* see .tooltipster-base. flex-shrink 1 is only necessary for IE10-
|
17 |
+
and flex-basis auto for IE11- (at least) */
|
18 |
+
flex: 1 1 auto;
|
19 |
+
}
|
20 |
+
|
21 |
+
.tooltipster-content {
|
22 |
+
/* prevents an overflow if the user adds padding to the div */
|
23 |
+
box-sizing: border-box;
|
24 |
+
/* these make sure we'll be able to detect any overflow */
|
25 |
+
max-height: 100%;
|
26 |
+
max-width: 100%;
|
27 |
+
overflow: auto;
|
28 |
+
}
|
29 |
+
|
30 |
+
.tooltipster-ruler {
|
31 |
+
/* these let us test the size of the tooltip without overflowing the window */
|
32 |
+
bottom: 0;
|
33 |
+
left: 0;
|
34 |
+
overflow: hidden;
|
35 |
+
position: fixed;
|
36 |
+
right: 0;
|
37 |
+
top: 0;
|
38 |
+
visibility: hidden;
|
39 |
+
}
|
40 |
+
|
41 |
+
/* ANIMATIONS */
|
42 |
+
|
43 |
+
/* Open/close animations */
|
44 |
+
|
45 |
+
/* fade */
|
46 |
+
|
47 |
+
.tooltipster-fade {
|
48 |
+
opacity: 0;
|
49 |
+
-webkit-transition-property: opacity;
|
50 |
+
-moz-transition-property: opacity;
|
51 |
+
-o-transition-property: opacity;
|
52 |
+
-ms-transition-property: opacity;
|
53 |
+
transition-property: opacity;
|
54 |
+
}
|
55 |
+
.tooltipster-fade.tooltipster-show {
|
56 |
+
opacity: 1;
|
57 |
+
}
|
58 |
+
|
59 |
+
/* grow */
|
60 |
+
|
61 |
+
.tooltipster-grow {
|
62 |
+
-webkit-transform: scale(0,0);
|
63 |
+
-moz-transform: scale(0,0);
|
64 |
+
-o-transform: scale(0,0);
|
65 |
+
-ms-transform: scale(0,0);
|
66 |
+
transform: scale(0,0);
|
67 |
+
-webkit-transition-property: -webkit-transform;
|
68 |
+
-moz-transition-property: -moz-transform;
|
69 |
+
-o-transition-property: -o-transform;
|
70 |
+
-ms-transition-property: -ms-transform;
|
71 |
+
transition-property: transform;
|
72 |
+
-webkit-backface-visibility: hidden;
|
73 |
+
}
|
74 |
+
.tooltipster-grow.tooltipster-show {
|
75 |
+
-webkit-transform: scale(1,1);
|
76 |
+
-moz-transform: scale(1,1);
|
77 |
+
-o-transform: scale(1,1);
|
78 |
+
-ms-transform: scale(1,1);
|
79 |
+
transform: scale(1,1);
|
80 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
|
81 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
82 |
+
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
83 |
+
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
84 |
+
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
85 |
+
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
86 |
+
}
|
87 |
+
|
88 |
+
/* swing */
|
89 |
+
|
90 |
+
.tooltipster-swing {
|
91 |
+
opacity: 0;
|
92 |
+
-webkit-transform: rotateZ(4deg);
|
93 |
+
-moz-transform: rotateZ(4deg);
|
94 |
+
-o-transform: rotateZ(4deg);
|
95 |
+
-ms-transform: rotateZ(4deg);
|
96 |
+
transform: rotateZ(4deg);
|
97 |
+
-webkit-transition-property: -webkit-transform, opacity;
|
98 |
+
-moz-transition-property: -moz-transform;
|
99 |
+
-o-transition-property: -o-transform;
|
100 |
+
-ms-transition-property: -ms-transform;
|
101 |
+
transition-property: transform;
|
102 |
+
}
|
103 |
+
.tooltipster-swing.tooltipster-show {
|
104 |
+
opacity: 1;
|
105 |
+
-webkit-transform: rotateZ(0deg);
|
106 |
+
-moz-transform: rotateZ(0deg);
|
107 |
+
-o-transform: rotateZ(0deg);
|
108 |
+
-ms-transform: rotateZ(0deg);
|
109 |
+
transform: rotateZ(0deg);
|
110 |
+
-webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
|
111 |
+
-webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
|
112 |
+
-moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
|
113 |
+
-ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
|
114 |
+
-o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
|
115 |
+
transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
|
116 |
+
}
|
117 |
+
|
118 |
+
/* fall */
|
119 |
+
|
120 |
+
.tooltipster-fall {
|
121 |
+
-webkit-transition-property: top;
|
122 |
+
-moz-transition-property: top;
|
123 |
+
-o-transition-property: top;
|
124 |
+
-ms-transition-property: top;
|
125 |
+
transition-property: top;
|
126 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
|
127 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
128 |
+
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
129 |
+
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
130 |
+
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
131 |
+
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
132 |
+
}
|
133 |
+
.tooltipster-fall.tooltipster-initial {
|
134 |
+
top: 0 !important;
|
135 |
+
}
|
136 |
+
.tooltipster-fall.tooltipster-show {
|
137 |
+
}
|
138 |
+
.tooltipster-fall.tooltipster-dying {
|
139 |
+
-webkit-transition-property: all;
|
140 |
+
-moz-transition-property: all;
|
141 |
+
-o-transition-property: all;
|
142 |
+
-ms-transition-property: all;
|
143 |
+
transition-property: all;
|
144 |
+
top: 0 !important;
|
145 |
+
opacity: 0;
|
146 |
+
}
|
147 |
+
|
148 |
+
/* slide */
|
149 |
+
|
150 |
+
.tooltipster-slide {
|
151 |
+
-webkit-transition-property: left;
|
152 |
+
-moz-transition-property: left;
|
153 |
+
-o-transition-property: left;
|
154 |
+
-ms-transition-property: left;
|
155 |
+
transition-property: left;
|
156 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
|
157 |
+
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
158 |
+
-moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
159 |
+
-ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
160 |
+
-o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
161 |
+
transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
|
162 |
+
}
|
163 |
+
.tooltipster-slide.tooltipster-initial {
|
164 |
+
left: -40px !important;
|
165 |
+
}
|
166 |
+
.tooltipster-slide.tooltipster-show {
|
167 |
+
}
|
168 |
+
.tooltipster-slide.tooltipster-dying {
|
169 |
+
-webkit-transition-property: all;
|
170 |
+
-moz-transition-property: all;
|
171 |
+
-o-transition-property: all;
|
172 |
+
-ms-transition-property: all;
|
173 |
+
transition-property: all;
|
174 |
+
left: 0 !important;
|
175 |
+
opacity: 0;
|
176 |
+
}
|
177 |
+
|
178 |
+
/* Update animations */
|
179 |
+
|
180 |
+
/* We use animations rather than transitions here because
|
181 |
+
transition durations may be specified in the style tag due to
|
182 |
+
animationDuration, and we try to avoid collisions and the use
|
183 |
+
of !important */
|
184 |
+
|
185 |
+
/* fade */
|
186 |
+
|
187 |
+
@keyframes tooltipster-fading {
|
188 |
+
0% {
|
189 |
+
opacity: 0;
|
190 |
+
}
|
191 |
+
100% {
|
192 |
+
opacity: 1;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
.tooltipster-update-fade {
|
197 |
+
animation: tooltipster-fading 400ms;
|
198 |
+
}
|
199 |
+
|
200 |
+
/* rotate */
|
201 |
+
|
202 |
+
@keyframes tooltipster-rotating {
|
203 |
+
25% {
|
204 |
+
transform: rotate(-2deg);
|
205 |
+
}
|
206 |
+
75% {
|
207 |
+
transform: rotate(2deg);
|
208 |
+
}
|
209 |
+
100% {
|
210 |
+
transform: rotate(0);
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
.tooltipster-update-rotate {
|
215 |
+
animation: tooltipster-rotating 600ms;
|
216 |
+
}
|
217 |
+
|
218 |
+
/* scale */
|
219 |
+
|
220 |
+
@keyframes tooltipster-scaling {
|
221 |
+
50% {
|
222 |
+
transform: scale(1.1);
|
223 |
+
}
|
224 |
+
100% {
|
225 |
+
transform: scale(1);
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
.tooltipster-update-scale {
|
230 |
+
animation: tooltipster-scaling 600ms;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* DEFAULT STYLE OF THE SIDETIP PLUGIN
|
235 |
+
*
|
236 |
+
* All styles are "namespaced" with .tooltipster-sidetip to prevent
|
237 |
+
* conflicts between plugins.
|
238 |
+
*/
|
239 |
+
|
240 |
+
/* .tooltipster-box */
|
241 |
+
|
242 |
+
.tooltipster-sidetip .tooltipster-box {
|
243 |
+
background: #565656;
|
244 |
+
border: 2px solid black;
|
245 |
+
border-radius: 4px;
|
246 |
+
}
|
247 |
+
|
248 |
+
.tooltipster-sidetip.tooltipster-bottom .tooltipster-box {
|
249 |
+
margin-top: 8px;
|
250 |
+
}
|
251 |
+
|
252 |
+
.tooltipster-sidetip.tooltipster-left .tooltipster-box {
|
253 |
+
margin-right: 8px;
|
254 |
+
}
|
255 |
+
|
256 |
+
.tooltipster-sidetip.tooltipster-right .tooltipster-box {
|
257 |
+
margin-left: 8px;
|
258 |
+
}
|
259 |
+
|
260 |
+
.tooltipster-sidetip.tooltipster-top .tooltipster-box {
|
261 |
+
margin-bottom: 8px;
|
262 |
+
}
|
263 |
+
|
264 |
+
/* .tooltipster-content */
|
265 |
+
|
266 |
+
.tooltipster-sidetip .tooltipster-content {
|
267 |
+
color: white;
|
268 |
+
line-height: 18px;
|
269 |
+
padding: 6px 14px;
|
270 |
+
}
|
271 |
+
|
272 |
+
/* .tooltipster-arrow : will keep only the zone of .tooltipster-arrow-uncropped that
|
273 |
+
corresponds to the arrow we want to display */
|
274 |
+
|
275 |
+
.tooltipster-sidetip .tooltipster-arrow {
|
276 |
+
overflow: hidden;
|
277 |
+
position: absolute;
|
278 |
+
}
|
279 |
+
|
280 |
+
.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow {
|
281 |
+
height: 10px;
|
282 |
+
/* half the width, for centering */
|
283 |
+
margin-left: -10px;
|
284 |
+
top: 0;
|
285 |
+
width: 20px;
|
286 |
+
}
|
287 |
+
|
288 |
+
.tooltipster-sidetip.tooltipster-left .tooltipster-arrow {
|
289 |
+
height: 20px;
|
290 |
+
margin-top: -10px;
|
291 |
+
right: 0;
|
292 |
+
/* top 0 to keep the arrow from overflowing .tooltipster-base when it has not
|
293 |
+
been positioned yet */
|
294 |
+
top: 0;
|
295 |
+
width: 10px;
|
296 |
+
}
|
297 |
+
|
298 |
+
.tooltipster-sidetip.tooltipster-right .tooltipster-arrow {
|
299 |
+
height: 20px;
|
300 |
+
margin-top: -10px;
|
301 |
+
left: 0;
|
302 |
+
/* same as .tooltipster-left .tooltipster-arrow */
|
303 |
+
top: 0;
|
304 |
+
width: 10px;
|
305 |
+
}
|
306 |
+
|
307 |
+
.tooltipster-sidetip.tooltipster-top .tooltipster-arrow {
|
308 |
+
bottom: 0;
|
309 |
+
height: 10px;
|
310 |
+
margin-left: -10px;
|
311 |
+
width: 20px;
|
312 |
+
}
|
313 |
+
|
314 |
+
/* common rules between .tooltipster-arrow-background and .tooltipster-arrow-border */
|
315 |
+
|
316 |
+
.tooltipster-sidetip .tooltipster-arrow-background, .tooltipster-sidetip .tooltipster-arrow-border {
|
317 |
+
height: 0;
|
318 |
+
position: absolute;
|
319 |
+
width: 0;
|
320 |
+
}
|
321 |
+
|
322 |
+
/* .tooltipster-arrow-background */
|
323 |
+
|
324 |
+
.tooltipster-sidetip .tooltipster-arrow-background {
|
325 |
+
border: 10px solid transparent;
|
326 |
+
}
|
327 |
+
|
328 |
+
.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-background {
|
329 |
+
border-bottom-color: #565656;
|
330 |
+
left: 0px;
|
331 |
+
top: 3px;
|
332 |
+
}
|
333 |
+
|
334 |
+
.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-background {
|
335 |
+
border-left-color: #565656;
|
336 |
+
left: -3px;
|
337 |
+
top: 0px;
|
338 |
+
}
|
339 |
+
|
340 |
+
.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-background {
|
341 |
+
border-right-color: #565656;
|
342 |
+
left: 3px;
|
343 |
+
top: 0px;
|
344 |
+
}
|
345 |
+
|
346 |
+
.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-background {
|
347 |
+
border-top-color: #565656;
|
348 |
+
left: 0px;
|
349 |
+
top: -3px;
|
350 |
+
}
|
351 |
+
|
352 |
+
/* .tooltipster-arrow-border */
|
353 |
+
|
354 |
+
.tooltipster-sidetip .tooltipster-arrow-border {
|
355 |
+
border: 10px solid transparent;
|
356 |
+
left: 0;
|
357 |
+
top: 0;
|
358 |
+
}
|
359 |
+
|
360 |
+
.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-border {
|
361 |
+
border-bottom-color: black;
|
362 |
+
}
|
363 |
+
|
364 |
+
.tooltipster-sidetip.tooltipster-left .tooltipster-arrow-border {
|
365 |
+
border-left-color: black;
|
366 |
+
}
|
367 |
+
|
368 |
+
.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-border {
|
369 |
+
border-right-color: black;
|
370 |
+
}
|
371 |
+
|
372 |
+
.tooltipster-sidetip.tooltipster-top .tooltipster-arrow-border {
|
373 |
+
border-top-color: black;
|
374 |
+
}
|
375 |
+
|
376 |
+
/* tooltipster-arrow-uncropped */
|
377 |
+
|
378 |
+
.tooltipster-sidetip .tooltipster-arrow-uncropped {
|
379 |
+
position: relative;
|
380 |
+
}
|
381 |
+
|
382 |
+
.tooltipster-sidetip.tooltipster-bottom .tooltipster-arrow-uncropped {
|
383 |
+
top: -10px;
|
384 |
+
}
|
385 |
+
|
386 |
+
.tooltipster-sidetip.tooltipster-right .tooltipster-arrow-uncropped {
|
387 |
+
left: -10px;
|
388 |
+
}
|
389 |
+
input[type=number].wprm-recipe-servings {
|
390 |
+
display: inline;
|
391 |
+
width: 60px;
|
392 |
+
margin: 0;
|
393 |
+
padding: 5px; }
|
394 |
+
|
395 |
+
input[type=range].wprm-recipe-servings-slider {
|
396 |
+
-webkit-appearance: none;
|
397 |
+
width: 100%;
|
398 |
+
margin: 5.8px 0;
|
399 |
+
background: none;
|
400 |
+
border: 0;
|
401 |
+
box-sizing: border-box; }
|
402 |
+
|
403 |
+
input[type=range].wprm-recipe-servings-slider:focus {
|
404 |
+
outline: none; }
|
405 |
+
|
406 |
+
input[type=range].wprm-recipe-servings-slider::-webkit-slider-runnable-track {
|
407 |
+
width: 100%;
|
408 |
+
height: 8.4px;
|
409 |
+
cursor: pointer;
|
410 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
411 |
+
background: #3071a9;
|
412 |
+
border-radius: 1.3px;
|
413 |
+
border: 0.2px solid #010101; }
|
414 |
+
|
415 |
+
input[type=range].wprm-recipe-servings-slider::-webkit-slider-thumb {
|
416 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
417 |
+
border: 1px solid #000000;
|
418 |
+
height: 20px;
|
419 |
+
width: 12px;
|
420 |
+
border-radius: 3px;
|
421 |
+
background: #ffffff;
|
422 |
+
cursor: pointer;
|
423 |
+
-webkit-appearance: none;
|
424 |
+
margin-top: -6px; }
|
425 |
+
|
426 |
+
input[type=range].wprm-recipe-servings-slider:focus::-webkit-slider-runnable-track {
|
427 |
+
background: #367ebd; }
|
428 |
+
|
429 |
+
input[type=range].wprm-recipe-servings-slider::-moz-range-track {
|
430 |
+
width: 100%;
|
431 |
+
height: 8.4px;
|
432 |
+
cursor: pointer;
|
433 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
434 |
+
background: #3071a9;
|
435 |
+
border-radius: 1.3px;
|
436 |
+
border: 0.2px solid #010101; }
|
437 |
+
|
438 |
+
input[type=range].wprm-recipe-servings-slider::-moz-range-thumb {
|
439 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
440 |
+
border: 1px solid #000000;
|
441 |
+
height: 20px;
|
442 |
+
width: 12px;
|
443 |
+
border-radius: 3px;
|
444 |
+
background: #ffffff;
|
445 |
+
cursor: pointer; }
|
446 |
+
|
447 |
+
input[type=range].wprm-recipe-servings-slider::-ms-track {
|
448 |
+
width: 100%;
|
449 |
+
height: 8.4px;
|
450 |
+
cursor: pointer;
|
451 |
+
background: transparent;
|
452 |
+
border-color: transparent;
|
453 |
+
color: transparent; }
|
454 |
+
|
455 |
+
input[type=range].wprm-recipe-servings-slider::-ms-fill-lower {
|
456 |
+
background: #2a6495;
|
457 |
+
border: 0.2px solid #010101;
|
458 |
+
border-radius: 2.6px;
|
459 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; }
|
460 |
+
|
461 |
+
input[type=range].wprm-recipe-servings-slider::-ms-fill-upper {
|
462 |
+
background: #3071a9;
|
463 |
+
border: 0.2px solid #010101;
|
464 |
+
border-radius: 2.6px;
|
465 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; }
|
466 |
+
|
467 |
+
input[type=range].wprm-recipe-servings-slider::-ms-thumb {
|
468 |
+
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
469 |
+
border: 1px solid #000000;
|
470 |
+
height: 20px;
|
471 |
+
width: 12px;
|
472 |
+
border-radius: 3px;
|
473 |
+
background: #ffffff;
|
474 |
+
cursor: pointer;
|
475 |
+
height: 8.4px; }
|
476 |
+
|
477 |
+
input[type=range].wprm-recipe-servings-slider:focus::-ms-fill-lower {
|
478 |
+
background: #3071a9; }
|
479 |
+
|
480 |
+
input[type=range].wprm-recipe-servings-slider:focus::-ms-fill-upper {
|
481 |
+
background: #367ebd; }
|
482 |
+
.wprm-unit-conversion.wprmpuc-active {
|
483 |
+
font-weight: bold; }
|
dist/print.js
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var WPRecipeMaker = WPRecipeMaker || {}; WPRecipeMaker["print"] =
|
2 |
+
/******/ (function(modules) { // webpackBootstrap
|
3 |
+
/******/ // The module cache
|
4 |
+
/******/ var installedModules = {};
|
5 |
+
/******/
|
6 |
+
/******/ // The require function
|
7 |
+
/******/ function __webpack_require__(moduleId) {
|
8 |
+
/******/
|
9 |
+
/******/ // Check if module is in cache
|
10 |
+
/******/ if(installedModules[moduleId]) {
|
11 |
+
/******/ return installedModules[moduleId].exports;
|
12 |
+
/******/ }
|
13 |
+
/******/ // Create a new module (and put it into the cache)
|
14 |
+
/******/ var module = installedModules[moduleId] = {
|
15 |
+
/******/ i: moduleId,
|
16 |
+
/******/ l: false,
|
17 |
+
/******/ exports: {}
|
18 |
+
/******/ };
|
19 |
+
/******/
|
20 |
+
/******/ // Execute the module function
|
21 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
+
/******/
|
23 |
+
/******/ // Flag the module as loaded
|
24 |
+
/******/ module.l = true;
|
25 |
+
/******/
|
26 |
+
/******/ // Return the exports of the module
|
27 |
+
/******/ return module.exports;
|
28 |
+
/******/ }
|
29 |
+
/******/
|
30 |
+
/******/
|
31 |
+
/******/ // expose the modules object (__webpack_modules__)
|
32 |
+
/******/ __webpack_require__.m = modules;
|
33 |
+
/******/
|
34 |
+
/******/ // expose the module cache
|
35 |
+
/******/ __webpack_require__.c = installedModules;
|
36 |
+
/******/
|
37 |
+
/******/ // define getter function for harmony exports
|
38 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
39 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
40 |
+
/******/ Object.defineProperty(exports, name, {
|
41 |
+
/******/ configurable: false,
|
42 |
+
/******/ enumerable: true,
|
43 |
+
/******/ get: getter
|
44 |
+
/******/ });
|
45 |
+
/******/ }
|
46 |
+
/******/ };
|
47 |
+
/******/
|
48 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
49 |
+
/******/ __webpack_require__.n = function(module) {
|
50 |
+
/******/ var getter = module && module.__esModule ?
|
51 |
+
/******/ function getDefault() { return module['default']; } :
|
52 |
+
/******/ function getModuleExports() { return module; };
|
53 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
54 |
+
/******/ return getter;
|
55 |
+
/******/ };
|
56 |
+
/******/
|
57 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
58 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
+
/******/
|
60 |
+
/******/ // __webpack_public_path__
|
61 |
+
/******/ __webpack_require__.p = "";
|
62 |
+
/******/
|
63 |
+
/******/ // Load entry module and return exports
|
64 |
+
/******/ return __webpack_require__(__webpack_require__.s = 50);
|
65 |
+
/******/ })
|
66 |
+
/************************************************************************/
|
67 |
+
/******/ ({
|
68 |
+
|
69 |
+
/***/ 50:
|
70 |
+
/***/ (function(module, exports) {
|
71 |
+
|
72 |
+
throw new Error("Module build failed: Error: ENOENT: no such file or directory, open '/Users/brecht/Development/WordPress Plugins/wp-recipe-maker/wp-recipe-maker/assets/js/print.js'");
|
73 |
+
|
74 |
+
/***/ })
|
75 |
+
|
76 |
+
/******/ });
|
assets/css/public/public.min.css → dist/public.css
RENAMED
File without changes
|
dist/public.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var WPRecipeMaker=WPRecipeMaker||{};WPRecipeMaker.public=function(n){function t(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e={};return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=10)}([function(n,t){n.exports=window.jQuery},,,,function(n,t,e){(function(n){(void 0!==window.wprm_public?wprm_public.settings.features_comment_ratings:wprm_temp_admin.settings.features_comment_ratings)&&n(document).ready(function(t){if(n(".wprm-recipe-container").length>0||n("body.wp-admin").length>0){n(".comment-form-wprm-rating").show();var e=n(".comment-form-wprm-rating").data("color");n(document).on("mouseenter",".comment-form-wprm-rating .wprm-rating-star",function(){n(this).prevAll().andSelf().each(function(){n(this).find("polygon").css("fill",e)}),n(this).nextAll().each(function(){n(this).find("polygon").css("fill","none")})}),n(document).on("mouseleave",".comment-form-wprm-rating .wprm-rating-star",function(){n(this).siblings().andSelf().each(function(){n(this).find("polygon").css("fill","")})}),n(document).on("click",".comment-form-wprm-rating .wprm-rating-star",function(){var t=n(this),e=t.data("rating"),r=t.parents(".comment-form-wprm-rating").find("#wprm-comment-rating");r.val()==e?(r.val(""),n(this).siblings("").andSelf().each(function(){n(this).removeClass("rated")})):(r.val(e),n(this).prevAll().andSelf().each(function(){n(this).addClass("rated")}),n(this).nextAll().each(function(){n(this).removeClass("rated")}))})}else n(".comment-form-wprm-rating").hide()})}).call(t,e(0))},,,,,,function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e(4),i=(e.n(r),e(11),e(13)),o=(e.n(i),e(14)),c=(e.n(o),e(15)),a=(e.n(c),e(16));e.n(a)},function(n,t,e){"use strict";(function(n){function t(n,t,e){var r=window.open(wprm_public.home_url+"wprm_print/"+n,"_blank");r.onload=function(){r.focus(),r.document.title=document.title,r.history.pushState("","Print Recipe",location.href.replace(location.hash,"")),r.set_print_system(e),r.set_print_servings(t),r.print()}}var r=e(12);n(document).ready(function(e){n(".wprm-recipe-print").on("click",function(e){e.preventDefault();var i=n(this).parents(".wprm-recipe-container"),o=parseInt(i.find(".wprm-recipe-servings").data("servings")),c=Object(r.a)(i);t(i.data("recipe-id"),o,c)}),n(".wprm-print-recipe-shortcode").on("click",function(e){e.preventDefault(),t(n(this).data("recipe-id"),!1,1)})})}).call(t,e(0))},function(n,t,e){"use strict";function r(n){var t=1,e=n.find(".wprm-unit-conversion.wprmpuc-active");return e.length>0&&(t=parseInt(e.data("system"))),t}t.a=r},function(n,t){},function(n,t){},function(n,t){},function(n,t){}]);
|
includes/admin/class-wprm-import-manager.php
CHANGED
@@ -44,7 +44,6 @@ class WPRM_Import_Manager {
|
|
44 |
*/
|
45 |
public static function init() {
|
46 |
self::load_importers();
|
47 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
48 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 16 );
|
49 |
add_action( 'admin_post_wprm_import_recipes', array( __CLASS__, 'form_import_recipes' ) );
|
50 |
add_action( 'admin_post_wprm_check_imported_recipes', array( __CLASS__, 'form_check_imported_recipes' ) );
|
@@ -64,17 +63,6 @@ class WPRM_Import_Manager {
|
|
64 |
add_submenu_page( null, __( 'Importing Recipes', 'wp-recipe-maker' ), __( 'Importing Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_importing', array( __CLASS__, 'importing_recipes' ) );
|
65 |
}
|
66 |
|
67 |
-
/**
|
68 |
-
* Enqueue stylesheets and scripts.
|
69 |
-
*
|
70 |
-
* @since 1.0.0
|
71 |
-
*/
|
72 |
-
public static function enqueue() {
|
73 |
-
wp_enqueue_style( 'wprm-import', WPRM_URL . 'assets/css/admin/import.min.css', array(), WPRM_VERSION, 'all' );
|
74 |
-
|
75 |
-
wp_enqueue_script( 'wprm-import', WPRM_URL . 'assets/js/admin/import.js', array( 'jquery' ), WPRM_VERSION, true );
|
76 |
-
}
|
77 |
-
|
78 |
/**
|
79 |
* Get the template for the import overview page.
|
80 |
*
|
@@ -123,7 +111,7 @@ class WPRM_Import_Manager {
|
|
123 |
}
|
124 |
|
125 |
// Import recipes via AJAX.
|
126 |
-
wp_localize_script( 'wprm-
|
127 |
'importer_uid' => $importer_uid,
|
128 |
'post_data' => $_POST,
|
129 |
'recipes' => $recipes,
|
44 |
*/
|
45 |
public static function init() {
|
46 |
self::load_importers();
|
|
|
47 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 16 );
|
48 |
add_action( 'admin_post_wprm_import_recipes', array( __CLASS__, 'form_import_recipes' ) );
|
49 |
add_action( 'admin_post_wprm_check_imported_recipes', array( __CLASS__, 'form_check_imported_recipes' ) );
|
63 |
add_submenu_page( null, __( 'Importing Recipes', 'wp-recipe-maker' ), __( 'Importing Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_importing', array( __CLASS__, 'importing_recipes' ) );
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
/**
|
67 |
* Get the template for the import overview page.
|
68 |
*
|
111 |
}
|
112 |
|
113 |
// Import recipes via AJAX.
|
114 |
+
wp_localize_script( 'wprm-admin', 'wprm_import', array(
|
115 |
'importer_uid' => $importer_uid,
|
116 |
'post_data' => $_POST,
|
117 |
'recipes' => $recipes,
|
includes/admin/import/class-wprm-import-recipecard.php
CHANGED
@@ -76,7 +76,7 @@ class WPRM_Import_Recipecard extends WPRM_Import {
|
|
76 |
$table = $wpdb->prefix . 'yumprint_recipe_recipe';
|
77 |
|
78 |
$rc_recipes = array();
|
79 |
-
if ( $table === $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) {
|
80 |
$rc_recipes = $wpdb->get_results( 'SELECT id, recipe, post_id FROM ' . $table );
|
81 |
}
|
82 |
|
76 |
$table = $wpdb->prefix . 'yumprint_recipe_recipe';
|
77 |
|
78 |
$rc_recipes = array();
|
79 |
+
if ( strtolower( $table ) === strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) ) {
|
80 |
$rc_recipes = $wpdb->get_results( 'SELECT id, recipe, post_id FROM ' . $table );
|
81 |
}
|
82 |
|
includes/admin/manage/class-wprm-manage-recipes.php
CHANGED
@@ -88,6 +88,10 @@ class WPRM_Manage_Recipes {
|
|
88 |
foreach ( $posts as $post ) {
|
89 |
$recipe = WPRM_Recipe_Manager::get_recipe( $post );
|
90 |
|
|
|
|
|
|
|
|
|
91 |
// Parent Post Link.
|
92 |
if ( $recipe->parent_post_id() ) {
|
93 |
$parent_post_link = '<a href="' . esc_url( get_edit_post_link( $recipe->parent_post_id() ) ) . '" target="_blank">' . get_the_title( $recipe->parent_post_id() ) . '</a>';
|
88 |
foreach ( $posts as $post ) {
|
89 |
$recipe = WPRM_Recipe_Manager::get_recipe( $post );
|
90 |
|
91 |
+
if ( ! $recipe ) {
|
92 |
+
continue;
|
93 |
+
}
|
94 |
+
|
95 |
// Parent Post Link.
|
96 |
if ( $recipe->parent_post_id() ) {
|
97 |
$parent_post_link = '<a href="' . esc_url( get_edit_post_link( $recipe->parent_post_id() ) ) . '" target="_blank">' . get_the_title( $recipe->parent_post_id() ) . '</a>';
|
includes/admin/manage/class-wprm-manage.php
CHANGED
@@ -25,7 +25,6 @@ class WPRM_Manage {
|
|
25 |
* @since 1.9.0
|
26 |
*/
|
27 |
public static function init() {
|
28 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
29 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ) );
|
30 |
add_action( 'admin_notices', array( __CLASS__, 'notices' ) );
|
31 |
add_action( 'wprm_manage_page', array( __CLASS__, 'manage_page' ) );
|
@@ -38,35 +37,6 @@ class WPRM_Manage {
|
|
38 |
add_action( 'wp_ajax_wprm_delete_recipe', array( __CLASS__, 'ajax_delete_recipe' ) );
|
39 |
}
|
40 |
|
41 |
-
/**
|
42 |
-
* Enqueue stylesheets and scripts.
|
43 |
-
*
|
44 |
-
* @since 1.9.0
|
45 |
-
*/
|
46 |
-
public static function enqueue() {
|
47 |
-
$screen = get_current_screen();
|
48 |
-
|
49 |
-
if ( 'toplevel_page_wprecipemaker' === $screen->base ) {
|
50 |
-
wp_enqueue_style( 'datatables', WPRM_URL . 'vendor/datatables/datatables.min.css', array(), WPRM_VERSION, 'all' );
|
51 |
-
wp_enqueue_style( 'tooltipster', WPRM_URL . 'vendor/tooltipster/css/tooltipster.bundle.min.css', array(), WPRM_VERSION, 'all' );
|
52 |
-
wp_enqueue_style( 'wprm-manage', WPRM_URL . 'assets/css/admin/manage.min.css', array(), WPRM_VERSION, 'all' );
|
53 |
-
|
54 |
-
wp_enqueue_script( 'datatables', WPRM_URL . 'vendor/datatables/datatables.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
55 |
-
wp_enqueue_script( 'tooltipster', WPRM_URL . 'vendor/tooltipster/js/tooltipster.bundle.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
56 |
-
wp_enqueue_script( 'wprm-manage', WPRM_URL . 'assets/js/admin/manage.js', array( 'jquery', 'datatables', 'tooltipster' ), WPRM_VERSION, true );
|
57 |
-
|
58 |
-
wp_localize_script( 'wprm-manage', 'wprm_manage', array(
|
59 |
-
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
60 |
-
'nonce' => wp_create_nonce( 'wprm' ),
|
61 |
-
'tooltip' => array(
|
62 |
-
'recipes' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-recipes-actions-edit">Edit Recipe</a><a href="#" class="wprm-manage-recipes-actions-delete">Delete Recipe</a>', 'recipes' ),
|
63 |
-
'ingredients' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-ingredients-actions-rename">Rename Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-link">Edit Ingredient Link</a><a href="#" class="wprm-manage-ingredients-actions-merge">Merge into Another Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-delete">Delete Ingredient</a>', 'ingredients' ),
|
64 |
-
'taxonomies' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-taxonomies-actions-rename">Rename Term</a><a href="#" class="wprm-manage-taxonomies-actions-merge">Merge into Another Term</a><a href="#" class="wprm-manage-taxonomies-actions-delete">Delete Term</a>', 'taxonomies' ),
|
65 |
-
),
|
66 |
-
));
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
/**
|
71 |
* Update term metadata through AJAX.
|
72 |
*
|
25 |
* @since 1.9.0
|
26 |
*/
|
27 |
public static function init() {
|
|
|
28 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ) );
|
29 |
add_action( 'admin_notices', array( __CLASS__, 'notices' ) );
|
30 |
add_action( 'wprm_manage_page', array( __CLASS__, 'manage_page' ) );
|
37 |
add_action( 'wp_ajax_wprm_delete_recipe', array( __CLASS__, 'ajax_delete_recipe' ) );
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Update term metadata through AJAX.
|
42 |
*
|
includes/admin/menu/class-wprm-admin-menu-addons.php
CHANGED
@@ -25,19 +25,9 @@ class WPRM_Admin_Menu_Addons {
|
|
25 |
* @since 1.5.0
|
26 |
*/
|
27 |
public static function init() {
|
28 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
29 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 19 );
|
30 |
}
|
31 |
|
32 |
-
/**
|
33 |
-
* Enqueue stylesheets and scripts.
|
34 |
-
*
|
35 |
-
* @since 1.5.0
|
36 |
-
*/
|
37 |
-
public static function enqueue() {
|
38 |
-
wp_enqueue_style( 'wprm-addons', WPRM_URL . 'assets/css/admin/addons.min.css', array(), WPRM_VERSION, 'all' );
|
39 |
-
}
|
40 |
-
|
41 |
/**
|
42 |
* Add the FAQ & Support submenu to the WPRM menu.
|
43 |
*
|
25 |
* @since 1.5.0
|
26 |
*/
|
27 |
public static function init() {
|
|
|
28 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 19 );
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* Add the FAQ & Support submenu to the WPRM menu.
|
33 |
*
|
includes/admin/menu/class-wprm-admin-menu-faq.php
CHANGED
@@ -26,20 +26,10 @@ class WPRM_Admin_Menu_Faq {
|
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'admin_init', array( __CLASS__, 'redirect' ) );
|
29 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
30 |
add_action( 'admin_head-wp-recipe-maker_page_wprm_faq', array( __CLASS__, 'add_support_widget' ) );
|
31 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 22 );
|
32 |
}
|
33 |
|
34 |
-
/**
|
35 |
-
* Enqueue stylesheets and scripts.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
*/
|
39 |
-
public static function enqueue() {
|
40 |
-
wp_enqueue_style( 'wprm-faq', WPRM_URL . 'assets/css/admin/faq.min.css', array(), WPRM_VERSION, 'all' );
|
41 |
-
}
|
42 |
-
|
43 |
/**
|
44 |
* Redirect to FAQ page if this plugin was activated by itself.
|
45 |
*
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'admin_init', array( __CLASS__, 'redirect' ) );
|
|
|
29 |
add_action( 'admin_head-wp-recipe-maker_page_wprm_faq', array( __CLASS__, 'add_support_widget' ) );
|
30 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 22 );
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
/**
|
34 |
* Redirect to FAQ page if this plugin was activated by itself.
|
35 |
*
|
includes/admin/modal/class-wprm-button.php
CHANGED
@@ -66,7 +66,7 @@ class WPRM_Button {
|
|
66 |
* @param mixed $plugin_array TinyMCE plugins.
|
67 |
*/
|
68 |
public static function add_button( $plugin_array ) {
|
69 |
-
$plugin_array['wp_recipe_maker'] = WPRM_URL . 'assets/js/
|
70 |
return $plugin_array;
|
71 |
}
|
72 |
|
66 |
* @param mixed $plugin_array TinyMCE plugins.
|
67 |
*/
|
68 |
public static function add_button( $plugin_array ) {
|
69 |
+
$plugin_array['wp_recipe_maker'] = WPRM_URL . 'assets/js/other/shortcode-button-tinymce.js';
|
70 |
return $plugin_array;
|
71 |
}
|
72 |
|
includes/admin/modal/class-wprm-modal.php
CHANGED
@@ -26,55 +26,10 @@ class WPRM_Modal {
|
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'admin_footer', array( __CLASS__, 'add_modal_content' ) );
|
29 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
30 |
|
31 |
add_action( 'wp_ajax_wprm_get_thumbnail', array( __CLASS__, 'ajax_get_thumbnail' ) );
|
32 |
}
|
33 |
|
34 |
-
/**
|
35 |
-
* Enqueue stylesheets and scripts.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
*/
|
39 |
-
public static function enqueue() {
|
40 |
-
wp_enqueue_style( 'wprm-medium-editor', WPRM_URL . 'vendor/medium-editor/css/medium-editor.min.css', array(), WPRM_VERSION, 'all' );
|
41 |
-
wp_enqueue_style( 'wprm-medium-editor-theme', WPRM_URL . 'vendor/medium-editor/css/themes/beagle.min.css', array(), WPRM_VERSION, 'all' );
|
42 |
-
wp_enqueue_style( 'wprm-select2', WPRM_URL . 'vendor/select2/css/select2.min.css', array(), WPRM_VERSION, 'all' );
|
43 |
-
wp_enqueue_style( 'wprm-modal', WPRM_URL . 'assets/css/admin/modal.min.css', array(), WPRM_VERSION, 'all' );
|
44 |
-
|
45 |
-
wp_enqueue_script( 'medium-editor', WPRM_URL . 'vendor/medium-editor/js/medium-editor.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
46 |
-
wp_enqueue_script( 'rangy', WPRM_URL . 'vendor/rangy/rangy-core.js', array(), WPRM_VERSION, true );
|
47 |
-
wp_enqueue_script( 'wprm-rich-editor', WPRM_URL . 'assets/js/admin/rich-editor.js', array( 'jquery', 'medium-editor', 'rangy' ), WPRM_VERSION, true );
|
48 |
-
wp_enqueue_script( 'wprm-select2', WPRM_URL . 'vendor/select2/js/select2.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
49 |
-
wp_enqueue_script( 'texthighlighter', WPRM_URL . 'vendor/texthighlighter/TextHighlighter.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
50 |
-
|
51 |
-
wp_enqueue_script( 'wprm-modal', WPRM_URL . 'assets/js/admin/modal.js', array( 'jquery' ), WPRM_VERSION, true );
|
52 |
-
wp_enqueue_script( 'wprm-feedback', WPRM_URL . 'assets/js/admin/feedback.js', array( 'jquery' ), WPRM_VERSION, true );
|
53 |
-
wp_enqueue_script( 'wprm-import-text', WPRM_URL . 'assets/js/admin/import-text.js', array( 'jquery', 'wprm-modal', 'texthighlighter' ), WPRM_VERSION, true );
|
54 |
-
wp_enqueue_script( 'wprm-recipe-form', WPRM_URL . 'assets/js/admin/recipe-form.js', array( 'jquery', 'jquery-ui-sortable', 'wprm-modal', 'medium-editor', 'wprm-select2' ), WPRM_VERSION, true );
|
55 |
-
wp_enqueue_script( 'wprm-recipe-snippets', WPRM_URL . 'assets/js/admin/recipe-snippets.js', array( 'jquery', 'wprm-modal' ), WPRM_VERSION, true );
|
56 |
-
|
57 |
-
wp_localize_script( 'wprm-modal', 'wprm_modal', array(
|
58 |
-
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
59 |
-
'nonce' => wp_create_nonce( 'wprm' ),
|
60 |
-
'text' => array(
|
61 |
-
'modal_close_confirm' => __( 'Are you sure? You will lose any unsaved changes.', 'wp-recipe-maker' ),
|
62 |
-
'action_button_insert' => __( 'Insert & Close', 'wp-recipe-maker' ),
|
63 |
-
'action_button_update' => __( 'Update & Close', 'wp-recipe-maker' ),
|
64 |
-
'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
|
65 |
-
'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
|
66 |
-
'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
|
67 |
-
'import_text_reset' => __( 'Are you sure you want to start over with importing from text?', 'wp-recipe-maker' ),
|
68 |
-
'edit_recipe' => __( 'Edit Recipe', 'wp-recipe-maker' ),
|
69 |
-
'first_recipe_on_page' => __( 'First recipe on page', 'wp-recipe-maker' ),
|
70 |
-
'medium_editor_placeholder' => __( 'Type here (select text for advanced styling options)', 'wp-recipe-maker' ),
|
71 |
-
),
|
72 |
-
'addons' => array(
|
73 |
-
'premium' => WPRM_Addons::is_active( 'premium' ),
|
74 |
-
),
|
75 |
-
));
|
76 |
-
}
|
77 |
-
|
78 |
/**
|
79 |
* Get the image thumbnail from its ID.
|
80 |
*
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'admin_footer', array( __CLASS__, 'add_modal_content' ) );
|
|
|
29 |
|
30 |
add_action( 'wp_ajax_wprm_get_thumbnail', array( __CLASS__, 'ajax_get_thumbnail' ) );
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
/**
|
34 |
* Get the image thumbnail from its ID.
|
35 |
*
|
includes/admin/modal/class-wprm-shortcode-preview.php
CHANGED
@@ -66,7 +66,7 @@ class WPRM_Shortcode_Preview {
|
|
66 |
* @param array $plugin_array Plugins to be used by TinyMCE.
|
67 |
*/
|
68 |
public static function tinymce_shortcode_plugin( $plugin_array ) {
|
69 |
-
$plugin_array['wprecipemaker'] = WPRM_URL . 'assets/js/
|
70 |
return $plugin_array;
|
71 |
}
|
72 |
}
|
66 |
* @param array $plugin_array Plugins to be used by TinyMCE.
|
67 |
*/
|
68 |
public static function tinymce_shortcode_plugin( $plugin_array ) {
|
69 |
+
$plugin_array['wprecipemaker'] = WPRM_URL . 'assets/js/other/shortcode-tinymce.js';
|
70 |
return $plugin_array;
|
71 |
}
|
72 |
}
|
includes/class-wp-recipe-maker.php
CHANGED
@@ -31,8 +31,8 @@ class WP_Recipe_Maker {
|
|
31 |
* @since 1.0.0
|
32 |
*/
|
33 |
private function define_constants() {
|
34 |
-
define( 'WPRM_VERSION', '
|
35 |
-
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '
|
36 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
37 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
38 |
define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
|
31 |
* @since 1.0.0
|
32 |
*/
|
33 |
private function define_constants() {
|
34 |
+
define( 'WPRM_VERSION', '2.0.0' );
|
35 |
+
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '2.0.0' );
|
36 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
37 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
38 |
define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
|
includes/public/class-wprm-assets.php
CHANGED
@@ -26,6 +26,7 @@ class WPRM_Assets {
|
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ), 1 );
|
|
|
29 |
|
30 |
if ( WPRM_Settings::get( 'features_custom_style' ) ) {
|
31 |
add_action( 'wp_head', array( __CLASS__, 'custom_css' ) );
|
@@ -38,8 +39,8 @@ class WPRM_Assets {
|
|
38 |
* @since 1.22.0
|
39 |
*/
|
40 |
public static function enqueue() {
|
41 |
-
wp_enqueue_style( 'wprm-public', WPRM_URL . '
|
42 |
-
wp_enqueue_script( 'wprm-public', WPRM_URL . '
|
43 |
|
44 |
wp_localize_script( 'wprm-public', 'wprm_public', array(
|
45 |
'settings' => array(
|
@@ -51,6 +52,50 @@ class WPRM_Assets {
|
|
51 |
));
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* Output custom CSS from the options.
|
56 |
*
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ), 1 );
|
29 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_admin' ), 1 );
|
30 |
|
31 |
if ( WPRM_Settings::get( 'features_custom_style' ) ) {
|
32 |
add_action( 'wp_head', array( __CLASS__, 'custom_css' ) );
|
39 |
* @since 1.22.0
|
40 |
*/
|
41 |
public static function enqueue() {
|
42 |
+
wp_enqueue_style( 'wprm-public', WPRM_URL . 'dist/public.css', array(), WPRM_VERSION, 'all' );
|
43 |
+
wp_enqueue_script( 'wprm-public', WPRM_URL . 'dist/public.js', array( 'jquery' ), WPRM_VERSION, true );
|
44 |
|
45 |
wp_localize_script( 'wprm-public', 'wprm_public', array(
|
46 |
'settings' => array(
|
52 |
));
|
53 |
}
|
54 |
|
55 |
+
/**
|
56 |
+
* Enqueue stylesheets and scripts.
|
57 |
+
*
|
58 |
+
* @since 2.0.0
|
59 |
+
*/
|
60 |
+
public static function enqueue_admin() {
|
61 |
+
wp_enqueue_style( 'wp-color-picker' );
|
62 |
+
wp_enqueue_style( 'wprm-admin', WPRM_URL . 'dist/admin.css', array(), WPRM_VERSION, 'all' );
|
63 |
+
|
64 |
+
wp_enqueue_script( 'wprm-admin', WPRM_URL . 'dist/admin.js', array( 'jquery', 'jquery-ui-sortable', 'wp-color-picker' ), WPRM_VERSION, true );
|
65 |
+
|
66 |
+
wp_localize_script( 'wprm-admin', 'wprm_temp_admin', array(
|
67 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
68 |
+
'nonce' => wp_create_nonce( 'wprm' ),
|
69 |
+
'addons' => array(
|
70 |
+
'premium' => WPRM_Addons::is_active( 'premium' ),
|
71 |
+
),
|
72 |
+
'settings' => array(
|
73 |
+
'features_comment_ratings' => WPRM_Settings::get( 'features_comment_ratings' ),
|
74 |
+
),
|
75 |
+
'manage' => array(
|
76 |
+
'tooltip' => array(
|
77 |
+
'recipes' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-recipes-actions-edit">Edit Recipe</a><a href="#" class="wprm-manage-recipes-actions-delete">Delete Recipe</a>', 'recipes' ),
|
78 |
+
'ingredients' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-ingredients-actions-rename">Rename Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-link">Edit Ingredient Link</a><a href="#" class="wprm-manage-ingredients-actions-merge">Merge into Another Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-delete">Delete Ingredient</a>', 'ingredients' ),
|
79 |
+
'taxonomies' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-taxonomies-actions-rename">Rename Term</a><a href="#" class="wprm-manage-taxonomies-actions-merge">Merge into Another Term</a><a href="#" class="wprm-manage-taxonomies-actions-delete">Delete Term</a>', 'taxonomies' ),
|
80 |
+
),
|
81 |
+
),
|
82 |
+
'modal' => array(
|
83 |
+
'text' => array(
|
84 |
+
'modal_close_confirm' => __( 'Are you sure? You will lose any unsaved changes.', 'wp-recipe-maker' ),
|
85 |
+
'action_button_insert' => __( 'Insert & Close', 'wp-recipe-maker' ),
|
86 |
+
'action_button_update' => __( 'Update & Close', 'wp-recipe-maker' ),
|
87 |
+
'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
|
88 |
+
'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
|
89 |
+
'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
|
90 |
+
'import_text_reset' => __( 'Are you sure you want to start over with importing from text?', 'wp-recipe-maker' ),
|
91 |
+
'edit_recipe' => __( 'Edit Recipe', 'wp-recipe-maker' ),
|
92 |
+
'first_recipe_on_page' => __( 'First recipe on page', 'wp-recipe-maker' ),
|
93 |
+
'medium_editor_placeholder' => __( 'Type here (select text for advanced styling options)', 'wp-recipe-maker' ),
|
94 |
+
),
|
95 |
+
),
|
96 |
+
));
|
97 |
+
}
|
98 |
+
|
99 |
/**
|
100 |
* Output custom CSS from the options.
|
101 |
*
|
includes/public/class-wprm-comment-rating.php
CHANGED
@@ -35,24 +35,6 @@ class WPRM_Comment_Rating {
|
|
35 |
|
36 |
add_action( 'comment_post', array( __CLASS__, 'save_comment_rating' ) );
|
37 |
add_action( 'edit_comment', array( __CLASS__, 'save_admin_comment_rating' ) );
|
38 |
-
|
39 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_admin' ) );
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Enqueue stylesheets and scripts for admin.
|
44 |
-
*
|
45 |
-
* @since 1.1.0
|
46 |
-
*/
|
47 |
-
public static function enqueue_admin() {
|
48 |
-
wp_enqueue_style( 'wprm-comments', WPRM_URL . 'assets/css/admin/comments.min.css', array(), WPRM_VERSION, 'all' );
|
49 |
-
wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . 'assets/js/public/comment-rating.js', array( 'jquery' ), WPRM_VERSION, true );
|
50 |
-
|
51 |
-
wp_localize_script( 'wprm-comment-rating', 'wprm_public', array(
|
52 |
-
'settings' => array(
|
53 |
-
'features_comment_ratings' => WPRM_Settings::get( 'features_comment_ratings' ),
|
54 |
-
),
|
55 |
-
));
|
56 |
}
|
57 |
|
58 |
/**
|
35 |
|
36 |
add_action( 'comment_post', array( __CLASS__, 'save_comment_rating' ) );
|
37 |
add_action( 'edit_comment', array( __CLASS__, 'save_admin_comment_rating' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
includes/public/class-wprm-print.php
CHANGED
@@ -46,9 +46,10 @@ class WPRM_Print {
|
|
46 |
$styles = WPRM_Template_Manager::get_template_styles( $recipe, 'print' );
|
47 |
$styles .= '<style>body { position: relative; padding-bottom: 30px; } #wprm-print-footer { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.8em; }</style>';
|
48 |
|
49 |
-
$styles .= '<link rel="stylesheet" type="text/css" href="' . WPRM_URL . '
|
50 |
if ( WPRM_Addons::is_active( 'premium' ) ) {
|
51 |
-
$
|
|
|
52 |
}
|
53 |
|
54 |
// Custom Style.
|
@@ -63,29 +64,23 @@ class WPRM_Print {
|
|
63 |
$styles .= '<style>' . WPRM_Settings::get( 'print_css' ) . '</style>';
|
64 |
}
|
65 |
|
66 |
-
|
67 |
$scripts = '';
|
68 |
if ( WPRM_Addons::is_active( 'premium' ) ) {
|
69 |
$scripts .= '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
|
70 |
$scripts .= '<script>var wprmp_public = { settings : { features_adjustable_servings : true } };</script>';
|
71 |
-
$scripts .= '<script src="' . WPRMP_URL . '
|
72 |
-
|
73 |
-
if ( WPRM_Addons::is_active( 'unit-conversion' ) ) {
|
74 |
-
$scripts .= '<script src="' . WPRMPUC_URL . 'assets/js/public/unit-conversion.js"></script>';
|
75 |
|
76 |
-
|
77 |
-
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
}
|
83 |
-
$scripts .= '<script>var wprmpuc_ingredients = ' . wp_json_encode( $ingredients ) . ';</script>';
|
84 |
-
} else {
|
85 |
-
$scripts .= '<script>wprm.set_print_system = function(system) {};</script>';
|
86 |
}
|
|
|
|
|
87 |
} else {
|
88 |
-
$scripts .= '<script>
|
89 |
}
|
90 |
|
91 |
// Fix for IE.
|
46 |
$styles = WPRM_Template_Manager::get_template_styles( $recipe, 'print' );
|
47 |
$styles .= '<style>body { position: relative; padding-bottom: 30px; } #wprm-print-footer { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.8em; }</style>';
|
48 |
|
49 |
+
$styles .= '<link rel="stylesheet" type="text/css" href="' . WPRM_URL . 'dist/public.css"/>';
|
50 |
if ( WPRM_Addons::is_active( 'premium' ) ) {
|
51 |
+
$filename = 'public-' . strtolower( WPRMP_BUNDLE );
|
52 |
+
$styles .= '<link rel="stylesheet" type="text/css" href="' . WPRMP_URL . 'dist/' . $filename . '.css"/>';
|
53 |
}
|
54 |
|
55 |
// Custom Style.
|
64 |
$styles .= '<style>' . WPRM_Settings::get( 'print_css' ) . '</style>';
|
65 |
}
|
66 |
|
|
|
67 |
$scripts = '';
|
68 |
if ( WPRM_Addons::is_active( 'premium' ) ) {
|
69 |
$scripts .= '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
|
70 |
$scripts .= '<script>var wprmp_public = { settings : { features_adjustable_servings : true } };</script>';
|
71 |
+
$scripts .= '<script src="' . WPRMP_URL . 'dist/print.js"></script>';
|
|
|
|
|
|
|
72 |
|
73 |
+
// Localize ingredients.
|
74 |
+
$ingredients = $recipe->ingredients_without_groups();
|
75 |
|
76 |
+
foreach ( (array) $ingredients as $key => $value ) {
|
77 |
+
if ( ! is_scalar( $value ) ) continue;
|
78 |
+
$ingredients[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
+
$scripts .= '<script>var wprmpuc_ingredients = ' . wp_json_encode( $ingredients ) . ';</script>';
|
81 |
+
$scripts .= '<script>function set_print_servings(servings) { WPRecipeMakerPremium.print.set_print_servings(servings); }; function set_print_system(system) { WPRecipeMakerPremium.print.set_print_system(system); };</script>';
|
82 |
} else {
|
83 |
+
$scripts .= '<script>function set_print_servings(servings) {}; function set_print_system(system) {};</script>';
|
84 |
}
|
85 |
|
86 |
// Fix for IE.
|
includes/public/class-wprm-settings.php
CHANGED
@@ -86,7 +86,6 @@ class WPRM_Settings {
|
|
86 |
*/
|
87 |
public static function init() {
|
88 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );
|
89 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
90 |
add_action( 'admin_post_wprm_settings_appearance', array( __CLASS__, 'form_save_settings_appearance' ) );
|
91 |
add_action( 'admin_post_wprm_settings_labels', array( __CLASS__, 'form_save_settings_labels' ) );
|
92 |
add_action( 'admin_post_wprm_settings_features', array( __CLASS__, 'form_save_settings_features' ) );
|
@@ -96,18 +95,6 @@ class WPRM_Settings {
|
|
96 |
add_action( 'wprm_settings_page', array( __CLASS__, 'settings_page' ) );
|
97 |
}
|
98 |
|
99 |
-
/**
|
100 |
-
* Enqueue stylesheets and scripts.
|
101 |
-
*
|
102 |
-
* @since 1.2.0
|
103 |
-
*/
|
104 |
-
public static function enqueue() {
|
105 |
-
wp_enqueue_style( 'wp-color-picker' );
|
106 |
-
wp_enqueue_style( 'wprm-settings', WPRM_URL . 'assets/css/admin/settings.min.css', array(), WPRM_VERSION, 'all' );
|
107 |
-
|
108 |
-
wp_enqueue_script( 'wprm-settings', WPRM_URL . 'assets/js/admin/settings.js', array( 'jquery', 'wp-color-picker' ), WPRM_VERSION, true );
|
109 |
-
}
|
110 |
-
|
111 |
/**
|
112 |
* Add the settings submenu to the WPRM menu.
|
113 |
*
|
86 |
*/
|
87 |
public static function init() {
|
88 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );
|
|
|
89 |
add_action( 'admin_post_wprm_settings_appearance', array( __CLASS__, 'form_save_settings_appearance' ) );
|
90 |
add_action( 'admin_post_wprm_settings_labels', array( __CLASS__, 'form_save_settings_labels' ) );
|
91 |
add_action( 'admin_post_wprm_settings_features', array( __CLASS__, 'form_save_settings_features' ) );
|
95 |
add_action( 'wprm_settings_page', array( __CLASS__, 'settings_page' ) );
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/**
|
99 |
* Add the settings submenu to the WPRM menu.
|
100 |
*
|
includes/public/class-wprm-template-helper.php
CHANGED
@@ -375,7 +375,7 @@ class WPRM_Template_Helper {
|
|
375 |
|
376 |
$output = '<div class="wprm-unit-conversion-container">' . implode( ' - ', $unit_systems_output ) . '</div>';
|
377 |
|
378 |
-
wp_localize_script( '
|
379 |
'ingredients' => $ingredients,
|
380 |
));
|
381 |
}
|
375 |
|
376 |
$output = '<div class="wprm-unit-conversion-container">' . implode( ' - ', $unit_systems_output ) . '</div>';
|
377 |
|
378 |
+
wp_localize_script( 'wprm-public', 'wprmpuc_recipe_' . $recipe->id(), array(
|
379 |
'ingredients' => $ingredients,
|
380 |
));
|
381 |
}
|
readme.txt
CHANGED
@@ -16,7 +16,7 @@ The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadat
|
|
16 |
[WP Recipe Maker](http://bootstrapped.ventures/wp-recipe-maker/) is the easy recipe plugin that everyone can use. An easy workflow allows you to add recipes to any post or page with automatic JSON-LD metadata for your recipes. This recipe metadata will improve your SEO and get you more visitors!
|
17 |
|
18 |
Would you like to see this recipe plugin in action before installing it? Take a look at this introduction video:
|
19 |
-
https://www.youtube.com/watch?v=AtvGLRtTQgg
|
20 |
|
21 |
> <strong>Get the most out of WP Recipe Maker!</strong><br>
|
22 |
> Join our [self-paced email course](https://www.getdrip.com/forms/86388969/submissions/new) and we'll help you get started and learn all the tips and trick for using this plugin.
|
@@ -109,6 +109,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
112 |
= 1.27.0 =
|
113 |
* Feature: Create and update recipes via REST API
|
114 |
* Improvement: Only show automatically added snippets on singular pages
|
@@ -393,6 +396,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
393 |
|
394 |
== Upgrade notice ==
|
395 |
|
|
|
|
|
|
|
396 |
= 1.27.0 =
|
397 |
Update for a few bug fixes and improvements
|
398 |
|
16 |
[WP Recipe Maker](http://bootstrapped.ventures/wp-recipe-maker/) is the easy recipe plugin that everyone can use. An easy workflow allows you to add recipes to any post or page with automatic JSON-LD metadata for your recipes. This recipe metadata will improve your SEO and get you more visitors!
|
17 |
|
18 |
Would you like to see this recipe plugin in action before installing it? Take a look at this introduction video:
|
19 |
+
[youtube https://www.youtube.com/watch?v=AtvGLRtTQgg]
|
20 |
|
21 |
> <strong>Get the most out of WP Recipe Maker!</strong><br>
|
22 |
> Join our [self-paced email course](https://www.getdrip.com/forms/86388969/submissions/new) and we'll help you get started and learn all the tips and trick for using this plugin.
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 2.0.0 =
|
113 |
+
* Plugin restructure for performance improvements and Premium bundle system
|
114 |
+
|
115 |
= 1.27.0 =
|
116 |
* Feature: Create and update recipes via REST API
|
117 |
* Improvement: Only show automatically added snippets on singular pages
|
396 |
|
397 |
== Upgrade notice ==
|
398 |
|
399 |
+
= 2.0.0 =
|
400 |
+
Update for performance improvements due to restructured assets
|
401 |
+
|
402 |
= 1.27.0 =
|
403 |
Update for a few bug fixes and improvements
|
404 |
|
templates/admin/menu/faq/whats_new.php
CHANGED
@@ -11,6 +11,11 @@
|
|
11 |
|
12 |
?>
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
<h3>2017-12-01 | WP Recipe Maker 1.27.0</h3>
|
15 |
<ul>
|
16 |
<li>Feature: Create and update recipes via REST API</li>
|
11 |
|
12 |
?>
|
13 |
|
14 |
+
<h3>2018-01-24 | WP Recipe Maker 2.0.0 & WP Recipe Maker Premium 2.0.0</h3>
|
15 |
+
<ul>
|
16 |
+
<li>Plugin restructure for performance improvements and Premium bundle system</li>
|
17 |
+
</ul>
|
18 |
+
|
19 |
<h3>2017-12-01 | WP Recipe Maker 1.27.0</h3>
|
20 |
<ul>
|
21 |
<li>Feature: Create and update recipes via REST API</li>
|
vendor/datatables/DataTables-1.10.12/images/sort_asc.png
DELETED
Binary file
|
vendor/datatables/DataTables-1.10.12/images/sort_asc_disabled.png
DELETED
Binary file
|
vendor/datatables/DataTables-1.10.12/images/sort_both.png
DELETED
Binary file
|
vendor/datatables/DataTables-1.10.12/images/sort_desc.png
DELETED
Binary file
|
vendor/datatables/DataTables-1.10.12/images/sort_desc_disabled.png
DELETED
Binary file
|
vendor/datatables/datatables.min.css
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* This combined file was created by the DataTables downloader builder:
|
3 |
-
* https://datatables.net/download
|
4 |
-
*
|
5 |
-
* To rebuild or modify this file with the latest versions of the included
|
6 |
-
* software please visit:
|
7 |
-
* https://datatables.net/download/#dt/dt-1.10.12
|
8 |
-
*
|
9 |
-
* Included libraries:
|
10 |
-
* DataTables 1.10.12
|
11 |
-
*/
|
12 |
-
|
13 |
-
table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("DataTables-1.10.12/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("DataTables-1.10.12/images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("DataTables-1.10.12/images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("DataTables-1.10.12/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("DataTables-1.10.12/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/datatables/datatables.min.js
DELETED
@@ -1,180 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* This combined file was created by the DataTables downloader builder:
|
3 |
-
* https://datatables.net/download
|
4 |
-
*
|
5 |
-
* To rebuild or modify this file with the latest versions of the included
|
6 |
-
* software please visit:
|
7 |
-
* https://datatables.net/download/#dt/dt-1.10.12
|
8 |
-
*
|
9 |
-
* Included libraries:
|
10 |
-
* DataTables 1.10.12
|
11 |
-
*/
|
12 |
-
|
13 |
-
/*!
|
14 |
-
DataTables 1.10.12
|
15 |
-
©2008-2015 SpryMedia Ltd - datatables.net/license
|
16 |
-
*/
|
17 |
-
(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(D){return h(D,window,document)}):"object"===typeof exports?module.exports=function(D,I){D||(D=window);I||(I="undefined"!==typeof window?require("jquery"):require("jquery")(D));return h(I,D,D.document)}:h(jQuery,window,document)})(function(h,D,I,k){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
|
18 |
-
d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function K(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),K(a[d],b[d],c)):b[d]=b[e]})}function Da(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&E(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&E(a,a,"sZeroRecords","sLoadingRecords");
|
19 |
-
a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX=
|
20 |
-
a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&K(m.models.oSearch,a[b])}function fb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;b&&!h.isArray(b)&&(a.aDataSort=[b])}function gb(a){if(!m.__browser){var b={};m.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,
|
21 |
-
width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&&
|
22 |
-
(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ea(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:I.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=
|
23 |
-
(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),K(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&
|
24 |
-
(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):
|
25 |
-
!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Fa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&ka(a);u(a,null,"column-sizing",[a])}function Z(a,b){var c=la(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function $(a,b){var c=la(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}
|
26 |
-
function aa(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function la(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ga(a){var b=a.aoColumns,c=a.aoData,d=m.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<j;g++){i=0;for(h=c.length;i<h;i++){t[i]===k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&
|
27 |
-
g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function ib(a,b,c,d){var e,f,g,j,i,n,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var q=n.targets!==k?n.targets:n.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ea(a);d(q[f],n)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&
|
28 |
-
d(j,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function N(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ha(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ia(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,
|
29 |
-
f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(L(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function jb(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}
|
30 |
-
function Ja(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\./g,".")})}function Q(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=Q(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=Ja(f);
|
31 |
-
for(var i=0,n=j.length;i<n;i++){f=j[i].match(ba);g=j[i].match(U);if(f){j[i]=j[i].replace(ba,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(n=a.length;i<n;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(U,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function R(a){if(h.isPlainObject(a))return R(a._);
|
32 |
-
if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ja(e),f;f=e[e.length-1];for(var g,j,i=0,n=e.length-1;i<n;i++){g=e[i].match(ba);j=e[i].match(U);if(g){e[i]=e[i].replace(ba,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(n=d.length;j<n;j++)f={},b(f,d[j],g),a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(U,
|
33 |
-
""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(U))a[f.replace(U,"")](d);else a[f.replace(ba,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ka(a){return G(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);
|
34 |
-
c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ia(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;La(a,e)}}function Ia(a,b,c,d){var e=[],f=b.firstChild,g,j,i=0,n,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");
|
35 |
-
-1!==c&&(c=a.substring(c+1),R(a)(d,b.getAttribute(c)))}},S=function(a){if(c===k||c===i)j=l[i],n=h.trim(a.innerHTML),j&&j._bAttrSrc?(R(j.mData._)(d,n),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=R(j.mData)),j._setter(d,n)):d[i]=n;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)S(f),e.push(f);f=f.nextSibling}else{e=b.anCells;f=0;for(g=e.length;f<g;f++)S(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&R(a.rowId)(d,b);return{data:d,cells:e}}
|
36 |
-
function Ha(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,n,l,q;if(null===e.nTr){j=c||I.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;La(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){n=a.aoColumns[l];i=c?d[l]:I.createElement(n.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||n.mRender||n.mData!==l)&&(!h.isPlainObject(n.mData)||n.mData._!==l+".display"))i.innerHTML=B(a,b,l,"display");n.sClass&&(i.className+=" "+n.sClass);n.bVisible&&!c?j.appendChild(i):!n.bVisible&&c&&i.parentNode.removeChild(i);
|
37 |
-
n.fnCreatedCell&&n.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}u(a,"aoRowCreatedCallback",null,[j,f,b])}e.nTr.setAttribute("role","row")}function La(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?pa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function kb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===
|
38 |
-
h("th, td",g).length,n=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Ma(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Na(a,"header")(a,d,f,n);i&&da(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH);
|
39 |
-
if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function ea(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,n;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(n=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);
|
40 |
-
for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+n]!==k&&g[d][f].cell==g[d][f+n].cell;){for(c=0;c<i;c++)j[d+c][f+n]=1;n++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",n)}}}}function O(a){var b=u(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=
|
41 |
-
-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!lb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ha(a,l);l=q.nTr;if(0!==e){var t=d[c%e];q._sRowStripe!=t&&(h(l).removeClass(q._sRowStripe).addClass(t),q._sRowStripe=t)}u(a,"aoRowCallback",null,[l,q._aData,c,j]);b.push(l);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:
|
42 |
-
f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];u(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ka(a),g,n,i]);u(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ka(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));u(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;
|
43 |
-
c.bSort&&mb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,t=0;t<f.length;t++){g=null;j=f[t];if("<"==j){i=h("<div/>")[0];
|
44 |
-
n=f[t+1];if("'"==n||'"'==n){l="";for(q=2;f[t+q]!=n;)l+=f[t+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;t+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&&d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"==
|
45 |
-
j&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q<n;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function da(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,n,l,q,t;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");
|
46 |
-
q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;n=g;t=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][n+j]={cell:e,unique:t},a[f+g].nTr=d}e=e.nextSibling}}}function qa(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],da(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function ra(a,b,c){u(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},
|
47 |
-
e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){u(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var n=h.isFunction(f)?f(b,a):f,b=h.isFunction(f)&&n?n:h.extend(!0,b,n);delete g.data}n={data:b,success:function(b){var c=b.error||b.sError;c&&L(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=u(a,null,"xhr",
|
48 |
-
[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?L(a,0,"Invalid JSON response",1):4===b.readyState&&L(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;u(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(n,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(n,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,
|
49 |
-
!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,n,l,q=V(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var k=function(a,b){j.push({name:a,value:b})};k("sEcho",a.iDraw);k("iColumns",c);k("sColumns",G(b,"sName").join(","));k("iDisplayStart",g);k("iDisplayLength",i);var S={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)n=b[g],
|
50 |
-
l=f[g],i="function"==typeof n.mData?"function":n.mData,S.columns.push({data:i,name:n.sName,searchable:n.bSearchable,orderable:n.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),k("mDataProp_"+g,i),d.bFilter&&(k("sSearch_"+g,l.sSearch),k("bRegex_"+g,l.bRegex),k("bSearchable_"+g,n.bSearchable)),d.bSort&&k("bSortable_"+g,n.bSortable);d.bFilter&&(k("sSearch",e.sSearch),k("bRegex",e.bRegex));d.bSort&&(h.each(q,function(a,b){S.order.push({column:b.col,dir:b.dir});k("iSortCol_"+a,b.col);k("sSortDir_"+
|
51 |
-
a,b.dir)}),k("iSortingCols",q.length));b=m.ext.legacy.ajax;return null===b?a.sAjaxSource?j:S:b?j:S}function vb(a,b){var c=sa(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}na(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,10);d=0;for(e=c.length;d<e;d++)N(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;O(a);a._bInitComplete||
|
52 |
-
ta(a,b);a.bAjaxDataGet=!0;C(a,!1)}function sa(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?Q(c)(b):b}function pb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?
|
53 |
-
"":this.value;b!=e.sSearch&&(fa(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,O(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",g?Oa(f,g):f).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==I.activeElement&&i.val(e.sSearch)}catch(d){}});
|
54 |
-
return b[0]}function fa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ga(a);if("ssp"!=y(a)){wb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)xb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);yb(a)}else f(b);a.bFiltered=!0;u(a,null,"search",[a])}function yb(a){for(var b=
|
55 |
-
m.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,n=c.length;i<n;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function xb(a,b,c,d,e,f){if(""!==b)for(var g=a.aiDisplay,d=Pa(b,d,e,f),e=g.length-1;0<=e;e--)b=a.aoData[g[e]]._aFilterData[c],d.test(b)||g.splice(e,1)}function wb(a,b,c,d,e,f){var d=Pa(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=zb(a);if(0>=b.length)a.aiDisplay=f.slice();
|
56 |
-
else{if(g||c||e.length>b.length||0!==b.indexOf(e)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Pa(a,b,c,d){a=b?a:Qa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',"")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function zb(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=m.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<
|
57 |
-
f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(ua.innerHTML=i,i=Zb?ua.textContent:ua.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Ab(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}
|
58 |
-
function Bb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function sb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Cb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Cb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),
|
59 |
-
g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Db(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Db(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/
|
60 |
-
e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ga(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){nb(a);kb(a);ea(a,a.aoHeader);ea(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Fa(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=x(f.sWidth));u(a,null,"preInit",[a]);T(a);e=y(a);if("ssp"!=e||g)"ajax"==e?ra(a,[],function(c){var f=sa(a,c);for(b=0;b<f.length;b++)N(a,f[b]);a.iInitDisplayStart=d;T(a);C(a,!1);ta(a,c)},a):(C(a,!1),
|
61 |
-
ta(a))}else setTimeout(function(){ga(a)},200)}function ta(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&Y(a);u(a,null,"plugin-init",[a,b]);u(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);u(a,null,"length",[a,c])}function ob(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=new Option(d[g],f[g]);var i=
|
62 |
-
h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());O(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;
|
63 |
-
d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Na(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:
|
64 |
-
"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:L(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(u(a,null,"page",[a]),c&&O(a));return b}function qb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");u(a,null,"processing",
|
65 |
-
[a,b])}function rb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",
|
66 |
-
width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));
|
67 |
-
var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),
|
68 |
-
m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,Y(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove();u&&(w=u.clone().prependTo(F),P=u.find("tr"),w=
|
69 |
-
w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);c.style.width=a.aoColumns[D].sWidth});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width=x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML);
|
70 |
-
z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[b]+"</div>";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+C[b]+"</div>";a.style.width=
|
71 |
-
A[b]},w);if(F.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":
|
72 |
-
"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,
|
73 |
-
j=c.length,i=la(a,"bVisible"),n=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,m,o,p=a.oBrowser,d=p.bScrollOversize;(m=b.style.width)&&-1!==m.indexOf("%")&&(l=m);for(m=0;m<i.length;m++)o=c[i[m]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),t=!0);if(d||!t&&!f&&!e&&j==aa(a)&&j==n.length)for(m=0;m<j;m++)i=Z(a,m),null!==i&&(c[i].sWidth=x(n.eq(m).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var r=h("<tr/>").appendTo(j.find("tbody"));
|
74 |
-
j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=qa(a,j.find("thead")[0]);for(m=0;m<i.length;m++)o=c[i[m]],n[m].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?x(o.sWidthOrig):"",o.sWidthOrig&&f&&h(n[m]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m<i.length;m++)t=i[m],o=c[t],h(Gb(a,t)).clone(!1).append(o.sContentPadding).appendTo(r);h("[name]",
|
75 |
-
j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):l&&j.width(l);for(m=e=0;m<i.length;m++)k=h(n[m]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(n[m].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[m]].sWidth=x(k-g);b.style.width=x(e);o.remove()}l&&(b.style.width=
|
76 |
-
x(l));if((l||f)&&!a._reszEvt)b=function(){h(D).bind("resize.DT-"+a.sInstance,Oa(function(){Y(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",x(a)).appendTo(b||I.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace($b,
|
77 |
-
""),c=c.replace(/ /g," "),c.length>d&&(d=c.length,e=f);return e}function x(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){i=n[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||
|
78 |
-
"string",n[a]._idx===k&&(n[a]._idx=h.inArray(n[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:n[a][1],index:n[a]._idx,type:j,formatter:m.ext.type.order[j+"-pre"]})}return d}function mb(a){var b,c,d=[],e=m.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ga(a);h=V(a);b=0;for(c=h.length;b<c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,m=f[b]._aSortData;for(g=
|
79 |
-
0;g<i;g++)if(j=h[g],c=k[j.col],e=m[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=m[i.col],g=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,
|
80 |
-
"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,
|
81 |
-
G(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==typeof d&&d(a)}function Ma(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}
|
82 |
-
function va(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=V(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(G(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(G(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],
|
83 |
-
c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function wa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Ab(a.oPreviousSearch),columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Ab(a.aoPreSearchCols[d])}})};u(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,
|
84 |
-
b)}}function Kb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&e.time&&(b=u(a,"aoStateLoadParams","stateLoadParams",[a,e]),-1===h.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&e.time<+new Date-1E3*b)&&d.length===e.columns.length))){a.oLoadedState=h.extend(!0,{},e);e.start!==k&&(a._iDisplayStart=e.start,a.iInitDisplayStart=e.start);e.length!==k&&(a._iDisplayLength=e.length);e.order!==k&&(a.aaSorting=[],h.each(e.order,function(b,c){a.aaSorting.push(c[0]>=
|
85 |
-
d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b<c;b++){var f=e.columns[b];f.visible!==k&&(d[b].bVisible=f.visible);f.search!==k&&h.extend(a.aoPreSearchCols[b],Bb(f.search))}u(a,"aoStateLoaded","stateLoaded",[a,e])}}}function xa(a){var b=m.settings,a=h.inArray(a,G(b,"nTable"));return-1!==a?b[a]:null}function L(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+
|
86 |
-
d);if(b)D.console&&console.log&&console.log(c);else if(b=m.ext,b=b.sErrMode||b.errMode,a&&u(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function E(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?E(a,b,d[0],d[1]):E(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Lb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==
|
87 |
-
e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).bind("selectstart.DT",function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function u(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,
|
88 |
-
c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Na(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ya(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"),
|
89 |
-
c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Xa)},"html-num":function(b){return za(b,a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Xa)}},function(b,c){v.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(v.type.search[b+a]=v.type.search.html)})}function Nb(a){return function(){var b=[xa(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this,
|
90 |
-
b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new r(xa(this[v.iApiIndex])):new r(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):
|
91 |
-
(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,
|
92 |
-
c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),
|
93 |
-
[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return xa(this[v.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=
|
94 |
-
function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=v.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=v.internal;for(var e in m.ext.internal)e&&(this[e]=Nb(e));this.each(function(){var e={},e=1<d?Lb(e,a,!0):a,g=0,j,i=this.getAttribute("id"),n=!1,l=m.defaults,q=h(this);if("table"!=
|
95 |
-
this.nodeName.toLowerCase())L(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{eb(l);fb(l.column);K(l,l,!0);K(l.column,l.column,!0);K(l,h.extend(e,q.data()));var t=m.settings,g=0;for(j=t.length;g<j;g++){var p=t[g];if(p.nTable==this||p.nTHead.parentNode==this||p.nTFoot&&p.nTFoot.parentNode==this){g=e.bRetrieve!==k?e.bRetrieve:l.bRetrieve;if(c||g)return p.oInstance;if(e.bDestroy!==k?e.bDestroy:l.bDestroy){p.oInstance.fnDestroy();break}else{L(p,0,"Cannot reinitialise DataTable",3);
|
96 |
-
return}}if(p.sTableId==this.id){t.splice(g,1);break}}if(null===i||""===i)this.id=i="DataTables_Table_"+m.ext._unique++;var o=h.extend(!0,{},m.models.oSettings,{sDestroyWidth:q[0].style.width,sInstance:i,sTableId:i});o.nTable=this;o.oApi=b.internal;o.oInit=e;t.push(o);o.oInstance=1===b.length?b:q.dataTable();eb(e);e.oLanguage&&Da(e.oLanguage);e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=h.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:e.aLengthMenu[0]);e=Lb(h.extend(!0,{},l),e);E(o.oFeatures,
|
97 |
-
e,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));E(o,e,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols",
|
98 |
-
"aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);E(o.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);E(o.oLanguage,e,"fnInfoCallback");z(o,"aoDrawCallback",e.fnDrawCallback,"user");z(o,"aoServerParams",e.fnServerParams,"user");z(o,"aoStateSaveParams",e.fnStateSaveParams,"user");z(o,"aoStateLoadParams",e.fnStateLoadParams,"user");z(o,"aoStateLoaded",e.fnStateLoaded,"user");z(o,"aoRowCallback",e.fnRowCallback,
|
99 |
-
"user");z(o,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(o,"aoHeaderCallback",e.fnHeaderCallback,"user");z(o,"aoFooterCallback",e.fnFooterCallback,"user");z(o,"aoInitComplete",e.fnInitComplete,"user");z(o,"aoPreDrawCallback",e.fnPreDrawCallback,"user");o.rowIdFn=Q(e.rowId);gb(o);i=o.oClasses;e.bJQueryUI?(h.extend(i,m.ext.oJUIClasses,e.oClasses),e.sDom===l.sDom&&"lfrtip"===l.sDom&&(o.sDom='<"H"lfr>t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&!o.renderer.header&&(o.renderer.header="jqueryui"):
|
100 |
-
o.renderer="jqueryui":h.extend(i,m.ext.classes,e.oClasses);q.addClass(i.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=e.iDisplayStart,o._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(o.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),o._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,o._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var r=o.oLanguage;h.extend(!0,r,e.oLanguage);""!==r.sUrl&&(h.ajax({dataType:"json",url:r.sUrl,success:function(a){Da(a);K(l.oLanguage,a);h.extend(true,
|
101 |
-
r,a);ga(o)},error:function(){ga(o)}}),n=!0);null===e.asStripeClasses&&(o.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=o.asStripeClasses,v=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return v.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),o.asDestroyStripes=g.slice());t=[];g=this.getElementsByTagName("thead");0!==g.length&&(da(o.aoHeader,g[0]),t=qa(o));if(null===e.aoColumns){p=[];g=0;for(j=t.length;g<j;g++)p.push(null)}else p=e.aoColumns;g=0;for(j=
|
102 |
-
p.length;g<j;g++)Ea(o,t?t[g]:null);ib(o,e.aoColumnDefs,p,function(a,b){ja(o,a,b)});if(v.length){var s=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(v[0]).children("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=s(b,"sort")||s(b,"order"),e=s(b,"filter")||s(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ja(o,a)}}})}var w=o.oFeatures;e.bStateSave&&(w.bStateSave=
|
103 |
-
!0,Kb(o,e),z(o,"aoDrawCallback",wa,"state_save"));if(e.aaSorting===k){t=o.aaSorting;g=0;for(j=t.length;g<j;g++)t[g][1]=o.aoColumns[g].asSorting[0]}va(o);w.bSort&&z(o,"aoDrawCallback",function(){if(o.bSorted){var a=V(o),b={};h.each(a,function(a,c){b[c.src]=c.dir});u(o,null,"order",[o,a,b]);Jb(o)}});z(o,"aoDrawCallback",function(){(o.bSorted||y(o)==="ssp"||w.bDeferRender)&&va(o)},"sc");g=q.children("caption").each(function(){this._captionSide=q.css("caption-side")});j=q.children("thead");0===j.length&&
|
104 |
-
(j=h("<thead/>").appendTo(this));o.nTHead=j[0];j=q.children("tbody");0===j.length&&(j=h("<tbody/>").appendTo(this));o.nTBody=j[0];j=q.children("tfoot");if(0===j.length&&0<g.length&&(""!==o.oScroll.sX||""!==o.oScroll.sY))j=h("<tfoot/>").appendTo(this);0===j.length||0===j.children().length?q.addClass(i.sNoFooter):0<j.length&&(o.nTFoot=j[0],da(o.aoFooter,o.nTFoot));if(e.aaData)for(g=0;g<e.aaData.length;g++)N(o,e.aaData[g]);else(o.bDeferLoading||"dom"==y(o))&&ma(o,h(o.nTBody).children("tr"));o.aiDisplay=
|
105 |
-
o.aiDisplayMaster.slice();o.bInitialised=!0;!1===n&&ga(o)}});b=null;return this},v,r,p,s,Ya={},Ob=/[\r\n]/g,Aa=/<.*?>/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,cc=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Xa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(Qa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,
|
106 |
-
"").replace(Ya[b],"."):a},Za=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:Za(a.replace(Aa,""),b,c)?!0:null},G=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},ha=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&
|
107 |
-
e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},W=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Sb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},pa=function(a){var b=[],c,d,e=a.length,f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};m.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,h=arguments;d&&g<d+c?(clearTimeout(e),
|
108 |
-
e=setTimeout(function(){d=k;a.apply(b,h)},c)):(d=g,a.apply(b,h))}},escapeRegex:function(a){return a.replace(cc,"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ba=/\[.*?\]$/,U=/\(\)$/,Qa=m.util.escapeRegex,ua=h("<div>")[0],Zb=ua.textContent!==k,$b=/<.*?>/g,Oa=m.util.throttle,Tb=[],w=Array.prototype,dc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:
|
109 |
-
null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};r=function(a,b){if(!(this instanceof r))return new r(a,b);var c=[],d=function(a){(a=dc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=pa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};r.extend(this,this,Tb)};
|
110 |
-
m.Api=r;h.extend(r.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new r(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new r(this.context,b)},flatten:function(){var a=
|
111 |
-
[];return new r(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,h,i,n,l=this.context,m,t,p=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(h=l.length;g<h;g++){var o=new r(l[g]);if("table"===b)f=c.call(o,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(o,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===
|
112 |
-
b||"row"===b||"cell"===b){t=this[g];"column-rows"===b&&(m=Ba(l[g],p.opts));i=0;for(n=t.length;i<n;i++)f=t[i],f="cell"===b?c.call(o,l[g],f.row,f.column,g,i):c.call(o,l[g],f,g,i,m),f!==k&&e.push(f)}}return e.length||d?(a=new r(l,a?e.concat.apply([],e):e),b=a.selector,b.rows=p.rows,b.cols=p.cols,b.opts=p.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=
|
113 |
-
0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new r(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return hb(this,a,b,0,this.length,1)},reduceRight:w.reduceRight||function(a,b){return hb(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},
|
114 |
-
unique:function(){return new r(this.context,pa(this))},unshift:w.unshift});r.extend=function(a,b,c){if(c.length&&b&&(b instanceof r||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=b.apply(a,arguments);r.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,r.extend(a,b[f.name],f.propExt)}};r.register=p=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<
|
115 |
-
d;c++)r.register(a[c],b);else for(var e=a.split("."),f=Tb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var n=f.length;i<n;i++)if(f[i].name===g){i=f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};r.registerPlural=s=function(a,b,c){r.register(a,c);r.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof r?a.length?h.isArray(a[0])?new r(a.context,
|
116 |
-
a[0]):a[0]:k:a})};p("tables()",function(a){var b;if(a){b=r;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=this;return b});p("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new r(b[0]):a});s("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});s("tables().body()","table().body()",
|
117 |
-
function(){return this.iterator("table",function(a){return a.nTBody},1)});s("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});s("tables().footer()","table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});s("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});p("draw()",function(a){return this.iterator("table",function(b){"page"===
|
118 |
-
a?O(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});p("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});p("page.info()",function(){if(0===this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,
|
119 |
-
serverSide:"ssp"===y(a)}});p("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Ub=function(a,b,c){if(c){var d=new r(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();ra(a,[],function(c){na(a);for(var c=sa(a,c),d=0,e=c.length;d<e;d++)N(a,c[d]);T(a,b);C(a,!1)})}};p("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});
|
120 |
-
p("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});p("ajax.reload()",function(a,b){return this.iterator("table",function(c){Ub(c,!1===b,a)})});p("ajax.url()",function(a){var b=this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});p("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Ub(c,
|
121 |
-
!1===b,a)})});var $a=function(a,b,c,d,e){var f=[],g,j,i,n,l,m;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(n=b.length;i<n;i++){j=b[i]&&b[i].split?b[i].split(","):[b[i]];l=0;for(m=j.length;l<m;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=v.selector[a];if(a.length){i=0;for(n=a.length;i<n;i++)f=a[i](d,e,f)}return pa(f)},ab=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",
|
122 |
-
page:"all"},a)},bb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,d,e,f=[],g=a.aiDisplay;c=a.aiDisplayMaster;var j=b.search;d=b.order;e=b.page;if("ssp"==y(a))return"removed"===j?[]:W(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==d||"applied"==d)f="none"==j?c.slice():"applied"==j?g.slice():h.map(c,function(a){return-1===
|
123 |
-
h.inArray(a,g)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};p("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=b;return $a("row",a,function(a){var b=Pb(a);if(b!==null&&!e)return[b];var j=Ba(c,e);if(b!==null&&h.inArray(b,j)!==-1)return[b];if(!a)return j;if(typeof a==="function")return h.map(j,function(b){var e=
|
124 |
-
c.aoData[b];return a(b,e._aData,e.nTr)?b:null});b=Sb(ha(c.aoData,j,"nTr"));if(a.nodeName){if(a._DT_RowIndex!==k)return[a._DT_RowIndex];if(a._DT_CellIndex)return[a._DT_CellIndex.row];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){j=c.aIds[a.replace(/^#/,"")];if(j!==k)return[j.idx]}return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});p("rows().nodes()",function(){return this.iterator("row",
|
125 |
-
function(a,b){return a.aoData[b].nTr||k},1)});p("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ha(a.aoData,b,"_aData")},1)});s("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});s("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){ca(b,c,a)})});s("rows().indexes()","row().index()",function(){return this.iterator("row",
|
126 |
-
function(a,b){return b},1)});s("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new r(c,b)});s("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,n,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(n=
|
127 |
-
l.length;i<n;i++)l[i]._DT_CellIndex.row=g}oa(b.aiDisplayMaster,c);oa(b.aiDisplay,c);oa(a[d],c,!1);Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});p("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(ma(b,c)[0]):h.push(N(b,c));return h},1),c=this.rows(-1);c.pop();h.merge(c,b);
|
128 |
-
return c});p("row()",function(a,b){return bb(this.rows(a,b))});p("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;b[0].aoData[this[0]]._aData=a;ca(b[0],this[0],"data");return this});p("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});p("row.add()",function(a){a instanceof h&&a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?
|
129 |
-
ma(b,a)[0]:N(b,a)});return this.row(b[0])});var cb=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Vb=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new r(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<G(g,"_details").length&&(f.on("draw.dt.DT_details",
|
130 |
-
function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=aa(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&cb(f,c)}))}}};p("row().child()",function(a,b){var c=this.context;if(a===k)return c.length&&this.length?
|
131 |
-
c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)cb(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});
|
132 |
-
p(["row().child.show()","row().child().show()"],function(){Vb(this,!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var ec=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));
|
133 |
-
return c};p("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=ab(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=G(g,"sName"),i=G(g,"nTh");return $a("column",e,function(a){var b=Pb(a);if(a==="")return W(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(ec):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],
|
134 |
-
10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});s("columns().header()",
|
135 |
-
"column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});s("columns().cache()","column().cache()",
|
136 |
-
function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ha(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ha(a.aoData,e,"anCells",b)},1)});s("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m=
|
137 |
-
h.inArray(!0,G(f,"bVisible"),c+1);i=0;for(n=j.length;i<n;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[m]||null)}else h(G(b.aoData,"anCells",c)).detach();g.bVisible=a;ea(b,b.aoHeader);ea(b,b.aoFooter);wa(b)}});a!==k&&(this.iterator("column",function(c,e){u(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});s("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?$(b,c):c},1)});p("columns.adjust()",
|
138 |
-
function(){return this.iterator("table",function(a){Y(a)},1)});p("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return Z(c,b);if("fromData"===a||"toVisible"===a)return $(c,b)}});p("column()",function(a,b){return bb(this.columns(a,b))});p("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=ab(c),f=
|
139 |
-
b.aoData,g=Ba(b,e),j=Sb(ha(f,g,"anCells")),i=h([].concat.apply([],j)),l,n=b.aoColumns.length,m,p,r,u,v,s;return $a("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){m=[];p=0;for(r=g.length;p<r;p++){l=g[p];for(u=0;u<n;u++){v={row:l,column:u};if(c){s=f[l];a(v,B(b,l,u),s.anCells?s.anCells[u]:null)&&m.push(v)}else m.push(v)}}return m}if(h.isPlainObject(a))return[a];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||
|
140 |
-
!a.nodeName)return c;s=h(a).closest("*[data-dt-row]");return s.length?[{row:s.data("dt-row"),column:s.data("dt-column")}]:[]},b,e)});var d=this.columns(b,c),e=this.rows(a,c),f,g,j,i,n,l=this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(n=d[b].length;i<n;i++)f.push({row:e[b][g],column:d[b][i]})}return f},1);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&
|
141 |
-
a.anCells?a.anCells[c]:k},1)});p("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});s("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});s("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,
|
142 |
-
b,c){return{row:b,column:c,columnVisible:$(a,c)}},1)});s("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){ca(b,c,a,d)})});p("cell()",function(a,b,c){return bb(this.cells(a,b,c))});p("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],c[0].row,c[0].column):k;jb(b[0],c[0].row,c[0].column,a);ca(b[0],c[0].row,"data",c[0].column);return this});p("order()",function(a,b){var c=this.context;if(a===k)return 0!==
|
143 |
-
c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});p("order.listener()",function(a,b,c){return this.iterator("table",function(d){Ma(d,a,b,c)})});p("order.fixed()",function(a){if(!a){var b=this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});p(["columns().order()",
|
144 |
-
"column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});p("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&fa(e,h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});s("columns().search()","column().search()",function(a,
|
145 |
-
b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),fa(e,e.oPreviousSearch,1))})});p("state()",function(){return this.context.length?this.context[0].oSavedState:null});p("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});p("state.loaded()",function(){return this.context.length?
|
146 |
-
this.context[0].oLoadedState:null});p("state.save()",function(){return this.iterator("table",function(a){wa(a)})});m.versionCheck=m.fnVersionCheck=function(a){for(var b=m.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:
|
147 |
-
null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new r(c):c};m.camelToHungarian=K;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)||
|
148 |
-
(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){na(a)})});p("settings()",function(){return new r(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return G(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,
|
149 |
-
d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;u(b,"aoDestroyCallback","destroy",[b]);a||(new r(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(D).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];va(b);h(l).removeClass(b.asStripeClasses.join(" "));
|
150 |
-
h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%
|
151 |
-
p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.12";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,
|
152 |
-
sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,
|
153 |
-
sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,
|
154 |
-
fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===
|
155 |
-
a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",
|
156 |
-
sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",
|
157 |
-
renderer:null,rowId:"DT_RowId"};X(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,
|
158 |
-
bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],
|
159 |
-
aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,
|
160 |
-
fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=
|
161 |
-
this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=v={buttons:{},classes:{},build:"dt/dt-1.10.12",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},
|
162 |
-
header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(v,{afnFiltering:v.search,aTypes:v.type.detect,ofnSearch:v.type.search,oSort:v.type.order,afnSortData:v.order,aoFeatures:v.feature,oApi:v.internal,oStdClasses:v.classes,oPagination:v.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",
|
163 |
-
sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",
|
164 |
-
sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ca="",Ca="",H=Ca+"ui-state-default",ia=Ca+"css_right ui-icon ui-icon-",Xb=Ca+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,
|
165 |
-
m.ext.classes,{sPageButton:"fg-button ui-button "+H,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:H+" sorting_asc",sSortDesc:H+" sorting_desc",sSortable:H+" sorting",sSortableAsc:H+" sorting_asc_disabled",sSortableDesc:H+" sorting_desc_disabled",sSortableNone:H+" sorting_disabled",sSortJUIAsc:ia+"triangle-1-n",sSortJUIDesc:ia+"triangle-1-s",sSortJUI:ia+"carat-2-n-s",
|
166 |
-
sSortJUIAscAllowed:ia+"carat-1-n",sSortJUIDescAllowed:ia+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+H,sScrollFoot:"dataTables_scrollFoot "+H,sHeaderTH:H,sFooterTH:H,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ya(a,
|
167 |
-
b)]},simple_numbers:function(a,b){return["previous",ya(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ya(a,b),"next","last"]},_numbers:ya,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},k,l,m=0,p=function(b,d){var o,r,u,s,v=function(b){Ta(a,b.data.action,true)};o=0;for(r=d.length;o<r;o++){s=d[o];if(h.isArray(s)){u=h("<"+(s.DT_el||"div")+"/>").appendTo(b);p(u,s)}else{k=null;
|
168 |
-
l="";switch(s){case "ellipsis":b.append('<span class="ellipsis">…</span>');break;case "first":k=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":k=j.sPrevious;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":k=j.sNext;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":k=j.sLast;l=s+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:k=s+1;l=e===s?g.sPageButtonActive:""}if(k!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s],
|
169 |
-
"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(k).appendTo(b);Wa(u,{action:s},v);m++}}}},r;try{r=h(b).find(I.activeElement).data("dt-idx")}catch(o){}p(h(b).empty(),d);r&&h(b).find("[data-dt-idx="+r+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":
|
170 |
-
null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Aa,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob,
|
171 |
-
" "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(v.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,
|
172 |
-
b){return a<b?1:a>b?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,
|
173 |
-
f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Yb=function(a){return"string"===typeof a?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):a};m.render={number:function(a,
|
174 |
-
b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Yb(f);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Yb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ea,_fnColumnOptions:ja,
|
175 |
-
_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Ga,_fnApplyColumnDefs:ib,_fnHungarianMap:X,_fnCamelToHungarian:K,_fnLanguageCompat:Da,_fnBrowserDetect:gb,_fnAddData:N,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:jb,_fnSplitObjNotation:Ja,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R,
|
176 |
-
_fnGetDataMaster:Ka,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ia,_fnCreateTr:Ha,_fnBuildHead:kb,_fnDrawHead:ea,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:nb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:fa,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Pa,_fnEscapeRegex:Qa,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,_fnInfoMacros:Db,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob,
|
177 |
-
_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:ka,_fnApplyToChildren:J,_fnCalculateColumnWidths:Fa,_fnThrottle:Oa,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:x,_fnSortFlatten:V,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Ma,_fnSortingClasses:va,_fnSortData:Ib,_fnSaveState:wa,_fnLoadState:Kb,_fnSettingsFromNode:xa,_fnLog:L,_fnMap:E,_fnBindAction:Wa,_fnCallbackReg:z,
|
178 |
-
_fnCallbackFire:u,_fnLengthOverflow:Sa,_fnRenderer:Na,_fnDataSource:y,_fnRowAttributes:La,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
|
179 |
-
|
180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/medium-editor/LICENSE
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
Copyright Davi Ferreira, http://www.daviferreira.com/
|
2 |
-
|
3 |
-
This software consists of voluntary contributions made by many
|
4 |
-
individuals. For exact contribution history, see the revision history
|
5 |
-
available at https://github.com/yabwe/medium-editor
|
6 |
-
|
7 |
-
The following license applies to all parts of this software except as
|
8 |
-
documented below:
|
9 |
-
|
10 |
-
====
|
11 |
-
|
12 |
-
Permission is hereby granted, free of charge, to any person obtaining
|
13 |
-
a copy of this software and associated documentation files (the
|
14 |
-
"Software"), to deal in the Software without restriction, including
|
15 |
-
without limitation the rights to use, copy, modify, merge, publish,
|
16 |
-
distribute, sublicense, and/or sell copies of the Software, and to
|
17 |
-
permit persons to whom the Software is furnished to do so, subject to
|
18 |
-
the following conditions:
|
19 |
-
|
20 |
-
The above copyright notice and this permission notice shall be
|
21 |
-
included in all copies or substantial portions of the Software.
|
22 |
-
|
23 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
24 |
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
25 |
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
26 |
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
27 |
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
28 |
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
29 |
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
30 |
-
|
31 |
-
====
|
32 |
-
|
33 |
-
All files located in the node_modules directory are
|
34 |
-
externally maintained libraries used by this software which have their
|
35 |
-
own licenses; we recommend you read them, as their terms may differ from
|
36 |
-
the terms above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/medium-editor/README.md
DELETED
@@ -1,725 +0,0 @@
|
|
1 |
-
# MediumEditor
|
2 |
-
|
3 |
-
This is a clone of [medium.com](https://medium.com) inline editor toolbar.
|
4 |
-
|
5 |
-
MediumEditor has been written using vanilla JavaScript, no additional frameworks required.
|
6 |
-
|
7 |
-
[![screenshot](https://raw.github.com/yabwe/medium-editor/master/demo/img/medium-editor.jpg)](http://yabwe.github.io/medium-editor/)
|
8 |
-
|
9 |
-
[![Join the chat at https://gitter.im/yabwe/medium-editor](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yabwe/medium-editor?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
10 |
-
|
11 |
-
## Browser Support
|
12 |
-
|
13 |
-
[![Saucelabs Build Status](https://saucelabs.com/browser-matrix/mediumeditor.svg)](https://saucelabs.com/beta/dashboard/builds)
|
14 |
-
|
15 |
-
![Supported Browsers](https://cloud.githubusercontent.com/assets/2444240/12874138/d3960a04-cd9b-11e5-8cc5-8136d82cf5f6.png)
|
16 |
-
|
17 |
-
[![NPM info](https://nodei.co/npm/medium-editor.png?downloads=true)](https://www.npmjs.com/package/medium-editor)
|
18 |
-
|
19 |
-
[![Travis build status](https://travis-ci.org/yabwe/medium-editor.svg?branch=master)](https://travis-ci.org/yabwe/medium-editor)
|
20 |
-
[![Dependency Status](https://david-dm.org/yabwe/medium-editor.svg)](https://david-dm.org/yabwe/medium-editor)
|
21 |
-
[![devDependency Status](https://david-dm.org/yabwe/medium-editor/dev-status.svg)](https://david-dm.org/yabwe/medium-editor#info=devDependencies)
|
22 |
-
[![Coverage Status](https://coveralls.io/repos/yabwe/medium-editor/badge.svg?branch=master&service=github)](https://coveralls.io/github/yabwe/medium-editor?branch=master)
|
23 |
-
|
24 |
-
# Basic usage
|
25 |
-
|
26 |
-
### Demo
|
27 |
-
|
28 |
-
__demo__: [http://yabwe.github.io/medium-editor/](http://yabwe.github.io/medium-editor/)
|
29 |
-
|
30 |
-
### Installation
|
31 |
-
|
32 |
-
**Via npm:**
|
33 |
-
|
34 |
-
Run in your console: `npm install medium-editor`
|
35 |
-
|
36 |
-
**Via bower:**
|
37 |
-
|
38 |
-
`bower install medium-editor`
|
39 |
-
|
40 |
-
**Via an external CDN**
|
41 |
-
|
42 |
-
* Using [jsDelivr](http://www.jsdelivr.com/#!medium-editor).
|
43 |
-
|
44 |
-
For the latest version:
|
45 |
-
|
46 |
-
```html
|
47 |
-
<script src="//cdn.jsdelivr.net/medium-editor/latest/js/medium-editor.min.js"></script>
|
48 |
-
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/latest/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8">
|
49 |
-
```
|
50 |
-
|
51 |
-
For a custom one:
|
52 |
-
|
53 |
-
```html
|
54 |
-
<script src="//cdn.jsdelivr.net/medium-editor/4.11.1/js/medium-editor.min.js"></script>
|
55 |
-
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/4.11.1/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8">
|
56 |
-
```
|
57 |
-
|
58 |
-
* Using [CDNJS](https://cdnjs.com/libraries/medium-editor).
|
59 |
-
|
60 |
-
**Manual installation:**
|
61 |
-
|
62 |
-
Download the [latest release](https://github.com/yabwe/medium-editor/releases) and attach medium editor's stylesheets to your page:
|
63 |
-
|
64 |
-
Find the files to below mentioned linking in the dist folder. (./medium-editor/dist/...)
|
65 |
-
|
66 |
-
```html
|
67 |
-
<link rel="stylesheet" href="css/medium-editor.css"> <!-- Core -->
|
68 |
-
<link rel="stylesheet" href="css/themes/default.css"> <!-- or any other theme -->
|
69 |
-
```
|
70 |
-
|
71 |
-
### Usage
|
72 |
-
|
73 |
-
The next step is to reference the editor's script
|
74 |
-
|
75 |
-
```html
|
76 |
-
<script src="js/medium-editor.js"></script>
|
77 |
-
```
|
78 |
-
|
79 |
-
You can now instantiate a new MediumEditor object:
|
80 |
-
```html
|
81 |
-
<script>var editor = new MediumEditor('.editable');</script>
|
82 |
-
```
|
83 |
-
|
84 |
-
The above code will transform all the elements with the .editable class into HTML5 editable contents and add the medium editor toolbar to them.
|
85 |
-
|
86 |
-
You can also pass a list of HTML elements:
|
87 |
-
|
88 |
-
```javascript
|
89 |
-
var elements = document.querySelectorAll('.editable'),
|
90 |
-
editor = new MediumEditor(elements);
|
91 |
-
```
|
92 |
-
|
93 |
-
MediumEditor also supports textarea. If you provide a textarea element, the script will create a new div with `contentEditable=true`, hide the textarea and link the textarea value to the div HTML content.
|
94 |
-
|
95 |
-
##### Integrating with various frameworks
|
96 |
-
|
97 |
-
People have contributed wrappers around MediumEditor for integrating with different frameworks and tech stacks. Take a look at the list of existing [Wrappers and Integrations](https://github.com/yabwe/medium-editor/wiki/Wrappers-and-Integration) that have already been written for MediumEditor!
|
98 |
-
|
99 |
-
## MediumEditor Options
|
100 |
-
|
101 |
-
View the [MediumEditor Options documentation](OPTIONS.md) on all the various options for MediumEditor.
|
102 |
-
|
103 |
-
Options to customize medium-editor are passed as the second argument to the [MediumEditor constructor](API.md#mediumeditorelements-options). Example:
|
104 |
-
|
105 |
-
```js
|
106 |
-
var editor = new MediumEditor('.editor', {
|
107 |
-
// options go here
|
108 |
-
});
|
109 |
-
```
|
110 |
-
|
111 |
-
### Core options
|
112 |
-
* __activeButtonClass__: CSS class added to active buttons in the toolbar. Default: `'medium-editor-button-active'`
|
113 |
-
* __buttonLabels__: type of labels on the buttons. Values: `false` | 'fontawesome'. Default: `false`
|
114 |
-
|
115 |
-
#### NOTE:
|
116 |
-
Using `'fontawesome'` as the buttonLabels requires version 4.1.0 of the fontawesome css to be on the page to ensure all icons will be displayed correctly
|
117 |
-
|
118 |
-
* __delay__: time in milliseconds to show the toolbar or anchor tag preview. Default: `0`
|
119 |
-
* __disableReturn__: enables/disables the use of the return-key. You can also set specific element behavior by using setting a data-disable-return attribute. Default: `false`
|
120 |
-
* __disableDoubleReturn__: allows/disallows two (or more) empty new lines. You can also set specific element behavior by using setting a data-disable-double-return attribute. Default: `false`
|
121 |
-
* __disableExtraSpaces__: when set to true, it disallows spaces at the beginning and end of the element. Also it disallows entering 2 consecutive spaces between 2 words. Default: `false`
|
122 |
-
* __disableEditing__: enables/disables adding the contenteditable behavior. Useful for using the toolbar with customized buttons/actions. You can also set specific element behavior by using setting a data-disable-editing attribute. Default: `false`
|
123 |
-
* __elementsContainer__: specifies a DOM node to contain MediumEditor's toolbar and anchor preview elements. Default: `document.body`
|
124 |
-
* __extensions__: extension to use (see [Custom Buttons and Extensions](src/js/extensions)) for more. Default: `{}`
|
125 |
-
* __spellcheck__: Enable/disable native contentEditable automatic spellcheck. Default: `true`
|
126 |
-
* __targetBlank__: enables/disables target="\_blank" for anchor tags. Default: `false`
|
127 |
-
|
128 |
-
### Toolbar options
|
129 |
-
|
130 |
-
The toolbar for MediumEditor is implemented as a built-in extension which automatically displays whenever the user selects some text. The toolbar can hold any set of defined built-in buttons, but can also hold any custom buttons passed in as extensions.
|
131 |
-
|
132 |
-
Options for the toolbar are passed as an object that is a member of the outer options object. Example:
|
133 |
-
```javascript
|
134 |
-
var editor = new MediumEditor('.editable', {
|
135 |
-
toolbar: {
|
136 |
-
/* These are the default options for the toolbar,
|
137 |
-
if nothing is passed this is what is used */
|
138 |
-
allowMultiParagraphSelection: true,
|
139 |
-
buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote'],
|
140 |
-
diffLeft: 0,
|
141 |
-
diffTop: -10,
|
142 |
-
firstButtonClass: 'medium-editor-button-first',
|
143 |
-
lastButtonClass: 'medium-editor-button-last',
|
144 |
-
relativeContainer: null,
|
145 |
-
standardizeSelectionStart: false,
|
146 |
-
static: false,
|
147 |
-
/* options which only apply when static is true */
|
148 |
-
align: 'center',
|
149 |
-
sticky: false,
|
150 |
-
updateOnEmptySelection: false
|
151 |
-
}
|
152 |
-
});
|
153 |
-
```
|
154 |
-
|
155 |
-
* __allowMultiParagraphSelection__: enables/disables whether the toolbar should be displayed when selecting multiple paragraphs/block elements. Default: `true`
|
156 |
-
* __buttons__: the set of buttons to display on the toolbar. Default: `['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote']`
|
157 |
-
* See [Button Options](#button-options) for details on more button options
|
158 |
-
* __diffLeft__: value in pixels to be added to the X axis positioning of the toolbar. Default: `0`
|
159 |
-
* __diffTop__: value in pixels to be added to the Y axis positioning of the toolbar. Default: `-10`
|
160 |
-
* __firstButtonClass__: CSS class added to the first button in the toolbar. Default: `'medium-editor-button-first'`
|
161 |
-
* __lastButtonClass__: CSS class added to the last button in the toolbar. Default: `'medium-editor-button-last'`
|
162 |
-
* __relativeContainer__: DOMElement to append the toolbar to instead of the body. When passed, the toolbar will also be positioned `relative` instead of `absolute`. Default: `null`
|
163 |
-
* __standardizeSelectionStart__: enables/disables standardizing how the beginning of a range is decided between browsers whenever the selected text is analyzed for updating toolbar buttons status. Default: `false`
|
164 |
-
* __static__: enable/disable the toolbar always displaying in the same location relative to the medium-editor element. Default: `false`
|
165 |
-
|
166 |
-
##### Options which only apply when the `static` option is being used:
|
167 |
-
* __align__: `left`|`center`|`right` - When the __static__ option is `true`, this aligns the static toolbar relative to the medium-editor element. Default: `center`
|
168 |
-
* __sticky__: When the __static__ option is `true`, this enables/disables the toolbar "sticking" to the viewport and staying visible on the screen while the page scrolls. Default: `false`
|
169 |
-
* __updateOnEmptySelection__: When the __static__ option is `true`, this enables/disables updating the state of the toolbar buttons even when the selection is collapsed (there is no selection, just a cursor). Default: `false`
|
170 |
-
|
171 |
-
To disable the toolbar (which also disables the anchor-preview extension), set the value of the `toolbar` option to `false`:
|
172 |
-
```javascript
|
173 |
-
var editor = new MediumEditor('.editable', {
|
174 |
-
toolbar: false
|
175 |
-
});
|
176 |
-
```
|
177 |
-
|
178 |
-
#### Button Options
|
179 |
-
|
180 |
-
Button behavior can be modified by passing an object into the buttons array instead of a string. This allow for overriding some of the default behavior of buttons. The following options are some of the basic parts of buttons that you may override, but any part of the `MediumEditor.Extension.prototype` can be overridden via these button options. (Check out the [source code for buttons](src/js/extensions/button.js) to see what all can be overridden).
|
181 |
-
|
182 |
-
* __name__: name of the button being overridden
|
183 |
-
* __action__: argument to pass to `MediumEditor.execAction()` when the button is clicked.
|
184 |
-
* __aria__: value to add as the aria-label attribute of the button element displayed in the toolbar. This is also used as the tooltip for the button.
|
185 |
-
* __tagNames__: array of element tag names that would indicate that this button has already been applied. If this action has already been applied, the button will be displayed as 'active' in the toolbar.
|
186 |
-
* _Example_: For 'bold', if the text is ever within a `<b>` or `<strong>` tag that indicates the text is already bold. So the array of tagNames for bold would be: `['b', 'strong']`
|
187 |
-
* __NOTE__: This is not used if `useQueryState` is set to `true`.
|
188 |
-
* __style__: A pair of css property & value(s) that indicate that this button has already been applied. If this action has already been applied, the button will be displayed as 'active' in the toolbar.
|
189 |
-
* _Example_: For 'bold', if the text is ever within an element with a `'font-weight'` style property set to `700` or `'bold'`, that indicates the text is already bold. So the style object for bold would be `{ prop: 'font-weight', value: '700|bold' }`
|
190 |
-
* __NOTE__: This is not used if `useQueryState` is set to `true`.
|
191 |
-
* Properties of the __style__ object:
|
192 |
-
* __prop__: name of the css property
|
193 |
-
* __value__: value(s) of the css property (multiple values can be separated by a `'|'`)
|
194 |
-
* __useQueryState__: Enables/disables whether this button should use the built-in `document.queryCommandState()` method to determine whether the action has already been applied. If the action has already been applied, the button will be displayed as 'active' in the toolbar
|
195 |
-
* _Example_: For 'bold', if this is set to true, the code will call `document.queryCommandState('bold')` which will return true if the browser thinks the text is already bold, and false otherwise
|
196 |
-
* __contentDefault__: Default `innerHTML` to put inside the button
|
197 |
-
* __contentFA__: The `innerHTML` to use for the content of the button if the __buttonLabels__ option for MediumEditor is set to `'fontawesome'`
|
198 |
-
* __classList__: An array of classNames (strings) to be added to the button
|
199 |
-
* __attrs__: A set of key-value pairs to add to the button as custom attributes to the button element.
|
200 |
-
|
201 |
-
Example of overriding buttons (here, the goal is to mimic medium by having <kbd>H1</kbd> and <kbd>H2</kbd> buttons which actually produce `<h2>` and `<h3>` tags respectively):
|
202 |
-
```javascript
|
203 |
-
var editor = new MediumEditor('.editable', {
|
204 |
-
toolbar: {
|
205 |
-
buttons: [
|
206 |
-
'bold',
|
207 |
-
'italic',
|
208 |
-
{
|
209 |
-
name: 'h1',
|
210 |
-
action: 'append-h2',
|
211 |
-
aria: 'header type 1',
|
212 |
-
tagNames: ['h2'],
|
213 |
-
contentDefault: '<b>H1</b>',
|
214 |
-
classList: ['custom-class-h1'],
|
215 |
-
attrs: {
|
216 |
-
'data-custom-attr': 'attr-value-h1'
|
217 |
-
}
|
218 |
-
},
|
219 |
-
{
|
220 |
-
name: 'h2',
|
221 |
-
action: 'append-h3',
|
222 |
-
aria: 'header type 2',
|
223 |
-
tagNames: ['h3'],
|
224 |
-
contentDefault: '<b>H2</b>',
|
225 |
-
classList: ['custom-class-h2'],
|
226 |
-
attrs: {
|
227 |
-
'data-custom-attr': 'attr-value-h2'
|
228 |
-
}
|
229 |
-
},
|
230 |
-
'justifyCenter',
|
231 |
-
'quote',
|
232 |
-
'anchor'
|
233 |
-
]
|
234 |
-
}
|
235 |
-
});
|
236 |
-
```
|
237 |
-
|
238 |
-
### Anchor Preview options
|
239 |
-
|
240 |
-
The anchor preview is a built-in extension which automatically displays a 'tooltip' when the user is hovering over a link in the editor. The tooltip will display the `href` of the link, and when click, will open the anchor editing form in the toolbar.
|
241 |
-
|
242 |
-
Options for the anchor preview 'tooltip' are passed as an object that is a member of the outer options object. Example:
|
243 |
-
```javascript
|
244 |
-
var editor = new MediumEditor('.editable', {
|
245 |
-
anchorPreview: {
|
246 |
-
/* These are the default options for anchor preview,
|
247 |
-
if nothing is passed this is what it used */
|
248 |
-
hideDelay: 500,
|
249 |
-
previewValueSelector: 'a'
|
250 |
-
}
|
251 |
-
}
|
252 |
-
});
|
253 |
-
```
|
254 |
-
|
255 |
-
* __hideDelay__: time in milliseconds to show the anchor tag preview after the mouse has left the anchor tag. Default: `500`
|
256 |
-
* __previewValueSelector__: the default selector to locate where to put the activeAnchor value in the preview. You should only need to override this if you've modified the way in which the anchor-preview extension renders. Default: `'a'`
|
257 |
-
* __showWhenToolbarIsVisible__: determines whether the anchor tag preview shows up when the toolbar is visible. You should set this value to true if the static option for the toolbar is true and you want the preview to show at the same time. Default: `false`
|
258 |
-
* __showOnEmptyLinks__: determines whether the anchor tag preview shows up on link with href as '' or '#something'. You should set this value to false if you do not want the preview to show up in such use cases. Default: `true`
|
259 |
-
|
260 |
-
To disable the anchor preview, set the value of the `anchorPreview` option to `false`:
|
261 |
-
```javascript
|
262 |
-
var editor = new MediumEditor('.editable', {
|
263 |
-
anchorPreview: false
|
264 |
-
});
|
265 |
-
```
|
266 |
-
##### NOTE:
|
267 |
-
* If the toolbar is disabled (via `toolbar: false` option or `data-disable-toolbar` attribute) the anchor-preview is automatically disabled.
|
268 |
-
* If the anchor editing form is not enabled, clicking on the anchor-preview will not allow the href of the link to be edited
|
269 |
-
|
270 |
-
### Placeholder Options
|
271 |
-
|
272 |
-
The placeholder handler is a built-in extension which displays placeholder text when the editor is empty.
|
273 |
-
|
274 |
-
Options for placeholder are passed as an object that is a member of the outer options object. Example:
|
275 |
-
```javascript
|
276 |
-
var editor = new MediumEditor('.editable', {
|
277 |
-
placeholder: {
|
278 |
-
/* This example includes the default options for placeholder,
|
279 |
-
if nothing is passed this is what it used */
|
280 |
-
text: 'Type your text',
|
281 |
-
hideOnClick: true
|
282 |
-
}
|
283 |
-
});
|
284 |
-
```
|
285 |
-
|
286 |
-
* __text__: Defines the default placeholder for empty contenteditables when __placeholder__ is not set to false. You can overwrite it by setting a `data-placeholder` attribute on the editor elements. Default: `'Type your text'`
|
287 |
-
|
288 |
-
* __hideOnClick__: Causes the placeholder to disappear as soon as the field gains focus. Default: `true`.
|
289 |
-
To hide the placeholder only after starting to type, and to show it again as soon as field is empty, set this option to `false`.
|
290 |
-
|
291 |
-
|
292 |
-
To disable the placeholder, set the value of the `placeholder` option to `false`:
|
293 |
-
```javascript
|
294 |
-
var editor = new MediumEditor('.editable', {
|
295 |
-
placeholder: false
|
296 |
-
});
|
297 |
-
```
|
298 |
-
|
299 |
-
### Anchor Form options
|
300 |
-
|
301 |
-
The anchor form is a built-in button extension which allows the user to add/edit/remove links from within the editor. When 'anchor' is passed in as a button in the list of buttons, this extension will be enabled and can be triggered by clicking the corresponding button in the toolbar.
|
302 |
-
|
303 |
-
Options for the anchor form are passed as an object that is a member of the outer options object. Example:
|
304 |
-
```javascript
|
305 |
-
var editor = new MediumEditor('.editable', {
|
306 |
-
toolbar: {
|
307 |
-
buttons: ['bold', 'italic', 'underline', 'anchor']
|
308 |
-
},
|
309 |
-
anchor: {
|
310 |
-
/* These are the default options for anchor form,
|
311 |
-
if nothing is passed this is what it used */
|
312 |
-
customClassOption: null,
|
313 |
-
customClassOptionText: 'Button',
|
314 |
-
linkValidation: false,
|
315 |
-
placeholderText: 'Paste or type a link',
|
316 |
-
targetCheckbox: false,
|
317 |
-
targetCheckboxText: 'Open in new window'
|
318 |
-
}
|
319 |
-
}
|
320 |
-
});
|
321 |
-
```
|
322 |
-
|
323 |
-
* __customClassOption__: custom class name the user can optionally have added to their created links (ie 'button'). If passed as a non-empty string, a checkbox will be displayed allowing the user to choose whether to have the class added to the created link or not. Default: `null`
|
324 |
-
* __customClassOptionText__: text to be shown in the checkbox when the __customClassOption__ is being used. Default: `'Button'`
|
325 |
-
* __linkValidation__: enables/disables check for common URL protocols on anchor links. Converts invalid url characters (ie spaces) to valid characters using `encodeURI`. Default: `false`
|
326 |
-
* __placeholderText__: text to be shown as placeholder of the anchor input. Default: `'Paste or type a link'`
|
327 |
-
* __targetCheckbox__: enables/disables displaying a "Open in new window" checkbox, which when checked changes the `target` attribute of the created link. Default: `false`
|
328 |
-
* __targetCheckboxText__: text to be shown in the checkbox enabled via the __targetCheckbox__ option. Default: `'Open in new window'`
|
329 |
-
|
330 |
-
### Paste Options
|
331 |
-
|
332 |
-
The paste handler is a built-in extension which attempts to filter the content when the user pastes. How the paste handler filters is configurable via specific options.
|
333 |
-
|
334 |
-
Options for paste handling are passed as an object that is a member of the outer options object. Example:
|
335 |
-
```javascript
|
336 |
-
var editor = new MediumEditor('.editable', {
|
337 |
-
paste: {
|
338 |
-
/* This example includes the default options for paste,
|
339 |
-
if nothing is passed this is what it used */
|
340 |
-
forcePlainText: true,
|
341 |
-
cleanPastedHTML: false,
|
342 |
-
cleanReplacements: [],
|
343 |
-
cleanAttrs: ['class', 'style', 'dir'],
|
344 |
-
cleanTags: ['meta'],
|
345 |
-
unwrapTags: []
|
346 |
-
}
|
347 |
-
});
|
348 |
-
```
|
349 |
-
|
350 |
-
* __forcePlainText__: Forces pasting as plain text. Default: `true`
|
351 |
-
* __cleanPastedHTML__: cleans pasted content from different sources, like google docs etc. Default: `false`
|
352 |
-
* __preCleanReplacements__: custom pairs (2 element arrays) of RegExp and replacement text to use during paste when __forcePlainText__ or __cleanPastedHTML__ are `true` OR when calling `cleanPaste(text)` helper method. These replacements are executed _before_ builtin replacements. Default: `[]`
|
353 |
-
* __cleanReplacements__: custom pairs (2 element arrays) of RegExp and replacement text to use during paste when __forcePlainText__ or __cleanPastedHTML__ are `true` OR when calling `cleanPaste(text)` helper method. These replacements are executed _after_ builtin replacements. Default: `[]`
|
354 |
-
* __cleanAttrs__: list of element attributes to remove during paste when __cleanPastedHTML__ is `true` or when calling `cleanPaste(text)` or `pasteHTML(html,options)` helper methods. Default: `['class', 'style', 'dir']`
|
355 |
-
* __cleanTags__: list of element tag names to remove during paste when __cleanPastedHTML__ is `true` or when calling `cleanPaste(text)` or `pasteHTML(html,options)` helper methods. Default: `['meta']`
|
356 |
-
* __unwrapTags__: list of element tag names to unwrap (remove the element tag but retain its child elements) during paste when __cleanPastedHTML__ is `true` or when calling `cleanPaste(text)` or `pasteHTML(html,options)` helper methods. Default: `[]`
|
357 |
-
|
358 |
-
### KeyboardCommands Options
|
359 |
-
|
360 |
-
The keyboard commands handler is a built-in extension for mapping key-combinations to actions to execute in the editor.
|
361 |
-
|
362 |
-
Options for KeyboardCommands are passed as an object that is a member of the outer options object. Example:
|
363 |
-
```javascript
|
364 |
-
var editor = new MediumEditor('.editable', {
|
365 |
-
keyboardCommands: {
|
366 |
-
/* This example includes the default options for keyboardCommands,
|
367 |
-
if nothing is passed this is what it used */
|
368 |
-
commands: [
|
369 |
-
{
|
370 |
-
command: 'bold',
|
371 |
-
key: 'B',
|
372 |
-
meta: true,
|
373 |
-
shift: false,
|
374 |
-
alt: false
|
375 |
-
},
|
376 |
-
{
|
377 |
-
command: 'italic',
|
378 |
-
key: 'I',
|
379 |
-
meta: true,
|
380 |
-
shift: false,
|
381 |
-
alt: false
|
382 |
-
},
|
383 |
-
{
|
384 |
-
command: 'underline',
|
385 |
-
key: 'U',
|
386 |
-
meta: true,
|
387 |
-
shift: false,
|
388 |
-
alt: false
|
389 |
-
}
|
390 |
-
],
|
391 |
-
}
|
392 |
-
});
|
393 |
-
```
|
394 |
-
|
395 |
-
* __commands__: Array of objects describing each command and the combination of keys that will trigger it. Required for each object:
|
396 |
-
* _command_: argument passed to `editor.execAction()` when key-combination is used
|
397 |
-
* if defined as `false`, the shortcut will be disabled
|
398 |
-
* _key_: keyboard character that triggers this command
|
399 |
-
* _meta_: whether the ctrl/meta key has to be active or inactive
|
400 |
-
* _shift_: whether the shift key has to be active or inactive
|
401 |
-
* _alt_: whether the alt key has to be active or inactive
|
402 |
-
|
403 |
-
To disable the keyboard commands, set the value of the `keyboardCommands` option to `false`:
|
404 |
-
```javascript
|
405 |
-
var editor = new MediumEditor('.editable', {
|
406 |
-
keyboardCommands: false
|
407 |
-
});
|
408 |
-
```
|
409 |
-
|
410 |
-
### Auto Link Options
|
411 |
-
|
412 |
-
The auto-link handler is a built-in extension which automatically turns URLs entered into the text field into HTML anchor tags (similar to the functionality of Markdown). This feature is OFF by default.
|
413 |
-
|
414 |
-
To enable built-in auto-link support, set the value of the `autoLink` option to `true`:
|
415 |
-
|
416 |
-
```javascript
|
417 |
-
var editor = new MediumEditor('.editable', {
|
418 |
-
autoLink: true
|
419 |
-
});
|
420 |
-
```
|
421 |
-
|
422 |
-
### Image Dragging Options
|
423 |
-
|
424 |
-
The image dragging handler is a built-in extension for handling dragging & dropping images into the contenteditable. This feature is ON by default.
|
425 |
-
|
426 |
-
To disable built-in image dragging, set the value of the `imageDragging` option to `false`:
|
427 |
-
```javascript
|
428 |
-
var editor = new MediumEditor('.editable', {
|
429 |
-
imageDragging: false
|
430 |
-
});
|
431 |
-
```
|
432 |
-
|
433 |
-
#### Disable File Dragging
|
434 |
-
To stop preventing drag & drop events and disable file dragging in general, provide a dummy ImageDragging extension.
|
435 |
-
```javascript
|
436 |
-
var editor = new MediumEditor('.editor', {
|
437 |
-
extensions: {
|
438 |
-
'imageDragging': {}
|
439 |
-
}
|
440 |
-
});
|
441 |
-
```
|
442 |
-
Due to the [state of code](https://github.com/yabwe/medium-editor/issues/966) in 5.0.0, the editor *ALWAYS* prevented any drag and drop actions.
|
443 |
-
We will have a better way to disable file dragging in 6.*
|
444 |
-
|
445 |
-
### Options Example:
|
446 |
-
|
447 |
-
```javascript
|
448 |
-
var editor = new MediumEditor('.editable', {
|
449 |
-
delay: 1000,
|
450 |
-
targetBlank: true,
|
451 |
-
toolbar: {
|
452 |
-
buttons: ['bold', 'italic', 'quote'],
|
453 |
-
diffLeft: 25,
|
454 |
-
diffTop: 10,
|
455 |
-
},
|
456 |
-
anchor: {
|
457 |
-
placeholderText: 'Type a link',
|
458 |
-
customClassOption: 'btn',
|
459 |
-
customClassOptionText: 'Create Button'
|
460 |
-
},
|
461 |
-
paste: {
|
462 |
-
cleanPastedHTML: true,
|
463 |
-
cleanAttrs: ['style', 'dir'],
|
464 |
-
cleanTags: ['label', 'meta'],
|
465 |
-
unwrapTags: ['sub', 'sup']
|
466 |
-
},
|
467 |
-
anchorPreview: {
|
468 |
-
hideDelay: 300
|
469 |
-
},
|
470 |
-
placeholder: {
|
471 |
-
text: 'Click to edit'
|
472 |
-
}
|
473 |
-
});
|
474 |
-
```
|
475 |
-
|
476 |
-
## Buttons
|
477 |
-
|
478 |
-
By default, MediumEditor supports buttons for most of the commands for `document.execCommand()` that are well-supported across all its supported browsers.
|
479 |
-
|
480 |
-
### Default buttons.
|
481 |
-
|
482 |
-
MediumEditor, by default, will show only the buttons listed here to avoid a huge toolbar:
|
483 |
-
|
484 |
-
* __bold__
|
485 |
-
* __italic__
|
486 |
-
* __underline__
|
487 |
-
* __anchor__ _(built-in support for collecting a url via the anchor extension)_
|
488 |
-
* __h2__
|
489 |
-
* __h3__
|
490 |
-
* __quote__
|
491 |
-
|
492 |
-
### All buttons.
|
493 |
-
|
494 |
-
These are all the built-in buttons supported by MediumEditor.
|
495 |
-
|
496 |
-
* __bold__
|
497 |
-
* __italic__
|
498 |
-
* __underline__
|
499 |
-
* __strikethrough__
|
500 |
-
* __subscript__
|
501 |
-
* __superscript__
|
502 |
-
* __anchor__
|
503 |
-
* __image__ (this simply converts selected text to an image tag)
|
504 |
-
* __quote__
|
505 |
-
* __pre__
|
506 |
-
* __orderedlist__
|
507 |
-
* __unorderedlist__
|
508 |
-
* __indent__ (moves the selected text up one level)
|
509 |
-
* __outdent__ (moves the selected text down one level)
|
510 |
-
* __justifyLeft__
|
511 |
-
* __justifyCenter__
|
512 |
-
* __justifyRight__
|
513 |
-
* __justifyFull__
|
514 |
-
* __h1__
|
515 |
-
* __h2__
|
516 |
-
* __h3__
|
517 |
-
* __h4__
|
518 |
-
* __h5__
|
519 |
-
* __h6__
|
520 |
-
* __removeFormat__ (clears inline style formatting, preserves blocks)
|
521 |
-
* __html__ (parses selected html and converts into actual html elements)
|
522 |
-
|
523 |
-
## Themes
|
524 |
-
|
525 |
-
Check out the Wiki page for a list of available themes: [https://github.com/yabwe/medium-editor/wiki/Themes](https://github.com/yabwe/medium-editor/wiki/Themes)
|
526 |
-
|
527 |
-
## API
|
528 |
-
|
529 |
-
View the [MediumEditor Object API documentation](API.md) on the Wiki for details on all the methods supported on the MediumEditor object.
|
530 |
-
|
531 |
-
### Initialization methods
|
532 |
-
* __MediumEditor(elements, options)__: Creates an instance of MediumEditor
|
533 |
-
* __.destroy()__: tears down the editor if already setup, removing all DOM elements and event handlers
|
534 |
-
* __.setup()__: rebuilds the editor if it has already been destroyed, recreating DOM elements and attaching event handlers
|
535 |
-
* __.addElements()__: add elements to an already initialized instance of MediumEditor
|
536 |
-
* __.removeElements()__: remove elements from an already initialized instance of MediumEditor
|
537 |
-
|
538 |
-
### Event Methods
|
539 |
-
* __.on(target, event, listener, useCapture)__: attach a listener to a DOM event which will be detached when MediumEditor is deactivated
|
540 |
-
* __.off(target, event, listener, useCapture)__: detach a listener to a DOM event that was attached via `on()`
|
541 |
-
* __.subscribe(event, listener)__: attaches a listener to a custom medium-editor event
|
542 |
-
* __.unsubscribe(event, listener)__: detaches a listener from a custom medium-editor event
|
543 |
-
* __.trigger(name, data, editable)__: manually triggers a custom medium-editor event
|
544 |
-
|
545 |
-
### Selection Methods
|
546 |
-
* __.checkSelection()__: manually trigger an update of the toolbar and extensions based on the current selection
|
547 |
-
* __.exportSelection()__: return a data representation of the selected text, which can be applied via `importSelection()`
|
548 |
-
* __.importSelection(selectionState)__: restore the selection using a data representation of previously selected text (ie value returned by `exportSelection()`)
|
549 |
-
* __.getFocusedElement()__: returns an element if any contenteditable element monitored by MediumEditor currently has focused
|
550 |
-
* __.getSelectedParentElement(range)__: get the parent contenteditable element that contains the current selection
|
551 |
-
* __.restoreSelection()__: restore the selection to what was selected when `saveSelection()` was called
|
552 |
-
* __.saveSelection()__: internally store the set of selected text
|
553 |
-
* __.selectAllContents()__: expands the selection to contain all text within the focused contenteditable
|
554 |
-
* __.selectElement(element)__: change selection to be a specific element and update the toolbar to reflect the selection
|
555 |
-
* __.stopSelectionUpdates()__: stop the toolbar from updating to reflect the state of the selected text
|
556 |
-
* __.startSelectionUpdates()__: put the toolbar back into its normal updating state
|
557 |
-
|
558 |
-
### Editor Action Methods
|
559 |
-
* __.cleanPaste(text)__: convert text to plaintext and replace current selection with result
|
560 |
-
* __.createLink(opts)__: creates a link via the native `document.execCommand('createLink')` command
|
561 |
-
* __.execAction(action, opts)__: executes an built-in action via `document.execCommand`
|
562 |
-
* __.pasteHTML(html, options)__: replace the current selection with html
|
563 |
-
* __.queryCommandState(action)__: wrapper around the browser's built in `document.queryCommandState(action)` for checking whether a specific action has already been applied to the selection.
|
564 |
-
|
565 |
-
### Helper Methods
|
566 |
-
* __.delay(fn)__: delay any function from being executed by the amount of time passed as the `delay` option
|
567 |
-
* __.getContent(index)__: gets the trimmed `innerHTML` of the element at `index`
|
568 |
-
* __.getExtensionByName(name)__: get a reference to an extension with the specified name
|
569 |
-
* __.resetContent(element)__: reset the content of all elements or a specific element to its value when added to the editor initially
|
570 |
-
* __.serialize()__: returns a JSON object with elements contents
|
571 |
-
* __.setContent(html, index)__: sets the `innerHTML` to `html` of the element at `index`
|
572 |
-
|
573 |
-
### Static Methods/Properties
|
574 |
-
* __.getEditorFromElement(element)__: retrieve the instance of MediumEditor that is monitoring the provided editor element
|
575 |
-
* __.version__: the version information for the MediumEditor library
|
576 |
-
|
577 |
-
## Dynamically add/remove elements to your instance
|
578 |
-
|
579 |
-
It is possible to dynamically add new elements to your existing MediumEditor instance:
|
580 |
-
|
581 |
-
```javascript
|
582 |
-
var editor = new MediumEditor('.editable');
|
583 |
-
editor.subscribe('editableInput', this._handleEditableInput.bind(this));
|
584 |
-
|
585 |
-
// imagine an ajax fetch/any other dynamic functionality which will add new '.editable' elements to the DOM
|
586 |
-
|
587 |
-
editor.addElements('.editable');
|
588 |
-
// OR editor.addElements(document.getElementsByClassName('editable'));
|
589 |
-
// OR editor.addElements(document.querySelectorAll('.editable'));
|
590 |
-
```
|
591 |
-
|
592 |
-
Passing an elements or array of elements to `addElements(elements)` will:
|
593 |
-
* Add the given element or array of elements to the internal `this.elements` array.
|
594 |
-
* Ensure the element(s) are initialized with the proper attributes and event handlers as if the element had been passed during instantiation of the editor.
|
595 |
-
* For any `<textarea>` elements:
|
596 |
-
* Hide the `<textarea>`
|
597 |
-
* Create a new `<div contenteditable=true>` element and add it to the elements array.
|
598 |
-
* Ensure the 2 elements remain sync'd.
|
599 |
-
* Be intelligent enough to run the necessary code only once per element, no matter how often you will call it.
|
600 |
-
|
601 |
-
### Removing elements dynamically
|
602 |
-
|
603 |
-
Straight forward, just call `removeElements` with the element or array of elements you to want to tear down. Each element itself will remain a contenteditable - it will just remove all event handlers and all references to it so you can safely remove it from DOM.
|
604 |
-
|
605 |
-
```javascript
|
606 |
-
editor.removeElements(document.querySelector('#myElement'));
|
607 |
-
// OR editor.removeElements(document.getElementById('myElement'));
|
608 |
-
// OR editor.removeElements('#myElement');
|
609 |
-
|
610 |
-
// in case you have jQuery and don't exactly know when an element was removed, for example after routing state change
|
611 |
-
var removedElements = [];
|
612 |
-
editor.elements.forEach(function (element) {
|
613 |
-
// check if the element is still available in current DOM
|
614 |
-
if (!$(element).parents('body').length) {
|
615 |
-
removedElements.push(element);
|
616 |
-
}
|
617 |
-
});
|
618 |
-
|
619 |
-
editor.removeElements(removedElements);
|
620 |
-
```
|
621 |
-
|
622 |
-
## Capturing DOM changes
|
623 |
-
|
624 |
-
For observing any changes on contentEditable, use the custom `'editableInput'` event exposed via the `subscribe()` method:
|
625 |
-
|
626 |
-
```js
|
627 |
-
var editor = new MediumEditor('.editable');
|
628 |
-
editor.subscribe('editableInput', function (event, editable) {
|
629 |
-
// Do some work
|
630 |
-
});
|
631 |
-
```
|
632 |
-
|
633 |
-
This event is supported in all browsers supported by MediumEditor (including IE9+ and Edge)! To help with cases when one instance of MediumEditor is monitoring multiple elements, the 2nd argument passed to the event handler (`editable` in the example above) will be a reference to the contenteditable element that has actually changed.
|
634 |
-
|
635 |
-
This is handy when you need to capture any modifications to the contenteditable element including:
|
636 |
-
* Typing
|
637 |
-
* Cutting/Pasting
|
638 |
-
* Changes from clicking on buttons in the toolbar
|
639 |
-
* Undo/Redo
|
640 |
-
|
641 |
-
Why is this interesting and why should you use this event instead of just attaching to the `input` event on the contenteditable element?
|
642 |
-
|
643 |
-
So for most modern browsers (Chrome, Firefox, Safari, etc.), the `input` event works just fine. In fact, `editableInput` is just a proxy for the `input` event in those browsers. However, the `input` event [is not supported for contenteditable elements in IE 9-11](https://connect.microsoft.com/IE/feedback/details/794285/ie10-11-input-event-does-not-fire-on-div-with-contenteditable-set) and is _mostly_ supported in Microsoft Edge, but not fully.
|
644 |
-
|
645 |
-
So, to properly support the `editableInput` event in Internet Explorer and Microsoft Edge, MediumEditor uses a combination of the `selectionchange` and `keypress` events, as well as monitoring calls to `document.execCommand`.
|
646 |
-
|
647 |
-
## Extensions & Plugins
|
648 |
-
|
649 |
-
Check the [documentation](src/js/extensions) in order to learn how to develop extensions for MediumEditor.
|
650 |
-
|
651 |
-
A list of existing extensions and plugins, such as [Images and Media embeds](http://orthes.github.io/medium-editor-insert-plugin/), [Tables](https://github.com/yabwe/medium-editor-tables) and [Markdown](https://github.com/IonicaBizau/medium-editor-markdown) can be found [here](https://github.com/yabwe/medium-editor/wiki/Extensions-Plugins).
|
652 |
-
|
653 |
-
## Development
|
654 |
-
|
655 |
-
To run the demo locally:
|
656 |
-
|
657 |
-
1. Clone this repo locally
|
658 |
-
2. Run `npm install` from your console at the root
|
659 |
-
3. Run `node index.js` from the root
|
660 |
-
4. Navigate to `http://localhost:8088/demo/index.html` to view the demo
|
661 |
-
|
662 |
-
MediumEditor development tasks are managed by Grunt. To install all the necessary packages, just invoke:
|
663 |
-
|
664 |
-
```bash
|
665 |
-
npm install
|
666 |
-
```
|
667 |
-
|
668 |
-
To run all the test and build the dist files for testing on demo pages, just invoke:
|
669 |
-
```bash
|
670 |
-
grunt
|
671 |
-
```
|
672 |
-
|
673 |
-
These are the other available grunt tasks:
|
674 |
-
|
675 |
-
* __js__: runs jslint and jasmine tests and creates minified and concatenated versions of the script;
|
676 |
-
* __css__: runs autoprefixer and csslint
|
677 |
-
* __test__: runs jasmine tests, jslint and csslint
|
678 |
-
* __watch__: watch for modifications on script/scss files
|
679 |
-
* __spec__: runs a task against a specified file
|
680 |
-
|
681 |
-
The source files are located inside the __src__ directory. Be sure to make changes to these files and not files in the dist directory.
|
682 |
-
|
683 |
-
## Contributing
|
684 |
-
|
685 |
-
[Kill some bugs :)](https://github.com/yabwe/medium-editor/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
|
686 |
-
|
687 |
-
1. Fork it
|
688 |
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
689 |
-
3. Test your changes to the best of your ability.
|
690 |
-
4. Update the documentation to reflect your changes if they add or changes current functionality.
|
691 |
-
5. Commit your changes (`git commit -am 'Added some feature'`) **without files from the _dist_ directory**.
|
692 |
-
6. Push to the branch (`git push origin my-new-feature`)
|
693 |
-
7. Create new Pull Request
|
694 |
-
|
695 |
-
### Code Consistency
|
696 |
-
|
697 |
-
To help create consistent looking code throughout the project, we use a few tools to help us. They have plugins for most popular editors/IDEs to make coding for our project, but you should use them in your project as well!
|
698 |
-
|
699 |
-
#### JSHint
|
700 |
-
|
701 |
-
We use [JSHint](http://jshint.com/) on each build to find easy-to-catch errors and potential problems in our js. You can find our JSHint settings in the `.jshintrc` file in the root of the project.
|
702 |
-
|
703 |
-
#### jscs
|
704 |
-
|
705 |
-
We use [jscs](http://jscs.info/) on each build to enforce some code style rules we have for our project. You can find our jscs settings in the `.jscsrc` file in the root of the project.
|
706 |
-
|
707 |
-
#### EditorConfig
|
708 |
-
|
709 |
-
We use [EditorConfig](http://EditorConfig.org) to maintain consistent coding styles between various editors and IDEs. You can find our settings in the `.editorconfig` file in the root of the project.
|
710 |
-
|
711 |
-
### Easy First Bugs
|
712 |
-
|
713 |
-
Looking for something simple for a first contribution? Try fixing an [easy first bug](https://github.com/yabwe/medium-editor/issues?q=is%3Aopen+is%3Aissue+label%3A%22easy+first+bug%22)!
|
714 |
-
|
715 |
-
## Contributors (100+ and counting!)
|
716 |
-
|
717 |
-
[https://github.com/yabwe/medium-editor/graphs/contributors](https://github.com/yabwe/medium-editor/graphs/contributors)
|
718 |
-
|
719 |
-
## Is Your Org Using MediumEditor?
|
720 |
-
|
721 |
-
Add your org [here](https://github.com/yabwe/medium-editor/issues/828) and we can add you to our [landing page](https://yabwe.github.io/medium-editor/#who-is-using-it)!
|
722 |
-
|
723 |
-
## License
|
724 |
-
|
725 |
-
MIT: https://github.com/yabwe/medium-editor/blob/master/LICENSE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/medium-editor/css/medium-editor.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.medium-editor-anchor-preview,.medium-editor-toolbar{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;z-index:2000}@-webkit-keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}100%{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}@keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}100%{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}.medium-editor-anchor-preview{left:0;line-height:1.4;max-width:280px;position:absolute;text-align:center;top:0;word-break:break-all;word-wrap:break-word;visibility:hidden}.medium-editor-anchor-preview a{color:#fff;display:inline-block;margin:5px 5px 10px}.medium-editor-placeholder-relative:after,.medium-editor-placeholder:after{content:attr(data-placeholder)!important;white-space:pre;padding:inherit;margin:inherit;font-style:italic}.medium-editor-anchor-preview-active{visibility:visible}.medium-editor-dragover{background:#ddd}.medium-editor-image-loading{-webkit-animation:medium-editor-image-loading 1s infinite ease-in-out;animation:medium-editor-image-loading 1s infinite ease-in-out;background-color:#333;border-radius:100%;display:inline-block;height:40px;width:40px}.medium-editor-placeholder{position:relative}.medium-editor-placeholder:after{position:absolute;left:0;top:0}.medium-editor-placeholder-relative,.medium-editor-placeholder-relative:after{position:relative}.medium-toolbar-arrow-over:before,.medium-toolbar-arrow-under:after{border-style:solid;content:'';display:block;height:0;left:50%;margin-left:-8px;position:absolute;width:0}.medium-toolbar-arrow-under:after{border-width:8px 8px 0}.medium-toolbar-arrow-over:before{border-width:0 8px 8px;top:-8px}.medium-editor-toolbar{left:0;position:absolute;top:0;visibility:hidden}.medium-editor-toolbar ul{margin:0;padding:0}.medium-editor-toolbar li{float:left;list-style:none;margin:0;padding:0}.medium-editor-toolbar li button{box-sizing:border-box;cursor:pointer;display:block;font-size:14px;line-height:1.33;margin:0;padding:15px;text-decoration:none}.medium-editor-toolbar li button:focus{outline:0}.medium-editor-toolbar li .medium-editor-action-underline{text-decoration:underline}.medium-editor-toolbar li .medium-editor-action-pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-weight:100;padding:15px 0}.medium-editor-toolbar-active{visibility:visible}.medium-editor-sticky-toolbar{position:fixed;top:1px}.medium-editor-relative-toolbar{position:relative}.medium-editor-toolbar-active.medium-editor-stalker-toolbar{-webkit-animation:medium-editor-pop-upwards 160ms forwards linear;animation:medium-editor-pop-upwards 160ms forwards linear}.medium-editor-action-bold{font-weight:bolder}.medium-editor-action-italic{font-style:italic}.medium-editor-toolbar-form{display:none}.medium-editor-toolbar-form a,.medium-editor-toolbar-form input{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.medium-editor-toolbar-form .medium-editor-toolbar-form-row{line-height:14px;margin-left:5px;padding-bottom:5px}.medium-editor-toolbar-form .medium-editor-toolbar-input,.medium-editor-toolbar-form label{border:none;box-sizing:border-box;font-size:14px;margin:0;padding:6px;width:316px;display:inline-block}.medium-editor-toolbar-form .medium-editor-toolbar-input:focus,.medium-editor-toolbar-form label:focus{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;box-shadow:none;outline:0}.medium-editor-toolbar-form a{display:inline-block;font-size:24px;font-weight:bolder;margin:0 10px;text-decoration:none}.medium-editor-toolbar-form-active{display:block}.medium-editor-toolbar-actions:after{clear:both;content:"";display:table}.medium-editor-element{word-wrap:break-word;min-height:30px}.medium-editor-element img{max-width:100%}.medium-editor-element sub{vertical-align:sub}.medium-editor-element sup{vertical-align:super}.medium-editor-hidden{display:none}
|
|
vendor/medium-editor/css/themes/beagle.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.medium-toolbar-arrow-under:after{border-color:#000 transparent transparent;top:40px}.medium-toolbar-arrow-over:before{border-color:transparent transparent #000}.medium-editor-toolbar{background-color:#000;border:none;border-radius:50px}.medium-editor-toolbar li button{background-color:transparent;border:none;box-sizing:border-box;color:#ccc;height:40px;min-width:40px;padding:5px 12px;-webkit-transition:background-color .2s ease-in,color .2s ease-in;transition:background-color .2s ease-in,color .2s ease-in}.medium-editor-toolbar li .medium-editor-button-active,.medium-editor-toolbar li button:hover{background-color:#000;color:#a2d7c7}.medium-editor-toolbar li .medium-editor-button-first{border-bottom-left-radius:50px;border-top-left-radius:50px;padding-left:24px}.medium-editor-toolbar li .medium-editor-button-last{border-bottom-right-radius:50px;border-right:none;border-top-right-radius:50px;padding-right:24px}.medium-editor-toolbar-form{background:#000;border-radius:50px;color:#ccc;overflow:hidden}.medium-editor-toolbar-form .medium-editor-toolbar-input{background:#000;box-sizing:border-box;color:#ccc;height:40px;padding-left:16px;width:220px}.medium-editor-toolbar-form .medium-editor-toolbar-input::-webkit-input-placeholder{color:#f8f5f3;color:rgba(248,245,243,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-moz-placeholder{color:#f8f5f3;color:rgba(248,245,243,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input::-moz-placeholder{color:#f8f5f3;color:rgba(248,245,243,.8)}.medium-editor-toolbar-form .medium-editor-toolbar-input:-ms-input-placeholder{color:#f8f5f3;color:rgba(248,245,243,.8)}.medium-editor-toolbar-form a{color:#ccc;-webkit-transform:translateY(2px);transform:translateY(2px)}.medium-editor-toolbar-form .medium-editor-toolbar-close{margin-right:16px}.medium-editor-toolbar-anchor-preview{background:#000;border-radius:50px;padding:5px 12px}.medium-editor-anchor-preview a{color:#ccc;text-decoration:none}
|
|
vendor/medium-editor/js/medium-editor.min.js
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
"classList"in document.createElement("_")||!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++c<d);e&&this._updateClassName()},k.remove=function(){var a,b,c=arguments,d=0,e=c.length,f=!1;do for(a=c[d]+"",b=i(this,a);-1!==b;)this.splice(b,1),f=!0,b=i(this,a);while(++d<e);f&&this._updateClassName()},k.toggle=function(a,b){a+="";var c=this.contains(a),d=c?b!==!0&&"remove":b!==!1&&"add";return d&&this[d](a),b===!0||b===!1?b:!c},k.toString=function(){return this.join(" ")},e.defineProperty){var m={get:l,enumerable:!0,configurable:!0};try{e.defineProperty(d,b,m)}catch(n){-2146823252===n.number&&(m.enumerable=!1,e.defineProperty(d,b,m))}}else e[c].__defineGetter__&&d.__defineGetter__(b,l)}}(self),function(a){"use strict";if(a.URL=a.URL||a.webkitURL,a.Blob&&a.URL)try{return void new Blob}catch(b){}var c=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||function(a){var b=function(a){return Object.prototype.toString.call(a).match(/^\[object\s(.*)\]$/)[1]},c=function(){this.data=[]},d=function(a,b,c){this.data=a,this.size=a.length,this.type=b,this.encoding=c},e=c.prototype,f=d.prototype,g=a.FileReaderSync,h=function(a){this.code=this[this.name=a]},i="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),j=i.length,k=a.URL||a.webkitURL||a,l=k.createObjectURL,m=k.revokeObjectURL,n=k,o=a.btoa,p=a.atob,q=a.ArrayBuffer,r=a.Uint8Array,s=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(d.fake=f.fake=!0;j--;)h.prototype[i[j]]=j+1;return k.createObjectURL||(n=a.URL=function(a){var b,c=document.createElementNS("http://www.w3.org/1999/xhtml","a");return c.href=a,"origin"in c||("data:"===c.protocol.toLowerCase()?c.origin=null:(b=a.match(s),c.origin=b&&b[1])),c}),n.createObjectURL=function(a){var b,c=a.type;return null===c&&(c="application/octet-stream"),a instanceof d?(b="data:"+c,"base64"===a.encoding?b+";base64,"+a.data:"URI"===a.encoding?b+","+decodeURIComponent(a.data):o?b+";base64,"+o(a.data):b+","+encodeURIComponent(a.data)):l?l.call(k,a):void 0},n.revokeObjectURL=function(a){"data:"!==a.substring(0,5)&&m&&m.call(k,a)},e.append=function(a){var c=this.data;if(r&&(a instanceof q||a instanceof r)){for(var e="",f=new r(a),i=0,j=f.length;j>i;i++)e+=String.fromCharCode(f[i]);c.push(e)}else if("Blob"===b(a)||"File"===b(a)){if(!g)throw new h("NOT_READABLE_ERR");var k=new g;c.push(k.readAsBinaryString(a))}else a instanceof d?"base64"===a.encoding&&p?c.push(p(a.data)):"URI"===a.encoding?c.push(decodeURIComponent(a.data)):"raw"===a.encoding&&c.push(a.data):("string"!=typeof a&&(a+=""),c.push(unescape(encodeURIComponent(a))))},e.getBlob=function(a){return arguments.length||(a=null),new d(this.data.join(""),a,"raw")},e.toString=function(){return"[object BlobBuilder]"},f.slice=function(a,b,c){var e=arguments.length;return 3>e&&(c=null),new d(this.data.slice(a,e>1?b:this.data.length),c,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},c}(a);a.Blob=function(a,b){var d=b?b.type||"":"",e=new c;if(a)for(var f=0,g=a.length;g>f;f++)Uint8Array&&a[f]instanceof Uint8Array?e.append(a[f].buffer):e.append(a[f]);var h=e.getBlob(d);return!h.slice&&h.webkitSlice&&(h.slice=h.webkitSlice),h};var d=Object.getPrototypeOf||function(a){return a.__proto__};a.Blob.prototype=d(new a.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this),function(a,b){"use strict";var c="object"==typeof module&&"undefined"!=typeof process&&process&&process.versions&&process.versions.electron;c||"object"!=typeof module?"function"==typeof define&&define.amd?define(function(){return b}):a.MediumEditor=b:module.exports=b}(this,function(){"use strict";function a(a,b){return this.init(a,b)}return a.extensions={},function(b){function c(a,b){var c,d=Array.prototype.slice.call(arguments,2);b=b||{};for(var e=0;e<d.length;e++){var f=d[e];if(f)for(c in f)f.hasOwnProperty(c)&&"undefined"!=typeof f[c]&&(a||b.hasOwnProperty(c)===!1)&&(b[c]=f[c])}return b}var d=!1;try{var e=document.createElement("div"),f=document.createTextNode(" ");e.appendChild(f),d=e.contains(f)}catch(g){}var h={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:b.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(a){return!!(h.isMac&&a.metaKey||!h.isMac&&a.ctrlKey)},isKey:function(a,b){var c=h.getKeyCode(a);return!1===Array.isArray(b)?c===b:-1!==b.indexOf(c)},getKeyCode:function(a){var b=a.which;return null===b&&(b=null!==a.charCode?a.charCode:a.keyCode),b},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var a=[!0].concat(Array.prototype.slice.call(arguments));return c.apply(this,a)},defaults:function(){var a=[!1].concat(Array.prototype.slice.call(arguments));return c.apply(this,a)},createLink:function(a,b,c,d){var e=a.createElement("a");return h.moveTextRangeIntoElement(b[0],b[b.length-1],e),e.setAttribute("href",c),d&&e.setAttribute("target",d),e},findOrCreateMatchingTextNodes:function(a,b,c){for(var d=a.createTreeWalker(b,NodeFilter.SHOW_ALL,null,!1),e=[],f=0,g=!1,i=null,j=null;null!==(i=d.nextNode());)if(!(i.nodeType>3))if(3===i.nodeType){if(!g&&c.start<f+i.nodeValue.length&&(g=!0,j=h.splitStartNodeIfNeeded(i,c.start,f)),g&&h.splitEndNodeIfNeeded(i,j,c.end,f),g&&f===c.end)break;if(g&&f>c.end+1)throw new Error("PerformLinking overshot the target!");g&&e.push(j||i),f+=i.nodeValue.length,null!==j&&(f+=j.nodeValue.length,d.nextNode()),j=null}else"img"===i.tagName.toLowerCase()&&(!g&&c.start<=f&&(g=!0),g&&e.push(i));return e},splitStartNodeIfNeeded:function(a,b,c){return b!==c?a.splitText(b-c):null},splitEndNodeIfNeeded:function(a,b,c,d){var e,f;e=d+a.nodeValue.length+(b?b.nodeValue.length:0)-1,f=c-d-(b?a.nodeValue.length:0),e>=c&&d!==e&&0!==f&&(b||a).splitText(f)},splitByBlockElements:function(b){if(3!==b.nodeType&&1!==b.nodeType)return[];var c=[],d=a.util.blockContainerElementNames.join(",");if(3===b.nodeType||0===b.querySelectorAll(d).length)return[b];for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(3===f.nodeType)c.push(f);else if(1===f.nodeType){var g=f.querySelectorAll(d);0===g.length?c.push(f):c=c.concat(a.util.splitByBlockElements(f))}}return c},findAdjacentTextNodeWithContent:function(a,b,c){var d,e=!1,f=c.createNodeIterator(a,NodeFilter.SHOW_TEXT,null,!1);for(d=f.nextNode();d;){if(d===b)e=!0;else if(e&&3===d.nodeType&&d.nodeValue&&d.nodeValue.trim().length>0)break;d=f.nextNode()}return d},findPreviousSibling:function(a){if(!a||h.isMediumEditorElement(a))return!1;for(var b=a.previousSibling;!b&&!h.isMediumEditorElement(a.parentNode);)a=a.parentNode,b=a.previousSibling;return b},isDescendant:function(a,b,c){if(!a||!b)return!1;if(a===b)return!!c;if(1!==a.nodeType)return!1;if(d||3!==b.nodeType)return a.contains(b);for(var e=b.parentNode;null!==e;){if(e===a)return!0;e=e.parentNode}return!1},isElement:function(a){return!(!a||1!==a.nodeType)},throttle:function(a,b){var c,d,e,f=50,g=null,h=0,i=function(){h=Date.now(),g=null,e=a.apply(c,d),g||(c=d=null)};return b||0===b||(b=f),function(){var f=Date.now(),j=b-(f-h);return c=this,d=arguments,0>=j||j>b?(g&&(clearTimeout(g),g=null),h=f,e=a.apply(c,d),g||(c=d=null)):g||(g=setTimeout(i,j)),e}},traverseUp:function(a,b){if(!a)return!1;do{if(1===a.nodeType){if(b(a))return a;if(h.isMediumEditorElement(a))return!1}a=a.parentNode}while(a);return!1},htmlEntities:function(a){return String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(b,c){var d,e,f,g,i,j,k,l=!1,m=["insertHTML",!1,c];if(!a.util.isEdge&&b.queryCommandSupported("insertHTML"))try{return b.execCommand.apply(b,m)}catch(n){}if(d=b.getSelection(),d.rangeCount){if(e=d.getRangeAt(0),k=e.commonAncestorContainer,h.isMediumEditorElement(k)&&!k.firstChild)e.selectNode(k.appendChild(b.createTextNode("")));else if(3===k.nodeType&&0===e.startOffset&&e.endOffset===k.nodeValue.length||3!==k.nodeType&&k.innerHTML===e.toString()){for(;!h.isMediumEditorElement(k)&&k.parentNode&&1===k.parentNode.childNodes.length&&!h.isMediumEditorElement(k.parentNode);)k=k.parentNode;e.selectNode(k)}for(e.deleteContents(),f=b.createElement("div"),f.innerHTML=c,g=b.createDocumentFragment();f.firstChild;)i=f.firstChild,j=g.appendChild(i);e.insertNode(g),j&&(e=e.cloneRange(),e.setStartAfter(j),e.collapse(!0),a.selection.selectRange(b,e)),l=!0}return b.execCommand.callListeners&&b.execCommand.callListeners(m,l),l},execFormatBlock:function(b,c){var d,e=h.getTopBlockContainer(a.selection.getSelectionStart(b));if("blockquote"===c){if(e&&(d=Array.prototype.slice.call(e.childNodes),d.some(function(a){return h.isBlockContainer(a)})))return b.execCommand("outdent",!1,null);if(h.isIE)return b.execCommand("indent",!1,c)}if(e&&c===e.nodeName.toLowerCase()&&(c="p"),h.isIE&&(c="<"+c+">"),e&&"blockquote"===e.nodeName.toLowerCase()){if(h.isIE&&"<p>"===c)return b.execCommand("outdent",!1,c);if((h.isFF||h.isEdge)&&"p"===c)return d=Array.prototype.slice.call(e.childNodes),d.some(function(a){return!h.isBlockContainer(a)})&&b.execCommand("formatBlock",!1,c),b.execCommand("outdent",!1,c)}return b.execCommand("formatBlock",!1,c)},setTargetBlank:function(a,b){var c,d=b||!1;if("a"===a.nodeName.toLowerCase())a.target="_blank";else for(a=a.getElementsByTagName("a"),c=0;c<a.length;c+=1)!1!==d&&d!==a[c].attributes.href.value||(a[c].target="_blank")},removeTargetBlank:function(a,b){var c;if("a"===a.nodeName.toLowerCase())a.removeAttribute("target");else for(a=a.getElementsByTagName("a"),c=0;c<a.length;c+=1)b===a[c].attributes.href.value&&a[c].removeAttribute("target")},addClassToAnchors:function(a,b){var c,d,e=b.split(" ");if("a"===a.nodeName.toLowerCase())for(d=0;d<e.length;d+=1)a.classList.add(e[d]);else{var f=a.getElementsByTagName("a");if(0===f.length){var g=h.getClosestTag(a,"a");a=g?[g]:[]}else a=f;for(c=0;c<a.length;c+=1)for(d=0;d<e.length;d+=1)a[c].classList.add(e[d])}},isListItem:function(a){if(!a)return!1;if("li"===a.nodeName.toLowerCase())return!0;for(var b=a.parentNode,c=b.nodeName.toLowerCase();"li"===c||!h.isBlockContainer(b)&&"div"!==c;){if("li"===c)return!0;if(b=b.parentNode,!b)return!1;c=b.nodeName.toLowerCase()}return!1},cleanListDOM:function(b,c){if("li"===c.nodeName.toLowerCase()){var d=c.parentElement;"p"===d.parentElement.nodeName.toLowerCase()&&(h.unwrap(d.parentElement,b),a.selection.moveCursor(b,c.firstChild,c.firstChild.textContent.length))}},splitOffDOMTree:function(a,b,c){for(var d=b,e=null,f=!c;d!==a;){var g,h=d.parentNode,i=h.cloneNode(!1),j=f?d:h.firstChild;for(e&&(f?i.appendChild(e):g=e),e=i;j;){var k=j.nextSibling;j===d?(j.hasChildNodes()?j=j.cloneNode(!1):j.parentNode.removeChild(j),j.textContent&&e.appendChild(j),j=f?k:null):(j.parentNode.removeChild(j),(j.hasChildNodes()||j.textContent)&&e.appendChild(j),j=k)}g&&e.appendChild(g),d=h}return e},moveTextRangeIntoElement:function(a,b,c){if(!a||!b)return!1;var d=h.findCommonRoot(a,b);if(!d)return!1;if(b===a){var e=a.parentNode,f=a.nextSibling;return e.removeChild(a),c.appendChild(a),f?e.insertBefore(c,f):e.appendChild(c),c.hasChildNodes()}for(var g,i,j,k=[],l=0;l<d.childNodes.length;l++)if(j=d.childNodes[l],g){if(h.isDescendant(j,b,!0)){i=j;break}k.push(j)}else h.isDescendant(j,a,!0)&&(g=j);var m=i.nextSibling,n=d.ownerDocument.createDocumentFragment();return g===a?(g.parentNode.removeChild(g),n.appendChild(g)):n.appendChild(h.splitOffDOMTree(g,a)),k.forEach(function(a){a.parentNode.removeChild(a),n.appendChild(a)}),i===b?(i.parentNode.removeChild(i),n.appendChild(i)):n.appendChild(h.splitOffDOMTree(i,b,!0)),c.appendChild(n),i.parentNode===d?d.insertBefore(c,i):m?d.insertBefore(c,m):d.appendChild(c),c.hasChildNodes()},depthOfNode:function(a){for(var b=0,c=a;null!==c.parentNode;)c=c.parentNode,b++;return b},findCommonRoot:function(a,b){for(var c=h.depthOfNode(a),d=h.depthOfNode(b),e=a,f=b;c!==d;)c>d?(e=e.parentNode,c-=1):(f=f.parentNode,d-=1);for(;e!==f;)e=e.parentNode,f=f.parentNode;return e},isElementAtBeginningOfBlock:function(a){for(var b,c;!h.isBlockContainer(a)&&!h.isMediumEditorElement(a);){for(c=a;c=c.previousSibling;)if(b=3===c.nodeType?c.nodeValue:c.textContent,b.length>0)return!1;a=a.parentNode}return!0},isMediumEditorElement:function(a){return a&&a.getAttribute&&!!a.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(a){return h.traverseUp(a,function(a){return h.isMediumEditorElement(a)})},isBlockContainer:function(a){return a&&3!==a.nodeType&&-1!==h.blockContainerElementNames.indexOf(a.nodeName.toLowerCase())},getClosestBlockContainer:function(a){return h.traverseUp(a,function(a){return h.isBlockContainer(a)||h.isMediumEditorElement(a)})},getTopBlockContainer:function(a){var b=h.isBlockContainer(a)?a:!1;return h.traverseUp(a,function(a){return h.isBlockContainer(a)&&(b=a),!b&&h.isMediumEditorElement(a)?(b=a,!0):!1}),b},getFirstSelectableLeafNode:function(a){for(;a&&a.firstChild;)a=a.firstChild;if(a=h.traverseUp(a,function(a){return-1===h.emptyElementNames.indexOf(a.nodeName.toLowerCase())}),"table"===a.nodeName.toLowerCase()){var b=a.querySelector("th, td");b&&(a=b)}return a},getFirstTextNode:function(a){return h.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),h._getFirstTextNode(a)},_getFirstTextNode:function(a){if(3===a.nodeType)return a;for(var b=0;b<a.childNodes.length;b++){var c=h._getFirstTextNode(a.childNodes[b]);if(null!==c)return c}return null},ensureUrlHasProtocol:function(a){return-1===a.indexOf("://")?"http://"+a:a},warn:function(){void 0!==b.console&&"function"==typeof b.console.warn&&b.console.warn.apply(b.console,arguments)},deprecated:function(a,b,c){var d=a+" is deprecated, please use "+b+" instead.";c&&(d+=" Will be removed in "+c),h.warn(d)},deprecatedMethod:function(a,b,c,d){h.deprecated(a,b,d),"function"==typeof this[b]&&this[b].apply(this,c)},cleanupAttrs:function(a,b){b.forEach(function(b){a.removeAttribute(b)})},cleanupTags:function(a,b){-1!==b.indexOf(a.nodeName.toLowerCase())&&a.parentNode.removeChild(a)},unwrapTags:function(b,c){-1!==c.indexOf(b.nodeName.toLowerCase())&&a.util.unwrap(b,document)},getClosestTag:function(a,b){return h.traverseUp(a,function(a){return a.nodeName.toLowerCase()===b.toLowerCase()})},unwrap:function(a,b){for(var c=b.createDocumentFragment(),d=Array.prototype.slice.call(a.childNodes),e=0;e<d.length;e++)c.appendChild(d[e]);c.childNodes.length?a.parentNode.replaceChild(c,a):a.parentNode.removeChild(a)},guid:function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}};a.util=h}(window),function(){var b=function(b){a.util.extend(this,b)};b.extend=function(b){var c,d=this;c=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return d.apply(this,arguments)},a.util.extend(c,d);var e=function(){this.constructor=c};return e.prototype=d.prototype,c.prototype=new e,b&&a.util.extend(c.prototype,b),c},b.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(a){return this.base.options[a]}},["execAction","on","off","subscribe","trigger"].forEach(function(a){b.prototype[a]=function(){return this.base[a].apply(this.base,arguments)}}),a.Extension=b}(),function(){function b(b){return a.util.isBlockContainer(b)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var c={findMatchingSelectionParent:function(b,c){var d,e,f=c.getSelection();return 0===f.rangeCount?!1:(d=f.getRangeAt(0),e=d.commonAncestorContainer,a.util.traverseUp(e,b))},getSelectionElement:function(b){return this.findMatchingSelectionParent(function(b){return a.util.isMediumEditorElement(b)},b)},exportSelection:function(a,b){if(!a)return null;var c=null,d=b.getSelection();if(d.rangeCount>0){var e,f=d.getRangeAt(0),g=f.cloneRange();g.selectNodeContents(a),g.setEnd(f.startContainer,f.startOffset),e=g.toString().length,c={start:e,end:e+f.toString().length},this.doesRangeStartWithImages(f,b)&&(c.startsWithImage=!0);var h=this.getTrailingImageCount(a,c,f.endContainer,f.endOffset);if(h&&(c.trailingImageCount=h),0!==e){var i=this.getIndexRelativeToAdjacentEmptyBlocks(b,a,f.startContainer,f.startOffset);-1!==i&&(c.emptyBlocksIndex=i)}}return c},importSelection:function(a,b,c,d){if(a&&b){var e=c.createRange();e.setStart(b,0),e.collapse(!0);var f,g=b,h=[],i=0,j=!1,k=!1,l=0,m=!1,n=!1,o=null;for((d||a.startsWithImage||"undefined"!=typeof a.emptyBlocksIndex)&&(n=!0);!m&&g;)if(g.nodeType>3)g=h.pop();else{if(3!==g.nodeType||k){if(a.trailingImageCount&&k&&("img"===g.nodeName.toLowerCase()&&l++,l===a.trailingImageCount)){for(var p=0;g.parentNode.childNodes[p]!==g;)p++;e.setEnd(g.parentNode,p+1),m=!0}if(!m&&1===g.nodeType)for(var q=g.childNodes.length-1;q>=0;)h.push(g.childNodes[q]),q-=1}else f=i+g.length,!j&&a.start>=i&&a.start<=f&&(n||a.start<f?(e.setStart(g,a.start-i),j=!0):o=g),j&&a.end>=i&&a.end<=f&&(a.trailingImageCount?k=!0:(e.setEnd(g,a.end-i),m=!0)),i=f;m||(g=h.pop())}!j&&o&&(e.setStart(o,o.length),e.setEnd(o,o.length)),"undefined"!=typeof a.emptyBlocksIndex&&(e=this.importSelectionMoveCursorPastBlocks(c,b,a.emptyBlocksIndex,e)),d&&(e=this.importSelectionMoveCursorPastAnchor(a,e)),this.selectRange(c,e)}},importSelectionMoveCursorPastAnchor:function(b,c){var d=function(a){return"a"===a.nodeName.toLowerCase()};if(b.start===b.end&&3===c.startContainer.nodeType&&c.startOffset===c.startContainer.nodeValue.length&&a.util.traverseUp(c.startContainer,d)){for(var e=c.startContainer,f=c.startContainer.parentNode;null!==f&&"a"!==f.nodeName.toLowerCase();)f.childNodes[f.childNodes.length-1]!==e?f=null:(e=f,f=f.parentNode);if(null!==f&&"a"===f.nodeName.toLowerCase()){for(var g=null,h=0;null===g&&h<f.parentNode.childNodes.length;h++)f.parentNode.childNodes[h]===f&&(g=h);c.setStart(f.parentNode,g+1),c.collapse(!0)}}return c},importSelectionMoveCursorPastBlocks:function(c,d,e,f){var g,h,i=c.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,b,!1),j=f.startContainer,k=0;for(e=e||1,g=3===j.nodeType&&a.util.isBlockContainer(j.previousSibling)?j.previousSibling:a.util.getClosestBlockContainer(j);i.nextNode();)if(h){if(h=i.currentNode,k++,k===e)break;if(h.textContent.length>0)break}else g===i.currentNode&&(h=i.currentNode);return h||(h=g),f.setStart(a.util.getFirstSelectableLeafNode(h),0),f},getIndexRelativeToAdjacentEmptyBlocks:function(c,d,e,f){if(e.textContent.length>0&&f>0)return-1;var g=e;if(3!==g.nodeType&&(g=e.childNodes[f]),g){if(!a.util.isElementAtBeginningOfBlock(g))return-1;var h=a.util.findPreviousSibling(g);if(!h)return-1;if(h.nodeValue)return-1}for(var i=a.util.getClosestBlockContainer(e),j=c.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,b,!1),k=0;j.nextNode();){var l=""===j.currentNode.textContent;if((l||k>0)&&(k+=1),j.currentNode===i)return k;l||(k=0)}return k},doesRangeStartWithImages:function(a,b){if(0!==a.startOffset||1!==a.startContainer.nodeType)return!1;if("img"===a.startContainer.nodeName.toLowerCase())return!0;var c=a.startContainer.querySelector("img");if(!c)return!1;for(var d=b.createTreeWalker(a.startContainer,NodeFilter.SHOW_ALL,null,!1);d.nextNode();){var e=d.currentNode;if(e===c)break;if(e.nodeValue)return!1}return!0},getTrailingImageCount:function(a,b,c,d){if(0===d||1!==c.nodeType)return 0;if("img"!==c.nodeName.toLowerCase()&&!c.querySelector("img"))return 0;for(var e=c.childNodes[d-1];e.hasChildNodes();)e=e.lastChild;for(var f,g=a,h=[],i=0,j=!1,k=!1,l=!1,m=0;!l&&g;)if(g.nodeType>3)g=h.pop();else{if(3!==g.nodeType||k){if("img"===g.nodeName.toLowerCase()&&m++,g===e)l=!0;else if(1===g.nodeType)for(var n=g.childNodes.length-1;n>=0;)h.push(g.childNodes[n]),n-=1}else m=0,f=i+g.length,!j&&b.start>=i&&b.start<=f&&(j=!0),j&&b.end>=i&&b.end<=f&&(k=!0),i=f;l||(g=h.pop())}return m},selectionContainsContent:function(a){var b=a.getSelection();if(!b||b.isCollapsed||!b.rangeCount)return!1;if(""!==b.toString().trim())return!0;var c=this.getSelectedParentElement(b.getRangeAt(0));return!(!c||!("img"===c.nodeName.toLowerCase()||1===c.nodeType&&c.querySelector("img")))},selectionInContentEditableFalse:function(a){var b,c=this.findMatchingSelectionParent(function(a){var c=a&&a.getAttribute("contenteditable");return"true"===c&&(b=!0),"#text"!==a.nodeName&&"false"===c},a);return!b&&c},getSelectionHtml:function(a){var b,c,d,e="",f=a.getSelection();if(f.rangeCount){for(d=a.createElement("div"),b=0,c=f.rangeCount;c>b;b+=1)d.appendChild(f.getRangeAt(b).cloneContents());e=d.innerHTML}return e},getCaretOffsets:function(a,b){var c,d;return b||(b=window.getSelection().getRangeAt(0)),c=b.cloneRange(),d=b.cloneRange(),c.selectNodeContents(a),c.setEnd(b.endContainer,b.endOffset),d.selectNodeContents(a),d.setStart(b.endContainer,b.endOffset),{left:c.toString().length,right:d.toString().length}},rangeSelectsSingleNode:function(a){var b=a.startContainer;return b===a.endContainer&&b.hasChildNodes()&&a.endOffset===a.startOffset+1},getSelectedParentElement:function(a){return a?this.rangeSelectsSingleNode(a)&&3!==a.startContainer.childNodes[a.startOffset].nodeType?a.startContainer.childNodes[a.startOffset]:3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer:null},getSelectedElements:function(a){var b,c,d,e=a.getSelection();if(!e.rangeCount||e.isCollapsed||!e.getRangeAt(0).commonAncestorContainer)return[];if(b=e.getRangeAt(0),3===b.commonAncestorContainer.nodeType){for(c=[],d=b.commonAncestorContainer;d.parentNode&&1===d.parentNode.childNodes.length;)c.push(d.parentNode),d=d.parentNode;return c}return[].filter.call(b.commonAncestorContainer.getElementsByTagName("*"),function(a){return"function"==typeof e.containsNode?e.containsNode(a,!0):!0})},selectNode:function(a,b){var c=b.createRange();c.selectNodeContents(a),this.selectRange(b,c)},select:function(a,b,c,d,e){var f=a.createRange();return f.setStart(b,c),d?f.setEnd(d,e):f.collapse(!0),this.selectRange(a,f),f},clearSelection:function(a,b){b?a.getSelection().collapseToStart():a.getSelection().collapseToEnd()},moveCursor:function(a,b,c){this.select(a,b,c)},getSelectionRange:function(a){var b=a.getSelection();return 0===b.rangeCount?null:b.getRangeAt(0)},selectRange:function(a,b){var c=a.getSelection();c.removeAllRanges(),c.addRange(b)},getSelectionStart:function(a){var b=a.getSelection().anchorNode,c=b&&3===b.nodeType?b.parentNode:b;return c}};a.selection=c}(),function(){function b(b,c){return b.some(function(b){if("function"!=typeof b.getInteractionElements)return!1;var d=b.getInteractionElements();return d?(Array.isArray(d)||(d=[d]),d.some(function(b){return a.util.isDescendant(b,c,!0)})):!1})}var c=function(a){this.base=a,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};c.prototype={InputEventOnContenteditableSupported:!a.util.isIE&&!a.util.isEdge,attachDOMEvent:function(b,c,d,e){var f=this.base.options.contentWindow,g=this.base.options.ownerDocument;b=a.util.isElement(b)||[f,g].indexOf(b)>-1?[b]:b,Array.prototype.forEach.call(b,function(a){a.addEventListener(c,d,e),this.events.push([a,c,d,e])}.bind(this))},detachDOMEvent:function(b,c,d,e){var f,g,h=this.base.options.contentWindow,i=this.base.options.ownerDocument;null!==b&&(b=a.util.isElement(b)||[h,i].indexOf(b)>-1?[b]:b,Array.prototype.forEach.call(b,function(a){f=this.indexOfListener(a,c,d,e),-1!==f&&(g=this.events.splice(f,1)[0],g[0].removeEventListener(g[1],g[2],g[3]))}.bind(this)))},indexOfListener:function(a,b,c,d){var e,f,g;for(e=0,f=this.events.length;f>e;e+=1)if(g=this.events[e],g[0]===a&&g[1]===b&&g[2]===c&&g[3]===d)return e;return-1},detachAllDOMEvents:function(){for(var a=this.events.pop();a;)a[0].removeEventListener(a[1],a[2],a[3]),a=this.events.pop()},detachAllEventsFromElement:function(a){for(var b=this.events.filter(function(b){return b&&b[0].getAttribute&&b[0].getAttribute("medium-editor-index")===a.getAttribute("medium-editor-index")}),c=0,d=b.length;d>c;c++){var e=b[c];this.detachDOMEvent(e[0],e[1],e[2],e[3])}},attachAllEventsToElement:function(a){this.listeners.editableInput&&(this.contentCache[a.getAttribute("medium-editor-index")]=a.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(b){this.attachDOMEvent(a,b.name,b.handler.bind(this))},this)},enableCustomEvent:function(a){void 0!==this.disabledEvents[a]&&delete this.disabledEvents[a]},disableCustomEvent:function(a){this.disabledEvents[a]=!0},attachCustomEvent:function(a,b){this.setupListener(a),this.customEvents[a]||(this.customEvents[a]=[]),this.customEvents[a].push(b)},detachCustomEvent:function(a,b){var c=this.indexOfCustomListener(a,b);-1!==c&&this.customEvents[a].splice(c,1)},indexOfCustomListener:function(a,b){return this.customEvents[a]&&this.customEvents[a].length?this.customEvents[a].indexOf(b):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(a,b,c){this.customEvents[a]&&!this.disabledEvents[a]&&this.customEvents[a].forEach(function(a){a(b,c)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(a){a.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(a){this.handleDocumentExecCommand(a)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var a=this.options.ownerDocument;if(this.execCommandListener&&a.execCommand.listeners){var b=a.execCommand.listeners.indexOf(this.execCommandListener);-1!==b&&a.execCommand.listeners.splice(b,1),a.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var a=this.options.ownerDocument;if(!a.execCommand.listeners){var b=function(b,c){a.execCommand.listeners&&a.execCommand.listeners.forEach(function(a){a({command:b[0],value:b[2],args:b,result:c})})},c=function(){var c=a.execCommand.orig.apply(this,arguments);if(!a.execCommand.listeners)return c;var d=Array.prototype.slice.call(arguments);return b(d,c),c};c.orig=a.execCommand,c.listeners=[],c.callListeners=b,a.execCommand=c}},unwrapExecCommand:function(){var a=this.options.ownerDocument;a.execCommand.orig&&(a.execCommand=a.execCommand.orig)},setupListener:function(a){if(!this.listeners[a]){switch(a){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(a){this.contentCache[a.getAttribute("medium-editor-index")]=a.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[a]=!0}},attachToEachElement:function(a,b){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(c){this.attachDOMEvent(c,a,b.bind(this))},this),this.eventsCache.push({name:a,handler:b})},cleanupElement:function(a){var b=a.getAttribute("medium-editor-index");b&&(this.detachAllEventsFromElement(a),this.contentCache&&delete this.contentCache[b])},focusElement:function(a){a.focus(),this.updateFocus(a,{target:a,type:"focus"})},updateFocus:function(c,d){var e,f=this.base.getFocusedElement();f&&"click"===d.type&&this.lastMousedownTarget&&(a.util.isDescendant(f,this.lastMousedownTarget,!0)||b(this.base.extensions,this.lastMousedownTarget))&&(e=f),e||this.base.elements.some(function(b){return!e&&a.util.isDescendant(b,c,!0)&&(e=b),!!e},this);var g=!a.util.isDescendant(f,c,!0)&&!b(this.base.extensions,c);e!==f&&(f&&g&&(f.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",d,f)),e&&(e.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",d,e))),g&&this.triggerCustomEvent("externalInteraction",d)},updateInput:function(a,b){if(this.contentCache){var c=a.getAttribute("medium-editor-index"),d=a.innerHTML;d!==this.contentCache[c]&&this.triggerCustomEvent("editableInput",b,a),this.contentCache[c]=d}},handleDocumentSelectionChange:function(b){if(b.currentTarget&&b.currentTarget.activeElement){var c,d=b.currentTarget.activeElement;this.base.elements.some(function(b){return a.util.isDescendant(b,d,!0)?(c=b,!0):!1},this),c&&this.updateInput(c,{target:d,currentTarget:c})}},handleDocumentExecCommand:function(){var a=this.base.getFocusedElement();a&&this.updateInput(a,{target:a,currentTarget:a})},handleBodyClick:function(a){this.updateFocus(a.target,a)},handleBodyFocus:function(a){this.updateFocus(a.target,a)},handleBodyMousedown:function(a){this.lastMousedownTarget=a.target},handleInput:function(a){this.updateInput(a.currentTarget,a)},handleClick:function(a){this.triggerCustomEvent("editableClick",a,a.currentTarget);
|
2 |
-
},handleBlur:function(a){this.triggerCustomEvent("editableBlur",a,a.currentTarget)},handleKeypress:function(a){if(this.triggerCustomEvent("editableKeypress",a,a.currentTarget),this.keypressUpdateInput){var b={target:a.target,currentTarget:a.currentTarget};setTimeout(function(){this.updateInput(b.currentTarget,b)}.bind(this),0)}},handleKeyup:function(a){this.triggerCustomEvent("editableKeyup",a,a.currentTarget)},handleMouseover:function(a){this.triggerCustomEvent("editableMouseover",a,a.currentTarget)},handleDragging:function(a){this.triggerCustomEvent("editableDrag",a,a.currentTarget)},handleDrop:function(a){this.triggerCustomEvent("editableDrop",a,a.currentTarget)},handlePaste:function(a){this.triggerCustomEvent("editablePaste",a,a.currentTarget)},handleKeydown:function(b){return this.triggerCustomEvent("editableKeydown",b,b.currentTarget),a.util.isKey(b,a.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",b,b.currentTarget):a.util.isKey(b,a.util.keyCode.ENTER)||b.ctrlKey&&a.util.isKey(b,a.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",b,b.currentTarget):a.util.isKey(b,a.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",b,b.currentTarget):a.util.isKey(b,[a.util.keyCode.DELETE,a.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",b,b.currentTarget):void 0}},a.Events=c}(),function(){var b=a.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(c){b.isBuiltInButton(c)?a.Extension.call(this,this.defaults[c]):a.Extension.call(this,c)},init:function(){a.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var a=this.document.createElement("button"),b=this.contentDefault,c=this.getAria(),d=this.getEditorOption("buttonLabels");return a.classList.add("medium-editor-action"),a.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(b){a.classList.add(b)}),a.setAttribute("data-action",this.getAction()),c&&(a.setAttribute("title",c),a.setAttribute("aria-label",c)),this.attrs&&Object.keys(this.attrs).forEach(function(b){a.setAttribute(b,this.attrs[b])},this),"fontawesome"===d&&this.contentFA&&(b=this.contentFA),a.innerHTML=b,a},handleClick:function(a){a.preventDefault(),a.stopPropagation();var b=this.getAction();b&&this.execAction(b)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var a=null;return this.useQueryState&&(a=this.base.queryCommandState(this.getAction())),a},isAlreadyApplied:function(a){var b,c,d=!1,e=this.getTagNames();return this.knownState===!1||this.knownState===!0?this.knownState:(e&&e.length>0&&(d=-1!==e.indexOf(a.nodeName.toLowerCase())),!d&&this.style&&(b=this.style.value.split("|"),c=this.window.getComputedStyle(a,null).getPropertyValue(this.style.prop),b.forEach(function(a){this.knownState||(d=-1!==c.indexOf(a),(d||"text-decoration"!==this.style.prop)&&(this.knownState=d))},this)),d)}});b.isBuiltInButton=function(b){return"string"==typeof b&&a.extensions.button.prototype.defaults.hasOwnProperty(b)},a.extensions.button=b}(),function(){a.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}}(),function(){var b=a.extensions.button.extend({init:function(){a.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var a=this.base.getExtensionByName("toolbar");a&&a.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var a=this.base.getExtensionByName("toolbar");a&&a.hideToolbarDefaultActions()},setToolbarPosition:function(){var a=this.base.getExtensionByName("toolbar");a&&a.setToolbarPosition()}});a.extensions.form=b}(),function(){var b=a.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){a.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(b){b.preventDefault(),b.stopPropagation();var c=a.selection.getSelectionRange(this.document);return"a"===c.startContainer.nodeName.toLowerCase()||"a"===c.endContainer.nodeName.toLowerCase()||a.util.getClosestTag(a.selection.getSelectedParentElement(c),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(b){a.util.isKey(b,a.util.keyCode.K)&&a.util.isMetaCtrlKey(b)&&!b.shiftKey&&this.handleClick(b)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var a=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return a.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),a.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&a.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target">',"<label>",this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&a.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),a.join("")},isDisplayed:function(){return a.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){a.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(b){var c=this.getInput(),d=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox();if(b=b||{value:""},"string"==typeof b&&(b={value:b}),this.base.saveSelection(),this.hideToolbarDefaultActions(),a.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),c.value=b.value,c.focus(),d&&(d.checked="_blank"===b.target),e){var f=b.buttonClass?b.buttonClass.split(" "):[];e.checked=-1!==f.indexOf(this.customClassOption)}},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},getFormOpts:function(){var a=this.getAnchorTargetCheckbox(),b=this.getAnchorButtonCheckbox(),c={value:this.getInput().value.trim()};return this.linkValidation&&(c.value=this.checkLinkFormat(c.value)),c.target="_self",a&&a.checked&&(c.target="_blank"),b&&b.checked&&(c.buttonClass=this.customClassOption),c},doFormSave:function(){var a=this.getFormOpts();this.completeFormSave(a)},completeFormSave:function(a){this.base.restoreSelection(),this.execAction(this.action,a),this.base.checkSelection()},ensureEncodedUri:function(a){return a===decodeURI(a)?encodeURI(a):a},ensureEncodedUriComponent:function(a){return a===decodeURIComponent(a)?encodeURIComponent(a):a},ensureEncodedParam:function(a){var b=a.split("="),c=b[0],d=b[1];return c+(void 0===d?"":"="+this.ensureEncodedUriComponent(d))},ensureEncodedQuery:function(a){return a.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(a){var b=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,c=b.test(a),d="",e=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,f=a.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),g=f[1],h=f[2],i=f[3];if(e.test(a))return"tel:"+a;if(!c){var j=g.split("/")[0];(j.match(/.+(\.|:).+/)||"localhost"===j)&&(d="http://")}return d+this.ensureEncodedUri(g)+(void 0===h?"":"?"+this.ensureEncodedQuery(h))+(void 0===i?"":"#"+i)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(a){var b=a.querySelector(".medium-editor-toolbar-close"),c=a.querySelector(".medium-editor-toolbar-save"),d=a.querySelector(".medium-editor-toolbar-input");this.on(a,"click",this.handleFormClick.bind(this)),this.on(d,"keyup",this.handleTextboxKeyup.bind(this)),this.on(b,"click",this.handleCloseClick.bind(this)),this.on(c,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var a=this.document,b=a.createElement("div");return b.className="medium-editor-toolbar-form",b.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),b.innerHTML=this.getTemplate(),this.attachFormEvents(b),b},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(b){return b.keyCode===a.util.keyCode.ENTER?(b.preventDefault(),void this.doFormSave()):void(b.keyCode===a.util.keyCode.ESCAPE&&(b.preventDefault(),this.doFormCancel()))},handleFormClick:function(a){a.stopPropagation()},handleSaveClick:function(a){a.preventDefault(),this.doFormSave()},handleCloseClick:function(a){a.preventDefault(),this.doFormCancel()}});a.extensions.anchor=b}(),function(){var b=a.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var a=this.document.createElement("div");return a.id="medium-editor-anchor-preview-"+this.getEditorId(),a.className="medium-editor-anchor-preview",a.innerHTML=this.getTemplate(),this.on(a,"click",this.handleClick.bind(this)),a},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(a){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||a.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=a.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=a.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=a,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(a){a=a||this.activeAnchor;var b,c,d,e,f,g=this.window.innerWidth,h=this.anchorPreview.offsetHeight,i=a.getBoundingClientRect(),j=this.diffLeft,k=this.diffTop,l=this.getEditorOption("elementsContainer"),m=["absolute","fixed"].indexOf(window.getComputedStyle(l).getPropertyValue("position"))>-1,n={};b=this.anchorPreview.offsetWidth/2;var o=this.base.getExtensionByName("toolbar");o&&(j=o.diffLeft,k=o.diffTop),c=j-b,m?(e=l.getBoundingClientRect(),["top","left"].forEach(function(a){n[a]=i[a]-e[a]}),n.width=i.width,n.height=i.height,i=n,g=e.width,f=l.scrollTop):f=this.window.pageYOffset,d=i.left+i.width/2,f+=h+i.top+i.height-k-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(f)+"px",this.anchorPreview.style.right="initial",b>d?(this.anchorPreview.style.left=c+b+"px",this.anchorPreview.style.right="initial"):b>g-d?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=c+d+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(a){var b=this.base.getExtensionByName("anchor"),c=this.activeAnchor;b&&c&&(a.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(c){var a={value:c.attributes.href.value,target:c.getAttribute("target"),buttonClass:c.getAttribute("class")};b.showForm(a),c=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(b){var c=a.util.getClosestTag(b.target,"a");if(!1!==c){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(c.outerHTML)||/href=["']#\S+["']/.test(c.outerHTML)))return!0;var d=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&d&&d.isDisplayed&&d.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==c&&this.detachPreviewHandlers(),this.anchorToPreview=c,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(a){a.relatedTarget&&/anchor-preview/.test(a.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var a=(new Date).getTime()-this.lastOver;a>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});a.extensions.anchorPreview=b}(),function(){function b(b){return!a.util.getClosestTag(b,"a")}var c,d,e,f,g;c=[" "," ","\n","\r"," "," "," "," "," ","\u2028","\u2029"],d="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",e="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+d+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+d+"))",f=new RegExp("^("+d+")$","i"),g=new RegExp(e,"gi");var h=a.Extension.extend({init:function(){a.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var a=0,b=0;b<this.window._mediumEditors.length;b++){var c=this.window._mediumEditors[b];null!==c&&void 0!==c.getExtensionByName("autoLink")&&a++}return 1===a},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(a,b){this.performLinking(b)},onKeypress:function(b){this.disableEventHandling||a.util.isKey(b,[a.util.keyCode.SPACE,a.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var a=this.base.exportSelection();this.performLinking(b.target)&&this.base.importSelection(a,!0)}catch(c){window.console&&window.console.error("Failed to perform linking",c),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(b){var c=a.util.splitByBlockElements(b),d=!1;0===c.length&&(c=[b]);for(var e=0;e<c.length;e++)d=this.removeObsoleteAutoLinkSpans(c[e])||d,d=this.performLinkingWithinElement(c[e])||d;return this.base.events.updateInput(b,{target:b,currentTarget:b}),d},removeObsoleteAutoLinkSpans:function(c){if(!c||3===c.nodeType)return!1;for(var d=c.querySelectorAll('span[data-auto-link="true"]'),e=!1,f=0;f<d.length;f++){var g=d[f].textContent;if(-1===g.indexOf("://")&&(g=a.util.ensureUrlHasProtocol(g)),d[f].getAttribute("data-href")!==g&&b(d[f])){e=!0;var h=g.replace(/\s+$/,"");if(d[f].getAttribute("data-href")===h){var i=g.length-h.length,j=a.util.splitOffDOMTree(d[f],this.splitTextBeforeEnd(d[f],i));d[f].parentNode.insertBefore(j,d[f].nextSibling)}else a.util.unwrap(d[f],this.document)}}return e},splitTextBeforeEnd:function(a,b){for(var c=this.document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1),d=!0;d;)d=null!==c.lastChild();for(var e,f,g;b>0&&null!==g;)e=c.currentNode,f=e.nodeValue,f.length>b?(g=e.splitText(f.length-b),b=0):(g=c.previousNode(),b-=f.length);return g},performLinkingWithinElement:function(b){for(var c=this.findLinkableText(b),d=!1,e=0;e<c.length;e++){var f=a.util.findOrCreateMatchingTextNodes(this.document,b,c[e]);this.shouldNotLink(f)||this.createAutoLink(f,c[e].href)}return d},shouldNotLink:function(b){for(var c=!1,d=0;d<b.length&&c===!1;d++)c=!!a.util.traverseUp(b[d],function(a){return"a"===a.nodeName.toLowerCase()||a.getAttribute&&"true"===a.getAttribute("data-auto-link")});return c},findLinkableText:function(a){for(var b=a.textContent,d=null,e=[];null!==(d=g.exec(b));){var h=!0,i=d.index+d[0].length;h=!(0!==d.index&&-1===c.indexOf(b[d.index-1])||i!==b.length&&-1===c.indexOf(b[i])),h=h&&(-1!==d[0].indexOf("/")||f.test(d[0].split(".").pop().split("?").shift())),h&&e.push({href:d[0],start:d.index,end:i})}return e},createAutoLink:function(b,c){c=a.util.ensureUrlHasProtocol(c);var d=a.util.createLink(this.document,b,c,this.getEditorOption("targetBlank")?"_blank":null),e=this.document.createElement("span");for(e.setAttribute("data-auto-link","true"),e.setAttribute("data-href",c),d.insertBefore(e,d.firstChild);d.childNodes.length>1;)e.appendChild(d.childNodes[1])}});a.extensions.autoLink=h}(),function(){function b(b){var d=a.util.getContainerEditorElement(b),e=Array.prototype.slice.call(d.parentElement.querySelectorAll("."+c));e.forEach(function(a){a.classList.remove(c)})}var c="medium-editor-dragover",d=a.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){a.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(a){a.preventDefault(),a.dataTransfer.dropEffect="copy";var d=a.target.classList?a.target:a.target.parentElement;b(d),"dragover"===a.type&&d.classList.add(c)},handleDrop:function(a){a.preventDefault(),a.stopPropagation(),this.base.selectElement(a.target);var c=this.base.exportSelection();c.start=c.end,this.base.importSelection(c),a.dataTransfer.files&&Array.prototype.slice.call(a.dataTransfer.files).forEach(function(a){this.isAllowedFile(a)&&a.type.match("image")&&this.insertImageFile(a)},this),b(a.target)},isAllowedFile:function(a){return this.allowedTypes.some(function(b){return!!a.type.match(b)})},insertImageFile:function(b){if("function"==typeof FileReader){var c=new FileReader;c.readAsDataURL(b),c.addEventListener("load",function(b){var c=this.document.createElement("img");c.src=b.target.result,a.util.insertHTMLCommand(this.document,c.outerHTML)}.bind(this))}}});a.extensions.fileDragging=d}(),function(){var b=a.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){a.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(a){var b=a.key.charCodeAt(0);this.keys[b]||(this.keys[b]=[]),this.keys[b].push(a)},this)},handleKeydown:function(b){var c=a.util.getKeyCode(b);if(this.keys[c]){var d=a.util.isMetaCtrlKey(b),e=!!b.shiftKey,f=!!b.altKey;this.keys[c].forEach(function(a){a.meta!==d||a.shift!==e||a.alt!==f&&void 0!==a.alt||(b.preventDefault(),b.stopPropagation(),"function"==typeof a.command?a.command.apply(this):!1!==a.command&&this.execAction(a.command))},this)}}});a.extensions.keyboardCommands=b}(),function(){var b=a.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){a.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(a){if(a.preventDefault(),a.stopPropagation(),!this.isDisplayed()){var b=this.document.queryCommandValue("fontName")+"";this.showForm(b)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(a){var b=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),b.value=a||"",b.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var a,b=this.document,c=b.createElement("div"),d=b.createElement("select"),e=b.createElement("a"),f=b.createElement("a");c.className="medium-editor-toolbar-form",c.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(c,"click",this.handleFormClick.bind(this));for(var g=0;g<this.fonts.length;g++)a=b.createElement("option"),a.innerHTML=this.fonts[g],a.value=this.fonts[g],d.appendChild(a);return d.className="medium-editor-toolbar-select",c.appendChild(d),this.on(d,"change",this.handleFontChange.bind(this)),f.setAttribute("href","#"),f.className="medium-editor-toobar-save",f.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",c.appendChild(f),this.on(f,"click",this.handleSaveClick.bind(this),!0),e.setAttribute("href","#"),e.className="medium-editor-toobar-close",e.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",c.appendChild(e),this.on(e,"click",this.handleCloseClick.bind(this)),c},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){a.selection.getSelectedElements(this.document).forEach(function(a){"font"===a.nodeName.toLowerCase()&&a.hasAttribute("face")&&a.removeAttribute("face")})},handleFontChange:function(){var a=this.getSelect().value;""===a?this.clearFontName():this.execAction("fontName",{value:a})},handleFormClick:function(a){a.stopPropagation()},handleSaveClick:function(a){a.preventDefault(),this.doFormSave()},handleCloseClick:function(a){a.preventDefault(),this.doFormCancel()}});a.extensions.fontName=b}(),function(){var b=a.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){a.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(a){if(a.preventDefault(),a.stopPropagation(),!this.isDisplayed()){var b=this.document.queryCommandValue("fontSize")+"";this.showForm(b)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(a){var b=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),b.value=a||"",b.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var a=this.document,b=a.createElement("div"),c=a.createElement("input"),d=a.createElement("a"),e=a.createElement("a");return b.className="medium-editor-toolbar-form",b.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(b,"click",this.handleFormClick.bind(this)),c.setAttribute("type","range"),c.setAttribute("min","1"),c.setAttribute("max","7"),c.className="medium-editor-toolbar-input",b.appendChild(c),this.on(c,"change",this.handleSliderChange.bind(this)),e.setAttribute("href","#"),e.className="medium-editor-toobar-save",e.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",b.appendChild(e),this.on(e,"click",this.handleSaveClick.bind(this),!0),
|
3 |
-
d.setAttribute("href","#"),d.className="medium-editor-toobar-close",d.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",b.appendChild(d),this.on(d,"click",this.handleCloseClick.bind(this)),b},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){a.selection.getSelectedElements(this.document).forEach(function(a){"font"===a.nodeName.toLowerCase()&&a.hasAttribute("size")&&a.removeAttribute("size")})},handleSliderChange:function(){var a=this.getInput().value;"4"===a?this.clearFontSize():this.execAction("fontSize",{value:a})},handleFormClick:function(a){a.stopPropagation()},handleSaveClick:function(a){a.preventDefault(),this.doFormSave()},handleCloseClick:function(a){a.preventDefault(),this.doFormCancel()}});a.extensions.fontSize=b}(),function(){function b(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function c(a,b,c){var d=a.clipboardData||b.clipboardData||c.dataTransfer,e={};if(!d)return e;if(d.getData){var f=d.getData("Text");f&&f.length>0&&(e["text/plain"]=f)}if(d.types)for(var g=0;g<d.types.length;g++){var h=d.types[g];e[h]=d.getData(h)}return e}var d="%ME_PASTEBIN%",e=null,f=null,g=function(a){a.stopPropagation()},h=a.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){a.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(a){this.on(a,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(a,b){this.on(b,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(a,b){if(!a.defaultPrevented){var d=c(a,this.window,this.document),e=d["text/html"],f=d["text/plain"];this.window.clipboardData&&void 0===a.clipboardData&&!e&&(e=f),(e||f)&&(a.preventDefault(),this.doPaste(e,f,b))}},doPaste:function(b,c,d){var e,f,g="";if(this.cleanPastedHTML&&b)return this.cleanPaste(b);if(this.getEditorOption("disableReturn")||d&&d.getAttribute("data-disable-return"))g=a.util.htmlEntities(c);else if(e=c.split(/[\r\n]+/g),e.length>1)for(f=0;f<e.length;f+=1)""!==e[f]&&(g+="<p>"+a.util.htmlEntities(e[f])+"</p>");else g=a.util.htmlEntities(e[0]);a.util.insertHTMLCommand(this.document,g)},handlePasteBinPaste:function(a){if(a.defaultPrevented)return void this.removePasteBin();var b=c(a,this.window,this.document),d=b["text/html"],e=b["text/plain"],g=f;return!this.cleanPastedHTML||d?(a.preventDefault(),this.removePasteBin(),this.doPaste(d,e,g),void this.trigger("editablePaste",{currentTarget:g,target:g},g)):void setTimeout(function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,e,g),this.trigger("editablePaste",{currentTarget:g,target:g},g)}.bind(this),0)},handleKeydown:function(b,c){a.util.isKey(b,a.util.keyCode.V)&&a.util.isMetaCtrlKey(b)&&(b.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(b){var c,h=a.selection.getSelectionRange(this.document),i=this.window.pageYOffset;f=b,h&&(c=h.getClientRects(),i+=c.length?c[0].top:h.startContainer.getBoundingClientRect().top),e=h;var j=this.document.createElement("div");j.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),j.setAttribute("style","border: 1px red solid; position: absolute; top: "+i+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),j.setAttribute("contentEditable",!0),j.innerHTML=d,this.document.body.appendChild(j),this.on(j,"focus",g),this.on(j,"focusin",g),this.on(j,"focusout",g),j.focus(),a.selection.selectNode(j,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(j,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==e&&(a.selection.selectRange(this.document,e),e=null),null!==f&&(f=null);var b=this.getPasteBin();b&&b&&(this.off(b,"focus",g),this.off(b,"focusin",g),this.off(b,"focusout",g),this.off(b,"paste",this.boundHandlePaste),b.parentElement.removeChild(b))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var a=this.getPasteBin();if(!a)return!1;if(a.firstChild&&"mcepastebin"===a.firstChild.id)return!1;var b=a.innerHTML;return b&&b!==d?b:!1},cleanPaste:function(a){var c,d,e,f,g=/<p|<br|<div/.test(a),h=[].concat(this.preCleanReplacements||[],b(),this.cleanReplacements||[]);for(c=0;c<h.length;c+=1)a=a.replace(h[c][0],h[c][1]);if(!g)return this.pasteHTML(a);for(e=this.document.createElement("div"),e.innerHTML="<p>"+a.split("<br><br>").join("</p><p>")+"</p>",d=e.querySelectorAll("a,p,div,br"),c=0;c<d.length;c+=1)switch(f=d[c],f.innerHTML=f.innerHTML.replace(/\n/gi," "),f.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(f);break;case"br":this.filterLineBreak(f)}this.pasteHTML(e.innerHTML)},pasteHTML:function(b,c){c=a.util.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var d,e,f,g,h=this.document.createDocumentFragment();for(h.appendChild(this.document.createElement("body")),g=h.querySelector("body"),g.innerHTML=b,this.cleanupSpans(g),d=g.querySelectorAll("*"),f=0;f<d.length;f+=1)e=d[f],"a"===e.nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&a.util.setTargetBlank(e),a.util.cleanupAttrs(e,c.cleanAttrs),a.util.cleanupTags(e,c.cleanTags),a.util.unwrapTags(e,c.unwrapTags);a.util.insertHTMLCommand(this.document,g.innerHTML.replace(/ /g," "))},isCommonBlock:function(a){return a&&("p"===a.nodeName.toLowerCase()||"div"===a.nodeName.toLowerCase())},filterCommonBlocks:function(a){/^\s*$/.test(a.textContent)&&a.parentNode&&a.parentNode.removeChild(a)},filterLineBreak:function(a){this.isCommonBlock(a.previousElementSibling)?this.removeWithParent(a):!this.isCommonBlock(a.parentNode)||a.parentNode.firstChild!==a&&a.parentNode.lastChild!==a?a.parentNode&&1===a.parentNode.childElementCount&&""===a.parentNode.textContent&&this.removeWithParent(a):this.removeWithParent(a)},removeWithParent:function(a){a&&a.parentNode&&(a.parentNode.parentNode&&1===a.parentNode.childElementCount?a.parentNode.parentNode.removeChild(a.parentNode):a.parentNode.removeChild(a))},cleanupSpans:function(b){var c,d,e,f=b.querySelectorAll(".replace-with"),g=function(a){return a&&"#text"!==a.nodeName&&"false"===a.getAttribute("contenteditable")};for(c=0;c<f.length;c+=1)d=f[c],e=this.document.createElement(d.classList.contains("bold")?"b":"i"),d.classList.contains("bold")&&d.classList.contains("italic")?e.innerHTML="<i>"+d.innerHTML+"</i>":e.innerHTML=d.innerHTML,d.parentNode.replaceChild(e,d);for(f=b.querySelectorAll("span"),c=0;c<f.length;c+=1){if(d=f[c],a.util.traverseUp(d,g))return!1;a.util.unwrap(d,this.document)}}});a.extensions.paste=h}(),function(){var b=a.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){a.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(a,b){this.initElement(b)},initElement:function(a){a.getAttribute("data-placeholder")||a.setAttribute("data-placeholder",this.text),this.updatePlaceholder(a)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(a,b){this.cleanupElement(b)},cleanupElement:function(a){a.getAttribute("data-placeholder")===this.text&&a.removeAttribute("data-placeholder")},showPlaceholder:function(b){b&&(a.util.isFF&&0===b.childNodes.length?(b.classList.add("medium-editor-placeholder-relative"),b.classList.remove("medium-editor-placeholder")):(b.classList.add("medium-editor-placeholder"),b.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(a){a&&(a.classList.remove("medium-editor-placeholder"),a.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(a,b){return a.querySelector("img, blockquote, ul, ol, table")||""!==a.textContent.replace(/^\s+|\s+$/g,"")?this.hidePlaceholder(a):void(b||this.showPlaceholder(a))},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(a,b){var c=this.hideOnClick&&b===this.base.getFocusedElement();this.updatePlaceholder(b,c)},handleFocus:function(a,b){this.hidePlaceholder(b)},handleBlur:function(a,b){this.updatePlaceholder(b)}});a.extensions.placeholder=b}(),function(){var b=a.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,"static":!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){a.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(a,b){return this.base.extensions.forEach(function(c){return c!==this?a.apply(b||this,arguments):void 0},this)},createToolbar:function(){var a=this.document.createElement("div");return a.id="medium-editor-toolbar-"+this.getEditorId(),a.className="medium-editor-toolbar",this["static"]?a.className+=" static-toolbar":this.relativeContainer?a.className+=" medium-editor-relative-toolbar":a.className+=" medium-editor-stalker-toolbar",a.appendChild(this.createToolbarButtons()),this.forEachExtension(function(b){b.hasForm&&a.appendChild(b.getForm())}),this.attachEventHandlers(),a},createToolbarButtons:function(){var b,c,d,e,f,g,h=this.document.createElement("ul");return h.id="medium-editor-toolbar-actions"+this.getEditorId(),h.className="medium-editor-toolbar-actions",h.style.display="block",this.buttons.forEach(function(d){"string"==typeof d?(f=d,g=null):(f=d.name,g=d),e=this.base.addBuiltInExtension(f,g),e&&"function"==typeof e.getButton&&(c=e.getButton(this.base),b=this.document.createElement("li"),a.util.isElement(c)?b.appendChild(c):b.innerHTML=c,h.appendChild(b))},this),d=h.querySelectorAll("button"),d.length>0&&(d[0].classList.add(this.firstButtonClass),d[d.length-1].classList.add(this.lastButtonClass)),h},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=a.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this["static"]&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(b){return b&&b.target&&a.util.isDescendant(this.getToolbarElement(),b.target)?!1:void this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension(function(a){a.hasForm&&a.isDisplayed()&&a.hideForm()})},multipleBlockElementsSelected:function(){var b=/<[^\/>][^>]*><\/[^>]+>/gim,c=new RegExp("<("+a.util.blockContainerElementNames.join("|")+")[^>]*>","g"),d=a.selection.getSelectionHtml(this.document).replace(b,""),e=d.match(c);return!!e&&e.length>1},modifySelection:function(){var b=this.window.getSelection(),c=b.getRangeAt(0);if(this.standardizeSelectionStart&&c.startContainer.nodeValue&&c.startOffset===c.startContainer.nodeValue.length){var d=a.util.findAdjacentTextNodeWithContent(a.selection.getSelectionElement(this.window),c.startContainer,this.document);if(d){for(var e=0;0===d.nodeValue.substr(e,1).trim().length;)e+=1;c=a.selection.select(this.document,d,e,c.endContainer,c.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||a.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var b=a.selection.getSelectionElement(this.window);return!b||-1===this.getEditorElements().indexOf(b)||b.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this["static"]?this.showAndUpdateToolbar():!a.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(a){"function"==typeof a.isActive&&"function"==typeof a.setInactive&&a.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var b,c=[],d=null,e=a.selection.getSelectionRange(this.document),f=function(a){"function"==typeof a.checkState?a.checkState(b):"function"==typeof a.isActive&&"function"==typeof a.isAlreadyApplied&&"function"==typeof a.setActive&&!a.isActive()&&a.isAlreadyApplied(b)&&a.setActive()};if(e&&(this.forEachExtension(function(a){return"function"==typeof a.queryCommandState&&(d=a.queryCommandState(),null!==d)?void(d&&"function"==typeof a.setActive&&a.setActive()):void c.push(a)}),b=a.selection.getSelectedParentElement(e),this.getEditorElements().some(function(c){return a.util.isDescendant(c,b,!0)})))for(;b&&(c.forEach(f),!a.util.isMediumEditorElement(b));)b=b.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var a=this.base.getFocusedElement(),b=this.window.getSelection();return a?void(!this["static"]&&b.isCollapsed||(this.showToolbar(),this.relativeContainer||(this["static"]?this.positionStaticToolbar(a):this.positionToolbar(b)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))):this},positionStaticToolbar:function(a){this.getToolbarElement().style.left="0";var b,c=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,d=this.window.innerWidth,e=this.getToolbarElement(),f=a.getBoundingClientRect(),g=f.top+c,h=f.left+f.width/2,i=e.offsetHeight,j=e.offsetWidth,k=j/2;switch(this.sticky?c>g+a.offsetHeight-i-this.stickyTopOffset?(e.style.top=g+a.offsetHeight-i+"px",e.classList.remove("medium-editor-sticky-toolbar")):c>g-i-this.stickyTopOffset?(e.classList.add("medium-editor-sticky-toolbar"),e.style.top=this.stickyTopOffset+"px"):(e.classList.remove("medium-editor-sticky-toolbar"),e.style.top=g-i+"px"):e.style.top=g-i+"px",this.align){case"left":b=f.left;break;case"right":b=f.right-j;break;case"center":b=h-k}0>b?b=0:b+j>d&&(b=d-Math.ceil(j)-1),e.style.left=b+"px"},positionToolbar:function(a){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var b=a.getRangeAt(0),c=b.getBoundingClientRect();(!c||0===c.height&&0===c.width&&b.startContainer===b.endContainer)&&(c=1===b.startContainer.nodeType&&b.startContainer.querySelector("img")?b.startContainer.querySelector("img").getBoundingClientRect():b.startContainer.getBoundingClientRect());var d,e,f=this.window.innerWidth,g=this.getToolbarElement(),h=g.offsetHeight,i=g.offsetWidth,j=i/2,k=50,l=this.diffLeft-j,m=this.getEditorOption("elementsContainer"),n=["absolute","fixed"].indexOf(window.getComputedStyle(m).getPropertyValue("position"))>-1,o={},p={};n?(e=m.getBoundingClientRect(),["top","left"].forEach(function(a){p[a]=c[a]-e[a]}),p.width=c.width,p.height=c.height,c=p,f=e.width,o.top=m.scrollTop):o.top=this.window.pageYOffset,d=c.left+c.width/2,o.top+=c.top-h,c.top<k?(g.classList.add("medium-toolbar-arrow-over"),g.classList.remove("medium-toolbar-arrow-under"),o.top+=k+c.height-this.diffTop):(g.classList.add("medium-toolbar-arrow-under"),g.classList.remove("medium-toolbar-arrow-over"),o.top+=this.diffTop),j>d?(o.left=l+j,o.right="initial"):j>f-d?(o.left="auto",o.right=0):(o.left=l+d,o.right="initial"),["top","left","right"].forEach(function(a){g.style[a]=o[a]+(isNaN(o[a])?"":"px")})}});a.extensions.toolbar=b}(),function(){var b=a.Extension.extend({init:function(){a.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(a){var b="medium-editor-dragover";a.preventDefault(),a.dataTransfer.dropEffect="copy","dragover"===a.type?a.target.classList.add(b):"dragleave"===a.type&&a.target.classList.remove(b)},handleDrop:function(b){var c,d="medium-editor-dragover";b.preventDefault(),b.stopPropagation(),b.dataTransfer.files&&(c=Array.prototype.slice.call(b.dataTransfer.files,0),c.some(function(b){if(b.type.match("image")){var c,d;c=new FileReader,c.readAsDataURL(b),d="medium-img-"+ +new Date,a.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+d+'" />'),c.onload=function(){var a=this.document.getElementById(d);a&&(a.removeAttribute("id"),a.removeAttribute("class"),a.src=c.result)}.bind(this)}}.bind(this))),b.target.classList.remove(d)}});a.extensions.imageDragging=b}(),function(){function b(b){var c=a.selection.getSelectionStart(this.options.ownerDocument),d=c.textContent,e=a.selection.getCaretOffsets(c);(void 0===d[e.left-1]||""===d[e.left-1].trim()||void 0!==d[e.left]&&""===d[e.left].trim())&&b.preventDefault()}function c(b,c){if(this.options.disableReturn||c.getAttribute("data-disable-return"))b.preventDefault();else if(this.options.disableDoubleReturn||c.getAttribute("data-disable-double-return")){var d=a.selection.getSelectionStart(this.options.ownerDocument);(d&&""===d.textContent.trim()&&"li"!==d.nodeName.toLowerCase()||d.previousElementSibling&&"br"!==d.previousElementSibling.nodeName.toLowerCase()&&""===d.previousElementSibling.textContent.trim())&&b.preventDefault()}}function d(b){var c=a.selection.getSelectionStart(this.options.ownerDocument),d=c&&c.nodeName.toLowerCase();"pre"===d&&(b.preventDefault(),a.util.insertHTMLCommand(this.options.ownerDocument," ")),a.util.isListItem(c)&&(b.preventDefault(),b.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function e(b){var c,d=a.selection.getSelectionStart(this.options.ownerDocument),e=d.nodeName.toLowerCase(),f=/^(\s+|<br\/?>)?$/i,g=/h\d/i;a.util.isKey(b,[a.util.keyCode.BACKSPACE,a.util.keyCode.ENTER])&&d.previousElementSibling&&g.test(e)&&0===a.selection.getCaretOffsets(d).left?a.util.isKey(b,a.util.keyCode.BACKSPACE)&&f.test(d.previousElementSibling.innerHTML)?(d.previousElementSibling.parentNode.removeChild(d.previousElementSibling),b.preventDefault()):!this.options.disableDoubleReturn&&a.util.isKey(b,a.util.keyCode.ENTER)&&(c=this.options.ownerDocument.createElement("p"),c.innerHTML="<br>",d.previousElementSibling.parentNode.insertBefore(c,d),b.preventDefault()):a.util.isKey(b,a.util.keyCode.DELETE)&&d.nextElementSibling&&d.previousElementSibling&&!g.test(e)&&f.test(d.innerHTML)&&g.test(d.nextElementSibling.nodeName.toLowerCase())?(a.selection.moveCursor(this.options.ownerDocument,d.nextElementSibling),d.previousElementSibling.parentNode.removeChild(d),b.preventDefault()):a.util.isKey(b,a.util.keyCode.BACKSPACE)&&"li"===e&&f.test(d.innerHTML)&&!d.previousElementSibling&&!d.parentElement.previousElementSibling&&d.nextElementSibling&&"li"===d.nextElementSibling.nodeName.toLowerCase()?(c=this.options.ownerDocument.createElement("p"),c.innerHTML="<br>",d.parentElement.parentElement.insertBefore(c,d.parentElement),a.selection.moveCursor(this.options.ownerDocument,c),d.parentElement.removeChild(d),b.preventDefault()):a.util.isKey(b,a.util.keyCode.BACKSPACE)&&a.util.getClosestTag(d,"blockquote")!==!1&&0===a.selection.getCaretOffsets(d).left?(b.preventDefault(),a.util.execFormatBlock(this.options.ownerDocument,"p")):a.util.isKey(b,a.util.keyCode.ENTER)&&a.util.getClosestTag(d,"blockquote")!==!1&&0===a.selection.getCaretOffsets(d).right?(c=this.options.ownerDocument.createElement("p"),c.innerHTML="<br>",d.parentElement.insertBefore(c,d.nextSibling),a.selection.moveCursor(this.options.ownerDocument,c),b.preventDefault()):a.util.isKey(b,a.util.keyCode.BACKSPACE)&&a.util.isMediumEditorElement(d.parentElement)&&!d.previousElementSibling&&d.nextElementSibling&&f.test(d.innerHTML)&&(b.preventDefault(),a.selection.moveCursor(this.options.ownerDocument,d.nextSibling),d.parentElement.removeChild(d))}function f(b){var c,d=a.selection.getSelectionStart(this.options.ownerDocument);d&&(a.util.isMediumEditorElement(d)&&0===d.children.length&&!a.util.isBlockContainer(d)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!a.util.isKey(b,a.util.keyCode.ENTER)||a.util.isListItem(d)||a.util.isBlockContainer(d)||(c=d.nodeName.toLowerCase(),"a"===c?this.options.ownerDocument.execCommand("unlink",!1,null):b.shiftKey||b.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function g(a,b){var c=b.parentNode.querySelector('textarea[medium-editor-textarea-id="'+b.getAttribute("medium-editor-textarea-id")+'"]');c&&(c.value=b.innerHTML.trim())}function h(a){a._mediumEditors||(a._mediumEditors=[null]),this.id||(this.id=a._mediumEditors.length),a._mediumEditors[this.id]=this}function i(a){a._mediumEditors&&a._mediumEditors[this.id]&&(a._mediumEditors[this.id]=null)}function j(b,c,d){var e=[];if(b||(b=[]),"string"==typeof b&&(b=c.querySelectorAll(b)),a.util.isElement(b)&&(b=[b]),d)for(var f=0;f<b.length;f++){var g=b[f];!a.util.isElement(g)||g.getAttribute("data-medium-editor-element")||g.getAttribute("medium-editor-textarea-id")||e.push(g)}else e=Array.prototype.slice.apply(b);return e}function k(a){var b=a.parentNode.querySelector('textarea[medium-editor-textarea-id="'+a.getAttribute("medium-editor-textarea-id")+'"]');b&&(b.classList.remove("medium-editor-hidden"),b.removeAttribute("medium-editor-textarea-id")),a.parentNode&&a.parentNode.removeChild(a)}function l(a,b){return Object.keys(b).forEach(function(c){void 0===a[c]&&(a[c]=b[c])}),a}function m(a,b,c){var d={window:c.options.contentWindow,document:c.options.ownerDocument,base:c};return a=l(a,d),"function"==typeof a.init&&a.init(),a.name||(a.name=b),a}function n(){return this.elements.every(function(a){return!!a.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function o(){return n.call(this)?this.options.anchorPreview!==!1:!1}function p(){return this.options.placeholder!==!1}function q(){return this.options.autoLink!==!1}function r(){return this.options.imageDragging!==!1}function s(){return this.options.keyboardCommands!==!1}function t(){return!this.options.extensions.imageDragging}function u(a){for(var b=this.options.ownerDocument.createElement("div"),c=Date.now(),d="medium-editor-"+c,e=a.attributes;this.options.ownerDocument.getElementById(d);)c++,d="medium-editor-"+c;b.className=a.className,b.id=d,b.innerHTML=a.value,a.setAttribute("medium-editor-textarea-id",d);for(var f=0,g=e.length;g>f;f++)b.hasAttribute(e[f].nodeName)||b.setAttribute(e[f].nodeName,e[f].nodeValue);return a.form&&this.on(a.form,"reset",function(a){a.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(d))}.bind(this)),a.classList.add("medium-editor-hidden"),a.parentNode.insertBefore(b,a),b}function v(b,d){if(!b.getAttribute("data-medium-editor-element")){"textarea"===b.nodeName.toLowerCase()&&(b=u.call(this,b),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=g.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||b.getAttribute("data-disable-editing")||(b.setAttribute("contentEditable",!0),b.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(b.getAttribute("data-disable-return")||b.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=c.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||b.getAttribute("data-disable-return")||this.on(b,"keyup",f.bind(this));var e=a.util.guid();b.setAttribute("data-medium-editor-element",!0),b.classList.add("medium-editor-element"),b.setAttribute("role","textbox"),b.setAttribute("aria-multiline",!0),b.setAttribute("data-medium-editor-editor-index",d),b.setAttribute("medium-editor-index",e),B[e]=b.innerHTML,this.events.attachAllEventsToElement(b)}return b}function w(){this.subscribe("editableKeydownTab",d.bind(this)),this.subscribe("editableKeydownDelete",e.bind(this)),this.subscribe("editableKeydownEnter",e.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",b.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=c.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function x(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(a){"toolbar"!==a&&this.options.extensions[a]&&this.extensions.push(m(this.options.extensions[a],a,this))},this),t.call(this)){var b=this.options.fileDragging;b||(b={},r.call(this)||(b.allowedTypes=[])),this.addBuiltInExtension("fileDragging",b)}var c={paste:!0,"anchor-preview":o.call(this),autoLink:q.call(this),keyboardCommands:s.call(this),placeholder:p.call(this)};Object.keys(c).forEach(function(a){c[a]&&this.addBuiltInExtension(a)},this);var d=this.options.extensions.toolbar;if(!d&&n.call(this)){var e=a.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});d=new a.extensions.toolbar(e)}d&&this.extensions.push(m(d,"toolbar",this))}function y(b,c){var d=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return c&&d.forEach(function(b){c.hasOwnProperty(b[0])&&void 0!==c[b[0]]&&a.util.deprecated(b[0],b[1],"v6.0.0")}),a.util.defaults({},c,b)}function z(b,c){var d,e,f=/^append-(.+)$/gi,g=/justify([A-Za-z]*)$/g;if(d=f.exec(b))return a.util.execFormatBlock(this.options.ownerDocument,d[1]);if("fontSize"===b)return c.size&&a.util.deprecated(".size option for fontSize command",".value","6.0.0"),e=c.value||c.size,this.options.ownerDocument.execCommand("fontSize",!1,e);if("fontName"===b)return c.name&&a.util.deprecated(".name option for fontName command",".value","6.0.0"),e=c.value||c.name,this.options.ownerDocument.execCommand("fontName",!1,e);if("createLink"===b)return this.createLink(c);if("image"===b){var h=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,h)}if("html"===b){var i=this.options.contentWindow.getSelection().toString().trim();return a.util.insertHTMLCommand(this.options.ownerDocument,i)}if(g.exec(b)){var j=this.options.ownerDocument.execCommand(b,!1,null),k=a.selection.getSelectedParentElement(a.selection.getSelectionRange(this.options.ownerDocument));return k&&A.call(this,a.util.getTopBlockContainer(k)),j}return e=c&&c.value,this.options.ownerDocument.execCommand(b,!1,e)}function A(b){if(b){var c,d=Array.prototype.slice.call(b.childNodes).filter(function(a){var b="div"===a.nodeName.toLowerCase();return b&&!c&&(c=a.style.textAlign),b});d.length&&(this.saveSelection(),d.forEach(function(b){if(b.style.textAlign===c){var d=b.lastChild;if(d){a.util.unwrap(b,this.options.ownerDocument);var e=this.options.ownerDocument.createElement("BR");d.parentNode.insertBefore(e,d.nextSibling)}}},this),b.style.textAlign=c,this.restoreSelection())}}var B={};a.prototype={init:function(a,b){return this.options=y.call(this,this.defaults,b),this.origElements=a,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(h.call(this,this.options.contentWindow),this.events=new a.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,x.call(this),w.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(a){"function"==typeof a.destroy&&a.destroy()},this),this.events.destroy(),this.elements.forEach(function(a){this.options.spellcheck&&(a.innerHTML=a.innerHTML),a.removeAttribute("contentEditable"),a.removeAttribute("spellcheck"),a.removeAttribute("data-medium-editor-element"),a.classList.remove("medium-editor-element"),a.removeAttribute("role"),a.removeAttribute("aria-multiline"),
|
4 |
-
a.removeAttribute("medium-editor-index"),a.removeAttribute("data-medium-editor-editor-index"),a.getAttribute("medium-editor-textarea-id")&&k(a)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,i.call(this,this.options.contentWindow))},on:function(a,b,c,d){return this.events.attachDOMEvent(a,b,c,d),this},off:function(a,b,c,d){return this.events.detachDOMEvent(a,b,c,d),this},subscribe:function(a,b){return this.events.attachCustomEvent(a,b),this},unsubscribe:function(a,b){return this.events.detachCustomEvent(a,b),this},trigger:function(a,b,c){return this.events.triggerCustomEvent(a,b,c),this},delay:function(a){var b=this;return setTimeout(function(){b.isActive&&a()},this.options.delay)},serialize:function(){var a,b,c={},d=this.elements.length;for(a=0;d>a;a+=1)b=""!==this.elements[a].id?this.elements[a].id:"element-"+a,c[b]={value:this.elements[a].innerHTML.trim()};return c},getExtensionByName:function(a){var b;return this.extensions&&this.extensions.length&&this.extensions.some(function(c){return c.name===a?(b=c,!0):!1}),b},addBuiltInExtension:function(b,c){var d,e=this.getExtensionByName(b);if(e)return e;switch(b){case"anchor":d=a.util.extend({},this.options.anchor,c),e=new a.extensions.anchor(d);break;case"anchor-preview":e=new a.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":e=new a.extensions.autoLink;break;case"fileDragging":e=new a.extensions.fileDragging(c);break;case"fontname":e=new a.extensions.fontName(this.options.fontName);break;case"fontsize":e=new a.extensions.fontSize(c);break;case"keyboardCommands":e=new a.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":e=new a.extensions.paste(this.options.paste);break;case"placeholder":e=new a.extensions.placeholder(this.options.placeholder);break;default:a.extensions.button.isBuiltInButton(b)&&(c?(d=a.util.defaults({},c,a.extensions.button.prototype.defaults[b]),e=new a.extensions.button(d)):e=new a.extensions.button(b))}return e&&this.extensions.push(m(e,b,this)),e},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var a=this.getExtensionByName("toolbar");return a&&a.checkState(),this},queryCommandState:function(a){var b,c=/^full-(.+)$/gi,d=null;b=c.exec(a),b&&(a=b[1]);try{d=this.options.ownerDocument.queryCommandState(a)}catch(e){d=null}return d},execAction:function(b,c){var d,e,f=/^full-(.+)$/gi;return d=f.exec(b),d?(this.saveSelection(),this.selectAllContents(),e=z.call(this,d[1],c),this.restoreSelection()):e=z.call(this,b,c),"insertunorderedlist"!==b&&"insertorderedlist"!==b||a.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),e},getSelectedParentElement:function(b){return void 0===b&&(b=this.options.contentWindow.getSelection().getRangeAt(0)),a.selection.getSelectedParentElement(b)},selectAllContents:function(){var b=a.selection.getSelectionElement(this.options.contentWindow);if(b){for(;1===b.children.length;)b=b.children[0];this.selectElement(b)}},selectElement:function(b){a.selection.selectNode(b,this.options.ownerDocument);var c=a.selection.getSelectionElement(this.options.contentWindow);c&&this.events.focusElement(c)},getFocusedElement:function(){var a;return this.elements.some(function(b){return!a&&b.getAttribute("data-medium-focused")&&(a=b),!!a},this),a},exportSelection:function(){var b=a.selection.getSelectionElement(this.options.contentWindow),c=this.elements.indexOf(b),d=null;return c>=0&&(d=a.selection.exportSelection(b,this.options.ownerDocument)),null!==d&&0!==c&&(d.editableElementIndex=c),d},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(b,c){if(b){var d=this.elements[b.editableElementIndex||0];a.selection.importSelection(b,d,this.options.ownerDocument,c)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(b){var c,d=a.selection.getSelectionElement(this.options.contentWindow),e={};if(-1!==this.elements.indexOf(d)){try{if(this.events.disableCustomEvent("editableInput"),b.url&&a.util.deprecated(".url option for createLink",".value","6.0.0"),c=b.url||b.value,c&&c.trim().length>0){var f=this.options.contentWindow.getSelection();if(f){var g,h,i,j,k=f.getRangeAt(0),l=k.commonAncestorContainer;if(3===k.endContainer.nodeType&&3!==k.startContainer.nodeType&&0===k.startOffset&&k.startContainer.firstChild===k.endContainer&&(l=k.endContainer),h=a.util.getClosestBlockContainer(k.startContainer),i=a.util.getClosestBlockContainer(k.endContainer),3!==l.nodeType&&0!==l.textContent.length&&h===i){var m=h||d,n=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),g=this.exportSelection(),n.appendChild(m.cloneNode(!0)),d===m?a.selection.select(this.options.ownerDocument,m.firstChild,0,m.lastChild,3===m.lastChild.nodeType?m.lastChild.nodeValue.length:m.lastChild.childNodes.length):a.selection.select(this.options.ownerDocument,m,0,m,m.childNodes.length);var o=this.exportSelection();j=a.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,n,{start:g.start-o.start,end:g.end-o.start,editableElementIndex:g.editableElementIndex}),0===j.length&&(n=this.options.ownerDocument.createDocumentFragment(),n.appendChild(l.cloneNode(!0)),j=[n.firstChild.firstChild,n.firstChild.lastChild]),a.util.createLink(this.options.ownerDocument,j,c.trim());var p=(n.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;a.util.insertHTMLCommand(this.options.ownerDocument,n.firstChild.innerHTML.replace(/^\s+/,"")),g.start-=p,g.end-=p,this.importSelection(g)}else this.options.ownerDocument.execCommand("createLink",!1,c);this.options.targetBlank||"_blank"===b.target?a.util.setTargetBlank(a.selection.getSelectionStart(this.options.ownerDocument),c):a.util.removeTargetBlank(a.selection.getSelectionStart(this.options.ownerDocument),c),b.buttonClass&&a.util.addClassToAnchors(a.selection.getSelectionStart(this.options.ownerDocument),b.buttonClass)}}if(this.options.targetBlank||"_blank"===b.target||b.buttonClass){e=this.options.ownerDocument.createEvent("HTMLEvents"),e.initEvent("input",!0,!0,this.options.contentWindow);for(var q=0,r=this.elements.length;r>q;q+=1)this.elements[q].dispatchEvent(e)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",e,d)}},cleanPaste:function(a){this.getExtensionByName("paste").cleanPaste(a)},pasteHTML:function(a,b){this.getExtensionByName("paste").pasteHTML(a,b)},setContent:function(a,b){if(b=b||0,this.elements[b]){var c=this.elements[b];c.innerHTML=a,this.checkContentChanged(c)}},getContent:function(a){return a=a||0,this.elements[a]?this.elements[a].innerHTML.trim():null},checkContentChanged:function(b){b=b||a.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(b,{target:b,currentTarget:b})},resetContent:function(a){if(a){var b=this.elements.indexOf(a);return void(-1!==b&&this.setContent(B[a.getAttribute("medium-editor-index")],b))}this.elements.forEach(function(a,b){this.setContent(B[a.getAttribute("medium-editor-index")],b)},this)},addElements:function(a){var b=j(a,this.options.ownerDocument,!0);return 0===b.length?!1:void b.forEach(function(a){a=v.call(this,a,this.id),this.elements.push(a),this.trigger("addElement",{target:a,currentTarget:a},a)},this)},removeElements:function(a){var b=j(a,this.options.ownerDocument),c=b.map(function(a){return a.getAttribute("medium-editor-textarea-id")&&a.parentNode?a.parentNode.querySelector('div[medium-editor-textarea-id="'+a.getAttribute("medium-editor-textarea-id")+'"]'):a});this.elements=this.elements.filter(function(a){return-1!==c.indexOf(a)?(this.events.cleanupElement(a),a.getAttribute("medium-editor-textarea-id")&&k(a),this.trigger("removeElement",{target:a,currentTarget:a},a),!1):!0},this)}},a.getEditorFromElement=function(a){var b=a.getAttribute("data-medium-editor-editor-index"),c=a&&a.ownerDocument&&(a.ownerDocument.defaultView||a.ownerDocument.parentWindow);return c&&c._mediumEditors&&c._mediumEditors[b]?c._mediumEditors[b]:null}}(),function(){a.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}(),a.parseVersionString=function(a){var b=a.split("-"),c=b[0].split("."),d=b.length>1?b[1]:"";return{major:parseInt(c[0],10),minor:parseInt(c[1],10),revision:parseInt(c[2],10),preRelease:d,toString:function(){return[c[0],c[1],c[2]].join(".")+(d?"-"+d:"")}}},a.version=a.parseVersionString.call(this,{version:"5.23.0"}.version),a}());
|
|
|
|
|
|
|
|
vendor/rangy/rangy-core.js
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Rangy, a cross-browser JavaScript range and selection library
|
3 |
-
* https://github.com/timdown/rangy
|
4 |
-
*
|
5 |
-
* Copyright 2015, Tim Down
|
6 |
-
* Licensed under the MIT license.
|
7 |
-
* Version: 1.3.0
|
8 |
-
* Build date: 10 May 2015
|
9 |
-
*/
|
10 |
-
!function(e,t){"function"==typeof define&&define.amd?define(e):"undefined"!=typeof module&&"object"==typeof exports?module.exports=e():t.rangy=e()}(function(){function e(e,t){var n=typeof e[t];return n==N||!(n!=C||!e[t])||"unknown"==n}function t(e,t){return!(typeof e[t]!=C||!e[t])}function n(e,t){return typeof e[t]!=E}function r(e){return function(t,n){for(var r=n.length;r--;)if(!e(t,n[r]))return!1;return!0}}function o(e){return e&&O(e,T)&&D(e,w)}function i(e){return t(e,"body")?e.body:e.getElementsByTagName("body")[0]}function a(t){typeof console!=E&&e(console,"log")&&console.log(t)}function s(e,t){b&&t?alert(e):a(e)}function c(e){I.initialized=!0,I.supported=!1,s("Rangy is not supported in this environment. Reason: "+e,I.config.alertOnFail)}function d(e){s("Rangy warning: "+e,I.config.alertOnWarn)}function f(e){return e.message||e.description||String(e)}function u(){if(b&&!I.initialized){var t,n=!1,r=!1;e(document,"createRange")&&(t=document.createRange(),O(t,y)&&D(t,S)&&(n=!0));var s=i(document);if(!s||"body"!=s.nodeName.toLowerCase())return void c("No body element found");if(s&&e(s,"createTextRange")&&(t=s.createTextRange(),o(t)&&(r=!0)),!n&&!r)return void c("Neither Range nor TextRange are available");I.initialized=!0,I.features={implementsDomRange:n,implementsTextRange:r};var d,u;for(var l in x)(d=x[l])instanceof p&&d.init(d,I);for(var h=0,g=M.length;g>h;++h)try{M[h](I)}catch(m){u="Rangy init listener threw an exception. Continuing. Detail: "+f(m),a(u)}}}function l(e,t,n){n&&(e+=" in module "+n.name),I.warn("DEPRECATED: "+e+" is deprecated. Please use "+t+" instead.")}function h(e,t,n,r){e[t]=function(){return l(t,n,r),e[n].apply(e,P.toArray(arguments))}}function g(e){e=e||window,u();for(var t=0,n=k.length;n>t;++t)k[t](e)}function p(e,t,n){this.name=e,this.dependencies=t,this.initialized=!1,this.supported=!1,this.initializer=n}function m(e,t,n){var r=new p(e,t,function(t){if(!t.initialized){t.initialized=!0;try{n(I,t),t.supported=!0}catch(r){var o="Module '"+e+"' failed to load: "+f(r);a(o),r.stack&&a(r.stack)}}});return x[e]=r,r}function R(){}function v(){}var C="object",N="function",E="undefined",S=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],y=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],w=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],T=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"],O=r(e),_=r(t),D=r(n),A=[].forEach?function(e,t){e.forEach(t)}:function(e,t){for(var n=0,r=e.length;r>n;++n)t(e[n],n)},x={},b=typeof window!=E&&typeof document!=E,P={isHostMethod:e,isHostObject:t,isHostProperty:n,areHostMethods:O,areHostObjects:_,areHostProperties:D,isTextRange:o,getBody:i,forEach:A},I={version:"1.3.0",initialized:!1,isBrowser:b,supported:!0,util:P,features:{},modules:x,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==E?!0:rangyAutoInitialize}};I.fail=c,I.warn=d;var B;({}).hasOwnProperty?(P.extend=B=function(e,t,n){var r,o;for(var i in t)t.hasOwnProperty(i)&&(r=e[i],o=t[i],n&&null!==r&&"object"==typeof r&&null!==o&&"object"==typeof o&&B(r,o,!0),e[i]=o);return t.hasOwnProperty("toString")&&(e.toString=t.toString),e},P.createOptions=function(e,t){var n={};return B(n,t),e&&B(n,e),n}):c("hasOwnProperty not supported"),b||c("Rangy can only run in a browser"),function(){var e;if(b){var t=document.createElement("div");t.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(t.childNodes,0)[0].nodeType&&(e=function(e){return n.call(e,0)})}catch(r){}}e||(e=function(e){for(var t=[],n=0,r=e.length;r>n;++n)t[n]=e[n];return t}),P.toArray=e}();var H;b&&(e(document,"addEventListener")?H=function(e,t,n){e.addEventListener(t,n,!1)}:e(document,"attachEvent")?H=function(e,t,n){e.attachEvent("on"+t,n)}:c("Document does not have required addEventListener or attachEvent method"),P.addListener=H);var M=[];P.deprecationNotice=l,P.createAliasForDeprecatedMethod=h,I.init=u,I.addInitListener=function(e){I.initialized?e(I):M.push(e)};var k=[];I.addShimListener=function(e){k.push(e)},b&&(I.shim=I.createMissingNativeApi=g,h(I,"createMissingNativeApi","shim")),p.prototype={init:function(){for(var e,t,n=this.dependencies||[],r=0,o=n.length;o>r;++r){if(t=n[r],e=x[t],!(e&&e instanceof p))throw new Error("required module '"+t+"' not found");if(e.init(),!e.supported)throw new Error("required module '"+t+"' not supported")}this.initializer(this)},fail:function(e){throw this.initialized=!0,this.supported=!1,new Error(e)},warn:function(e){I.warn("Module "+this.name+": "+e)},deprecationNotice:function(e,t){I.warn("DEPRECATED: "+e+" in module "+this.name+" is deprecated. Please use "+t+" instead")},createError:function(e){return new Error("Error in Rangy "+this.name+" module: "+e)}},I.createModule=function(e){var t,n;2==arguments.length?(t=arguments[1],n=[]):(t=arguments[2],n=arguments[1]);var r=m(e,n,t);I.initialized&&I.supported&&r.init()},I.createCoreModule=function(e,t,n){m(e,t,n)},I.RangePrototype=R,I.rangePrototype=new R,I.selectionPrototype=new v,I.createCoreModule("DomUtil",[],function(e,t){function n(e){var t;return typeof e.namespaceURI==b||null===(t=e.namespaceURI)||"http://www.w3.org/1999/xhtml"==t}function r(e){var t=e.parentNode;return 1==t.nodeType?t:null}function o(e){for(var t=0;e=e.previousSibling;)++t;return t}function i(e){switch(e.nodeType){case 7:case 10:return 0;case 3:case 8:return e.length;default:return e.childNodes.length}}function a(e,t){var n,r=[];for(n=e;n;n=n.parentNode)r.push(n);for(n=t;n;n=n.parentNode)if(M(r,n))return n;return null}function s(e,t,n){for(var r=n?t:t.parentNode;r;){if(r===e)return!0;r=r.parentNode}return!1}function c(e,t){return s(e,t,!0)}function d(e,t,n){for(var r,o=n?e:e.parentNode;o;){if(r=o.parentNode,r===t)return o;o=r}return null}function f(e){var t=e.nodeType;return 3==t||4==t||8==t}function u(e){if(!e)return!1;var t=e.nodeType;return 3==t||8==t}function l(e,t){var n=t.nextSibling,r=t.parentNode;return n?r.insertBefore(e,n):r.appendChild(e),e}function h(e,t,n){var r=e.cloneNode(!1);if(r.deleteData(0,t),e.deleteData(t,e.length-t),l(r,e),n)for(var i,a=0;i=n[a++];)i.node==e&&i.offset>t?(i.node=r,i.offset-=t):i.node==e.parentNode&&i.offset>o(e)&&++i.offset;return r}function g(e){if(9==e.nodeType)return e;if(typeof e.ownerDocument!=b)return e.ownerDocument;if(typeof e.document!=b)return e.document;if(e.parentNode)return g(e.parentNode);throw t.createError("getDocument: no document found for node")}function p(e){var n=g(e);if(typeof n.defaultView!=b)return n.defaultView;if(typeof n.parentWindow!=b)return n.parentWindow;throw t.createError("Cannot get a window object for node")}function m(e){if(typeof e.contentDocument!=b)return e.contentDocument;if(typeof e.contentWindow!=b)return e.contentWindow.document;throw t.createError("getIframeDocument: No Document object found for iframe element")}function R(e){if(typeof e.contentWindow!=b)return e.contentWindow;if(typeof e.contentDocument!=b)return e.contentDocument.defaultView;throw t.createError("getIframeWindow: No Window object found for iframe element")}function v(e){return e&&P.isHostMethod(e,"setTimeout")&&P.isHostObject(e,"document")}function C(e,t,n){var r;if(e?P.isHostProperty(e,"nodeType")?r=1==e.nodeType&&"iframe"==e.tagName.toLowerCase()?m(e):g(e):v(e)&&(r=e.document):r=document,!r)throw t.createError(n+"(): Parameter must be a Window object or DOM node");return r}function N(e){for(var t;t=e.parentNode;)e=t;return e}function E(e,n,r,i){var s,c,f,u,l;if(e==r)return n===i?0:i>n?-1:1;if(s=d(r,e,!0))return n<=o(s)?-1:1;if(s=d(e,r,!0))return o(s)<i?-1:1;if(c=a(e,r),!c)throw new Error("comparePoints error: nodes have no common ancestor");if(f=e===c?c:d(e,c,!0),u=r===c?c:d(r,c,!0),f===u)throw t.createError("comparePoints got to case 4 and childA and childB are the same!");for(l=c.firstChild;l;){if(l===f)return-1;if(l===u)return 1;l=l.nextSibling}}function S(e){var t;try{return t=e.parentNode,!1}catch(n){return!0}}function y(e){if(!e)return"[No node]";if(k&&S(e))return"[Broken node]";if(f(e))return'"'+e.data+'"';if(1==e.nodeType){var t=e.id?' id="'+e.id+'"':"";return"<"+e.nodeName+t+">[index:"+o(e)+",length:"+e.childNodes.length+"]["+(e.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return e.nodeName}function w(e){for(var t,n=g(e).createDocumentFragment();t=e.firstChild;)n.appendChild(t);return n}function T(e,t,n){var r=I(e),o=e.createElement("div");o.contentEditable=""+!!n,t&&(o.innerHTML=t);var i=r.firstChild;return i?r.insertBefore(o,i):r.appendChild(o),o}function O(e){return e.parentNode.removeChild(e)}function _(e){this.root=e,this._next=e}function D(e){return new _(e)}function A(e,t){this.node=e,this.offset=t}function x(e){this.code=this[e],this.codeName=e,this.message="DOMException: "+this.codeName}var b="undefined",P=e.util,I=P.getBody;P.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||t.fail("document missing a Node creation method"),P.isHostMethod(document,"getElementsByTagName")||t.fail("document missing getElementsByTagName method");var B=document.createElement("div");P.areHostMethods(B,["insertBefore","appendChild","cloneNode"]||!P.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"]))||t.fail("Incomplete Element implementation"),P.isHostProperty(B,"innerHTML")||t.fail("Element is missing innerHTML property");var H=document.createTextNode("test");P.areHostMethods(H,["splitText","deleteData","insertData","appendData","cloneNode"]||!P.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"])||!P.areHostProperties(H,["data"]))||t.fail("Incomplete Text Node implementation");var M=function(e,t){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1},k=!1;!function(){var t=document.createElement("b");t.innerHTML="1";var n=t.firstChild;t.innerHTML="<br />",k=S(n),e.features.crashyTextNodes=k}();var L;typeof window.getComputedStyle!=b?L=function(e,t){return p(e).getComputedStyle(e,null)[t]}:typeof document.documentElement.currentStyle!=b?L=function(e,t){return e.currentStyle?e.currentStyle[t]:""}:t.fail("No means of obtaining computed style properties found"),_.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var e,t,n=this._current=this._next;if(this._current)if(e=n.firstChild)this._next=e;else{for(t=null;n!==this.root&&!(t=n.nextSibling);)n=n.parentNode;this._next=t}return this._current},detach:function(){this._current=this._next=this.root=null}},A.prototype={equals:function(e){return!!e&&this.node===e.node&&this.offset==e.offset},inspect:function(){return"[DomPosition("+y(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},x.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},x.prototype.toString=function(){return this.message},e.dom={arrayContains:M,isHtmlNamespace:n,parentElement:r,getNodeIndex:o,getNodeLength:i,getCommonAncestor:a,isAncestorOf:s,isOrIsAncestorOf:c,getClosestAncestorIn:d,isCharacterDataNode:f,isTextOrCommentNode:u,insertAfter:l,splitDataNode:h,getDocument:g,getWindow:p,getIframeWindow:R,getIframeDocument:m,getBody:I,isWindow:v,getContentDocument:C,getRootContainer:N,comparePoints:E,isBrokenNode:S,inspectNode:y,getComputedStyleProperty:L,createTestElement:T,removeNode:O,fragmentFromNodeChildren:w,createIterator:D,DomPosition:A},e.DOMException=x}),I.createCoreModule("DomRange",["DomUtil"],function(e){function t(e,t){return 3!=e.nodeType&&(F(e,t.startContainer)||F(e,t.endContainer))}function n(e){return e.document||j(e.startContainer)}function r(e){return Q(e.startContainer)}function o(e){return new M(e.parentNode,W(e))}function i(e){return new M(e.parentNode,W(e)+1)}function a(e,t,n){var r=11==e.nodeType?e.firstChild:e;return L(t)?n==t.length?B.insertAfter(e,t):t.parentNode.insertBefore(e,0==n?t:U(t,n)):n>=t.childNodes.length?t.appendChild(e):t.insertBefore(e,t.childNodes[n]),r}function s(e,t,r){if(w(e),w(t),n(t)!=n(e))throw new k("WRONG_DOCUMENT_ERR");var o=z(e.startContainer,e.startOffset,t.endContainer,t.endOffset),i=z(e.endContainer,e.endOffset,t.startContainer,t.startOffset);return r?0>=o&&i>=0:0>o&&i>0}function c(e){for(var t,r,o,i=n(e.range).createDocumentFragment();r=e.next();){if(t=e.isPartiallySelectedSubtree(),r=r.cloneNode(!t),t&&(o=e.getSubtreeIterator(),r.appendChild(c(o)),o.detach()),10==r.nodeType)throw new k("HIERARCHY_REQUEST_ERR");i.appendChild(r)}return i}function d(e,t,n){var r,o;n=n||{stop:!1};for(var i,a;i=e.next();)if(e.isPartiallySelectedSubtree()){if(t(i)===!1)return void(n.stop=!0);if(a=e.getSubtreeIterator(),d(a,t,n),a.detach(),n.stop)return}else for(r=B.createIterator(i);o=r.next();)if(t(o)===!1)return void(n.stop=!0)}function f(e){for(var t;e.next();)e.isPartiallySelectedSubtree()?(t=e.getSubtreeIterator(),f(t),t.detach()):e.remove()}function u(e){for(var t,r,o=n(e.range).createDocumentFragment();t=e.next();){if(e.isPartiallySelectedSubtree()?(t=t.cloneNode(!1),r=e.getSubtreeIterator(),t.appendChild(u(r)),r.detach()):e.remove(),10==t.nodeType)throw new k("HIERARCHY_REQUEST_ERR");o.appendChild(t)}return o}function l(e,t,n){var r,o=!(!t||!t.length),i=!!n;o&&(r=new RegExp("^("+t.join("|")+")$"));var a=[];return d(new g(e,!1),function(t){if(!(o&&!r.test(t.nodeType)||i&&!n(t))){var s=e.startContainer;if(t!=s||!L(s)||e.startOffset!=s.length){var c=e.endContainer;t==c&&L(c)&&0==e.endOffset||a.push(t)}}}),a}function h(e){var t="undefined"==typeof e.getName?"Range":e.getName();return"["+t+"("+B.inspectNode(e.startContainer)+":"+e.startOffset+", "+B.inspectNode(e.endContainer)+":"+e.endOffset+")]"}function g(e,t){if(this.range=e,this.clonePartiallySelectedTextNodes=t,!e.collapsed){this.sc=e.startContainer,this.so=e.startOffset,this.ec=e.endContainer,this.eo=e.endOffset;var n=e.commonAncestorContainer;this.sc===this.ec&&L(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||L(this.sc)?V(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||L(this.ec)?V(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}function p(e){return function(t,n){for(var r,o=n?t:t.parentNode;o;){if(r=o.nodeType,Y(e,r))return o;o=o.parentNode}return null}}function m(e,t){if(rt(e,t))throw new k("INVALID_NODE_TYPE_ERR")}function R(e,t){if(!Y(t,e.nodeType))throw new k("INVALID_NODE_TYPE_ERR")}function v(e,t){if(0>t||t>(L(e)?e.length:e.childNodes.length))throw new k("INDEX_SIZE_ERR")}function C(e,t){if(tt(e,!0)!==tt(t,!0))throw new k("WRONG_DOCUMENT_ERR")}function N(e){if(nt(e,!0))throw new k("NO_MODIFICATION_ALLOWED_ERR")}function E(e,t){if(!e)throw new k(t)}function S(e,t){return t<=(L(e)?e.length:e.childNodes.length)}function y(e){return!!e.startContainer&&!!e.endContainer&&!(G&&(B.isBrokenNode(e.startContainer)||B.isBrokenNode(e.endContainer)))&&Q(e.startContainer)==Q(e.endContainer)&&S(e.startContainer,e.startOffset)&&S(e.endContainer,e.endOffset)}function w(e){if(!y(e))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+e.inspect()+")")}function T(e,t){w(e);var n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,a=n===o;L(o)&&i>0&&i<o.length&&U(o,i,t),L(n)&&r>0&&r<n.length&&(n=U(n,r,t),a?(i-=r,o=n):o==n.parentNode&&i>=W(n)&&i++,r=0),e.setStartAndEnd(n,r,o,i)}function O(e){w(e);var t=e.commonAncestorContainer.parentNode.cloneNode(!1);return t.appendChild(e.cloneContents()),t.innerHTML}function _(e){e.START_TO_START=dt,e.START_TO_END=ft,e.END_TO_END=ut,e.END_TO_START=lt,e.NODE_BEFORE=ht,e.NODE_AFTER=gt,e.NODE_BEFORE_AND_AFTER=pt,e.NODE_INSIDE=mt}function D(e){_(e),_(e.prototype)}function A(e,t){return function(){w(this);var n,r,o=this.startContainer,a=this.startOffset,s=this.commonAncestorContainer,c=new g(this,!0);o!==s&&(n=V(o,s,!0),r=i(n),o=r.node,a=r.offset),d(c,N),c.reset();var f=e(c);return c.detach(),t(this,o,a,o,a),f}}function x(n,r){function a(e,t){return function(n){R(n,Z),R(Q(n),$);var r=(e?o:i)(n);(t?s:c)(this,r.node,r.offset)}}function s(e,t,n){var o=e.endContainer,i=e.endOffset;(t!==e.startContainer||n!==e.startOffset)&&((Q(t)!=Q(o)||1==z(t,n,o,i))&&(o=t,i=n),r(e,t,n,o,i))}function c(e,t,n){var o=e.startContainer,i=e.startOffset;(t!==e.endContainer||n!==e.endOffset)&&((Q(t)!=Q(o)||-1==z(t,n,o,i))&&(o=t,i=n),r(e,o,i,t,n))}var d=function(){};d.prototype=e.rangePrototype,n.prototype=new d,H.extend(n.prototype,{setStart:function(e,t){m(e,!0),v(e,t),s(this,e,t)},setEnd:function(e,t){m(e,!0),v(e,t),c(this,e,t)},setStartAndEnd:function(){var e=arguments,t=e[0],n=e[1],o=t,i=n;switch(e.length){case 3:i=e[2];break;case 4:o=e[2],i=e[3]}r(this,t,n,o,i)},setBoundary:function(e,t,n){this["set"+(n?"Start":"End")](e,t)},setStartBefore:a(!0,!0),setStartAfter:a(!1,!0),setEndBefore:a(!0,!1),setEndAfter:a(!1,!1),collapse:function(e){w(this),e?r(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):r(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(e){m(e,!0),r(this,e,0,e,q(e))},selectNode:function(e){m(e,!1),R(e,Z);var t=o(e),n=i(e);r(this,t.node,t.offset,n.node,n.offset)},extractContents:A(u,r),deleteContents:A(f,r),canSurroundContents:function(){w(this),N(this.startContainer),N(this.endContainer);var e=new g(this,!0),n=e._first&&t(e._first,this)||e._last&&t(e._last,this);return e.detach(),!n},splitBoundaries:function(){T(this)},splitBoundariesPreservingPositions:function(e){T(this,e)},normalizeBoundaries:function(){w(this);var e,t=this.startContainer,n=this.startOffset,o=this.endContainer,i=this.endOffset,a=function(e){var t=e.nextSibling;t&&t.nodeType==e.nodeType&&(o=e,i=e.length,e.appendData(t.data),X(t))},s=function(e){var r=e.previousSibling;if(r&&r.nodeType==e.nodeType){t=e;var a=e.length;if(n=r.length,e.insertData(0,r.data),X(r),t==o)i+=n,o=t;else if(o==e.parentNode){var s=W(e);i==s?(o=e,i=a):i>s&&i--}}},c=!0;if(L(o))i==o.length?a(o):0==i&&(e=o.previousSibling,e&&e.nodeType==o.nodeType&&(i=e.length,t==o&&(c=!1),e.appendData(o.data),X(o),o=e));else{if(i>0){var d=o.childNodes[i-1];d&&L(d)&&a(d)}c=!this.collapsed}if(c){if(L(t))0==n?s(t):n==t.length&&(e=t.nextSibling,e&&e.nodeType==t.nodeType&&(o==e&&(o=t,i+=t.length),t.appendData(e.data),X(e)));else if(n<t.childNodes.length){var f=t.childNodes[n];f&&L(f)&&s(f)}}else t=o,n=i;r(this,t,n,o,i)},collapseToPoint:function(e,t){m(e,!0),v(e,t),this.setStartAndEnd(e,t)}}),D(n)}function b(e){e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset,e.commonAncestorContainer=e.collapsed?e.startContainer:B.getCommonAncestor(e.startContainer,e.endContainer)}function P(e,t,n,r,o){e.startContainer=t,e.startOffset=n,e.endContainer=r,e.endOffset=o,e.document=B.getDocument(t),b(e)}function I(e){this.startContainer=e,this.startOffset=0,this.endContainer=e,this.endOffset=0,this.document=e,b(this)}var B=e.dom,H=e.util,M=B.DomPosition,k=e.DOMException,L=B.isCharacterDataNode,W=B.getNodeIndex,F=B.isOrIsAncestorOf,j=B.getDocument,z=B.comparePoints,U=B.splitDataNode,V=B.getClosestAncestorIn,q=B.getNodeLength,Y=B.arrayContains,Q=B.getRootContainer,G=e.features.crashyTextNodes,X=B.removeNode;g.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var e=this._current=this._next;return e&&(this._next=e!==this._last?e.nextSibling:null,L(e)&&this.clonePartiallySelectedTextNodes&&(e===this.ec&&(e=e.cloneNode(!0)).deleteData(this.eo,e.length-this.eo),this._current===this.sc&&(e=e.cloneNode(!0)).deleteData(0,this.so))),e},remove:function(){var e,t,n=this._current;!L(n)||n!==this.sc&&n!==this.ec?n.parentNode&&X(n):(e=n===this.sc?this.so:0,t=n===this.ec?this.eo:n.length,e!=t&&n.deleteData(e,t-e))},isPartiallySelectedSubtree:function(){var e=this._current;return t(e,this.range)},getSubtreeIterator:function(){var e;if(this.isSingleCharacterDataNode)e=this.range.cloneRange(),e.collapse(!1);else{e=new I(n(this.range));var t=this._current,r=t,o=0,i=t,a=q(t);F(t,this.sc)&&(r=this.sc,o=this.so),F(t,this.ec)&&(i=this.ec,a=this.eo),P(e,r,o,i,a)}return new g(e,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var Z=[1,3,4,5,7,8,10],$=[2,9,11],J=[5,6,10,12],K=[1,3,4,5,7,8,10,11],et=[1,3,4,5,7,8],tt=p([9,11]),nt=p(J),rt=p([6,10,12]),ot=document.createElement("style"),it=!1;try{ot.innerHTML="<b>x</b>",it=3==ot.firstChild.nodeType}catch(at){}e.features.htmlParsingConforms=it;var st=it?function(e){var t=this.startContainer,n=j(t);if(!t)throw new k("INVALID_STATE_ERR");var r=null;return 1==t.nodeType?r=t:L(t)&&(r=B.parentElement(t)),r=null===r||"HTML"==r.nodeName&&B.isHtmlNamespace(j(r).documentElement)&&B.isHtmlNamespace(r)?n.createElement("body"):r.cloneNode(!1),r.innerHTML=e,B.fragmentFromNodeChildren(r)}:function(e){var t=n(this),r=t.createElement("body");return r.innerHTML=e,B.fragmentFromNodeChildren(r)},ct=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],dt=0,ft=1,ut=2,lt=3,ht=0,gt=1,pt=2,mt=3;H.extend(e.rangePrototype,{compareBoundaryPoints:function(e,t){w(this),C(this.startContainer,t.startContainer);var n,r,o,i,a=e==lt||e==dt?"start":"end",s=e==ft||e==dt?"start":"end";return n=this[a+"Container"],r=this[a+"Offset"],o=t[s+"Container"],i=t[s+"Offset"],z(n,r,o,i)},insertNode:function(e){if(w(this),R(e,K),N(this.startContainer),F(e,this.startContainer))throw new k("HIERARCHY_REQUEST_ERR");var t=a(e,this.startContainer,this.startOffset);this.setStartBefore(t)},cloneContents:function(){w(this);var e,t;if(this.collapsed)return n(this).createDocumentFragment();if(this.startContainer===this.endContainer&&L(this.startContainer))return e=this.startContainer.cloneNode(!0),e.data=e.data.slice(this.startOffset,this.endOffset),t=n(this).createDocumentFragment(),t.appendChild(e),t;var r=new g(this,!0);return e=c(r),r.detach(),e},canSurroundContents:function(){w(this),N(this.startContainer),N(this.endContainer);var e=new g(this,!0),n=e._first&&t(e._first,this)||e._last&&t(e._last,this);return e.detach(),!n},surroundContents:function(e){if(R(e,et),!this.canSurroundContents())throw new k("INVALID_STATE_ERR");var t=this.extractContents();if(e.hasChildNodes())for(;e.lastChild;)e.removeChild(e.lastChild);a(e,this.startContainer,this.startOffset),e.appendChild(t),this.selectNode(e)},cloneRange:function(){w(this);for(var e,t=new I(n(this)),r=ct.length;r--;)e=ct[r],t[e]=this[e];return t},toString:function(){w(this);var e=this.startContainer;if(e===this.endContainer&&L(e))return 3==e.nodeType||4==e.nodeType?e.data.slice(this.startOffset,this.endOffset):"";var t=[],n=new g(this,!0);return d(n,function(e){(3==e.nodeType||4==e.nodeType)&&t.push(e.data)}),n.detach(),t.join("")},compareNode:function(e){w(this);var t=e.parentNode,n=W(e);if(!t)throw new k("NOT_FOUND_ERR");var r=this.comparePoint(t,n),o=this.comparePoint(t,n+1);return 0>r?o>0?pt:ht:o>0?gt:mt},comparePoint:function(e,t){return w(this),E(e,"HIERARCHY_REQUEST_ERR"),C(e,this.startContainer),z(e,t,this.startContainer,this.startOffset)<0?-1:z(e,t,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:st,toHtml:function(){return O(this)},intersectsNode:function(e,t){if(w(this),Q(e)!=r(this))return!1;var n=e.parentNode,o=W(e);if(!n)return!0;var i=z(n,o,this.endContainer,this.endOffset),a=z(n,o+1,this.startContainer,this.startOffset);return t?0>=i&&a>=0:0>i&&a>0},isPointInRange:function(e,t){return w(this),E(e,"HIERARCHY_REQUEST_ERR"),C(e,this.startContainer),z(e,t,this.startContainer,this.startOffset)>=0&&z(e,t,this.endContainer,this.endOffset)<=0},intersectsRange:function(e){return s(this,e,!1)},intersectsOrTouchesRange:function(e){return s(this,e,!0)},intersection:function(e){if(this.intersectsRange(e)){var t=z(this.startContainer,this.startOffset,e.startContainer,e.startOffset),n=z(this.endContainer,this.endOffset,e.endContainer,e.endOffset),r=this.cloneRange();return-1==t&&r.setStart(e.startContainer,e.startOffset),1==n&&r.setEnd(e.endContainer,e.endOffset),r}return null},union:function(e){if(this.intersectsOrTouchesRange(e)){var t=this.cloneRange();return-1==z(e.startContainer,e.startOffset,this.startContainer,this.startOffset)&&t.setStart(e.startContainer,e.startOffset),1==z(e.endContainer,e.endOffset,this.endContainer,this.endOffset)&&t.setEnd(e.endContainer,e.endOffset),t}throw new k("Ranges do not intersect")},containsNode:function(e,t){return t?this.intersectsNode(e,!1):this.compareNode(e)==mt},containsNodeContents:function(e){return this.comparePoint(e,0)>=0&&this.comparePoint(e,q(e))<=0},containsRange:function(e){var t=this.intersection(e);return null!==t&&e.equals(t)},containsNodeText:function(e){var t=this.cloneRange();t.selectNode(e);var n=t.getNodes([3]);if(n.length>0){t.setStart(n[0],0);var r=n.pop();return t.setEnd(r,r.length),this.containsRange(t)}return this.containsNodeContents(e)},getNodes:function(e,t){return w(this),l(this,e,t)},getDocument:function(){return n(this)},collapseBefore:function(e){this.setEndBefore(e),this.collapse(!1)},collapseAfter:function(e){this.setStartAfter(e),this.collapse(!0)},getBookmark:function(t){var r=n(this),o=e.createRange(r);t=t||B.getBody(r),o.selectNodeContents(t);var i=this.intersection(o),a=0,s=0;return i&&(o.setEnd(i.startContainer,i.startOffset),a=o.toString().length,s=a+i.toString().length),{start:a,end:s,containerNode:t}},moveToBookmark:function(e){var t=e.containerNode,n=0;this.setStart(t,0),this.collapse(!0);for(var r,o,i,a,s=[t],c=!1,d=!1;!d&&(r=s.pop());)if(3==r.nodeType)o=n+r.length,!c&&e.start>=n&&e.start<=o&&(this.setStart(r,e.start-n),c=!0),c&&e.end>=n&&e.end<=o&&(this.setEnd(r,e.end-n),d=!0),n=o;else for(a=r.childNodes,i=a.length;i--;)s.push(a[i])},getName:function(){return"DomRange"},equals:function(e){return I.rangesEqual(this,e)},isValid:function(){return y(this)},inspect:function(){return h(this)},detach:function(){}}),x(I,P),H.extend(I,{rangeProperties:ct,RangeIterator:g,copyComparisonConstants:D,createPrototypeRange:x,inspect:h,toHtml:O,getRangeDocument:n,rangesEqual:function(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}}),e.DomRange=I}),I.createCoreModule("WrappedRange",["DomRange"],function(e,t){var n,r,o=e.dom,i=e.util,a=o.DomPosition,s=e.DomRange,c=o.getBody,d=o.getContentDocument,f=o.isCharacterDataNode;if(e.features.implementsDomRange&&!function(){function r(e){for(var t,n=l.length;n--;)t=l[n],e[t]=e.nativeRange[t];e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset}function a(e,t,n,r,o){var i=e.startContainer!==t||e.startOffset!=n,a=e.endContainer!==r||e.endOffset!=o,s=!e.equals(e.nativeRange);(i||a||s)&&(e.setEnd(r,o),e.setStart(t,n))}var f,u,l=s.rangeProperties;n=function(e){if(!e)throw t.createError("WrappedRange: Range must be specified");this.nativeRange=e,r(this)},s.createPrototypeRange(n,a),f=n.prototype,f.selectNode=function(e){this.nativeRange.selectNode(e),r(this)},f.cloneContents=function(){return this.nativeRange.cloneContents()},f.surroundContents=function(e){this.nativeRange.surroundContents(e),r(this)},f.collapse=function(e){this.nativeRange.collapse(e),r(this)},f.cloneRange=function(){return new n(this.nativeRange.cloneRange())},f.refresh=function(){r(this)},f.toString=function(){return this.nativeRange.toString()};var h=document.createTextNode("test");c(document).appendChild(h);var g=document.createRange();g.setStart(h,0),g.setEnd(h,0);try{g.setStart(h,1),f.setStart=function(e,t){this.nativeRange.setStart(e,t),r(this)},f.setEnd=function(e,t){this.nativeRange.setEnd(e,t),r(this)},u=function(e){return function(t){this.nativeRange[e](t),r(this)}}}catch(p){f.setStart=function(e,t){try{this.nativeRange.setStart(e,t)}catch(n){this.nativeRange.setEnd(e,t),this.nativeRange.setStart(e,t)}r(this)},f.setEnd=function(e,t){try{this.nativeRange.setEnd(e,t)}catch(n){this.nativeRange.setStart(e,t),this.nativeRange.setEnd(e,t)}r(this)},u=function(e,t){return function(n){try{this.nativeRange[e](n)}catch(o){this.nativeRange[t](n),this.nativeRange[e](n)}r(this)}}}f.setStartBefore=u("setStartBefore","setEndBefore"),f.setStartAfter=u("setStartAfter","setEndAfter"),f.setEndBefore=u("setEndBefore","setStartBefore"),f.setEndAfter=u("setEndAfter","setStartAfter"),f.selectNodeContents=function(e){this.setStartAndEnd(e,0,o.getNodeLength(e))},g.selectNodeContents(h),g.setEnd(h,3);var m=document.createRange();m.selectNodeContents(h),m.setEnd(h,4),m.setStart(h,2),f.compareBoundaryPoints=-1==g.compareBoundaryPoints(g.START_TO_END,m)&&1==g.compareBoundaryPoints(g.END_TO_START,m)?function(e,t){return t=t.nativeRange||t,e==t.START_TO_END?e=t.END_TO_START:e==t.END_TO_START&&(e=t.START_TO_END),this.nativeRange.compareBoundaryPoints(e,t)}:function(e,t){return this.nativeRange.compareBoundaryPoints(e,t.nativeRange||t)};var R=document.createElement("div");R.innerHTML="123";var v=R.firstChild,C=c(document);C.appendChild(R),g.setStart(v,1),g.setEnd(v,2),g.deleteContents(),"13"==v.data&&(f.deleteContents=function(){this.nativeRange.deleteContents(),r(this)},f.extractContents=function(){var e=this.nativeRange.extractContents();return r(this),e}),C.removeChild(R),C=null,i.isHostMethod(g,"createContextualFragment")&&(f.createContextualFragment=function(e){return this.nativeRange.createContextualFragment(e)}),c(document).removeChild(h),f.getName=function(){return"WrappedRange"},e.WrappedRange=n,e.createNativeRange=function(e){return e=d(e,t,"createNativeRange"),e.createRange()}}(),e.features.implementsTextRange){var u=function(e){var t=e.parentElement(),n=e.duplicate();n.collapse(!0);var r=n.parentElement();n=e.duplicate(),n.collapse(!1);var i=n.parentElement(),a=r==i?r:o.getCommonAncestor(r,i);return a==t?a:o.getCommonAncestor(t,a)},l=function(e){return 0==e.compareEndPoints("StartToEnd",e)},h=function(e,t,n,r,i){var s=e.duplicate();s.collapse(n);var c=s.parentElement();if(o.isOrIsAncestorOf(t,c)||(c=t),!c.canHaveHTML){var d=new a(c.parentNode,o.getNodeIndex(c));return{boundaryPosition:d,nodeInfo:{nodeIndex:d.offset,containerElement:d.node}}}var u=o.getDocument(c).createElement("span");u.parentNode&&o.removeNode(u);for(var l,h,g,p,m,R=n?"StartToStart":"StartToEnd",v=i&&i.containerElement==c?i.nodeIndex:0,C=c.childNodes.length,N=C,E=N;;){if(E==C?c.appendChild(u):c.insertBefore(u,c.childNodes[E]),s.moveToElementText(u),l=s.compareEndPoints(R,e),0==l||v==N)break;if(-1==l){if(N==v+1)break;v=E}else N=N==v+1?v:E;E=Math.floor((v+N)/2),c.removeChild(u)}if(m=u.nextSibling,-1==l&&m&&f(m)){s.setEndPoint(n?"EndToStart":"EndToEnd",e);var S;if(/[\r\n]/.test(m.data)){var y=s.duplicate(),w=y.text.replace(/\r\n/g,"\r").length;for(S=y.moveStart("character",w);-1==(l=y.compareEndPoints("StartToEnd",y));)S++,y.moveStart("character",1)}else S=s.text.length;p=new a(m,S)}else h=(r||!n)&&u.previousSibling,g=(r||n)&&u.nextSibling,p=g&&f(g)?new a(g,0):h&&f(h)?new a(h,h.data.length):new a(c,o.getNodeIndex(u));return o.removeNode(u),{boundaryPosition:p,nodeInfo:{nodeIndex:E,containerElement:c}}},g=function(e,t){var n,r,i,a,s=e.offset,d=o.getDocument(e.node),u=c(d).createTextRange(),l=f(e.node);return l?(n=e.node,r=n.parentNode):(a=e.node.childNodes,n=s<a.length?a[s]:null,r=e.node),i=d.createElement("span"),i.innerHTML="&#feff;",n?r.insertBefore(i,n):r.appendChild(i),u.moveToElementText(i),u.collapse(!t),r.removeChild(i),l&&u[t?"moveStart":"moveEnd"]("character",s),u};r=function(e){this.textRange=e,this.refresh()},r.prototype=new s(document),r.prototype.refresh=function(){var e,t,n,r=u(this.textRange);
|
11 |
-
l(this.textRange)?t=e=h(this.textRange,r,!0,!0).boundaryPosition:(n=h(this.textRange,r,!0,!1),e=n.boundaryPosition,t=h(this.textRange,r,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(e.node,e.offset),this.setEnd(t.node,t.offset)},r.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(r);var p=function(e){if(e.collapsed)return g(new a(e.startContainer,e.startOffset),!0);var t=g(new a(e.startContainer,e.startOffset),!0),n=g(new a(e.endContainer,e.endOffset),!1),r=c(s.getRangeDocument(e)).createTextRange();return r.setEndPoint("StartToStart",t),r.setEndPoint("EndToEnd",n),r};if(r.rangeToTextRange=p,r.prototype.toTextRange=function(){return p(this)},e.WrappedTextRange=r,!e.features.implementsDomRange||e.config.preferTextRange){var m=function(e){return e("return this;")()}(Function);"undefined"==typeof m.Range&&(m.Range=r),e.createNativeRange=function(e){return e=d(e,t,"createNativeRange"),c(e).createTextRange()},e.WrappedRange=r}}e.createRange=function(n){return n=d(n,t,"createRange"),new e.WrappedRange(e.createNativeRange(n))},e.createRangyRange=function(e){return e=d(e,t,"createRangyRange"),new s(e)},i.createAliasForDeprecatedMethod(e,"createIframeRange","createRange"),i.createAliasForDeprecatedMethod(e,"createIframeRangyRange","createRangyRange"),e.addShimListener(function(t){var n=t.document;"undefined"==typeof n.createRange&&(n.createRange=function(){return e.createRange(n)}),n=t=null})}),I.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(e,t){function n(e){return"string"==typeof e?/^backward(s)?$/i.test(e):!!e}function r(e,n){if(e){if(D.isWindow(e))return e;if(e instanceof R)return e.win;var r=D.getContentDocument(e,t,n);return D.getWindow(r)}return window}function o(e){return r(e,"getWinSelection").getSelection()}function i(e){return r(e,"getDocSelection").document.selection}function a(e){var t=!1;return e.anchorNode&&(t=1==D.comparePoints(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)),t}function s(e,t,n){var r=n?"end":"start",o=n?"start":"end";e.anchorNode=t[r+"Container"],e.anchorOffset=t[r+"Offset"],e.focusNode=t[o+"Container"],e.focusOffset=t[o+"Offset"]}function c(e){var t=e.nativeSelection;e.anchorNode=t.anchorNode,e.anchorOffset=t.anchorOffset,e.focusNode=t.focusNode,e.focusOffset=t.focusOffset}function d(e){e.anchorNode=e.focusNode=null,e.anchorOffset=e.focusOffset=0,e.rangeCount=0,e.isCollapsed=!0,e._ranges.length=0}function f(t){var n;return t instanceof b?(n=e.createNativeRange(t.getDocument()),n.setEnd(t.endContainer,t.endOffset),n.setStart(t.startContainer,t.startOffset)):t instanceof P?n=t.nativeRange:H.implementsDomRange&&t instanceof D.getWindow(t.startContainer).Range&&(n=t),n}function u(e){if(!e.length||1!=e[0].nodeType)return!1;for(var t=1,n=e.length;n>t;++t)if(!D.isAncestorOf(e[0],e[t]))return!1;return!0}function l(e){var n=e.getNodes();if(!u(n))throw t.createError("getSingleElementFromRange: range "+e.inspect()+" did not consist of a single element");return n[0]}function h(e){return!!e&&"undefined"!=typeof e.text}function g(e,t){var n=new P(t);e._ranges=[n],s(e,n,!1),e.rangeCount=1,e.isCollapsed=n.collapsed}function p(t){if(t._ranges.length=0,"None"==t.docSelection.type)d(t);else{var n=t.docSelection.createRange();if(h(n))g(t,n);else{t.rangeCount=n.length;for(var r,o=k(n.item(0)),i=0;i<t.rangeCount;++i)r=e.createRange(o),r.selectNode(n.item(i)),t._ranges.push(r);t.isCollapsed=1==t.rangeCount&&t._ranges[0].collapsed,s(t,t._ranges[t.rangeCount-1],!1)}}}function m(e,n){for(var r=e.docSelection.createRange(),o=l(n),i=k(r.item(0)),a=L(i).createControlRange(),s=0,c=r.length;c>s;++s)a.add(r.item(s));try{a.add(o)}catch(d){throw t.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),p(e)}function R(e,t,n){this.nativeSelection=e,this.docSelection=t,this._ranges=[],this.win=n,this.refresh()}function v(e){e.win=e.anchorNode=e.focusNode=e._ranges=null,e.rangeCount=e.anchorOffset=e.focusOffset=0,e.detached=!0}function C(e,t){for(var n,r,o=tt.length;o--;)if(n=tt[o],r=n.selection,"deleteAll"==t)v(r);else if(n.win==e)return"delete"==t?(tt.splice(o,1),!0):r;return"deleteAll"==t&&(tt.length=0),null}function N(e,n){for(var r,o=k(n[0].startContainer),i=L(o).createControlRange(),a=0,s=n.length;s>a;++a){r=l(n[a]);try{i.add(r)}catch(c){throw t.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),p(e)}function E(e,t){if(e.win.document!=k(t))throw new I("WRONG_DOCUMENT_ERR")}function S(t){return function(n,r){var o;this.rangeCount?(o=this.getRangeAt(0),o["set"+(t?"Start":"End")](n,r)):(o=e.createRange(this.win.document),o.setStartAndEnd(n,r)),this.setSingleRange(o,this.isBackward())}}function y(e){var t=[],n=new B(e.anchorNode,e.anchorOffset),r=new B(e.focusNode,e.focusOffset),o="function"==typeof e.getName?e.getName():"Selection";if("undefined"!=typeof e.rangeCount)for(var i=0,a=e.rangeCount;a>i;++i)t[i]=b.inspect(e.getRangeAt(i));return"["+o+"(Ranges: "+t.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}e.config.checkSelectionRanges=!0;var w,T,O="boolean",_="number",D=e.dom,A=e.util,x=A.isHostMethod,b=e.DomRange,P=e.WrappedRange,I=e.DOMException,B=D.DomPosition,H=e.features,M="Control",k=D.getDocument,L=D.getBody,W=b.rangesEqual,F=x(window,"getSelection"),j=A.isHostObject(document,"selection");H.implementsWinGetSelection=F,H.implementsDocSelection=j;var z=j&&(!F||e.config.preferTextRange);if(z)w=i,e.isSelectionValid=function(e){var t=r(e,"isSelectionValid").document,n=t.selection;return"None"!=n.type||k(n.createRange().parentElement())==t};else{if(!F)return t.fail("Neither document.selection or window.getSelection() detected."),!1;w=o,e.isSelectionValid=function(){return!0}}e.getNativeSelection=w;var U=w();if(!U)return t.fail("Native selection was null (possibly issue 138?)"),!1;var V=e.createNativeRange(document),q=L(document),Y=A.areHostProperties(U,["anchorNode","focusNode","anchorOffset","focusOffset"]);H.selectionHasAnchorAndFocus=Y;var Q=x(U,"extend");H.selectionHasExtend=Q;var G=typeof U.rangeCount==_;H.selectionHasRangeCount=G;var X=!1,Z=!0,$=Q?function(t,n){var r=b.getRangeDocument(n),o=e.createRange(r);o.collapseToPoint(n.endContainer,n.endOffset),t.addRange(f(o)),t.extend(n.startContainer,n.startOffset)}:null;A.areHostMethods(U,["addRange","getRangeAt","removeAllRanges"])&&typeof U.rangeCount==_&&H.implementsDomRange&&!function(){var t=window.getSelection();if(t){for(var n=t.rangeCount,r=n>1,o=[],i=a(t),s=0;n>s;++s)o[s]=t.getRangeAt(s);var c=D.createTestElement(document,"",!1),d=c.appendChild(document.createTextNode(" ")),f=document.createRange();if(f.setStart(d,1),f.collapse(!0),t.removeAllRanges(),t.addRange(f),Z=1==t.rangeCount,t.removeAllRanges(),!r){var u=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(u&&parseInt(u[1])>=36)X=!1;else{var l=f.cloneRange();f.setStart(d,0),l.setEnd(d,3),l.setStart(d,2),t.addRange(f),t.addRange(l),X=2==t.rangeCount}}for(D.removeNode(c),t.removeAllRanges(),s=0;n>s;++s)0==s&&i?$?$(t,o[s]):(e.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),t.addRange(o[s])):t.addRange(o[s])}}(),H.selectionSupportsMultipleRanges=X,H.collapsedNonEditableSelectionsSupported=Z;var J,K=!1;q&&x(q,"createControlRange")&&(J=q.createControlRange(),A.areHostProperties(J,["item","add"])&&(K=!0)),H.implementsControlRange=K,T=Y?function(e){return e.anchorNode===e.focusNode&&e.anchorOffset===e.focusOffset}:function(e){return e.rangeCount?e.getRangeAt(e.rangeCount-1).collapsed:!1};var et;x(U,"getRangeAt")?et=function(e,t){try{return e.getRangeAt(t)}catch(n){return null}}:Y&&(et=function(t){var n=k(t.anchorNode),r=e.createRange(n);return r.setStartAndEnd(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),r.collapsed!==this.isCollapsed&&r.setStartAndEnd(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset),r}),R.prototype=e.selectionPrototype;var tt=[],nt=function(e){if(e&&e instanceof R)return e.refresh(),e;e=r(e,"getNativeSelection");var t=C(e),n=w(e),o=j?i(e):null;return t?(t.nativeSelection=n,t.docSelection=o,t.refresh()):(t=new R(n,o,e),tt.push({win:e,selection:t})),t};e.getSelection=nt,A.createAliasForDeprecatedMethod(e,"getIframeSelection","getSelection");var rt=R.prototype;if(!z&&Y&&A.areHostMethods(U,["removeAllRanges","addRange"])){rt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),d(this)};var ot=function(e,t){$(e.nativeSelection,t),e.refresh()};rt.addRange=G?function(t,r){if(K&&j&&this.docSelection.type==M)m(this,t);else if(n(r)&&Q)ot(this,t);else{var o;X?o=this.rangeCount:(this.removeAllRanges(),o=0);var i=f(t).cloneRange();try{this.nativeSelection.addRange(i)}catch(a){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==o+1){if(e.config.checkSelectionRanges){var c=et(this.nativeSelection,this.rangeCount-1);c&&!W(c,t)&&(t=new P(c))}this._ranges[this.rangeCount-1]=t,s(this,t,st(this.nativeSelection)),this.isCollapsed=T(this)}else this.refresh()}}:function(e,t){n(t)&&Q?ot(this,e):(this.nativeSelection.addRange(f(e)),this.refresh())},rt.setRanges=function(e){if(K&&j&&e.length>1)N(this,e);else{this.removeAllRanges();for(var t=0,n=e.length;n>t;++t)this.addRange(e[t])}}}else{if(!(x(U,"empty")&&x(V,"select")&&K&&z))return t.fail("No means of selecting a Range or TextRange was found"),!1;rt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var e;if(this.anchorNode)e=k(this.anchorNode);else if(this.docSelection.type==M){var t=this.docSelection.createRange();t.length&&(e=k(t.item(0)))}if(e){var n=L(e).createTextRange();n.select(),this.docSelection.empty()}}}catch(r){}d(this)},rt.addRange=function(t){this.docSelection.type==M?m(this,t):(e.WrappedTextRange.rangeToTextRange(t).select(),this._ranges[0]=t,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,s(this,t,!1))},rt.setRanges=function(e){this.removeAllRanges();var t=e.length;t>1?N(this,e):t&&this.addRange(e[0])}}rt.getRangeAt=function(e){if(0>e||e>=this.rangeCount)throw new I("INDEX_SIZE_ERR");return this._ranges[e].cloneRange()};var it;if(z)it=function(t){var n;e.isSelectionValid(t.win)?n=t.docSelection.createRange():(n=L(t.win.document).createTextRange(),n.collapse(!0)),t.docSelection.type==M?p(t):h(n)?g(t,n):d(t)};else if(x(U,"getRangeAt")&&typeof U.rangeCount==_)it=function(t){if(K&&j&&t.docSelection.type==M)p(t);else if(t._ranges.length=t.rangeCount=t.nativeSelection.rangeCount,t.rangeCount){for(var n=0,r=t.rangeCount;r>n;++n)t._ranges[n]=new e.WrappedRange(t.nativeSelection.getRangeAt(n));s(t,t._ranges[t.rangeCount-1],st(t.nativeSelection)),t.isCollapsed=T(t)}else d(t)};else{if(!Y||typeof U.isCollapsed!=O||typeof V.collapsed!=O||!H.implementsDomRange)return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;it=function(e){var t,n=e.nativeSelection;n.anchorNode?(t=et(n,0),e._ranges=[t],e.rangeCount=1,c(e),e.isCollapsed=T(e)):d(e)}}rt.refresh=function(e){var t=e?this._ranges.slice(0):null,n=this.anchorNode,r=this.anchorOffset;if(it(this),e){var o=t.length;if(o!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=r)return!0;for(;o--;)if(!W(t[o],this._ranges[o]))return!0;return!1}};var at=function(e,t){var n=e.getAllRanges();e.removeAllRanges();for(var r=0,o=n.length;o>r;++r)W(t,n[r])||e.addRange(n[r]);e.rangeCount||d(e)};rt.removeRange=K&&j?function(e){if(this.docSelection.type==M){for(var t,n=this.docSelection.createRange(),r=l(e),o=k(n.item(0)),i=L(o).createControlRange(),a=!1,s=0,c=n.length;c>s;++s)t=n.item(s),t!==r||a?i.add(n.item(s)):a=!0;i.select(),p(this)}else at(this,e)}:function(e){at(this,e)};var st;!z&&Y&&H.implementsDomRange?(st=a,rt.isBackward=function(){return st(this)}):st=rt.isBackward=function(){return!1},rt.isBackwards=rt.isBackward,rt.toString=function(){for(var e=[],t=0,n=this.rangeCount;n>t;++t)e[t]=""+this._ranges[t];return e.join("")},rt.collapse=function(t,n){E(this,t);var r=e.createRange(t);r.collapseToPoint(t,n),this.setSingleRange(r),this.isCollapsed=!0},rt.collapseToStart=function(){if(!this.rangeCount)throw new I("INVALID_STATE_ERR");var e=this._ranges[0];this.collapse(e.startContainer,e.startOffset)},rt.collapseToEnd=function(){if(!this.rangeCount)throw new I("INVALID_STATE_ERR");var e=this._ranges[this.rangeCount-1];this.collapse(e.endContainer,e.endOffset)},rt.selectAllChildren=function(t){E(this,t);var n=e.createRange(t);n.selectNodeContents(t),this.setSingleRange(n)},rt.deleteFromDocument=function(){if(K&&j&&this.docSelection.type==M){for(var e,t=this.docSelection.createRange();t.length;)e=t.item(0),t.remove(e),D.removeNode(e);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var r=0,o=n.length;o>r;++r)n[r].deleteContents();this.addRange(n[o-1])}}},rt.eachRange=function(e,t){for(var n=0,r=this._ranges.length;r>n;++n)if(e(this.getRangeAt(n)))return t},rt.getAllRanges=function(){var e=[];return this.eachRange(function(t){e.push(t)}),e},rt.setSingleRange=function(e,t){this.removeAllRanges(),this.addRange(e,t)},rt.callMethodOnEachRange=function(e,t){var n=[];return this.eachRange(function(r){n.push(r[e].apply(r,t||[]))}),n},rt.setStart=S(!0),rt.setEnd=S(!1),e.rangePrototype.select=function(e){nt(this.getDocument()).setSingleRange(this,e)},rt.changeEachRange=function(e){var t=[],n=this.isBackward();this.eachRange(function(n){e(n),t.push(n)}),this.removeAllRanges(),n&&1==t.length?this.addRange(t[0],"backward"):this.setRanges(t)},rt.containsNode=function(e,t){return this.eachRange(function(n){return n.containsNode(e,t)},!0)||!1},rt.getBookmark=function(e){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[e])}},rt.moveToBookmark=function(t){for(var n,r,o=[],i=0;n=t.rangeBookmarks[i++];)r=e.createRange(this.win),r.moveToBookmark(n),o.push(r);t.backward?this.setSingleRange(o[0],"backward"):this.setRanges(o)},rt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},rt.restoreRanges=function(e){this.removeAllRanges();for(var t,n=0;t=e.ranges[n];++n)this.addRange(t,e.backward&&0==n)},rt.toHtml=function(){var e=[];return this.eachRange(function(t){e.push(b.toHtml(t))}),e.join("")},H.implementsTextRange&&(rt.getNativeTextRange=function(){var n;if(n=this.docSelection){var r=n.createRange();if(h(r))return r;throw t.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return e.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw t.createError("getNativeTextRange: selection contains no range")}),rt.getName=function(){return"WrappedSelection"},rt.inspect=function(){return y(this)},rt.detach=function(){C(this.win,"delete"),v(this)},R.detachAll=function(){C(null,"deleteAll")},R.inspect=y,R.isDirectionBackward=n,e.Selection=R,e.selectionPrototype=rt,e.addShimListener(function(e){"undefined"==typeof e.getSelection&&(e.getSelection=function(){return nt(e)}),e=null})});var L=!1,W=function(){L||(L=!0,!I.initialized&&I.config.autoInitialize&&u())};return b&&("complete"==document.readyState?W():(e(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",W,!1),H(window,"load",W))),I},this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/tooltipster/css/tooltipster.bundle.min.css
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
.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}
|
2 |
-
.tooltipster-sidetip.tooltipster-shadow .tooltipster-box{border:none;border-radius:5px;background:#fff;box-shadow:0 0 10px 6px rgba(0,0,0,.1)}.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom .tooltipster-box{margin-top:6px}.tooltipster-sidetip.tooltipster-shadow.tooltipster-left .tooltipster-box{margin-right:6px}.tooltipster-sidetip.tooltipster-shadow.tooltipster-right .tooltipster-box{margin-left:6px}.tooltipster-sidetip.tooltipster-shadow.tooltipster-top .tooltipster-box{margin-bottom:6px}.tooltipster-sidetip.tooltipster-shadow .tooltipster-content{color:#8d8d8d}.tooltipster-sidetip.tooltipster-shadow .tooltipster-arrow{height:6px;margin-left:-6px;width:12px}.tooltipster-sidetip.tooltipster-shadow.tooltipster-left .tooltipster-arrow,.tooltipster-sidetip.tooltipster-shadow.tooltipster-right .tooltipster-arrow{height:12px;margin-left:0;margin-top:-6px;width:6px}.tooltipster-sidetip.tooltipster-shadow .tooltipster-arrow-background{display:none}.tooltipster-sidetip.tooltipster-shadow .tooltipster-arrow-border{border:6px solid transparent}.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#fff}.tooltipster-sidetip.tooltipster-shadow.tooltipster-left .tooltipster-arrow-border{border-left-color:#fff}.tooltipster-sidetip.tooltipster-shadow.tooltipster-right .tooltipster-arrow-border{border-right-color:#fff}.tooltipster-sidetip.tooltipster-shadow.tooltipster-top .tooltipster-arrow-border{border-top-color:#fff}.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom .tooltipster-arrow-uncropped{top:-6px}.tooltipster-sidetip.tooltipster-shadow.tooltipster-right .tooltipster-arrow-uncropped{left:-6px}
|
3 |
-
.tooltipster-sidetip.tooltipster-punk .tooltipster-box{border-radius:5px;border:none;border-bottom:3px solid #f71169;background:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-top .tooltipster-box{margin-bottom:7px}.tooltipster-sidetip.tooltipster-punk .tooltipster-content{color:#fff;padding:8px 16px}.tooltipster-sidetip.tooltipster-punk .tooltipster-arrow-background{display:none}.tooltipster-sidetip.tooltipster-punk.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-left .tooltipster-arrow-border{border-left-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-right .tooltipster-arrow-border{border-right-color:#2a2a2a}.tooltipster-sidetip.tooltipster-punk.tooltipster-top .tooltipster-arrow-border{border-top-color:#f71169}
|
4 |
-
.tooltipster-sidetip.tooltipster-noir .tooltipster-box{border-radius:0;border:3px solid #000;background:#fff}.tooltipster-sidetip.tooltipster-noir .tooltipster-content{color:#000}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow{height:11px;margin-left:-11px;width:22px}.tooltipster-sidetip.tooltipster-noir.tooltipster-left .tooltipster-arrow,.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow{height:22px;margin-left:0;margin-top:-11px;width:11px}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow-background{border:11px solid transparent}.tooltipster-sidetip.tooltipster-noir.tooltipster-bottom .tooltipster-arrow-background{border-bottom-color:#fff;top:4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-left .tooltipster-arrow-background{border-left-color:#fff;left:-4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow-background{border-right-color:#fff;left:4px}.tooltipster-sidetip.tooltipster-noir.tooltipster-top .tooltipster-arrow-background{border-top-color:#fff;top:-4px}.tooltipster-sidetip.tooltipster-noir .tooltipster-arrow-border{border-width:11px}.tooltipster-sidetip.tooltipster-noir.tooltipster-bottom .tooltipster-arrow-uncropped{top:-11px}.tooltipster-sidetip.tooltipster-noir.tooltipster-right .tooltipster-arrow-uncropped{left:-11px}
|
5 |
-
.tooltipster-sidetip.tooltipster-light .tooltipster-box{border-radius:3px;border:1px solid #ccc;background:#ededed}.tooltipster-sidetip.tooltipster-light .tooltipster-content{color:#666}.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:#ededed;top:1px}.tooltipster-sidetip.tooltipster-light.tooltipster-left .tooltipster-arrow-background{border-left-color:#ededed;left:-1px}.tooltipster-sidetip.tooltipster-light.tooltipster-right .tooltipster-arrow-background{border-right-color:#ededed;left:1px}.tooltipster-sidetip.tooltipster-light.tooltipster-top .tooltipster-arrow-background{border-top-color:#ededed;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}
|
6 |
-
.tooltipster-sidetip.tooltipster-borderless .tooltipster-box{border:none;background:#1b1b1b;background:rgba(10,10,10,.9)}.tooltipster-sidetip.tooltipster-borderless.tooltipster-bottom .tooltipster-box{margin-top:8px}.tooltipster-sidetip.tooltipster-borderless.tooltipster-left .tooltipster-box{margin-right:8px}.tooltipster-sidetip.tooltipster-borderless.tooltipster-right .tooltipster-box{margin-left:8px}.tooltipster-sidetip.tooltipster-borderless.tooltipster-top .tooltipster-box{margin-bottom:8px}.tooltipster-sidetip.tooltipster-borderless .tooltipster-arrow{height:8px;margin-left:-8px;width:16px}.tooltipster-sidetip.tooltipster-borderless.tooltipster-left .tooltipster-arrow,.tooltipster-sidetip.tooltipster-borderless.tooltipster-right .tooltipster-arrow{height:16px;margin-left:0;margin-top:-8px;width:8px}.tooltipster-sidetip.tooltipster-borderless .tooltipster-arrow-background{display:none}.tooltipster-sidetip.tooltipster-borderless .tooltipster-arrow-border{border:8px solid transparent}.tooltipster-sidetip.tooltipster-borderless.tooltipster-bottom .tooltipster-arrow-border{border-bottom-color:#1b1b1b;border-bottom-color:rgba(10,10,10,.9)}.tooltipster-sidetip.tooltipster-borderless.tooltipster-left .tooltipster-arrow-border{border-left-color:#1b1b1b;border-left-color:rgba(10,10,10,.9)}.tooltipster-sidetip.tooltipster-borderless.tooltipster-right .tooltipster-arrow-border{border-right-color:#1b1b1b;border-right-color:rgba(10,10,10,.9)}.tooltipster-sidetip.tooltipster-borderless.tooltipster-top .tooltipster-arrow-border{border-top-color:#1b1b1b;border-top-color:rgba(10,10,10,.9)}.tooltipster-sidetip.tooltipster-borderless.tooltipster-bottom .tooltipster-arrow-uncropped{top:-8px}.tooltipster-sidetip.tooltipster-borderless.tooltipster-right .tooltipster-arrow-uncropped{left:-8px}
|
|
|
|
|
|
|
|
|
|
|
|
vendor/tooltipster/js/tooltipster.bundle.min.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
/*! tooltipster v4.1.5 */!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){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={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:"body",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},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.1.5",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_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(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},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(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__destroying=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),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(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a("body").on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__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]),"string"==typeof this.__options.parent&&(this.__options.parent=a(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 b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.destroy()},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else{if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{var d=c.__geometry(),e=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var f=a(c),g=f.css("overflow-x"),h=f.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(d.origin.windowOffset.left<i.left||d.origin.windowOffset.right>i.right))return e=!0,!1;if("visible"!=h&&(d.origin.windowOffset.top<i.top||d.origin.windowOffset.bottom>i.bottom))return e=!0,!1}return"fixed"==f.css("position")?!1:void 0}),e)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var f=d.origin.offset.left-c.__Geometry.origin.offset.left,g=d.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+f,top:c.__lastPosition.coord.top+g})}}c._trigger({type:"scroll",event:b})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c){var d=this,e=!0;if(d._trigger({type:"close",event:b,stop:function(){e=!1}}),e||d.__destroying){c&&d.__callbacks.close.push(c),d.__callbacks.open=[],d.__timeoutsClear();var f=function(){a.each(d.__callbacks.close,function(a,c){c.call(d,d,{event:b,origin:d._$origin[0]})}),d.__callbacks.close=[]};if("closed"!=d.__state){var g=!0,i=new Date,j=i.getTime(),k=j+d.__options.animationDuration[1];if("disappearing"==d.__state&&k>d.__closingTime&&(g=!1),g){d.__closingTime=k,"disappearing"!=d.__state&&d.__stateSet("disappearing");var l=function(){clearInterval(d.__tracker),d._trigger({type:"closing",event:b}),d._$tooltip.off("."+d.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+d.__namespace+"-triggerClose"),d.__$originParents.each(function(b,c){a(c).off("scroll."+d.__namespace+"-triggerClose")}),d.__$originParents=null,a("body").off("."+d.__namespace+"-triggerClose"),d._$origin.off("."+d.__namespace+"-triggerClose"),d._off("dismissable"),d.__stateSet("closed"),d._trigger({type:"after",event:b}),d.__options.functionAfter&&d.__options.functionAfter.call(d,d,{event:b,origin:d._$origin[0]}),f()};h.hasTransitions?(d._$tooltip.css({"-moz-animation-duration":d.__options.animationDuration[1]+"ms","-ms-animation-duration":d.__options.animationDuration[1]+"ms","-o-animation-duration":d.__options.animationDuration[1]+"ms","-webkit-animation-duration":d.__options.animationDuration[1]+"ms","animation-duration":d.__options.animationDuration[1]+"ms","transition-duration":d.__options.animationDuration[1]+"ms"}),d._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),d.__options.animationDuration[1]>0&&d._$tooltip.delay(d.__options.animationDuration[1]),d._$tooltip.queue(l)):d._$tooltip.stop().fadeOut(d.__options.animationDuration[1],l)}}else f()}return d},_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(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(a){e.reposition(a)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="";e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),a("body").on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&a("body").on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;return b.__destroyed?b.__destroyError():b.__destroying||(b.__destroying=!0,b._close(null,function(){b._trigger("destroy"),b.__destroying=!1,b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a("body").off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)})),b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},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(a){return this.__destroyed||this.__destroying?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,destroying:this.__destroying,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}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo("body")},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),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 a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom,width:a.width||a.right}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]));var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<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||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),
|
2 |
-
"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});
|
|
|
|
wp-recipe-maker.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
|
17 |
* Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
|
18 |
-
* Version:
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
|
17 |
* Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
|
18 |
+
* Version: 2.0.0
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|