Version Description
(07 June 2022) = Bug Fixes: * Retrigger emails from Submissions page if form only has 1 Email Action * Invalid Date message triggered by Date Picker Field * Typo in Delete Form popup * Importing a form sets the Step value of any Number field to 1, regardless of the Export value * Front End Checkbox/Radio lists are not keyboard accessible * Form Preview Page does not work in themes that enable full site editor * Public link not working in some themes * Checkbox Fields with a checked calc value of 0 evaluate to 1 in JS * Activating Layouts & Styles removes merge tags from email actions until the form is republished * Trigger error when cookies for reCaptcha v3 were not allowed ( Implemented with hooks ) * Submissions page select dates filter restored
Security Enhancements * Improve escaping on field template labels and values reported responsibly by Ryan at WP Scan * Improve sanitization of label values * Improve authorization check for field imports
=
Release Info
Developer | nahuelmahe |
Plugin | Ninja Forms – The Easy and Powerful Forms Builder |
Version | 3.6.10 |
Comparing to | |
See all releases |
Code changes from version 3.6.9 to 3.6.10
- assets/css/display-opinions-dark.css +1 -1
- assets/css/display-opinions-dark.css.map +1 -1
- assets/css/display-opinions-light.css +1 -1
- assets/css/display-opinions-light.css.map +1 -1
- assets/js/admin-import-export.js +4 -0
- assets/js/{min → lib}/blockFrameSetup.js +0 -0
- assets/js/{min → lib}/global.js +58 -9
- assets/js/min/builder.js +1 -17429
@@ -1,2 +1,2 @@
|
|
1 |
-
.ninja-forms-form-wrap *,.ninja-forms-form-wrap :after,.ninja-forms-form-wrap :before{-ms-box-sizing:border-box;box-sizing:border-box}.nf-response-msg{display:none}#ninja_forms_required_items,.nf-field-container{clear:both;position:relative;margin-bottom:25px}#ninja_forms_required_items:after,.nf-field-container:after{clear:both;content:"";display:block}#ninja_forms_required_items.hidden-container,#ninja_forms_required_items.hr-container,.nf-field-container.hidden-container,.nf-field-container.hr-container{margin:0;height:auto}#ninja_forms_required_items.hidden-container .nf-field-label,#ninja_forms_required_items.hr-container .nf-field-label,#ninja_forms_required_items.html-container .nf-field-label,.nf-field-container.hidden-container .nf-field-label,.nf-field-container.hr-container .nf-field-label,.nf-field-container.html-container .nf-field-label{display:none}.nf-field-label label{font-weight:700;margin:0;padding:0}.nf-field-element{position:relative}.nf-field-element input,.nf-field-element select,.nf-field-element textarea{margin:0;width:auto;height:auto;vertical-align:inherit}.nf-field-element textarea{height:200px}.nf-field-description p:last-child{margin:0}.nf-help{background:url(../img/help-info.png) no-repeat;display:inline-block;width:16px;height:16px}.nf-input-limit{font-size:12px;margin-top:5px}.nf-static{padding:0 10px}.nf-after-field .nf-error-msg{margin-right:10px}.list-checkbox-wrap .nf-field-element li,.list-checkbox-wrap .nf-field-element ul,.list-image-wrap .nf-field-element li,.list-image-wrap .nf-field-element ul,.list-radio-wrap .nf-field-element li,.list-radio-wrap .nf-field-element ul{list-style:none!important;margin:0!important;padding:0!important}.list-checkbox-wrap .nf-field-element li input,.list-checkbox-wrap .nf-field-element ul input,.list-image-wrap .nf-field-element li input,.list-image-wrap .nf-field-element ul input,.list-radio-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element ul input{margin-right:5px}.list-checkbox-wrap .nf-field-element li,.list-image-wrap .nf-field-element li,.list-radio-wrap .nf-field-element li{padding-left:10px;margin:0 0 5px!important;text-indent:0!important}.list-checkbox-wrap .nf-field-element li label,.list-image-wrap .nf-field-element li label,.list-radio-wrap .nf-field-element li label{display:block;float:none;width:auto;margin-left:1.5em}.list-checkbox-wrap .nf-field-element li input,.list-image-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element li input{width:auto!important;float:left;margin-top:.25em}.listimage-wrap li{width:100%;height:100%;display:inline-grid}.listimage-wrap li label{padding:5px;border:2px solid transparent}.listimage-wrap li label.nf-checked-label{border:2px solid #007acc;transition:all .5s}.listimage-wrap li label img{display:block}.listimage-wrap li input{display:none}.product-wrap>div input{width:80px!important}.product-wrap>div .nf-product-field span{padding:0 5px}.starrating-wrap .star{border-bottom:0}.nf-form-hp{position:absolute;visibility:hidden}.list-select-wrap div div{display:none}.nf-error-msg,.ninja-forms-req-symbol{color:#e80000}.nf-error.listimage-wrap .nf-field-element ul,.nf-error .ninja-forms-field{border:1px solid #e80000}.nf-field-submit-error{padding:15px}.ninja-forms-noscript-message{background:#f1f1f1;border:4px dashed #ccc;color:#333;display:block;font-size:20px;margin:20px 0;padding:40px;text-align:center}.two-col-list ul li{float:left;width:50%}.three-col-list ul li{float:left;width:33.33%}.four-col-list ul li{float:left;width:25%}.five-col-list ul li{float:left;width:20%}.six-col-list ul li{float:left;width:16.66%}body .pika-label{background:transparent}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:none;float:left;margin-left:2.564102564102564%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:20px}.nf-form-cont .five-sixths:after,.nf-form-cont .four-sixths:after,.nf-form-cont .one-fourth:after,.nf-form-cont .one-half:after,.nf-form-cont .one-sixth:after,.nf-form-cont .one-third:after,.nf-form-cont .three-fourths:after,.nf-form-cont .three-sixths:after,.nf-form-cont .two-fourths:after,.nf-form-cont .two-sixths:after,.nf-form-cont .two-thirds:after{clear:both;content:"";display:block}.nf-form-cont .one-half,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths{width:48.717948717948715%}.nf-form-cont .one-third,.nf-form-cont .two-sixths{width:31.623931623931625%}.nf-form-cont .four-sixths,.nf-form-cont .two-thirds{width:65.81196581196582%}.nf-form-cont .one-fourth{width:23.076923076923077%}.nf-form-cont .three-fourths{width:74.35897435897436%}.nf-form-cont .one-sixth{width:14.52991452991453%}.nf-form-cont .five-sixths{width:82.90598290598291%}.nf-form-cont .first{clear:both;margin-left:0}.note-popover{display:none!important}.nf-form-wrap .note-editor{border:0!important}.nf-form-wrap .note-editor .note-toolbar:after{clear:both;content:"";display:block}.nf-form-wrap .note-editor .note-editable{background:#f9f9f9;border:1px solid #f1f1f1;display:block}.nf-form-wrap .note-editor .note-editable p{font-size:16px}.nf-form-wrap .note-editor .note-editable ul{list-style-type:disc;margin-left:2em}.nf-form-wrap .note-editor .note-editable table td{border:1px solid #ccc;width:auto}.nf-form-wrap .note-editor .modal{display:none}.nf-form-wrap .note-editor .btn-group{float:left}.nf-form-wrap .note-editor .btn-group.note-tools{float:right}.nf-form-wrap .note-editor .btn{background:#f9f9f9;border:0;border-radius:4px;color:#666;cursor:pointer;margin-right:2px;padding-top:4px}.nf-form-wrap .note-editor .btn.disabled{background:transparent;color:#aaa}.nf-form-wrap .note-editor .btn.disabled .merge-tags{background:#f9f9f9;color:#666}.nf-form-wrap .note-editor button[type=button]{padding:4px;width:auto;height:auto}.nf-form-wrap .note-editor .dropdown-toggle{position:relative;display:inline-block;top:0}.nf-form-wrap .note-editor .dropdown-toggle:after{content:"";width:0}.nf-form-wrap .tooltip{position:absolute;z-index:1070;display:block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.nf-form-wrap .tooltip.in{filter:alpha(opacity=90);opacity:.9}.nf-form-wrap .tooltip.top{padding:5px 0;margin-top:-3px}.nf-form-wrap .tooltip.right{padding:0 5px;margin-left:3px}.nf-form-wrap .tooltip.bottom{padding:5px 0;margin-top:3px}.nf-form-wrap .tooltip.left{padding:0 5px;margin-left:-3px}.nf-form-wrap .tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.nf-form-wrap .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.nf-form-wrap .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.nf-form-wrap .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.nf-form-wrap .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .dropdown-menu{position:absolute;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175)}.nf-form-wrap .dropdown-menu.pull-right{right:0;left:auto}.nf-form-wrap .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nf-form-wrap .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.nf-form-wrap .dropdown-menu>li>a:focus,.nf-form-wrap .dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.nf-form-wrap .dropdown-menu>.active>a,.nf-form-wrap .dropdown-menu>.active>a:focus,.nf-form-wrap .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.nf-form-wrap .dropdown-menu>.disabled>a,.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{color:#777}.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.nf-form-wrap .open>.dropdown-menu{display:block}.nf-form-wrap .open>a{outline:0}.nf-form-wrap .dropdown-menu-right{right:0;left:auto}.nf-form-wrap .dropdown-menu-left{right:auto;left:0}.nf-form-wrap .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.nf-form-wrap .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.nf-form-wrap .pull-right>.dropdown-menu{right:0;left:auto}.nf-form-wrap .dropup .caret,.nf-form-wrap .navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.nf-form-wrap .dropup .dropdown-menu,.nf-form-wrap .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.nf-form-wrap .navbar-right .dropdown-menu{right:0;left:auto}.nf-form-wrap .navbar-right .dropdown-menu-left{right:auto;left:0}}.nf-form-wrap .btn-group-justified>.btn-group .dropdown-menu{left:auto}.nf-form-wrap .nav-justified>.dropdown .dropdown-menu,.nf-form-wrap .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.nf-form-wrap .nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.nf-form-wrap .navbar-nav .open .dropdown-menu .dropdown-header,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{line-height:20px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.nf-form-wrap .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.nf-form-wrap .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}@media (max-width:767px){.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.nf-loading-spinner{width:40px;height:40px;margin:100px auto;background-color:hsla(0,0%,81.6%,.5);border-radius:100%;-webkit-animation:nf-scaleout 1s ease-in-out infinite;animation:nf-scaleout 1s ease-in-out infinite}@-webkit-keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}@keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.field-wrap{display:flex}.field-wrap>label{display:block}.field-wrap .pikaday__container,.field-wrap .pikaday__display,.field-wrap>div input,.field-wrap select,.field-wrap textarea{width:100%}.field-wrap>div input[type=checkbox],.field-wrap button,.field-wrap input[type=button],.field-wrap input[type=submit]{width:auto}.nf-field-label{order:5}.nf-field-description{width:100%;order:10}.nf-field-element{order:15}.label-above .nf-field-label{margin-bottom:10px}.label-below .nf-field-label{margin-top:10px;order:15}.label-below .nf-field-element{order:5}.label-hidden .field-wrap{flex-wrap:wrap}.label-hidden .nf-field-label{height:0;margin:0!important;width:100%;visibility:hidden}.label-hidden .nf-field-description{width:100%;order:20}.label-hidden .nf-field-element{width:100%}.label-left .field-wrap{flex-direction:row;flex-wrap:wrap}.label-left .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-right:2%;text-align:right;width:35%;order:5}.label-left .nf-field-label label{width:100%}.label-left .nf-field-description{margin-left:35%}.label-left .nf-field-element{display:inline-block;width:65%;order:10}.label-left .nf-after-field{margin-left:36.5%}.label-right .field-wrap{flex-direction:row}.label-right .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-left:2%;width:35%;order:10}.label-right .nf-field-description{margin-right:35%;order:15}.label-right .nf-field-element{display:inline-block;width:65%;order:5}.label-right .checkbox-wrap .nf-field-label{width:auto}.label-right .checkbox-wrap .nf-field-element{width:20px}.label-right .nf-after-field{width:65%}.label-above .field-wrap,.label-below .field-wrap{flex-direction:column;flex-flow:wrap}.label-above .nf-field-element,.label-below .nf-field-element{margin:0;width:100%}.label-left .listcheckbox-wrap .nf-field-label,.label-left .listradio-wrap .nf-field-label,.label-left .textarea-wrap .nf-field-label,.label-right .listcheckbox-wrap .nf-field-label,.label-right .listradio-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{align-items:flex-start}.label-left .textarea-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{margin-top:5px}.label-left .hr-wrap,.label-left .html-wrap,.label-right .hr-wrap,.label-right .html-wrap{display:block}.label-left .hr-wrap .nf-field-element,.label-left .html-wrap .nf-field-element,.label-right .hr-wrap .nf-field-element,.label-right .html-wrap .nf-field-element{display:block;margin:0;width:100%}.nf-repeater-fieldsets fieldset{margin-bottom:1em}.nf-remove-fieldset{color:red;font-size:1.5em;background-color:transparent;border:thin solid red;padding:.1em .4em;float:right;margin-top:-1em}.nf-help{background:none}.nf-field-description{font-size:14px}.nf-form-content{padding:5px;max-width:1000px;margin:0 auto}.nf-form-content label{font-size:18px;line-height:20px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content .ninja-forms-field{font-size:16px;margin:0;padding:12px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content input.ninja-forms-field,.nf-form-content select.ninja-forms-field:not([multiple]){height:50px}.nf-form-content textarea.ninja-forms-field{height:200px}.nf-form-content hr.ninja-forms-field{padding:0}.nf-form-content input[type=checkbox].ninja-forms-field,.nf-form-content input[type=radio].ninja-forms-field{height:auto}.nf-form-content .listcheckbox-wrap li,.nf-form-content .listradio-wrap li{margin-bottom:12px!important;line-height:0}.nf-form-content .nf-product-field span{padding-right:16px}.nf-form-content .nf-product-field .nf-field-qty{font-size:16px;padding:5px;width:80px!important}.nf-form-content .nf-static{background:transparent;border:0;font-weight:700;padding:0}.nf-form-content .label-above .nf-field-label,.nf-form-content .label-below .nf-field-label,.nf-form-content .label-hidden .nf-field-label{margin-bottom:10px;padding:0}.nf-form-content .label-below .nf-field-label{margin-bottom:0;margin-top:10px}.nf-form-content .label-right .nf-field-label{margin:0}.nf-form-content .label-right>input[type=radio],.nf-form-content .label-right input[type=checkbox],.nf-form-content .label-right ul{margin-right:1%}.nf-form-content .list-select-wrap>div{position:relative}.nf-form-content .list-select-wrap>div div{display:block;position:absolute;font-size:16px;line-height:16px;margin:0;padding:16px;height:50px;top:0;right:0;left:0;z-index:1}.nf-form-content .list-select-wrap>div div:after{content:"\f078";font-family:FontAwesome;font-size:20px;position:absolute;right:10px;bottom:0;height:50px;line-height:50px}.nf-form-content .list-select-wrap>div.label-right div{width:59%}.nf-form-content .list-select-wrap>div.label-below div{top:0;bottom:auto}.nf-form-content .list-select-wrap>div.label-left div{width:59%;left:40.5%;right:40px}.nf-form-content .list-select-wrap>div select{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;z-index:2}.nf-form-content .listmultiselect-wrap select{-webkit-appearance:normal;-moz-appearance:normal;appearance:normal}.checkbox-wrap .nf-field-element label,.checkbox-wrap .nf-field-label label,.listcheckbox-wrap .nf-field-element label,.listcheckbox-wrap .nf-field-label label{position:relative;margin-left:30px}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{border:1px solid;content:"";width:18px;height:18px;position:absolute;left:-28px;bottom:0}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{content:"\f00c";font-family:FontAwesome;font-size:24px;position:absolute;bottom:0;z-index:2}.checkbox-container .nf-field-element input{display:none}.checkbox-container.label-above label{height:50px;margin:0;display:block}.checkbox-container.label-above label:before{left:-2px;bottom:-16px}.checkbox-container.label-above label:after{left:0;bottom:-16px}.checkbox-container.label-below label{display:block;margin:20px 0 0}.checkbox-container.label-below label:before{left:-2px;bottom:auto;top:-27px}.checkbox-container.label-below label:after{left:0;bottom:auto;top:-25px}.checkbox-container.label-left .nf-field-label{width:38%;padding-right:5%}.checkbox-container.label-left .nf-field-element{width:58%}.checkbox-container.label-left label{margin:0;display:block}.checkbox-container.label-left label:before{left:auto;top:-2px;right:-36px}.checkbox-container.label-left label:after{left:auto;top:0;right:-31px}.checkbox-container.label-right .nf-field-label{padding:0;order:10}.checkbox-container.label-right .nf-field-element{order:5;display:none}.checkbox-container.label-right label{margin:0 0 0 30px;display:block}.checkbox-container.label-right label:before{left:-30px;top:0}.checkbox-container.label-right label:after{left:-28px;top:0}.checkbox-container.label-right .field-wrap{display:flex}.checkbox-container.label-right .field-wrap>div{width:100%}.checkbox-container.label-hidden label{height:0;margin:0;display:block}.checkbox-container.label-hidden label:after{left:0;bottom:0;visibility:visible}.checkbox-container.label-hidden label.nf-checked-label:before{left:-2px;bottom:0;visibility:visible}.listcheckbox-container .nf-field-label label:after{background:transparent!important;border:0}.listcheckbox-container .nf-field-element input{display:none}.listcheckbox-container .nf-field-element label{margin-left:30px!important}.listcheckbox-container .nf-field-element label:before{top:1px;left:-30px;bottom:auto}.listcheckbox-container .nf-field-element label:after{top:3px;bottom:auto}.listcheckbox-container.label-above .nf-field-label label,.listcheckbox-container.label-below .nf-field-label label,.listcheckbox-container.label-right .nf-field-label label{margin:0}.listcheckbox-container.label-above .nf-field-label label:before,.listcheckbox-container.label-below .nf-field-label label:before,.listcheckbox-container.label-right .nf-field-label label:before{left:-30px}.listradio-wrap .nf-field-element label{position:relative;margin-left:30px!important}.listradio-wrap .nf-field-element label:after{border-radius:50%;content:"";width:18px;height:18px;position:absolute;left:-30px;bottom:1px;top:.05em}.listradio-wrap .nf-field-element label.nf-checked-label:before{border-radius:50%;content:"";height:10px;width:10px;position:absolute;left:-26px;bottom:5px;z-index:2;top:.25em}.listradio-wrap .nf-field-element input{display:none}input[type=checkbox].nf-toggle{background:transparent;border:0;box-shadow:0 0 0;margin:10px;height:18px;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;cursor:pointer}input[type=checkbox].nf-toggle:after{background:#bcbdbf;border:2px solid #bcbdbf;border-radius:20px;content:"";position:absolute;top:-4px;left:-4px;width:46px;height:24px;transition:all .3s ease}input[type=checkbox].nf-toggle:before{background:#fff;border-radius:20px;content:"";position:absolute;top:-1px;left:0;width:18px;height:18px;z-index:99;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:after{background:#90ee90;border:2px solid #90ee90;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:before{top:-1px;left:20px;transition:all .3s ease}.label-right input[type=checkbox].nf-toggle{padding:0 50px 0 0}.label-left input[type=checkbox].nf-toggle{padding:0;margin-left:22px;margin-top:20px}.nf-icons .nf-field-element{position:relative}.nf-icons .nf-field-element:before{font-family:FontAwesome;font-size:20px;position:absolute;left:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;z-index:1}.nf-icons .address-wrap .nf-field-element input,.nf-icons .city-wrap .nf-field-element input,.nf-icons .creditcardcvc-wrap .nf-field-element input,.nf-icons .creditcardexpiration-wrap .nf-field-element input,.nf-icons .creditcardfullname-wrap .nf-field-element input,.nf-icons .creditcardnumber-wrap .nf-field-element input,.nf-icons .creditcardzip-wrap .nf-field-element input,.nf-icons .date-wrap .nf-field-element input,.nf-icons .email-wrap .nf-field-element input,.nf-icons .firstname-wrap .nf-field-element input,.nf-icons .lastname-wrap .nf-field-element input,.nf-icons .number-wrap .nf-field-element input,.nf-icons .phone-wrap .nf-field-element input,.nf-icons .quantity-wrap .nf-field-element input,.nf-icons .state-wrap .nf-field-element input,.nf-icons .zip-wrap .nf-field-element input{padding-left:60px}.nf-icons.right .nf-field-element:before{left:auto;right:1px}.nf-icons.right .address-wrap>div input,.nf-icons.right .city-wrap>div input,.nf-icons.right .creditcardcvc-wrap>div input,.nf-icons.right .creditcardexpiration-wrap>div input,.nf-icons.right .creditcardfullname-wrap>div input,.nf-icons.right .creditcardnumber-wrap>div input,.nf-icons.right .creditcardzip-wrap>div input,.nf-icons.right .date-wrap>div input,.nf-icons.right .email-wrap>div input,.nf-icons.right .firstname-wrap>div input,.nf-icons.right .lastname-wrap>div input,.nf-icons.right .number-wrap>div input,.nf-icons.right .phone-wrap>div input,.nf-icons.right .quantity-wrap>div input,.nf-icons.right .state-wrap>div input,.nf-icons.right .zip-wrap>div input{padding-left:12px;padding-right:60px}.nf-icons .date-wrap .nf-field-element:before{content:"\f073"}.nf-icons .number-wrap .nf-field-element:before,.nf-icons .quantity-wrap>div:before{content:"\f292"}.nf-icons .email-wrap .nf-field-element:before{content:"\f0e0"}.nf-icons .phone-wrap .nf-field-element:before{content:"\f095"}.nf-icons .firstname-wrap .nf-field-element:before,.nf-icons .lastname-wrap .nf-field-element:before{content:"\f007"}.nf-icons .address-wrap .nf-field-element:before,.nf-icons .city-wrap .nf-field-element:before,.nf-icons .state-wrap .nf-field-element:before,.nf-icons .zip-wrap .nf-field-element:before{content:"\f041"}.nf-icons .creditcardcvc-wrap .nf-field-element:before,.nf-icons .creditcardexpiration-wrap .nf-field-element:before,.nf-icons .creditcardfullname-wrap .nf-field-element:before,.nf-icons .creditcardnumber-wrap .nf-field-element:before,.nf-icons .creditcardzip-wrap .nf-field-element:before{content:"\f283"}.nf-field-element .date-and-time{margin-bottom:5px}.nf-field-element .hour{padding:5px;border-right:0}.nf-field-element .ampm,.nf-field-element .minute{padding:5px;border-left:0}.nf-form-content .list-select-wrap .nf-field-element>div,.nf-form-content input:not([type=button]),.nf-form-content textarea{background:#222;border:1px solid #3c3c3c;border-radius:0;box-shadow:none;color:#888;transition:all .5s}.nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-form-content input:not([type=button]):focus,.nf-form-content textarea:focus{background:#3c3c3c;border-color:#555;color:#a2a2a2;outline:none;transition:all .5s}.nf-form-content button,.nf-form-content input[type=button],.nf-form-content input[type=submit]{background:#fff;border:0;color:#222;transition:all .5s}.nf-form-content button:hover,.nf-form-content input[type=button]:hover,.nf-form-content input[type=submit]:hover{background:#3c3c3c;color:#888;transition:all .5s}.nf-form-content select.ninja-forms-field{color:#888}.nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.list-select-wrap div:after{color:#888;transition:all .5s}.list-select-wrap select:active+div,.list-select-wrap select:focus+div{background:#3c3c3c!important;border-color:#555!important;transition:all .5s}.listradio-wrap .nf-field-element label:after{background:#222;border:2px solid #3c3c3c;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#fff;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:before{background:#fff}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{background:#222;border-color:#3c3c3c;transition:all .5s}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{color:#222;opacity:0;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:after,.checkbox-wrap .nf-field-label label.nf-checked-label:after,.listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#555;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:before,.checkbox-wrap .nf-field-label label.nf-checked-label:before,.listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#fff;opacity:1;transition:all .5s}.nf-error{position:relative}.nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-error .nf-error-msg{color:#e80000}.nf-pass{position:relative}.nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-icons .nf-field-element:before{background:#3c3c3c;color:#222}.nf-help{color:#fff}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div,.nf-brown .nf-form-content input:not([type=button]),.nf-brown .nf-form-content textarea{background:#3e2b13;border:1px solid #65461f;border-radius:0;box-shadow:none;color:#ca9553;transition:all .5s}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-brown .nf-form-content input:not([type=button]):focus,.nf-brown .nf-form-content textarea:focus{background:#65461f;border-color:#8c612b;color:#d6ad7a;outline:none;transition:all .5s}.nf-brown .nf-form-content button,.nf-brown .nf-form-content input[type=button],.nf-brown .nf-form-content input[type=submit]{background:#ea981b;border:0;color:#3e2b13;transition:all .5s}.nf-brown .nf-form-content button:hover,.nf-brown .nf-form-content input[type=button]:hover,.nf-brown .nf-form-content input[type=submit]:hover{background:#65461f;color:#ca9553;transition:all .5s}.nf-brown .nf-form-content select.ninja-forms-field{color:#ca9553}.nf-brown .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-brown .list-select-wrap div:after{color:#ca9553;transition:all .5s}.nf-brown .list-select-wrap select:active+div,.nf-brown .list-select-wrap select:focus+div{background:#65461f!important;border-color:#8c612b!important;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label:after{background:#3e2b13;border:2px solid #65461f;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#ea981b;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#ea981b}.nf-brown .checkbox-wrap .nf-field-element label:after,.nf-brown .checkbox-wrap .nf-field-label label:after,.nf-brown .listcheckbox-wrap .nf-field-element label:after,.nf-brown .listcheckbox-wrap .nf-field-label label:after{background:#3e2b13;border-color:#65461f;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label:before,.nf-brown .checkbox-wrap .nf-field-label label:before,.nf-brown .listcheckbox-wrap .nf-field-element label:before,.nf-brown .listcheckbox-wrap .nf-field-label label:before{color:#3e2b13;opacity:0;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#8c612b;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#ea981b;opacity:1;transition:all .5s}.nf-brown .nf-error{position:relative}.nf-brown .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-brown .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-brown .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-error .nf-error-msg{color:#e80000}.nf-brown .nf-pass{position:relative}.nf-brown .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-brown .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-brown .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-brown .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-brown .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-brown .nf-icons .nf-field-element:before{background:#65461f;color:#3e2b13}.nf-brown .nf-help{color:#ea981b}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div,.nf-red .nf-form-content input:not([type=button]),.nf-red .nf-form-content textarea{background:#350000;border:1px solid #680000;border-radius:0;box-shadow:none;color:#ff0202;transition:all .5s}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-red .nf-form-content input:not([type=button]):focus,.nf-red .nf-form-content textarea:focus{background:#680000;border-color:#9b0000;color:#ff3535;outline:none;transition:all .5s}.nf-red .nf-form-content button,.nf-red .nf-form-content input[type=button],.nf-red .nf-form-content input[type=submit]{background:red;border:0;color:#350000;transition:all .5s}.nf-red .nf-form-content button:hover,.nf-red .nf-form-content input[type=button]:hover,.nf-red .nf-form-content input[type=submit]:hover{background:#680000;color:#ff0202;transition:all .5s}.nf-red .nf-form-content select.ninja-forms-field{color:#ff0202}.nf-red .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-red .list-select-wrap div:after{color:#ff0202;transition:all .5s}.nf-red .list-select-wrap select:active+div,.nf-red .list-select-wrap select:focus+div{background:#680000!important;border-color:#9b0000!important;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label:after{background:#350000;border:2px solid #680000;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:red;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:before{background:red}.nf-red .checkbox-wrap .nf-field-element label:after,.nf-red .checkbox-wrap .nf-field-label label:after,.nf-red .listcheckbox-wrap .nf-field-element label:after,.nf-red .listcheckbox-wrap .nf-field-label label:after{background:#350000;border-color:#680000;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label:before,.nf-red .checkbox-wrap .nf-field-label label:before,.nf-red .listcheckbox-wrap .nf-field-element label:before,.nf-red .listcheckbox-wrap .nf-field-label label:before{color:#350000;opacity:0;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#9b0000;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:red;opacity:1;transition:all .5s}.nf-red .nf-error{position:relative}.nf-red .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-red .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-red .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-error .nf-error-msg{color:#e80000}.nf-red .nf-pass{position:relative}.nf-red .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-red .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-red .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-red .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-red .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-red .nf-icons .nf-field-element:before{background:#680000;color:#350000}.nf-red .nf-help{color:red}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div,.nf-blue .nf-form-content input:not([type=button]),.nf-blue .nf-form-content textarea{background:#001c33;border:1px solid #003866;border-radius:0;box-shadow:none;color:#008cff;transition:all .5s}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-blue .nf-form-content input:not([type=button]):focus,.nf-blue .nf-form-content textarea:focus{background:#003866;border-color:#005499;color:#33a3ff;outline:none;transition:all .5s}.nf-blue .nf-form-content button,.nf-blue .nf-form-content input[type=button],.nf-blue .nf-form-content input[type=submit]{background:#00aeff;border:0;color:#001c33;transition:all .5s}.nf-blue .nf-form-content button:hover,.nf-blue .nf-form-content input[type=button]:hover,.nf-blue .nf-form-content input[type=submit]:hover{background:#003866;color:#008cff;transition:all .5s}.nf-blue .nf-form-content select.ninja-forms-field{color:#008cff}.nf-blue .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-blue .list-select-wrap div:after{color:#008cff;transition:all .5s}.nf-blue .list-select-wrap select:active+div,.nf-blue .list-select-wrap select:focus+div{background:#003866!important;border-color:#005499!important;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label:after{background:#001c33;border:2px solid #003866;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#00aeff;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#00aeff}.nf-blue .checkbox-wrap .nf-field-element label:after,.nf-blue .checkbox-wrap .nf-field-label label:after,.nf-blue .listcheckbox-wrap .nf-field-element label:after,.nf-blue .listcheckbox-wrap .nf-field-label label:after{background:#001c33;border-color:#003866;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label:before,.nf-blue .checkbox-wrap .nf-field-label label:before,.nf-blue .listcheckbox-wrap .nf-field-element label:before,.nf-blue .listcheckbox-wrap .nf-field-label label:before{color:#001c33;opacity:0;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#005499;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#00aeff;opacity:1;transition:all .5s}.nf-blue .nf-error{position:relative}.nf-blue .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-blue .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-blue .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-error .nf-error-msg{color:#e80000}.nf-blue .nf-pass{position:relative}.nf-blue .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-blue .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-blue .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-blue .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-blue .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-blue .nf-icons .nf-field-element:before{background:#003866;color:#001c33}.nf-blue .nf-help{color:#00aeff}@media only screen and (max-width:800px){.nf-field-container .nf-field-label{margin-bottom:10px!important;padding:0;width:100%;order:5}.nf-field-container .nf-field-label label{text-align:left}.nf-field-container .nf-field-description{margin:0;width:100%;order:10}.nf-field-container .nf-field-element{width:100%;order:15}.nf-field-container .checkbox-wrap .nf-field-label{width:auto}.nf-field-container .checkbox-wrap .nf-field-label label{position:relative;margin-left:30px}.nf-field-container .checkbox-wrap .nf-field-label label:after{left:-28px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-label label:before{left:-30px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-element{width:20px}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:both;float:none;margin:0;width:100%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:0}}
|
2 |
/*# sourceMappingURL=display-opinions-dark.css.map */
|
1 |
+
.ninja-forms-form-wrap *,.ninja-forms-form-wrap :after,.ninja-forms-form-wrap :before{-ms-box-sizing:border-box;box-sizing:border-box}.nf-response-msg{display:none}#ninja_forms_required_items,.nf-field-container{clear:both;position:relative;margin-bottom:25px}#ninja_forms_required_items:after,.nf-field-container:after{clear:both;content:"";display:block}#ninja_forms_required_items.hidden-container,#ninja_forms_required_items.hr-container,.nf-field-container.hidden-container,.nf-field-container.hr-container{margin:0;height:auto}#ninja_forms_required_items.hidden-container .nf-field-label,#ninja_forms_required_items.hr-container .nf-field-label,#ninja_forms_required_items.html-container .nf-field-label,.nf-field-container.hidden-container .nf-field-label,.nf-field-container.hr-container .nf-field-label,.nf-field-container.html-container .nf-field-label{display:none}.nf-field-label label{font-weight:700;margin:0;padding:0}.nf-field-element{position:relative}.nf-field-element input,.nf-field-element select,.nf-field-element textarea{margin:0;width:auto;height:auto;vertical-align:inherit}.nf-field-element textarea{height:200px}.nf-field-description p:last-child{margin:0}.nf-help{background:url(../img/help-info.png) no-repeat;display:inline-block;width:16px;height:16px}.nf-input-limit{font-size:12px;margin-top:5px}.nf-static{padding:0 10px}.nf-after-field .nf-error-msg{margin-right:10px}.list-checkbox-wrap .nf-field-element li,.list-checkbox-wrap .nf-field-element ul,.list-image-wrap .nf-field-element li,.list-image-wrap .nf-field-element ul,.list-radio-wrap .nf-field-element li,.list-radio-wrap .nf-field-element ul{list-style:none!important;margin:0!important;padding:0!important}.list-checkbox-wrap .nf-field-element li input,.list-checkbox-wrap .nf-field-element ul input,.list-image-wrap .nf-field-element li input,.list-image-wrap .nf-field-element ul input,.list-radio-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element ul input{margin-right:5px}.list-checkbox-wrap .nf-field-element li,.list-image-wrap .nf-field-element li,.list-radio-wrap .nf-field-element li{padding-left:10px;margin:0 0 5px!important;text-indent:0!important}.list-checkbox-wrap .nf-field-element li label,.list-image-wrap .nf-field-element li label,.list-radio-wrap .nf-field-element li label{display:block;float:none;width:auto;margin-left:1.5em}.list-checkbox-wrap .nf-field-element li input,.list-image-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element li input{width:auto!important;float:left;margin-top:.25em}.listimage-wrap li{width:100%;height:100%;display:inline-grid}.listimage-wrap li label{padding:5px;border:2px solid transparent}.listimage-wrap li label.nf-checked-label{border:2px solid #007acc;transition:all .5s}.listimage-wrap li label img{display:block}.listimage-wrap li input{display:none}.product-wrap>div input{width:80px!important}.product-wrap>div .nf-product-field span{padding:0 5px}.starrating-wrap .star{border-bottom:0}.nf-form-hp{position:absolute;visibility:hidden}.list-select-wrap div div{display:none}.nf-error-msg,.ninja-forms-req-symbol{color:#e80000}.nf-error.listimage-wrap .nf-field-element ul,.nf-error .ninja-forms-field{border:1px solid #e80000}.nf-field-submit-error{padding:15px}.ninja-forms-noscript-message{background:#f1f1f1;border:4px dashed #ccc;color:#333;display:block;font-size:20px;margin:20px 0;padding:40px;text-align:center}.two-col-list ul li{float:left;width:50%}.three-col-list ul li{float:left;width:33.33%}.four-col-list ul li{float:left;width:25%}.five-col-list ul li{float:left;width:20%}.six-col-list ul li{float:left;width:16.66%}body .pika-label{background:transparent}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:none;float:left;margin-left:2.564102564102564%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:20px}.nf-form-cont .five-sixths:after,.nf-form-cont .four-sixths:after,.nf-form-cont .one-fourth:after,.nf-form-cont .one-half:after,.nf-form-cont .one-sixth:after,.nf-form-cont .one-third:after,.nf-form-cont .three-fourths:after,.nf-form-cont .three-sixths:after,.nf-form-cont .two-fourths:after,.nf-form-cont .two-sixths:after,.nf-form-cont .two-thirds:after{clear:both;content:"";display:block}.nf-form-cont .one-half,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths{width:48.717948717948715%}.nf-form-cont .one-third,.nf-form-cont .two-sixths{width:31.623931623931625%}.nf-form-cont .four-sixths,.nf-form-cont .two-thirds{width:65.81196581196582%}.nf-form-cont .one-fourth{width:23.076923076923077%}.nf-form-cont .three-fourths{width:74.35897435897436%}.nf-form-cont .one-sixth{width:14.52991452991453%}.nf-form-cont .five-sixths{width:82.90598290598291%}.nf-form-cont .first{clear:both;margin-left:0}.note-popover{display:none!important}.nf-form-wrap .note-editor{border:0!important}.nf-form-wrap .note-editor .note-toolbar:after{clear:both;content:"";display:block}.nf-form-wrap .note-editor .note-editable{background:#f9f9f9;border:1px solid #f1f1f1;display:block}.nf-form-wrap .note-editor .note-editable p{font-size:16px}.nf-form-wrap .note-editor .note-editable ul{list-style-type:disc;margin-left:2em}.nf-form-wrap .note-editor .note-editable table td{border:1px solid #ccc;width:auto}.nf-form-wrap .note-editor .modal{display:none}.nf-form-wrap .note-editor .btn-group{float:left}.nf-form-wrap .note-editor .btn-group.note-tools{float:right}.nf-form-wrap .note-editor .btn{background:#f9f9f9;border:0;border-radius:4px;color:#666;cursor:pointer;margin-right:2px;padding-top:4px}.nf-form-wrap .note-editor .btn.disabled{background:transparent;color:#aaa}.nf-form-wrap .note-editor .btn.disabled .merge-tags{background:#f9f9f9;color:#666}.nf-form-wrap .note-editor button[type=button]{padding:4px;width:auto;height:auto}.nf-form-wrap .note-editor .dropdown-toggle{position:relative;display:inline-block;top:0}.nf-form-wrap .note-editor .dropdown-toggle:after{content:"";width:0}.nf-form-wrap .tooltip{position:absolute;z-index:1070;display:block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.nf-form-wrap .tooltip.in{filter:alpha(opacity=90);opacity:.9}.nf-form-wrap .tooltip.top{padding:5px 0;margin-top:-3px}.nf-form-wrap .tooltip.right{padding:0 5px;margin-left:3px}.nf-form-wrap .tooltip.bottom{padding:5px 0;margin-top:3px}.nf-form-wrap .tooltip.left{padding:0 5px;margin-left:-3px}.nf-form-wrap .tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.nf-form-wrap .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.nf-form-wrap .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.nf-form-wrap .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.nf-form-wrap .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .dropdown-menu{position:absolute;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175)}.nf-form-wrap .dropdown-menu.pull-right{right:0;left:auto}.nf-form-wrap .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nf-form-wrap .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.nf-form-wrap .dropdown-menu>li>a:focus,.nf-form-wrap .dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.nf-form-wrap .dropdown-menu>.active>a,.nf-form-wrap .dropdown-menu>.active>a:focus,.nf-form-wrap .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.nf-form-wrap .dropdown-menu>.disabled>a,.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{color:#777}.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.nf-form-wrap .open>.dropdown-menu{display:block}.nf-form-wrap .open>a{outline:0}.nf-form-wrap .dropdown-menu-right{right:0;left:auto}.nf-form-wrap .dropdown-menu-left{right:auto;left:0}.nf-form-wrap .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.nf-form-wrap .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.nf-form-wrap .pull-right>.dropdown-menu{right:0;left:auto}.nf-form-wrap .dropup .caret,.nf-form-wrap .navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.nf-form-wrap .dropup .dropdown-menu,.nf-form-wrap .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.nf-form-wrap .navbar-right .dropdown-menu{right:0;left:auto}.nf-form-wrap .navbar-right .dropdown-menu-left{right:auto;left:0}}.nf-form-wrap .btn-group-justified>.btn-group .dropdown-menu{left:auto}.nf-form-wrap .nav-justified>.dropdown .dropdown-menu,.nf-form-wrap .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.nf-form-wrap .nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.nf-form-wrap .navbar-nav .open .dropdown-menu .dropdown-header,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{line-height:20px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.nf-form-wrap .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.nf-form-wrap .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}@media (max-width:767px){.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.nf-loading-spinner{width:40px;height:40px;margin:100px auto;background-color:hsla(0,0%,81.6%,.5);border-radius:100%;-webkit-animation:nf-scaleout 1s ease-in-out infinite;animation:nf-scaleout 1s ease-in-out infinite}@-webkit-keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}@keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.field-wrap{display:flex}.field-wrap>label{display:block}.field-wrap .pikaday__container,.field-wrap .pikaday__display,.field-wrap>div input,.field-wrap select,.field-wrap textarea{width:100%}.field-wrap>div input[type=checkbox],.field-wrap button,.field-wrap input[type=button],.field-wrap input[type=submit]{width:auto}.nf-field-label{order:5}.nf-field-description{width:100%;order:10}.nf-field-element{order:15}.label-above .nf-field-label{margin-bottom:10px}.label-below .nf-field-label{margin-top:10px;order:15}.label-below .nf-field-element{order:5}.label-hidden .field-wrap{flex-wrap:wrap}.label-hidden .nf-field-label{height:0;margin:0!important;width:100%;visibility:hidden}.label-hidden .nf-field-description{width:100%;order:20}.label-hidden .nf-field-element{width:100%}.label-left .field-wrap{flex-direction:row;flex-wrap:wrap}.label-left .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-right:2%;text-align:right;width:35%;order:5}.label-left .nf-field-label label{width:100%}.label-left .nf-field-description{margin-left:35%}.label-left .nf-field-element{display:inline-block;width:65%;order:10}.label-left .nf-after-field{margin-left:36.5%}.label-right .field-wrap{flex-direction:row}.label-right .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-left:2%;width:35%;order:10}.label-right .nf-field-description{margin-right:35%;order:15}.label-right .nf-field-element{display:inline-block;width:65%;order:5}.label-right .checkbox-wrap .nf-field-label{width:auto}.label-right .checkbox-wrap .nf-field-element{width:20px}.label-right .nf-after-field{width:65%}.label-above .field-wrap,.label-below .field-wrap{flex-direction:column;flex-flow:wrap}.label-above .nf-field-element,.label-below .nf-field-element{margin:0;width:100%}.label-left .listcheckbox-wrap .nf-field-label,.label-left .listradio-wrap .nf-field-label,.label-left .textarea-wrap .nf-field-label,.label-right .listcheckbox-wrap .nf-field-label,.label-right .listradio-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{align-items:flex-start}.label-left .textarea-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{margin-top:5px}.label-left .hr-wrap,.label-left .html-wrap,.label-right .hr-wrap,.label-right .html-wrap{display:block}.label-left .hr-wrap .nf-field-element,.label-left .html-wrap .nf-field-element,.label-right .hr-wrap .nf-field-element,.label-right .html-wrap .nf-field-element{display:block;margin:0;width:100%}.nf-repeater-fieldsets fieldset{margin-bottom:1em}.nf-remove-fieldset{color:red;font-size:1.5em;background-color:transparent;border:thin solid red;padding:.1em .4em;float:right;margin-top:-1em}.nf-help{background:none}.nf-field-description{font-size:14px}.nf-form-content{padding:5px;max-width:1000px;margin:0 auto}.nf-form-content label{font-size:18px;line-height:20px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content .ninja-forms-field{font-size:16px;margin:0;padding:12px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content input.ninja-forms-field,.nf-form-content select.ninja-forms-field:not([multiple]){height:50px}.nf-form-content textarea.ninja-forms-field{height:200px}.nf-form-content hr.ninja-forms-field{padding:0}.nf-form-content input[type=checkbox].ninja-forms-field,.nf-form-content input[type=radio].ninja-forms-field{height:auto}.nf-form-content .listcheckbox-wrap li,.nf-form-content .listradio-wrap li{margin-bottom:12px!important;line-height:0}.nf-form-content .nf-product-field span{padding-right:16px}.nf-form-content .nf-product-field .nf-field-qty{font-size:16px;padding:5px;width:80px!important}.nf-form-content .nf-static{background:transparent;border:0;font-weight:700;padding:0}.nf-form-content .label-above .nf-field-label,.nf-form-content .label-below .nf-field-label,.nf-form-content .label-hidden .nf-field-label{margin-bottom:10px;padding:0}.nf-form-content .label-below .nf-field-label{margin-bottom:0;margin-top:10px}.nf-form-content .label-right .nf-field-label{margin:0}.nf-form-content .label-right>input[type=radio],.nf-form-content .label-right input[type=checkbox],.nf-form-content .label-right ul{margin-right:1%}.nf-form-content .list-select-wrap>div{position:relative}.nf-form-content .list-select-wrap>div div{display:block;position:absolute;font-size:16px;line-height:16px;margin:0;padding:16px;height:50px;top:0;right:0;left:0;z-index:1}.nf-form-content .list-select-wrap>div div:after{content:"\f078";font-family:FontAwesome;font-size:20px;position:absolute;right:10px;bottom:0;height:50px;line-height:50px}.nf-form-content .list-select-wrap>div.label-right div{width:59%}.nf-form-content .list-select-wrap>div.label-below div{top:0;bottom:auto}.nf-form-content .list-select-wrap>div.label-left div{width:59%;left:40.5%;right:40px}.nf-form-content .list-select-wrap>div select{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;z-index:2}.nf-form-content .listmultiselect-wrap select{-webkit-appearance:normal;-moz-appearance:normal;appearance:normal}.checkbox-wrap .nf-field-element label,.checkbox-wrap .nf-field-label label,.listcheckbox-wrap .nf-field-element label,.listcheckbox-wrap .nf-field-label label{position:relative;margin-left:30px}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{border:1px solid;content:"";width:18px;height:18px;position:absolute;left:-28px;bottom:0}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{content:"\f00c";font-family:FontAwesome;font-size:24px;position:absolute;bottom:0;z-index:2}.checkbox-container .nf-field-element input{display:inherit;opacity:0}.checkbox-container.label-above label{height:50px;margin:0;display:block}.checkbox-container.label-above label:before{left:-2px;bottom:-16px}.checkbox-container.label-above label:after{left:0;bottom:-16px}.checkbox-container.label-below label{display:block;margin:20px 0 0}.checkbox-container.label-below label:before{left:-2px;bottom:auto;top:-27px}.checkbox-container.label-below label:after{left:0;bottom:auto;top:-25px}.checkbox-container.label-left .nf-field-label{width:38%;padding-right:5%}.checkbox-container.label-left .nf-field-element{width:58%}.checkbox-container.label-left label{margin:0;display:block}.checkbox-container.label-left label:before{left:auto;top:-2px;right:-36px}.checkbox-container.label-left label:after{left:auto;top:0;right:-31px}.checkbox-container.label-right .nf-field-label{padding:0;order:10}.checkbox-container.label-right .nf-field-element{order:5;display:inline;position:absolute;opacity:0}.checkbox-container.label-right label{margin:0 0 0 30px;display:block}.checkbox-container.label-right label:before{left:-30px;top:0}.checkbox-container.label-right label:after{left:-28px;top:0}.checkbox-container.label-right .field-wrap{display:flex}.checkbox-container.label-right .field-wrap>div{width:100%}.checkbox-container.label-hidden label{height:0;margin:0;display:block}.checkbox-container.label-hidden label:after{left:0;bottom:0;visibility:visible}.checkbox-container.label-hidden label.nf-checked-label:before{left:-2px;bottom:0;visibility:visible}.listcheckbox-container .nf-field-label label:after{background:transparent!important;border:0}.listcheckbox-container .nf-field-element input{display:inherit;opacity:0}.listcheckbox-container .nf-field-element label{margin-left:30px!important}.listcheckbox-container .nf-field-element label:before{top:1px;left:-30px;bottom:auto}.listcheckbox-container .nf-field-element label:after{top:3px;bottom:auto}.listcheckbox-container.label-above .nf-field-label label,.listcheckbox-container.label-below .nf-field-label label,.listcheckbox-container.label-right .nf-field-label label{margin:0}.listcheckbox-container.label-above .nf-field-label label:before,.listcheckbox-container.label-below .nf-field-label label:before,.listcheckbox-container.label-right .nf-field-label label:before{left:-30px}.listradio-wrap .nf-field-element label{position:relative;margin-left:30px!important}.listradio-wrap .nf-field-element label:after{border-radius:50%;content:"";width:18px;height:18px;position:absolute;left:-30px;bottom:1px;top:.05em}.listradio-wrap .nf-field-element label.nf-checked-label:before{border-radius:50%;content:"";height:10px;width:10px;position:absolute;left:-26px;bottom:5px;z-index:2;top:.25em}.listradio-wrap .nf-field-element input{display:inherit}input[type=checkbox].nf-toggle{background:transparent;border:0;box-shadow:0 0 0;margin:10px;height:18px;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;cursor:pointer}input[type=checkbox].nf-toggle:after{background:#bcbdbf;border:2px solid #bcbdbf;border-radius:20px;content:"";position:absolute;top:-4px;left:-4px;width:46px;height:24px;transition:all .3s ease}input[type=checkbox].nf-toggle:before{background:#fff;border-radius:20px;content:"";position:absolute;top:-1px;left:0;width:18px;height:18px;z-index:99;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:after{background:#90ee90;border:2px solid #90ee90;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:before{top:-1px;left:20px;transition:all .3s ease}.label-right input[type=checkbox].nf-toggle{padding:0 50px 0 0}.label-left input[type=checkbox].nf-toggle{padding:0;margin-left:22px;margin-top:20px}.nf-icons .nf-field-element{position:relative}.nf-icons .nf-field-element:before{font-family:FontAwesome;font-size:20px;position:absolute;left:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;z-index:1}.nf-icons .address-wrap .nf-field-element input,.nf-icons .city-wrap .nf-field-element input,.nf-icons .creditcardcvc-wrap .nf-field-element input,.nf-icons .creditcardexpiration-wrap .nf-field-element input,.nf-icons .creditcardfullname-wrap .nf-field-element input,.nf-icons .creditcardnumber-wrap .nf-field-element input,.nf-icons .creditcardzip-wrap .nf-field-element input,.nf-icons .date-wrap .nf-field-element input,.nf-icons .email-wrap .nf-field-element input,.nf-icons .firstname-wrap .nf-field-element input,.nf-icons .lastname-wrap .nf-field-element input,.nf-icons .number-wrap .nf-field-element input,.nf-icons .phone-wrap .nf-field-element input,.nf-icons .quantity-wrap .nf-field-element input,.nf-icons .state-wrap .nf-field-element input,.nf-icons .zip-wrap .nf-field-element input{padding-left:60px}.nf-icons.right .nf-field-element:before{left:auto;right:1px}.nf-icons.right .address-wrap>div input,.nf-icons.right .city-wrap>div input,.nf-icons.right .creditcardcvc-wrap>div input,.nf-icons.right .creditcardexpiration-wrap>div input,.nf-icons.right .creditcardfullname-wrap>div input,.nf-icons.right .creditcardnumber-wrap>div input,.nf-icons.right .creditcardzip-wrap>div input,.nf-icons.right .date-wrap>div input,.nf-icons.right .email-wrap>div input,.nf-icons.right .firstname-wrap>div input,.nf-icons.right .lastname-wrap>div input,.nf-icons.right .number-wrap>div input,.nf-icons.right .phone-wrap>div input,.nf-icons.right .quantity-wrap>div input,.nf-icons.right .state-wrap>div input,.nf-icons.right .zip-wrap>div input{padding-left:12px;padding-right:60px}.nf-icons .date-wrap .nf-field-element:before{content:"\f073"}.nf-icons .number-wrap .nf-field-element:before,.nf-icons .quantity-wrap>div:before{content:"\f292"}.nf-icons .email-wrap .nf-field-element:before{content:"\f0e0"}.nf-icons .phone-wrap .nf-field-element:before{content:"\f095"}.nf-icons .firstname-wrap .nf-field-element:before,.nf-icons .lastname-wrap .nf-field-element:before{content:"\f007"}.nf-icons .address-wrap .nf-field-element:before,.nf-icons .city-wrap .nf-field-element:before,.nf-icons .state-wrap .nf-field-element:before,.nf-icons .zip-wrap .nf-field-element:before{content:"\f041"}.nf-icons .creditcardcvc-wrap .nf-field-element:before,.nf-icons .creditcardexpiration-wrap .nf-field-element:before,.nf-icons .creditcardfullname-wrap .nf-field-element:before,.nf-icons .creditcardnumber-wrap .nf-field-element:before,.nf-icons .creditcardzip-wrap .nf-field-element:before{content:"\f283"}.nf-field-element .date-and-time{margin-bottom:5px}.nf-field-element .hour{padding:5px;border-right:0}.nf-field-element .ampm,.nf-field-element .minute{padding:5px;border-left:0}.nf-form-content .list-select-wrap .nf-field-element>div,.nf-form-content input:not([type=button]),.nf-form-content textarea{background:#222;border:1px solid #3c3c3c;border-radius:0;box-shadow:none;color:#888;transition:all .5s}.nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-form-content input:not([type=button]):focus,.nf-form-content textarea:focus{background:#3c3c3c;border-color:#555;color:#a2a2a2;outline:none;transition:all .5s}.nf-form-content button,.nf-form-content input[type=button],.nf-form-content input[type=submit]{background:#fff;border:0;color:#222;transition:all .5s}.nf-form-content button:hover,.nf-form-content input[type=button]:hover,.nf-form-content input[type=submit]:hover{background:#3c3c3c;color:#888;transition:all .5s}.nf-form-content select.ninja-forms-field{color:#888}.nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.list-select-wrap div:after{color:#888;transition:all .5s}.list-select-wrap select:active+div,.list-select-wrap select:focus+div{background:#3c3c3c!important;border-color:#555!important;transition:all .5s}.listradio-wrap .nf-field-element label:after{background:#222;border:2px solid #3c3c3c;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#fff;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:before{background:#fff}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{background:#222;border-color:#3c3c3c;transition:all .5s}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{color:#222;opacity:0;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:after,.checkbox-wrap .nf-field-label label.nf-checked-label:after,.listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#555;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:before,.checkbox-wrap .nf-field-label label.nf-checked-label:before,.listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#fff;opacity:1;transition:all .5s}.nf-error{position:relative}.nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-error .nf-error-msg{color:#e80000}.nf-pass{position:relative}.nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-icons .nf-field-element:before{background:#3c3c3c;color:#222}.nf-help{color:#fff}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div,.nf-brown .nf-form-content input:not([type=button]),.nf-brown .nf-form-content textarea{background:#3e2b13;border:1px solid #65461f;border-radius:0;box-shadow:none;color:#ca9553;transition:all .5s}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-brown .nf-form-content input:not([type=button]):focus,.nf-brown .nf-form-content textarea:focus{background:#65461f;border-color:#8c612b;color:#d6ad7a;outline:none;transition:all .5s}.nf-brown .nf-form-content button,.nf-brown .nf-form-content input[type=button],.nf-brown .nf-form-content input[type=submit]{background:#ea981b;border:0;color:#3e2b13;transition:all .5s}.nf-brown .nf-form-content button:hover,.nf-brown .nf-form-content input[type=button]:hover,.nf-brown .nf-form-content input[type=submit]:hover{background:#65461f;color:#ca9553;transition:all .5s}.nf-brown .nf-form-content select.ninja-forms-field{color:#ca9553}.nf-brown .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-brown .list-select-wrap div:after{color:#ca9553;transition:all .5s}.nf-brown .list-select-wrap select:active+div,.nf-brown .list-select-wrap select:focus+div{background:#65461f!important;border-color:#8c612b!important;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label:after{background:#3e2b13;border:2px solid #65461f;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#ea981b;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#ea981b}.nf-brown .checkbox-wrap .nf-field-element label:after,.nf-brown .checkbox-wrap .nf-field-label label:after,.nf-brown .listcheckbox-wrap .nf-field-element label:after,.nf-brown .listcheckbox-wrap .nf-field-label label:after{background:#3e2b13;border-color:#65461f;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label:before,.nf-brown .checkbox-wrap .nf-field-label label:before,.nf-brown .listcheckbox-wrap .nf-field-element label:before,.nf-brown .listcheckbox-wrap .nf-field-label label:before{color:#3e2b13;opacity:0;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#8c612b;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#ea981b;opacity:1;transition:all .5s}.nf-brown .nf-error{position:relative}.nf-brown .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-brown .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-brown .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-error .nf-error-msg{color:#e80000}.nf-brown .nf-pass{position:relative}.nf-brown .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-brown .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-brown .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-brown .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-brown .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-brown .nf-icons .nf-field-element:before{background:#65461f;color:#3e2b13}.nf-brown .nf-help{color:#ea981b}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div,.nf-red .nf-form-content input:not([type=button]),.nf-red .nf-form-content textarea{background:#350000;border:1px solid #680000;border-radius:0;box-shadow:none;color:#ff0202;transition:all .5s}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-red .nf-form-content input:not([type=button]):focus,.nf-red .nf-form-content textarea:focus{background:#680000;border-color:#9b0000;color:#ff3535;outline:none;transition:all .5s}.nf-red .nf-form-content button,.nf-red .nf-form-content input[type=button],.nf-red .nf-form-content input[type=submit]{background:red;border:0;color:#350000;transition:all .5s}.nf-red .nf-form-content button:hover,.nf-red .nf-form-content input[type=button]:hover,.nf-red .nf-form-content input[type=submit]:hover{background:#680000;color:#ff0202;transition:all .5s}.nf-red .nf-form-content select.ninja-forms-field{color:#ff0202}.nf-red .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-red .list-select-wrap div:after{color:#ff0202;transition:all .5s}.nf-red .list-select-wrap select:active+div,.nf-red .list-select-wrap select:focus+div{background:#680000!important;border-color:#9b0000!important;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label:after{background:#350000;border:2px solid #680000;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:red;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:before{background:red}.nf-red .checkbox-wrap .nf-field-element label:after,.nf-red .checkbox-wrap .nf-field-label label:after,.nf-red .listcheckbox-wrap .nf-field-element label:after,.nf-red .listcheckbox-wrap .nf-field-label label:after{background:#350000;border-color:#680000;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label:before,.nf-red .checkbox-wrap .nf-field-label label:before,.nf-red .listcheckbox-wrap .nf-field-element label:before,.nf-red .listcheckbox-wrap .nf-field-label label:before{color:#350000;opacity:0;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#9b0000;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:red;opacity:1;transition:all .5s}.nf-red .nf-error{position:relative}.nf-red .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-red .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-red .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-error .nf-error-msg{color:#e80000}.nf-red .nf-pass{position:relative}.nf-red .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-red .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-red .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-red .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-red .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-red .nf-icons .nf-field-element:before{background:#680000;color:#350000}.nf-red .nf-help{color:red}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div,.nf-blue .nf-form-content input:not([type=button]),.nf-blue .nf-form-content textarea{background:#001c33;border:1px solid #003866;border-radius:0;box-shadow:none;color:#008cff;transition:all .5s}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-blue .nf-form-content input:not([type=button]):focus,.nf-blue .nf-form-content textarea:focus{background:#003866;border-color:#005499;color:#33a3ff;outline:none;transition:all .5s}.nf-blue .nf-form-content button,.nf-blue .nf-form-content input[type=button],.nf-blue .nf-form-content input[type=submit]{background:#00aeff;border:0;color:#001c33;transition:all .5s}.nf-blue .nf-form-content button:hover,.nf-blue .nf-form-content input[type=button]:hover,.nf-blue .nf-form-content input[type=submit]:hover{background:#003866;color:#008cff;transition:all .5s}.nf-blue .nf-form-content select.ninja-forms-field{color:#008cff}.nf-blue .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-blue .list-select-wrap div:after{color:#008cff;transition:all .5s}.nf-blue .list-select-wrap select:active+div,.nf-blue .list-select-wrap select:focus+div{background:#003866!important;border-color:#005499!important;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label:after{background:#001c33;border:2px solid #003866;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#00aeff;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#00aeff}.nf-blue .checkbox-wrap .nf-field-element label:after,.nf-blue .checkbox-wrap .nf-field-label label:after,.nf-blue .listcheckbox-wrap .nf-field-element label:after,.nf-blue .listcheckbox-wrap .nf-field-label label:after{background:#001c33;border-color:#003866;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label:before,.nf-blue .checkbox-wrap .nf-field-label label:before,.nf-blue .listcheckbox-wrap .nf-field-element label:before,.nf-blue .listcheckbox-wrap .nf-field-label label:before{color:#001c33;opacity:0;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#005499;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#00aeff;opacity:1;transition:all .5s}.nf-blue .nf-error{position:relative}.nf-blue .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-blue .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-blue .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-error .nf-error-msg{color:#e80000}.nf-blue .nf-pass{position:relative}.nf-blue .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-blue .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-blue .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-blue .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-blue .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-blue .nf-icons .nf-field-element:before{background:#003866;color:#001c33}.nf-blue .nf-help{color:#00aeff}@media only screen and (max-width:800px){.nf-field-container .nf-field-label{margin-bottom:10px!important;padding:0;width:100%;order:5}.nf-field-container .nf-field-label label{text-align:left}.nf-field-container .nf-field-description{margin:0;width:100%;order:10}.nf-field-container .nf-field-element{width:100%;order:15}.nf-field-container .checkbox-wrap .nf-field-label{width:auto}.nf-field-container .checkbox-wrap .nf-field-label label{position:relative;margin-left:30px}.nf-field-container .checkbox-wrap .nf-field-label label:after{left:-28px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-label label:before{left:-30px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-element{width:20px}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:both;float:none;margin:0;width:100%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:0}}
|
2 |
/*# sourceMappingURL=display-opinions-dark.css.map */
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["st-defaults.scss","editor.scss","st-loading.scss","st-label-positions.scss","repeater-field.scss","op-spacing.scss","op-select.scss","op-checkbox.scss","op-radio.scss","op-toggle.scss","op-icons.scss","op-date.scss","op-color.scss","display-opinions-dark.scss","op-variables-dark.scss","st-media-queries.scss"],"names":[],"mappings":"AAIA,sFAKI,yBAA0B,CAC1B,qBAAsB,CAG1B,iBACI,YAAa,CAGjB,gDAEI,UAAW,CACX,iBAAkB,CAClB,kBAAmB,CAJvB,4DAMQ,UAAW,CACX,UAAW,CACX,aAAc,CARtB,4JAYQ,QAAS,CACT,WAAY,CAbpB,0UAoBY,YAAa,CAKzB,sBAEQ,eAAiB,CACjB,QAAS,CACT,SAAU,CAGlB,kBACI,iBAAkB,CADtB,4EAKQ,QAAS,CACT,UAAW,CACX,WAAY,CACZ,sBAAuB,CAR/B,2BAWQ,YAAa,CAGrB,mCAEQ,QAAS,CAGjB,SACI,8CAAmD,CACnD,oBAAqB,CACrB,UAAW,CACX,WAAY,CAGhB,gBACI,cAAe,CACf,cAAe,CAEnB,WACI,cAAe,CAEnB,8BAEQ,iBAAkB,CAe1B,0OAKY,yBAA2B,CAC3B,kBAAoB,CACpB,mBAAqB,CAPjC,8QASgB,gBAAiB,CATjC,qHAaY,iBAAkB,CAClB,wBAA0B,CAC1B,uBAA+B,CAf3C,uIAkBgB,aAAc,CACd,UAAc,CAEd,UAAW,CACX,iBAAkB,CAtBlC,u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B,kBAAmB,CChH3B,qDDoHY,WAAY,CACZ,uBAAwB,CACxB,cAAe,CACf,eAAgB,CAChB,iBAAkB,CAClB,KAAM,CACN,UAAW,CACX,WAAY,CACZ,gBAAiB,CACjB,kBAAmB,CC7H/B,mEDiIgB,YAAa,CCjI7B,gCD2II,gBAAiB,CACjB,aAAgB,CAChB,2BAA4B,CAC5B,iBAAkB,CAClB,SAAU,CC/Id,sCDiJQ,eAAgB,CAChB,uBAAwB,CACxB,cAAe,CACf,iBAAkB,CAClB,KAAM,CACN,SAAU,CACV,WAAY,CACZ,gBAAiB,CACjB,SAAU,CCzJlB,gCD8JI,oBAAqB,CACrB,aAAc,CACd,wBAAyB,CChK7B,4CDqKQ,kBEhN4B,CFiN5B,aCzKM,CAGd,kBD2KI,aC7KY,CE1ChB,yCACI,oCAEQ,4BAA8B,CAC9B,SAAU,CACV,UAAW,CACX,OAAQ,CALhB,0CAOY,eAAgB,CAP5B,0CAWQ,QAAS,CACT,UAAW,CACX,QAAS,CAbjB,sCAgBQ,UAAW,CACX,QAAS,CAjBjB,mDAqBY,UAAW,CArBvB,yDAuBgB,iBAAkB,CAClB,gBAAiB,CAxBjC,+DA0BoB,UAAW,CACX,QAAS,CA3B7B,gEA8BoB,UAAW,CACX,QAAS,CA/B7B,qDAoCY,UAAW,CAIvB,kSAYQ,UAAW,CACX,UAAW,CACX,QAAS,CACT,UAAW,CAfnB,0XAiBY,SAAU,CACb","file":"display-opinions-dark.css","sourcesContent":["/*\n * Ninja Forms - Form Display Structure\n */\n\n.ninja-forms-form-wrap *,\n.ninja-forms-form-wrap *:after,\n.ninja-forms-form-wrap *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.nf-response-msg {\n display: none;\n}\n\n.nf-field-container,\n#ninja_forms_required_items {\n clear: both;\n position: relative;\n margin-bottom: 25px;\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n &.hidden-container,\n &.hr-container {\n margin: 0;\n height: auto;\n .nf-field-label {\n display: none;\n }\n }\n &.html-container {\n .nf-field-label {\n display: none;\n }\n }\n}\n\n.nf-field-label {\n label {\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n}\n.nf-field-element {\n position: relative;\n input,\n select,\n textarea {\n margin: 0;\n width: auto;\n height: auto;\n vertical-align: inherit;\n }\n textarea {\n height: 200px;\n }\n}\n.nf-field-description {\n p:last-child {\n margin: 0;\n }\n}\n.nf-help {\n background: url( '../img/help-info.png' ) no-repeat;\n display: inline-block;\n width: 16px;\n height: 16px;\n}\n\n.nf-input-limit {\n font-size: 12px;\n margin-top: 5px;\n}\n.nf-static {\n padding: 0 10px;\n}\n.nf-after-field {\n .nf-error-msg {\n margin-right: 10px;\n //text-align: right;\n }\n}\n\n/* ---------------------------------\nCHECKBOX FIELD\n----------------------------------*/\n\n\n\n/* ---------------------------------\nRADIO & CHECKBOX LISTS\n----------------------------------*/\n\n.list-radio-wrap,\n.list-checkbox-wrap,\n.list-image-wrap {\n .nf-field-element {\n ul, li {\n list-style: none !important;\n margin: 0 !important;\n padding: 0 !important;\n input {\n margin-right: 5px;\n }\n }\n li {\n padding-left: 10px;\n margin: 0 0 5px !important;\n text-indent: initial !important;\n label {\n //display: inline;\n display: block;\n float: initial;\n //margin: 0;\n width: auto;\n margin-left: 1.5em;\n }\n input {\n width: auto !important;\n float: left;\n margin-top: .25em;\n }\n }\n }\n}\n\n.listimage-wrap {\n li {\n width: 100%;\n height: 100%;\n display: inline-grid;\n label {\n padding: 5px;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n &.nf-checked-label {\n border-width: 2px;\n border-style: solid;\n border-color: #007acc;\n transition: all .5s;\n }\n img {\n display: block;\n }\n }\n input {\n display: none;\n }\n }\n}\n\n/* ---------------------------------\nPRODUCT FIELD\n----------------------------------*/\n.product-wrap {\n > div {\n input {\n width: 80px !important;\n }\n .nf-product-field {\n span {\n padding: 0 5px;\n }\n }\n }\n}\n\n/* ---------------------------------\nSTAR RATING\n----------------------------------*/\n.starrating-wrap .star {\n border-bottom: 0;\n}\n\n/* ---------------------------------\nHONEYPOT\n----------------------------------*/\n\n.nf-form-hp {\n position: absolute;\n visibility: hidden;\n}\n\n/* ---------------------------------\nSELECT LIST\n----------------------------------*/\n.list-select-wrap {\n div div {\n display: none;\n }\n}\n\n\n/* ---------------------------------\nCOLORS\nAs minimal as possible\n----------------------------------*/\n.ninja-forms-req-symbol,\n.nf-error-msg {\n color: #E80000;\n}\n.nf-error {\n .ninja-forms-field {\n border: 1px solid #E80000;\n }\n &.listimage-wrap {\n .nf-field-element {\n ul {\n border: 1px solid #E80000;\n }\n }\n }\n}\n.nf-field-submit-error {\n padding: 15px;\n}\n\n.ninja-forms-noscript-message {\n background: #f1f1f1;\n border: 4px dashed #ccc;\n color: #333;\n display: block;\n font-size: 20px;\n margin: 20px 0;\n padding: 40px;\n text-align: center;\n}\n\n/* ---------------------------------\nHELPER CLASSES\n----------------------------------*/\n.two-col-list {\n ul {\n li {\n float: left;\n width: 50%\n }\n }\n}\n.three-col-list {\n ul {\n li {\n float: left;\n width: 33.33%\n }\n }\n}\n.four-col-list {\n ul {\n li {\n float: left;\n width: 25%\n }\n }\n}\n.five-col-list {\n ul {\n li {\n float: left;\n width: 20%\n }\n }\n}\n.six-col-list {\n ul {\n li {\n float: left;\n width: 16.66%\n }\n }\n}\n\n\nbody {\n .pika-label {\n background: transparent;\n }\n}\n\n/* Column Classes\n Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css\n--------------------------------------------- */\n.nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: initial;\n float: left;\n margin-left: 2.564102564102564%;\n .inside {\n padding: 20px;\n }\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n\n .one-half,\n .three-sixths,\n .two-fourths {\n width: 48.717948717948715%;\n }\n\n .one-third,\n .two-sixths {\n width: 31.623931623931625%;\n }\n\n .four-sixths,\n .two-thirds {\n width: 65.81196581196582%;\n }\n\n .one-fourth {\n width: 23.076923076923077%;\n }\n\n .three-fourths {\n width: 74.35897435897436%;\n }\n\n .one-sixth {\n width: 14.52991452991453%;\n }\n\n .five-sixths {\n width: 82.90598290598291%;\n }\n\n .first {\n clear: both;\n margin-left: 0;\n }\n}\n",".note-popover {\n display: none !important;\n}\n.nf-form-wrap {\n .note-editor {\n border: 0 !important;\n .note-toolbar {\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n .note-editable {\n background: #f9f9f9;\n border: 1px solid #f1f1f1;\n display: block;\n p {\n font-size: 16px;\n }\n ul {\n list-style-type: disc;\n margin-left: 2em;\n }\n table {\n td {\n border: 1px solid #ccc;\n width: auto;\n }\n }\n }\n .modal {\n display: none;\n }\n .btn-group {\n float: left;\n &.note-tools {\n float: right;\n }\n }\n .btn {\n background: #f9f9f9;\n border: 0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n margin-right: 2px;\n padding-top: 4px;\n &.disabled {\n background: transparent;\n color: #aaa;\n .merge-tags {\n background: #f9f9f9;\n color: #666;\n }\n }\n }\n button[type=button] {\n padding: 4px;\n width: auto;\n height: auto;\n }\n .dropdown-toggle {\n position: relative;\n display: inline-block;\n top: 0;\n &::after {\n content: \"\";\n width: 0;\n }\n }\n }\n .tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n white-space: normal;\n filter: alpha(opacity=0);\n opacity: 0;\n\n line-break: auto;\n }\n .tooltip.in {\n filter: alpha(opacity=90);\n opacity: .9;\n }\n .tooltip.top {\n padding: 5px 0;\n margin-top: -3px;\n }\n .tooltip.right {\n padding: 0 5px;\n margin-left: 3px;\n }\n .tooltip.bottom {\n padding: 5px 0;\n margin-top: 3px;\n }\n .tooltip.left {\n padding: 0 5px;\n margin-left: -3px;\n }\n .tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n }\n .tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-left .tooltip-arrow {\n right: 5px;\n bottom: 0;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n }\n .tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n }\n .tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .dropdown-menu {\n position: absolute;\n // top: 100%;\n // left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n font-size: 14px;\n text-align: left;\n list-style: none;\n background-color: #fff;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, .15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n }\n .dropdown-menu.pull-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n }\n .dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333;\n white-space: nowrap;\n }\n .dropdown-menu > li > a:hover,\n .dropdown-menu > li > a:focus {\n color: #262626;\n text-decoration: none;\n background-color: #f5f5f5;\n }\n .dropdown-menu > .active > a,\n .dropdown-menu > .active > a:hover,\n .dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n background-color: #337ab7;\n outline: 0;\n }\n .dropdown-menu > .disabled > a,\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n color: #777;\n }\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n cursor: not-allowed;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n }\n .open > .dropdown-menu {\n display: block;\n }\n .open > a {\n outline: 0;\n }\n .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n .dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777;\n white-space: nowrap;\n }\n .dropdown-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 990;\n }\n .pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n }\n .dropup .caret,\n .navbar-fixed-bottom .dropdown .caret {\n content: \"\";\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n }\n .dropup .dropdown-menu,\n .navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n @media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n right: 0;\n left: auto;\n }\n .navbar-right .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n }\n .btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n }\n .nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n }\n .navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n }\n @media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n }\n}\n",".nf-loading-spinner {\n width: 40px;\n height: 40px;\n margin: 100px auto;\n background-color: rgba(208,208,208,.5);\n\n border-radius: 100%;\n animation: nf-scaleout 1.0s infinite ease-in-out;\n}\n\n@-webkit-keyframes nf-scaleout {\n 0% { transform: scale(0) }\n 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}\n\n@keyframes nf-scaleout {\n 0% {\n transform: scale(0);\n } 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}","/* ---------------------------------\nSTANDARDIZE ALL FIELDS\n----------------------------------*/\n.field-wrap {\n display: flex;\n //flex-wrap:wrap;\n > label {\n display: block;\n }\n > div input,\n textarea,\n select,\n .pikaday__container,\n .pikaday__display {\n width: 100%;\n }\n > div input[type=\"checkbox\"] {\n width: auto;\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n width: auto;\n }\n .nf-product-field {\n // .nf-element {\n // width: 100%;\n // }\n }\n}\n\n.nf-field-label {\n order: 5;\n}\n.nf-field-description {\n width: 100%;\n order: 10;\n}\n.nf-field-element {\n order: 15;\n}\n\n\n/* ---------------------------------\nLABEL ABOVE\n----------------------------------*/\n.label-above {\n .nf-field-label {\n margin-bottom: 10px;\n }\n}\n\n/* ---------------------------------\nLABEL BELOW\n----------------------------------*/\n.label-below {\n .nf-field-label {\n margin-top: 10px;\n order: 15;\n }\n .nf-field-element {\n order: 5;\n }\n}\n\n/* ---------------------------------\nLABEL HIDDEN\n----------------------------------*/\n.label-hidden {\n .field-wrap {\n flex-wrap: wrap;\n }\n .nf-field-label {\n height: 0;\n margin: 0 !important;\n width: 100%;\n visibility: hidden;\n }\n .nf-field-description {\n width: 100%;\n order: 20;\n }\n .nf-field-element {\n width: 100%;\n }\n}\n\n/* ---------------------------------\nLABEL LEFT\n----------------------------------*/\n.label-left {\n .field-wrap {\n flex-direction: row;\n flex-wrap: wrap;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-right: 2%;\n text-align: right;\n width: 35%;\n order: 5;\n label {\n width: 100%;\n }\n }\n .nf-field-description {\n margin-left: 35%;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 10;\n }\n .nf-after-field {\n margin-left: 36.5%;\n }\n}\n\n/* ---------------------------------\nLABEL RIGHT\n----------------------------------*/\n.label-right {\n .field-wrap {\n flex-direction: row;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: 2%;\n width: 35%;\n order: 10;\n }\n .nf-field-description {\n margin-right: 35%;\n order: 15;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 5;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n }\n .nf-field-element {\n width: 20px;\n }\n }\n .nf-after-field {\n width: 65%;\n }\n}\n/* ---------------------------------\nADJUST SOME LABEL ABOVE & BELOW ISSUES\n----------------------------------*/\n.label-below,\n.label-above {\n .field-wrap {\n flex-direction: column;\n flex-flow: wrap;\n }\n .nf-field-element {\n margin: 0;\n width: 100%;\n }\n .checkbox-wrap {\n .nf-field-label {\n //margin: 0;\n }\n }\n}\n\n/* ---------------------------------\nADJUST SOME LABEL LEFT & RIGHT ISSUES\n----------------------------------*/\n.label-left,\n.label-right {\n .textarea-wrap,\n .listradio-wrap,\n .listcheckbox-wrap {\n .nf-field-label {\n align-items: flex-start;\n }\n }\n .textarea-wrap {\n .nf-field-label {\n margin-top: 5px;\n }\n }\n .html-wrap,\n .hr-wrap {\n display: block;\n .nf-field-element {\n display: block;\n margin: 0;\n width: 100%;\n }\n }\n}\n\n/* ---------------------------------\nFIELD DESCRIPTION POSITIONS\n----------------------------------*/\n",".nf-repeater-fieldsets{\n fieldset {\n margin-bottom: 1em;\n }\n}\n\n.nf-remove-fieldset {\n color: red;\n font-size: 1.5em;\n background-color: transparent;\n border: thin solid red;\n padding: 0.1em 0.4em;\n float: right;\n margin-top: -1em;\n}",".nf-help {\n background: none;\n}\n.nf-field-description {\n font-size: 14px;\n}\n.nf-form-content {\n padding: 5px;\n max-width: 1000px;\n margin: 0 auto;\n label {\n font-size: 18px;\n line-height: 20px;\n }\n .ninja-forms-field,\n .listselect-wrap .nf-field-element div {\n font-size: 16px;\n margin: 0;\n padding: 12px;\n }\n input.ninja-forms-field,\n select.ninja-forms-field:not([multiple]),\n .listselect-wrap .nf-field-element div {\n height: 50px;\n }\n textarea.ninja-forms-field {\n height: 200px;\n }\n hr.ninja-forms-field {\n padding: 0;\n }\n input[type=\"radio\"].ninja-forms-field,\n input[type=\"checkbox\"].ninja-forms-field {\n height: auto;\n }\n .listradio-wrap,\n .listcheckbox-wrap {\n li {\n margin-bottom: 12px !important;\n line-height: 0;\n }\n }\n .nf-product-field {\n &.ninja-forms-field {\n // background: transparent;\n // border: 0;\n // padding: 0;\n }\n span {\n padding-right: 16px;\n }\n .nf-field-qty {\n font-size: 16px;\n padding: 5px;\n width: 80px !important;\n }\n }\n .listselect-wrap,\n .liststate-wrap,\n .listcountry-wrap {\n select {\n //height: 50px;\n }\n }\n .nf-static {\n background: transparent;\n border: 0;\n font-weight: bold;\n padding: 0;\n }\n .label-above,\n .label-below,\n .label-hidden {\n .nf-field-label {\n margin-bottom: 10px;\n padding: 0;\n }\n }\n .label-below {\n .nf-field-label {\n margin-bottom: 0;\n margin-top: 10px;\n }\n }\n .label-right {\n .nf-field-label {\n margin: 0;\n }\n > input,\n textarea,\n select,\n .nf-product-field,\n .starrating,\n .nf-static,\n .pikaday__container {\n // margin-right: 1%;\n }\n > input[type=radio],\n input[type=checkbox] {\n margin-right: 1%;\n }\n ul {\n margin-right: 1%;\n }\n }\n .label-left {\n // > label {\n // margin: 0;\n // }\n // > input,\n // textarea,\n // select,\n // .pikaday__container {\n // // margin-left: 1%;\n // }\n // > input[type=radio],\n // input[type=checkbox] {\n // margin-left: 1%;\n // }\n // ul {\n // margin-left: 15px;\n // }\n }\n}\n","\n.nf-form-content {\n .list-select-wrap > div {\n position: relative;\n div {\n display: block;\n position: absolute;\n font-size: 16px;\n line-height: 16px;\n margin: 0;\n padding: 16px;\n height: 50px;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1;\n &::after {\n content: \"\\f078\";\n font-family: FontAwesome;\n font-size: 20px;\n //font-weight: bold;\n //transform: rotate(90deg);\n position: absolute;\n right: 10px;\n bottom: 0;\n height: 50px;\n line-height: 50px;\n }\n }\n &.label-right {\n div {\n width: 59%;\n // &::after {\n // right: 20px;\n // }\n }\n }\n &.label-below {\n div {\n top: 0;\n bottom: auto;\n }\n }\n &.label-left {\n div {\n width: 59%;\n left: 40.5%;\n right: 40px;\n }\n }\n select {\n background: transparent;\n border: 0;\n appearance: none;\n position: relative;\n z-index: 2;\n }\n }\n .listmultiselect-wrap {\n select {\n appearance: normal;\n }\n }\n}\n",".checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n border: 1px solid;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -28px;\n bottom: 0;\n }\n &::before {\n content: \"\\f00c\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n bottom: 0;\n opacity: 0;\n z-index: 2;\n }\n }\n }\n}\n.checkbox-container {\n .nf-field-element {\n input {\n display: none;\n }\n }\n &.label-above,\n &.label-below {\n // .nf-field-element {\n // input {\n // display: none;\n // }\n // }\n }\n &.label-above {\n label {\n height: 50px;\n margin: 0;\n display: block;\n &::before {\n left: -2px;\n bottom: -16px;\n }\n &::after {\n left: 0;\n bottom: -16px;\n }\n }\n }\n &.label-below {\n label {\n margin: 0;\n display: block;\n margin-top: 20px;\n &::before {\n left: -2px;\n bottom: auto;\n top: -27px;\n }\n &::after {\n left: 0;\n bottom: auto;\n top: -25px;\n }\n }\n }\n &.label-left {\n .nf-field-label {\n width: 38%;\n padding-right: 5%;\n }\n .nf-field-element {\n width: 58%;\n }\n label {\n margin: 0;\n display: block;\n &::before {\n left: auto;\n top: -2px;\n right: -36px;\n }\n &::after {\n left: auto;\n top: 0;\n right: -31px;\n }\n }\n }\n &.label-right {\n .nf-field-label {\n padding: 0;\n order: 10;\n }\n .nf-field-element {\n order: 5;\n display: none;\n }\n label {\n margin: 0 0 0 30px;\n display: block;\n &::before {\n left: -30px;\n top: 0;\n }\n &::after {\n left: -28px;\n top: 0;\n }\n }\n .field-wrap {\n display: flex;\n > div {\n width: 100%;\n }\n }\n label {\n &::after {\n // Commenting this line out to deal with checkbox list issues.\n // Leaving it in place because it may need to be re-visited in the future.\n //top: 2px !important;\n }\n }\n }\n &.label-hidden {\n label {\n height: 0;\n margin: 0;\n display: block;\n &::after {\n left: 0;\n bottom: 0;\n visibility: visible;\n }\n &.nf-checked-label {\n &::before {\n left: -2px;\n bottom: 0;\n visibility: visible;\n }\n }\n }\n }\n}\n.listcheckbox-container {\n .nf-field-label {\n label {\n &::after {\n background: transparent !important;\n border: 0;\n }\n }\n }\n .nf-field-element {\n input {\n display: none;\n }\n label {\n margin-left: 30px !important;\n &::before {\n top: 1px;\n left: -30px;\n bottom: auto;\n }\n &::after {\n top: 3px;\n bottom: auto;\n }\n }\n }\n &.label-above,\n &.label-below,\n &.label-right {\n .nf-field-label {\n label {\n margin: 0;\n &::before {\n left: -30px;\n }\n }\n }\n }\n}\n",".listradio-wrap {\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px !important;\n &::after {\n border-radius: 50%;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -30px;\n bottom: 1px;\n top: .05em;\n }\n &.nf-checked-label {\n &::before {\n border-radius: 50%;\n content: \"\";\n height: 10px;\n width: 10px;\n position: absolute;\n left: -26px;\n bottom: 5px;\n z-index: 2;\n top: .25em;\n }\n }\n }\n input {\n display: none;\n }\n }\n}\n","input[type=checkbox].nf-toggle {\n background: transparent;\n border: 0;\n box-shadow: 0 0 0;\n margin: 10px;\n height: 18px;\n appearance: none;\n position: relative;\n cursor: pointer;\n &::after {\n background: #BCBDBF;\n border: 2px solid #BCBDBF;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -4px;\n left: -4px;\n width: 46px;\n height: 24px;\n transition: all 0.3s ease;\n }\n &::before {\n background: #fff;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -1px;\n left: 0;\n width: 18px;\n height: 18px;\n z-index: 99;\n transition: all 0.3s ease;\n }\n &:checked {\n &::after {\n background: lightgreen;\n border: 2px solid lightgreen;\n transition: all 0.3s ease;\n }\n &::before {\n top: -1px;\n left: 20px;\n transition: all 0.3s ease;\n }\n }\n .label-right & {\n padding: 0 50px 0 0;\n }\n .label-left & {\n padding: 0;\n margin-left: 22px;\n margin-top: 20px;\n }\n}\n",".nf-icons {\n .nf-field-element {\n position: relative;\n &::before {\n //border: 1px;\n font-family: FontAwesome;\n font-size: 20px;\n position: absolute;\n left: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n z-index: 1;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n .nf-field-element {\n input {\n padding-left: 60px;\n }\n }\n }\n &.right {\n .nf-field-element {\n &::before {\n left: auto;\n right: 1px;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n > div {\n input {\n padding-left: 12px;\n padding-right: 60px;\n }\n }\n }\n }\n .date-wrap .nf-field-element::before {\n content: \"\\f073\";\n }\n .number-wrap .nf-field-element::before,\n .quantity-wrap > div::before {\n content: \"\\f292\";\n }\n .email-wrap .nf-field-element::before {\n content: \"\\f0e0\";\n }\n .phone-wrap .nf-field-element::before {\n content: \"\\f095\";\n }\n .firstname-wrap .nf-field-element::before,\n .lastname-wrap .nf-field-element::before {\n content: \"\\f007\";\n }\n .address-wrap .nf-field-element::before,\n .city-wrap .nf-field-element::before,\n .state-wrap .nf-field-element::before,\n .zip-wrap .nf-field-element::before {\n content: \"\\f041\";\n }\n .creditcardfullname-wrap .nf-field-element::before,\n .creditcardnumber-wrap .nf-field-element::before,\n .creditcardcvc-wrap .nf-field-element::before,\n .creditcardexpiration-wrap .nf-field-element::before,\n .creditcardzip-wrap .nf-field-element::before {\n content: \"\\f283\";\n }\n}\n",".nf-field-element {\n\t.date-and-time {\n\t\tmargin-bottom: 5px;\n\t}\n\t.hour {\n\t\tpadding: 5px;\n\t\tborder-right: 0;\n\t}\n\t.minute {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n\t.ampm {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n}",".nf-form-content {\n input:not([type='button']),\n textarea,\n .list-select-wrap .nf-field-element > div {\n background: $field-background;\n border: 1px solid $field-border;\n border-radius: 0;\n box-shadow: none;\n color: $field-font;\n transition: all .5s;\n &:focus {\n background: $focus-background;\n border-color: $focus-border;\n //box-shadow: -3px 3px 10px #ccc;\n color: $focus-font;\n outline: none;\n transition: all .5s;\n }\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n background: $accent;\n border: 0;\n color: $field-background;\n transition: all .5s;\n &:hover {\n background: $field-border;\n color: $field-font;\n transition: all .5s;\n }\n }\n select.ninja-forms-field {\n color: $field-font;\n &:focus {\n background: transparent;\n border: 0;\n box-shadow: none;\n outline: none;\n }\n }\n}\n\n.list-select-wrap {\n div {\n &::after {\n color: $field-font;\n transition: all .5s;\n }\n }\n select {\n &:active,\n &:focus {\n + div {\n background: $focus-background !important;\n border-color: $focus-border !important;\n transition: all .5s;\n }\n }\n }\n}\n\n.listradio-wrap {\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border: 2px solid $field-border;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n border-color: $selected-font;\n transition: all .5s;\n }\n &::before {\n background: $selected-font;\n }\n }\n }\n }\n}\n\n.checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border-color: $field-border;\n transition: all .5s;\n }\n &::before {\n color: $field-background;\n opacity: 0;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n //background: $accent;\n border-color: $selected-border;\n transition: all .5s;\n }\n &::before {\n color: $selected-font;\n opacity: 100;\n transition: all .5s;\n }\n }\n }\n }\n}\n\n.nf-error {\n position: relative;\n .ninja-forms-field {\n border-color: #E80000 !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n background: #E80000;\n color: #fff;\n font-family: FontAwesome;\n font-size: 20px;\n content: \"\\f12a\";\n position: absolute;\n top: 1px;\n right: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n .nf-error-msg {\n color: #E80000;\n }\n}\n.checkbox-container {\n .nf-after-field .nf-error-msg {\n //text-align: left;\n }\n}\n.nf-pass {\n position: relative;\n .ninja-forms-field {\n border-color: green !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n color: green;\n font-family: FontAwesome;\n font-size: 30px;\n content: \"\\f058\";\n position: absolute;\n top: 0;\n right: 16px;\n height: 50px;\n line-height: 50px;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n // &.field-wrap::before {\n // border-color: green !important;\n // }\n}\n\n.nf-field-submit-error {\n border: 1px solid;\n margin: 10px 0px;\n padding: 15px 15px 15px 50px;\n position: relative;\n z-index: 1;\n &::after {\n content: \"\\f06a\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n top: 0;\n left: 15px;\n height: 50px;\n line-height: 50px;\n z-index: 2;\n }\n}\n\n.nf-field-submit-error {\n border-color: #D8000C;\n color: #D8000C;\n background-color: #FFBABA;\n}\n\n.nf-icons {\n .nf-field-element::before {\n background: $field-border;\n color: $field-background;\n }\n}\n\n.nf-help {\n color: $selected-font;\n}\n","@import \"display-structure\";\n\n@import \"op-spacing\";\n//@import \"op-columns\";\n@import \"op-select\";\n@import \"op-checkbox\";\n@import \"op-radio\";\n@import \"op-toggle\";\n@import \"op-icons\";\n@import \"op-date\";\n\n/* ---------------------------------\nDEFAULT DARK COLORS\n----------------------------------*/\n$base: #222;\n$accent: #fff;\n@import \"op-variables-dark\";\n@import \"op-color\";\n\n/* ---------------------------------\nDARK COLORS - nf-brown\n----------------------------------*/\n$base: #3e2b13;\n$accent: #ea981b;\n@import \"op-variables-dark\";\n.nf-brown {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nDARK COLORS - nf-red\n----------------------------------*/\n$base: #350000;\n$accent: red;\n@import \"op-variables-dark\";\n.nf-red {\n @import \"op-color\";\n}\n/* ---------------------------------\nDARK COLORS - nf-blue\n----------------------------------*/\n$base: #001C33;\n$accent: #00AEFF;\n@import \"op-variables-dark\";\n.nf-blue {\n @import \"op-color\";\n}\n\n@import \"st-media-queries\";\n","$field-background: $base;\n$field-border: lighten( $base, 10% );\n$field-font: lighten( $base, 40% );\n\n$focus-background: lighten( $base, 10% );\n$focus-border: lighten( $focus-background, 10% );\n$focus-font: lighten( $field-font, 10% );\n\n$selected-background: darken( $base, 10% );\n$selected-border: lighten( $field-border, 10% );\n$selected-font: $accent;\n","@media only screen and (max-width: 800px) {\n .nf-field-container {\n .nf-field-label {\n margin-bottom: 10px !important;\n padding: 0;\n width: 100%;\n order: 5;\n label {\n text-align: left;\n }\n }\n .nf-field-description {\n margin: 0;\n width: 100%;\n order: 10;\n }\n .nf-field-element {\n width: 100%;\n order: 15;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n left: -28px;\n bottom: 0;\n }\n &::before {\n left: -30px;\n bottom: 0;\n }\n }\n }\n .nf-field-element {\n width: 20px;\n }\n }\n }\n .nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: both;\n float: none;\n margin: 0;\n width: 100%;\n .inside {\n padding: 0;\n }\n }\n }\n}\n"]}
|
1 |
+
{"version":3,"sources":["st-defaults.scss","editor.scss","st-loading.scss","st-label-positions.scss","repeater-field.scss","op-spacing.scss","op-select.scss","op-checkbox.scss","op-radio.scss","op-toggle.scss","op-icons.scss","op-date.scss","op-color.scss","display-opinions-dark.scss","op-variables-dark.scss","st-media-queries.scss"],"names":[],"mappings":"AAIA,sFAKI,yBAA0B,CAC1B,qBAAsB,CAG1B,iBACI,YAAa,CAGjB,gDAEI,UAAW,CACX,iBAAkB,CAClB,kBAAmB,CAJvB,4DAMQ,UAAW,CACX,UAAW,CACX,aAAc,CARtB,4JAYQ,QAAS,CACT,WAAY,CAbpB,0UAoBY,YAAa,CAKzB,sBAEQ,eAAiB,CACjB,QAAS,CACT,SAAU,CAGlB,kBACI,iBAAkB,CADtB,4EAKQ,QAAS,CACT,UAAW,CACX,WAAY,CACZ,sBAAuB,CAR/B,2BAWQ,YAAa,CAGrB,mCAEQ,QAAS,CAGjB,SACI,8CAAmD,CACnD,oBAAqB,CACrB,UAAW,CACX,WAAY,CAGhB,gBACI,cAAe,CACf,cAAe,CAEnB,WACI,cAAe,CAEnB,8BAEQ,iBAAkB,CAe1B,0OAKY,yBAA2B,CAC3B,kBAAoB,CACpB,mBAAqB,CAPjC,8QASgB,gBAAiB,CATjC,qHAaY,iBAAkB,CAClB,wBAA0B,CAC1B,uBAA+B,CAf3C,uIAkBgB,aAAc,CACd,UAAc,CAEd,UAAW,CACX,iBAAkB,CAtBlC,uIAyBgB,oBAAsB,CACtB,UAAW,CACX,gBAAiB,CAMjC,mBAEQ,UAAW,CACX,WAAY,CACZ,mBAAoB,CAJ5B,yBAMY,WAAY,CAGZ,4BAAyB,CATrC,0CAagB,wBAAqB,CACrB,kBAAmB,CAdnC,6BAiBgB,aAAc,CAjB9B,yBAqBY,YAAa,CAQzB,wBAGY,oBAAsB,CAHlC,yCAOgB,aAAc,CAS9B,uBACI,eAAgB,CAOpB,YACI,iBAAkB,CAClB,iBAAkB,CAMtB,0BAEQ,YAAa,CASrB,sCAEI,aAAc,CAElB,2EAOgB,wBAAyB,CAKzC,uBACI,YAAa,CAGjB,8BACI,kBAA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,gBAAiB,CACjB,SAAU,CCzJlB,gCD8JI,oBAAqB,CACrB,aAAc,CACd,wBAAyB,CChK7B,4CDqKQ,kBEhN4B,CFiN5B,aCzKM,CAGd,kBD2KI,aC7KY,CE1ChB,yCACI,oCAEQ,4BAA8B,CAC9B,SAAU,CACV,UAAW,CACX,OAAQ,CALhB,0CAOY,eAAgB,CAP5B,0CAWQ,QAAS,CACT,UAAW,CACX,QAAS,CAbjB,sCAgBQ,UAAW,CACX,QAAS,CAjBjB,mDAqBY,UAAW,CArBvB,yDAuBgB,iBAAkB,CAClB,gBAAiB,CAxBjC,+DA0BoB,UAAW,CACX,QAAS,CA3B7B,gEA8BoB,UAAW,CACX,QAAS,CA/B7B,qDAoCY,UAAW,CAIvB,kSAYQ,UAAW,CACX,UAAW,CACX,QAAS,CACT,UAAW,CAfnB,0XAiBY,SAAU,CACb","file":"display-opinions-dark.css","sourcesContent":["/*\n * Ninja Forms - Form Display Structure\n */\n\n.ninja-forms-form-wrap *,\n.ninja-forms-form-wrap *:after,\n.ninja-forms-form-wrap *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.nf-response-msg {\n display: none;\n}\n\n.nf-field-container,\n#ninja_forms_required_items {\n clear: both;\n position: relative;\n margin-bottom: 25px;\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n &.hidden-container,\n &.hr-container {\n margin: 0;\n height: auto;\n .nf-field-label {\n display: none;\n }\n }\n &.html-container {\n .nf-field-label {\n display: none;\n }\n }\n}\n\n.nf-field-label {\n label {\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n}\n.nf-field-element {\n position: relative;\n input,\n select,\n textarea {\n margin: 0;\n width: auto;\n height: auto;\n vertical-align: inherit;\n }\n textarea {\n height: 200px;\n }\n}\n.nf-field-description {\n p:last-child {\n margin: 0;\n }\n}\n.nf-help {\n background: url( '../img/help-info.png' ) no-repeat;\n display: inline-block;\n width: 16px;\n height: 16px;\n}\n\n.nf-input-limit {\n font-size: 12px;\n margin-top: 5px;\n}\n.nf-static {\n padding: 0 10px;\n}\n.nf-after-field {\n .nf-error-msg {\n margin-right: 10px;\n //text-align: right;\n }\n}\n\n/* ---------------------------------\nCHECKBOX FIELD\n----------------------------------*/\n\n\n\n/* ---------------------------------\nRADIO & CHECKBOX LISTS\n----------------------------------*/\n\n.list-radio-wrap,\n.list-checkbox-wrap,\n.list-image-wrap {\n .nf-field-element {\n ul, li {\n list-style: none !important;\n margin: 0 !important;\n padding: 0 !important;\n input {\n margin-right: 5px;\n }\n }\n li {\n padding-left: 10px;\n margin: 0 0 5px !important;\n text-indent: initial !important;\n label {\n //display: inline;\n display: block;\n float: initial;\n //margin: 0;\n width: auto;\n margin-left: 1.5em;\n }\n input {\n width: auto !important;\n float: left;\n margin-top: .25em;\n }\n }\n }\n}\n\n.listimage-wrap {\n li {\n width: 100%;\n height: 100%;\n display: inline-grid;\n label {\n padding: 5px;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n &.nf-checked-label {\n border-width: 2px;\n border-style: solid;\n border-color: #007acc;\n transition: all .5s;\n }\n img {\n display: block;\n }\n }\n input {\n display: none;\n }\n }\n}\n\n/* ---------------------------------\nPRODUCT FIELD\n----------------------------------*/\n.product-wrap {\n > div {\n input {\n width: 80px !important;\n }\n .nf-product-field {\n span {\n padding: 0 5px;\n }\n }\n }\n}\n\n/* ---------------------------------\nSTAR RATING\n----------------------------------*/\n.starrating-wrap .star {\n border-bottom: 0;\n}\n\n/* ---------------------------------\nHONEYPOT\n----------------------------------*/\n\n.nf-form-hp {\n position: absolute;\n visibility: hidden;\n}\n\n/* ---------------------------------\nSELECT LIST\n----------------------------------*/\n.list-select-wrap {\n div div {\n display: none;\n }\n}\n\n\n/* ---------------------------------\nCOLORS\nAs minimal as possible\n----------------------------------*/\n.ninja-forms-req-symbol,\n.nf-error-msg {\n color: #E80000;\n}\n.nf-error {\n .ninja-forms-field {\n border: 1px solid #E80000;\n }\n &.listimage-wrap {\n .nf-field-element {\n ul {\n border: 1px solid #E80000;\n }\n }\n }\n}\n.nf-field-submit-error {\n padding: 15px;\n}\n\n.ninja-forms-noscript-message {\n background: #f1f1f1;\n border: 4px dashed #ccc;\n color: #333;\n display: block;\n font-size: 20px;\n margin: 20px 0;\n padding: 40px;\n text-align: center;\n}\n\n/* ---------------------------------\nHELPER CLASSES\n----------------------------------*/\n.two-col-list {\n ul {\n li {\n float: left;\n width: 50%\n }\n }\n}\n.three-col-list {\n ul {\n li {\n float: left;\n width: 33.33%\n }\n }\n}\n.four-col-list {\n ul {\n li {\n float: left;\n width: 25%\n }\n }\n}\n.five-col-list {\n ul {\n li {\n float: left;\n width: 20%\n }\n }\n}\n.six-col-list {\n ul {\n li {\n float: left;\n width: 16.66%\n }\n }\n}\n\n\nbody {\n .pika-label {\n background: transparent;\n }\n}\n\n/* Column Classes\n Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css\n--------------------------------------------- */\n.nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: initial;\n float: left;\n margin-left: 2.564102564102564%;\n .inside {\n padding: 20px;\n }\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n\n .one-half,\n .three-sixths,\n .two-fourths {\n width: 48.717948717948715%;\n }\n\n .one-third,\n .two-sixths {\n width: 31.623931623931625%;\n }\n\n .four-sixths,\n .two-thirds {\n width: 65.81196581196582%;\n }\n\n .one-fourth {\n width: 23.076923076923077%;\n }\n\n .three-fourths {\n width: 74.35897435897436%;\n }\n\n .one-sixth {\n width: 14.52991452991453%;\n }\n\n .five-sixths {\n width: 82.90598290598291%;\n }\n\n .first {\n clear: both;\n margin-left: 0;\n }\n}\n",".note-popover {\n display: none !important;\n}\n.nf-form-wrap {\n .note-editor {\n border: 0 !important;\n .note-toolbar {\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n .note-editable {\n background: #f9f9f9;\n border: 1px solid #f1f1f1;\n display: block;\n p {\n font-size: 16px;\n }\n ul {\n list-style-type: disc;\n margin-left: 2em;\n }\n table {\n td {\n border: 1px solid #ccc;\n width: auto;\n }\n }\n }\n .modal {\n display: none;\n }\n .btn-group {\n float: left;\n &.note-tools {\n float: right;\n }\n }\n .btn {\n background: #f9f9f9;\n border: 0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n margin-right: 2px;\n padding-top: 4px;\n &.disabled {\n background: transparent;\n color: #aaa;\n .merge-tags {\n background: #f9f9f9;\n color: #666;\n }\n }\n }\n button[type=button] {\n padding: 4px;\n width: auto;\n height: auto;\n }\n .dropdown-toggle {\n position: relative;\n display: inline-block;\n top: 0;\n &::after {\n content: \"\";\n width: 0;\n }\n }\n }\n .tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n white-space: normal;\n filter: alpha(opacity=0);\n opacity: 0;\n\n line-break: auto;\n }\n .tooltip.in {\n filter: alpha(opacity=90);\n opacity: .9;\n }\n .tooltip.top {\n padding: 5px 0;\n margin-top: -3px;\n }\n .tooltip.right {\n padding: 0 5px;\n margin-left: 3px;\n }\n .tooltip.bottom {\n padding: 5px 0;\n margin-top: 3px;\n }\n .tooltip.left {\n padding: 0 5px;\n margin-left: -3px;\n }\n .tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n }\n .tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-left .tooltip-arrow {\n right: 5px;\n bottom: 0;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n }\n .tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n }\n .tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .dropdown-menu {\n position: absolute;\n // top: 100%;\n // left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n font-size: 14px;\n text-align: left;\n list-style: none;\n background-color: #fff;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, .15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n }\n .dropdown-menu.pull-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n }\n .dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333;\n white-space: nowrap;\n }\n .dropdown-menu > li > a:hover,\n .dropdown-menu > li > a:focus {\n color: #262626;\n text-decoration: none;\n background-color: #f5f5f5;\n }\n .dropdown-menu > .active > a,\n .dropdown-menu > .active > a:hover,\n .dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n background-color: #337ab7;\n outline: 0;\n }\n .dropdown-menu > .disabled > a,\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n color: #777;\n }\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n cursor: not-allowed;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n }\n .open > .dropdown-menu {\n display: block;\n }\n .open > a {\n outline: 0;\n }\n .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n .dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777;\n white-space: nowrap;\n }\n .dropdown-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 990;\n }\n .pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n }\n .dropup .caret,\n .navbar-fixed-bottom .dropdown .caret {\n content: \"\";\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n }\n .dropup .dropdown-menu,\n .navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n @media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n right: 0;\n left: auto;\n }\n .navbar-right .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n }\n .btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n }\n .nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n }\n .navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n }\n @media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n }\n}\n",".nf-loading-spinner {\n width: 40px;\n height: 40px;\n margin: 100px auto;\n background-color: rgba(208,208,208,.5);\n\n border-radius: 100%;\n animation: nf-scaleout 1.0s infinite ease-in-out;\n}\n\n@-webkit-keyframes nf-scaleout {\n 0% { transform: scale(0) }\n 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}\n\n@keyframes nf-scaleout {\n 0% {\n transform: scale(0);\n } 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}","/* ---------------------------------\nSTANDARDIZE ALL FIELDS\n----------------------------------*/\n.field-wrap {\n display: flex;\n //flex-wrap:wrap;\n > label {\n display: block;\n }\n > div input,\n textarea,\n select,\n .pikaday__container,\n .pikaday__display {\n width: 100%;\n }\n > div input[type=\"checkbox\"] {\n width: auto;\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n width: auto;\n }\n .nf-product-field {\n // .nf-element {\n // width: 100%;\n // }\n }\n}\n\n.nf-field-label {\n order: 5;\n}\n.nf-field-description {\n width: 100%;\n order: 10;\n}\n.nf-field-element {\n order: 15;\n}\n\n\n/* ---------------------------------\nLABEL ABOVE\n----------------------------------*/\n.label-above {\n .nf-field-label {\n margin-bottom: 10px;\n }\n}\n\n/* ---------------------------------\nLABEL BELOW\n----------------------------------*/\n.label-below {\n .nf-field-label {\n margin-top: 10px;\n order: 15;\n }\n .nf-field-element {\n order: 5;\n }\n}\n\n/* ---------------------------------\nLABEL HIDDEN\n----------------------------------*/\n.label-hidden {\n .field-wrap {\n flex-wrap: wrap;\n }\n .nf-field-label {\n height: 0;\n margin: 0 !important;\n width: 100%;\n visibility: hidden;\n }\n .nf-field-description {\n width: 100%;\n order: 20;\n }\n .nf-field-element {\n width: 100%;\n }\n}\n\n/* ---------------------------------\nLABEL LEFT\n----------------------------------*/\n.label-left {\n .field-wrap {\n flex-direction: row;\n flex-wrap: wrap;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-right: 2%;\n text-align: right;\n width: 35%;\n order: 5;\n label {\n width: 100%;\n }\n }\n .nf-field-description {\n margin-left: 35%;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 10;\n }\n .nf-after-field {\n margin-left: 36.5%;\n }\n}\n\n/* ---------------------------------\nLABEL RIGHT\n----------------------------------*/\n.label-right {\n .field-wrap {\n flex-direction: row;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: 2%;\n width: 35%;\n order: 10;\n }\n .nf-field-description {\n margin-right: 35%;\n order: 15;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 5;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n }\n .nf-field-element {\n width: 20px;\n }\n }\n .nf-after-field {\n width: 65%;\n }\n}\n/* ---------------------------------\nADJUST SOME LABEL ABOVE & BELOW ISSUES\n----------------------------------*/\n.label-below,\n.label-above {\n .field-wrap {\n flex-direction: column;\n flex-flow: wrap;\n }\n .nf-field-element {\n margin: 0;\n width: 100%;\n }\n .checkbox-wrap {\n .nf-field-label {\n //margin: 0;\n }\n }\n}\n\n/* ---------------------------------\nADJUST SOME LABEL LEFT & RIGHT ISSUES\n----------------------------------*/\n.label-left,\n.label-right {\n .textarea-wrap,\n .listradio-wrap,\n .listcheckbox-wrap {\n .nf-field-label {\n align-items: flex-start;\n }\n }\n .textarea-wrap {\n .nf-field-label {\n margin-top: 5px;\n }\n }\n .html-wrap,\n .hr-wrap {\n display: block;\n .nf-field-element {\n display: block;\n margin: 0;\n width: 100%;\n }\n }\n}\n\n/* ---------------------------------\nFIELD DESCRIPTION POSITIONS\n----------------------------------*/\n",".nf-repeater-fieldsets{\n fieldset {\n margin-bottom: 1em;\n }\n}\n\n.nf-remove-fieldset {\n color: red;\n font-size: 1.5em;\n background-color: transparent;\n border: thin solid red;\n padding: 0.1em 0.4em;\n float: right;\n margin-top: -1em;\n}",".nf-help {\n background: none;\n}\n.nf-field-description {\n font-size: 14px;\n}\n.nf-form-content {\n padding: 5px;\n max-width: 1000px;\n margin: 0 auto;\n label {\n font-size: 18px;\n line-height: 20px;\n }\n .ninja-forms-field,\n .listselect-wrap .nf-field-element div {\n font-size: 16px;\n margin: 0;\n padding: 12px;\n }\n input.ninja-forms-field,\n select.ninja-forms-field:not([multiple]),\n .listselect-wrap .nf-field-element div {\n height: 50px;\n }\n textarea.ninja-forms-field {\n height: 200px;\n }\n hr.ninja-forms-field {\n padding: 0;\n }\n input[type=\"radio\"].ninja-forms-field,\n input[type=\"checkbox\"].ninja-forms-field {\n height: auto;\n }\n .listradio-wrap,\n .listcheckbox-wrap {\n li {\n margin-bottom: 12px !important;\n line-height: 0;\n }\n }\n .nf-product-field {\n &.ninja-forms-field {\n // background: transparent;\n // border: 0;\n // padding: 0;\n }\n span {\n padding-right: 16px;\n }\n .nf-field-qty {\n font-size: 16px;\n padding: 5px;\n width: 80px !important;\n }\n }\n .listselect-wrap,\n .liststate-wrap,\n .listcountry-wrap {\n select {\n //height: 50px;\n }\n }\n .nf-static {\n background: transparent;\n border: 0;\n font-weight: bold;\n padding: 0;\n }\n .label-above,\n .label-below,\n .label-hidden {\n .nf-field-label {\n margin-bottom: 10px;\n padding: 0;\n }\n }\n .label-below {\n .nf-field-label {\n margin-bottom: 0;\n margin-top: 10px;\n }\n }\n .label-right {\n .nf-field-label {\n margin: 0;\n }\n > input,\n textarea,\n select,\n .nf-product-field,\n .starrating,\n .nf-static,\n .pikaday__container {\n // margin-right: 1%;\n }\n > input[type=radio],\n input[type=checkbox] {\n margin-right: 1%;\n }\n ul {\n margin-right: 1%;\n }\n }\n .label-left {\n // > label {\n // margin: 0;\n // }\n // > input,\n // textarea,\n // select,\n // .pikaday__container {\n // // margin-left: 1%;\n // }\n // > input[type=radio],\n // input[type=checkbox] {\n // margin-left: 1%;\n // }\n // ul {\n // margin-left: 15px;\n // }\n }\n}\n","\n.nf-form-content {\n .list-select-wrap > div {\n position: relative;\n div {\n display: block;\n position: absolute;\n font-size: 16px;\n line-height: 16px;\n margin: 0;\n padding: 16px;\n height: 50px;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1;\n &::after {\n content: \"\\f078\";\n font-family: FontAwesome;\n font-size: 20px;\n //font-weight: bold;\n //transform: rotate(90deg);\n position: absolute;\n right: 10px;\n bottom: 0;\n height: 50px;\n line-height: 50px;\n }\n }\n &.label-right {\n div {\n width: 59%;\n // &::after {\n // right: 20px;\n // }\n }\n }\n &.label-below {\n div {\n top: 0;\n bottom: auto;\n }\n }\n &.label-left {\n div {\n width: 59%;\n left: 40.5%;\n right: 40px;\n }\n }\n select {\n background: transparent;\n border: 0;\n appearance: none;\n position: relative;\n z-index: 2;\n }\n }\n .listmultiselect-wrap {\n select {\n appearance: normal;\n }\n }\n}\n",".checkbox-wrap,\r\n.listcheckbox-wrap {\r\n .nf-field-label,\r\n .nf-field-element {\r\n label {\r\n position: relative;\r\n margin-left: 30px;\r\n &::after {\r\n border: 1px solid;\r\n content: \"\";\r\n width: 18px;\r\n height: 18px;\r\n position: absolute;\r\n left: -28px;\r\n bottom: 0;\r\n }\r\n &::before {\r\n content: \"\\f00c\";\r\n font-family: FontAwesome;\r\n font-size: 24px;\r\n position: absolute;\r\n bottom: 0;\r\n opacity: 0;\r\n z-index: 2;\r\n }\r\n }\r\n }\r\n}\r\n.checkbox-container {\r\n .nf-field-element {\r\n input {\r\n display: inherit;\r\n opacity: 0;\r\n }\r\n }\r\n &.label-above,\r\n &.label-below {\r\n // .nf-field-element {\r\n // input {\r\n // display: none;\r\n // }\r\n // }\r\n }\r\n &.label-above {\r\n label {\r\n height: 50px;\r\n margin: 0;\r\n display: block;\r\n &::before {\r\n left: -2px;\r\n bottom: -16px;\r\n }\r\n &::after {\r\n left: 0;\r\n bottom: -16px;\r\n }\r\n }\r\n }\r\n &.label-below {\r\n label {\r\n margin: 0;\r\n display: block;\r\n margin-top: 20px;\r\n &::before {\r\n left: -2px;\r\n bottom: auto;\r\n top: -27px;\r\n }\r\n &::after {\r\n left: 0;\r\n bottom: auto;\r\n top: -25px;\r\n }\r\n }\r\n }\r\n &.label-left {\r\n .nf-field-label {\r\n width: 38%;\r\n padding-right: 5%;\r\n }\r\n .nf-field-element {\r\n width: 58%;\r\n }\r\n label {\r\n margin: 0;\r\n display: block;\r\n &::before {\r\n left: auto;\r\n top: -2px;\r\n right: -36px;\r\n }\r\n &::after {\r\n left: auto;\r\n top: 0;\r\n right: -31px;\r\n }\r\n }\r\n }\r\n &.label-right {\r\n .nf-field-label {\r\n padding: 0;\r\n order: 10;\r\n }\r\n .nf-field-element {\r\n order: 5;\r\n display: inline;\r\n position: absolute;\r\n opacity: 0;\r\n }\r\n label {\r\n margin: 0 0 0 30px;\r\n display: block;\r\n &::before {\r\n left: -30px;\r\n top: 0;\r\n }\r\n &::after {\r\n left: -28px;\r\n top: 0;\r\n }\r\n }\r\n .field-wrap {\r\n display: flex;\r\n > div {\r\n width: 100%;\r\n }\r\n }\r\n label {\r\n &::after {\r\n // Commenting this line out to deal with checkbox list issues.\r\n // Leaving it in place because it may need to be re-visited in the future.\r\n //top: 2px !important;\r\n }\r\n }\r\n }\r\n &.label-hidden {\r\n label {\r\n height: 0;\r\n margin: 0;\r\n display: block;\r\n &::after {\r\n left: 0;\r\n bottom: 0;\r\n visibility: visible;\r\n }\r\n &.nf-checked-label {\r\n &::before {\r\n left: -2px;\r\n bottom: 0;\r\n visibility: visible;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n.listcheckbox-container {\r\n .nf-field-label {\r\n label {\r\n &::after {\r\n background: transparent !important;\r\n border: 0;\r\n }\r\n }\r\n }\r\n .nf-field-element {\r\n input {\r\n display: inherit;\r\n opacity: 0;\r\n }\r\n label {\r\n margin-left: 30px !important;\r\n &::before {\r\n top: 1px;\r\n left: -30px;\r\n bottom: auto;\r\n }\r\n &::after {\r\n top: 3px;\r\n bottom: auto;\r\n }\r\n }\r\n }\r\n &.label-above,\r\n &.label-below,\r\n &.label-right {\r\n .nf-field-label {\r\n label {\r\n margin: 0;\r\n &::before {\r\n left: -30px;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n",".listradio-wrap {\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px !important;\n &::after {\n border-radius: 50%;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -30px;\n bottom: 1px;\n top: .05em;\n }\n &.nf-checked-label {\n &::before {\n border-radius: 50%;\n content: \"\";\n height: 10px;\n width: 10px;\n position: absolute;\n left: -26px;\n bottom: 5px;\n z-index: 2;\n top: .25em;\n }\n }\n }\n input {\n display: inherit;\n }\n }\n}\n","input[type=checkbox].nf-toggle {\n background: transparent;\n border: 0;\n box-shadow: 0 0 0;\n margin: 10px;\n height: 18px;\n appearance: none;\n position: relative;\n cursor: pointer;\n &::after {\n background: #BCBDBF;\n border: 2px solid #BCBDBF;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -4px;\n left: -4px;\n width: 46px;\n height: 24px;\n transition: all 0.3s ease;\n }\n &::before {\n background: #fff;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -1px;\n left: 0;\n width: 18px;\n height: 18px;\n z-index: 99;\n transition: all 0.3s ease;\n }\n &:checked {\n &::after {\n background: lightgreen;\n border: 2px solid lightgreen;\n transition: all 0.3s ease;\n }\n &::before {\n top: -1px;\n left: 20px;\n transition: all 0.3s ease;\n }\n }\n .label-right & {\n padding: 0 50px 0 0;\n }\n .label-left & {\n padding: 0;\n margin-left: 22px;\n margin-top: 20px;\n }\n}\n",".nf-icons {\n .nf-field-element {\n position: relative;\n &::before {\n //border: 1px;\n font-family: FontAwesome;\n font-size: 20px;\n position: absolute;\n left: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n z-index: 1;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n .nf-field-element {\n input {\n padding-left: 60px;\n }\n }\n }\n &.right {\n .nf-field-element {\n &::before {\n left: auto;\n right: 1px;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n > div {\n input {\n padding-left: 12px;\n padding-right: 60px;\n }\n }\n }\n }\n .date-wrap .nf-field-element::before {\n content: \"\\f073\";\n }\n .number-wrap .nf-field-element::before,\n .quantity-wrap > div::before {\n content: \"\\f292\";\n }\n .email-wrap .nf-field-element::before {\n content: \"\\f0e0\";\n }\n .phone-wrap .nf-field-element::before {\n content: \"\\f095\";\n }\n .firstname-wrap .nf-field-element::before,\n .lastname-wrap .nf-field-element::before {\n content: \"\\f007\";\n }\n .address-wrap .nf-field-element::before,\n .city-wrap .nf-field-element::before,\n .state-wrap .nf-field-element::before,\n .zip-wrap .nf-field-element::before {\n content: \"\\f041\";\n }\n .creditcardfullname-wrap .nf-field-element::before,\n .creditcardnumber-wrap .nf-field-element::before,\n .creditcardcvc-wrap .nf-field-element::before,\n .creditcardexpiration-wrap .nf-field-element::before,\n .creditcardzip-wrap .nf-field-element::before {\n content: \"\\f283\";\n }\n}\n",".nf-field-element {\n\t.date-and-time {\n\t\tmargin-bottom: 5px;\n\t}\n\t.hour {\n\t\tpadding: 5px;\n\t\tborder-right: 0;\n\t}\n\t.minute {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n\t.ampm {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n}",".nf-form-content {\n input:not([type='button']),\n textarea,\n .list-select-wrap .nf-field-element > div {\n background: $field-background;\n border: 1px solid $field-border;\n border-radius: 0;\n box-shadow: none;\n color: $field-font;\n transition: all .5s;\n &:focus {\n background: $focus-background;\n border-color: $focus-border;\n //box-shadow: -3px 3px 10px #ccc;\n color: $focus-font;\n outline: none;\n transition: all .5s;\n }\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n background: $accent;\n border: 0;\n color: $field-background;\n transition: all .5s;\n &:hover {\n background: $field-border;\n color: $field-font;\n transition: all .5s;\n }\n }\n select.ninja-forms-field {\n color: $field-font;\n &:focus {\n background: transparent;\n border: 0;\n box-shadow: none;\n outline: none;\n }\n }\n}\n\n.list-select-wrap {\n div {\n &::after {\n color: $field-font;\n transition: all .5s;\n }\n }\n select {\n &:active,\n &:focus {\n + div {\n background: $focus-background !important;\n border-color: $focus-border !important;\n transition: all .5s;\n }\n }\n }\n}\n\n.listradio-wrap {\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border: 2px solid $field-border;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n border-color: $selected-font;\n transition: all .5s;\n }\n &::before {\n background: $selected-font;\n }\n }\n }\n }\n}\n\n.checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border-color: $field-border;\n transition: all .5s;\n }\n &::before {\n color: $field-background;\n opacity: 0;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n //background: $accent;\n border-color: $selected-border;\n transition: all .5s;\n }\n &::before {\n color: $selected-font;\n opacity: 100;\n transition: all .5s;\n }\n }\n }\n }\n}\n\n.nf-error {\n position: relative;\n .ninja-forms-field {\n border-color: #E80000 !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n background: #E80000;\n color: #fff;\n font-family: FontAwesome;\n font-size: 20px;\n content: \"\\f12a\";\n position: absolute;\n top: 1px;\n right: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n .nf-error-msg {\n color: #E80000;\n }\n}\n.checkbox-container {\n .nf-after-field .nf-error-msg {\n //text-align: left;\n }\n}\n.nf-pass {\n position: relative;\n .ninja-forms-field {\n border-color: green !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n color: green;\n font-family: FontAwesome;\n font-size: 30px;\n content: \"\\f058\";\n position: absolute;\n top: 0;\n right: 16px;\n height: 50px;\n line-height: 50px;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n // &.field-wrap::before {\n // border-color: green !important;\n // }\n}\n\n.nf-field-submit-error {\n border: 1px solid;\n margin: 10px 0px;\n padding: 15px 15px 15px 50px;\n position: relative;\n z-index: 1;\n &::after {\n content: \"\\f06a\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n top: 0;\n left: 15px;\n height: 50px;\n line-height: 50px;\n z-index: 2;\n }\n}\n\n.nf-field-submit-error {\n border-color: #D8000C;\n color: #D8000C;\n background-color: #FFBABA;\n}\n\n.nf-icons {\n .nf-field-element::before {\n background: $field-border;\n color: $field-background;\n }\n}\n\n.nf-help {\n color: $selected-font;\n}\n","@import \"display-structure\";\n\n@import \"op-spacing\";\n//@import \"op-columns\";\n@import \"op-select\";\n@import \"op-checkbox\";\n@import \"op-radio\";\n@import \"op-toggle\";\n@import \"op-icons\";\n@import \"op-date\";\n\n/* ---------------------------------\nDEFAULT DARK COLORS\n----------------------------------*/\n$base: #222;\n$accent: #fff;\n@import \"op-variables-dark\";\n@import \"op-color\";\n\n/* ---------------------------------\nDARK COLORS - nf-brown\n----------------------------------*/\n$base: #3e2b13;\n$accent: #ea981b;\n@import \"op-variables-dark\";\n.nf-brown {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nDARK COLORS - nf-red\n----------------------------------*/\n$base: #350000;\n$accent: red;\n@import \"op-variables-dark\";\n.nf-red {\n @import \"op-color\";\n}\n/* ---------------------------------\nDARK COLORS - nf-blue\n----------------------------------*/\n$base: #001C33;\n$accent: #00AEFF;\n@import \"op-variables-dark\";\n.nf-blue {\n @import \"op-color\";\n}\n\n@import \"st-media-queries\";\n","$field-background: $base;\n$field-border: lighten( $base, 10% );\n$field-font: lighten( $base, 40% );\n\n$focus-background: lighten( $base, 10% );\n$focus-border: lighten( $focus-background, 10% );\n$focus-font: lighten( $field-font, 10% );\n\n$selected-background: darken( $base, 10% );\n$selected-border: lighten( $field-border, 10% );\n$selected-font: $accent;\n","@media only screen and (max-width: 800px) {\n .nf-field-container {\n .nf-field-label {\n margin-bottom: 10px !important;\n padding: 0;\n width: 100%;\n order: 5;\n label {\n text-align: left;\n }\n }\n .nf-field-description {\n margin: 0;\n width: 100%;\n order: 10;\n }\n .nf-field-element {\n width: 100%;\n order: 15;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n left: -28px;\n bottom: 0;\n }\n &::before {\n left: -30px;\n bottom: 0;\n }\n }\n }\n .nf-field-element {\n width: 20px;\n }\n }\n }\n .nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: both;\n float: none;\n margin: 0;\n width: 100%;\n .inside {\n padding: 0;\n }\n }\n }\n}\n"]}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
.ninja-forms-form-wrap *,.ninja-forms-form-wrap :after,.ninja-forms-form-wrap :before{-ms-box-sizing:border-box;box-sizing:border-box}.nf-response-msg{display:none}#ninja_forms_required_items,.nf-field-container{clear:both;position:relative;margin-bottom:25px}#ninja_forms_required_items:after,.nf-field-container:after{clear:both;content:"";display:block}#ninja_forms_required_items.hidden-container,#ninja_forms_required_items.hr-container,.nf-field-container.hidden-container,.nf-field-container.hr-container{margin:0;height:auto}#ninja_forms_required_items.hidden-container .nf-field-label,#ninja_forms_required_items.hr-container .nf-field-label,#ninja_forms_required_items.html-container .nf-field-label,.nf-field-container.hidden-container .nf-field-label,.nf-field-container.hr-container .nf-field-label,.nf-field-container.html-container .nf-field-label{display:none}.nf-field-label label{font-weight:700;margin:0;padding:0}.nf-field-element{position:relative}.nf-field-element input,.nf-field-element select,.nf-field-element textarea{margin:0;width:auto;height:auto;vertical-align:inherit}.nf-field-element textarea{height:200px}.nf-field-description p:last-child{margin:0}.nf-help{background:url(../img/help-info.png) no-repeat;display:inline-block;width:16px;height:16px}.nf-input-limit{font-size:12px;margin-top:5px}.nf-static{padding:0 10px}.nf-after-field .nf-error-msg{margin-right:10px}.list-checkbox-wrap .nf-field-element li,.list-checkbox-wrap .nf-field-element ul,.list-image-wrap .nf-field-element li,.list-image-wrap .nf-field-element ul,.list-radio-wrap .nf-field-element li,.list-radio-wrap .nf-field-element ul{list-style:none!important;margin:0!important;padding:0!important}.list-checkbox-wrap .nf-field-element li input,.list-checkbox-wrap .nf-field-element ul input,.list-image-wrap .nf-field-element li input,.list-image-wrap .nf-field-element ul input,.list-radio-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element ul input{margin-right:5px}.list-checkbox-wrap .nf-field-element li,.list-image-wrap .nf-field-element li,.list-radio-wrap .nf-field-element li{padding-left:10px;margin:0 0 5px!important;text-indent:0!important}.list-checkbox-wrap .nf-field-element li label,.list-image-wrap .nf-field-element li label,.list-radio-wrap .nf-field-element li label{display:block;float:none;width:auto;margin-left:1.5em}.list-checkbox-wrap .nf-field-element li input,.list-image-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element li input{width:auto!important;float:left;margin-top:.25em}.listimage-wrap li{width:100%;height:100%;display:inline-grid}.listimage-wrap li label{padding:5px;border:2px solid transparent}.listimage-wrap li label.nf-checked-label{border:2px solid #007acc;transition:all .5s}.listimage-wrap li label img{display:block}.listimage-wrap li input{display:none}.product-wrap>div input{width:80px!important}.product-wrap>div .nf-product-field span{padding:0 5px}.starrating-wrap .star{border-bottom:0}.nf-form-hp{position:absolute;visibility:hidden}.list-select-wrap div div{display:none}.nf-error-msg,.ninja-forms-req-symbol{color:#e80000}.nf-error.listimage-wrap .nf-field-element ul,.nf-error .ninja-forms-field{border:1px solid #e80000}.nf-field-submit-error{padding:15px}.ninja-forms-noscript-message{background:#f1f1f1;border:4px dashed #ccc;color:#333;display:block;font-size:20px;margin:20px 0;padding:40px;text-align:center}.two-col-list ul li{float:left;width:50%}.three-col-list ul li{float:left;width:33.33%}.four-col-list ul li{float:left;width:25%}.five-col-list ul li{float:left;width:20%}.six-col-list ul li{float:left;width:16.66%}body .pika-label{background:transparent}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:none;float:left;margin-left:2.564102564102564%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:20px}.nf-form-cont .five-sixths:after,.nf-form-cont .four-sixths:after,.nf-form-cont .one-fourth:after,.nf-form-cont .one-half:after,.nf-form-cont .one-sixth:after,.nf-form-cont .one-third:after,.nf-form-cont .three-fourths:after,.nf-form-cont .three-sixths:after,.nf-form-cont .two-fourths:after,.nf-form-cont .two-sixths:after,.nf-form-cont .two-thirds:after{clear:both;content:"";display:block}.nf-form-cont .one-half,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths{width:48.717948717948715%}.nf-form-cont .one-third,.nf-form-cont .two-sixths{width:31.623931623931625%}.nf-form-cont .four-sixths,.nf-form-cont .two-thirds{width:65.81196581196582%}.nf-form-cont .one-fourth{width:23.076923076923077%}.nf-form-cont .three-fourths{width:74.35897435897436%}.nf-form-cont .one-sixth{width:14.52991452991453%}.nf-form-cont .five-sixths{width:82.90598290598291%}.nf-form-cont .first{clear:both;margin-left:0}.note-popover{display:none!important}.nf-form-wrap .note-editor{border:0!important}.nf-form-wrap .note-editor .note-toolbar:after{clear:both;content:"";display:block}.nf-form-wrap .note-editor .note-editable{background:#f9f9f9;border:1px solid #f1f1f1;display:block}.nf-form-wrap .note-editor .note-editable p{font-size:16px}.nf-form-wrap .note-editor .note-editable ul{list-style-type:disc;margin-left:2em}.nf-form-wrap .note-editor .note-editable table td{border:1px solid #ccc;width:auto}.nf-form-wrap .note-editor .modal{display:none}.nf-form-wrap .note-editor .btn-group{float:left}.nf-form-wrap .note-editor .btn-group.note-tools{float:right}.nf-form-wrap .note-editor .btn{background:#f9f9f9;border:0;border-radius:4px;color:#666;cursor:pointer;margin-right:2px;padding-top:4px}.nf-form-wrap .note-editor .btn.disabled{background:transparent;color:#aaa}.nf-form-wrap .note-editor .btn.disabled .merge-tags{background:#f9f9f9;color:#666}.nf-form-wrap .note-editor button[type=button]{padding:4px;width:auto;height:auto}.nf-form-wrap .note-editor .dropdown-toggle{position:relative;display:inline-block;top:0}.nf-form-wrap .note-editor .dropdown-toggle:after{content:"";width:0}.nf-form-wrap .tooltip{position:absolute;z-index:1070;display:block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.nf-form-wrap .tooltip.in{filter:alpha(opacity=90);opacity:.9}.nf-form-wrap .tooltip.top{padding:5px 0;margin-top:-3px}.nf-form-wrap .tooltip.right{padding:0 5px;margin-left:3px}.nf-form-wrap .tooltip.bottom{padding:5px 0;margin-top:3px}.nf-form-wrap .tooltip.left{padding:0 5px;margin-left:-3px}.nf-form-wrap .tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.nf-form-wrap .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.nf-form-wrap .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.nf-form-wrap .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.nf-form-wrap .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .dropdown-menu{position:absolute;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175)}.nf-form-wrap .dropdown-menu.pull-right{right:0;left:auto}.nf-form-wrap .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nf-form-wrap .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.nf-form-wrap .dropdown-menu>li>a:focus,.nf-form-wrap .dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.nf-form-wrap .dropdown-menu>.active>a,.nf-form-wrap .dropdown-menu>.active>a:focus,.nf-form-wrap .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.nf-form-wrap .dropdown-menu>.disabled>a,.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{color:#777}.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.nf-form-wrap .open>.dropdown-menu{display:block}.nf-form-wrap .open>a{outline:0}.nf-form-wrap .dropdown-menu-right{right:0;left:auto}.nf-form-wrap .dropdown-menu-left{right:auto;left:0}.nf-form-wrap .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.nf-form-wrap .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.nf-form-wrap .pull-right>.dropdown-menu{right:0;left:auto}.nf-form-wrap .dropup .caret,.nf-form-wrap .navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.nf-form-wrap .dropup .dropdown-menu,.nf-form-wrap .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.nf-form-wrap .navbar-right .dropdown-menu{right:0;left:auto}.nf-form-wrap .navbar-right .dropdown-menu-left{right:auto;left:0}}.nf-form-wrap .btn-group-justified>.btn-group .dropdown-menu{left:auto}.nf-form-wrap .nav-justified>.dropdown .dropdown-menu,.nf-form-wrap .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.nf-form-wrap .nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.nf-form-wrap .navbar-nav .open .dropdown-menu .dropdown-header,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{line-height:20px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.nf-form-wrap .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.nf-form-wrap .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}@media (max-width:767px){.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.nf-loading-spinner{width:40px;height:40px;margin:100px auto;background-color:hsla(0,0%,81.6%,.5);border-radius:100%;-webkit-animation:nf-scaleout 1s ease-in-out infinite;animation:nf-scaleout 1s ease-in-out infinite}@-webkit-keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}@keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.field-wrap{display:flex}.field-wrap>label{display:block}.field-wrap .pikaday__container,.field-wrap .pikaday__display,.field-wrap>div input,.field-wrap select,.field-wrap textarea{width:100%}.field-wrap>div input[type=checkbox],.field-wrap button,.field-wrap input[type=button],.field-wrap input[type=submit]{width:auto}.nf-field-label{order:5}.nf-field-description{width:100%;order:10}.nf-field-element{order:15}.label-above .nf-field-label{margin-bottom:10px}.label-below .nf-field-label{margin-top:10px;order:15}.label-below .nf-field-element{order:5}.label-hidden .field-wrap{flex-wrap:wrap}.label-hidden .nf-field-label{height:0;margin:0!important;width:100%;visibility:hidden}.label-hidden .nf-field-description{width:100%;order:20}.label-hidden .nf-field-element{width:100%}.label-left .field-wrap{flex-direction:row;flex-wrap:wrap}.label-left .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-right:2%;text-align:right;width:35%;order:5}.label-left .nf-field-label label{width:100%}.label-left .nf-field-description{margin-left:35%}.label-left .nf-field-element{display:inline-block;width:65%;order:10}.label-left .nf-after-field{margin-left:36.5%}.label-right .field-wrap{flex-direction:row}.label-right .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-left:2%;width:35%;order:10}.label-right .nf-field-description{margin-right:35%;order:15}.label-right .nf-field-element{display:inline-block;width:65%;order:5}.label-right .checkbox-wrap .nf-field-label{width:auto}.label-right .checkbox-wrap .nf-field-element{width:20px}.label-right .nf-after-field{width:65%}.label-above .field-wrap,.label-below .field-wrap{flex-direction:column;flex-flow:wrap}.label-above .nf-field-element,.label-below .nf-field-element{margin:0;width:100%}.label-left .listcheckbox-wrap .nf-field-label,.label-left .listradio-wrap .nf-field-label,.label-left .textarea-wrap .nf-field-label,.label-right .listcheckbox-wrap .nf-field-label,.label-right .listradio-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{align-items:flex-start}.label-left .textarea-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{margin-top:5px}.label-left .hr-wrap,.label-left .html-wrap,.label-right .hr-wrap,.label-right .html-wrap{display:block}.label-left .hr-wrap .nf-field-element,.label-left .html-wrap .nf-field-element,.label-right .hr-wrap .nf-field-element,.label-right .html-wrap .nf-field-element{display:block;margin:0;width:100%}.nf-repeater-fieldsets fieldset{margin-bottom:1em}.nf-remove-fieldset{color:red;font-size:1.5em;background-color:transparent;border:thin solid red;padding:.1em .4em;float:right;margin-top:-1em}.nf-help{background:none}.nf-field-description{font-size:14px}.nf-form-content{padding:5px;max-width:1000px;margin:0 auto}.nf-form-content label{font-size:18px;line-height:20px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content .ninja-forms-field{font-size:16px;margin:0;padding:12px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content input.ninja-forms-field,.nf-form-content select.ninja-forms-field:not([multiple]){height:50px}.nf-form-content textarea.ninja-forms-field{height:200px}.nf-form-content hr.ninja-forms-field{padding:0}.nf-form-content input[type=checkbox].ninja-forms-field,.nf-form-content input[type=radio].ninja-forms-field{height:auto}.nf-form-content .listcheckbox-wrap li,.nf-form-content .listradio-wrap li{margin-bottom:12px!important;line-height:0}.nf-form-content .nf-product-field span{padding-right:16px}.nf-form-content .nf-product-field .nf-field-qty{font-size:16px;padding:5px;width:80px!important}.nf-form-content .nf-static{background:transparent;border:0;font-weight:700;padding:0}.nf-form-content .label-above .nf-field-label,.nf-form-content .label-below .nf-field-label,.nf-form-content .label-hidden .nf-field-label{margin-bottom:10px;padding:0}.nf-form-content .label-below .nf-field-label{margin-bottom:0;margin-top:10px}.nf-form-content .label-right .nf-field-label{margin:0}.nf-form-content .label-right>input[type=radio],.nf-form-content .label-right input[type=checkbox],.nf-form-content .label-right ul{margin-right:1%}.nf-form-content .list-select-wrap>div{position:relative}.nf-form-content .list-select-wrap>div div{display:block;position:absolute;font-size:16px;line-height:16px;margin:0;padding:16px;height:50px;top:0;right:0;left:0;z-index:1}.nf-form-content .list-select-wrap>div div:after{content:"\f078";font-family:FontAwesome;font-size:20px;position:absolute;right:10px;bottom:0;height:50px;line-height:50px}.nf-form-content .list-select-wrap>div.label-right div{width:59%}.nf-form-content .list-select-wrap>div.label-below div{top:0;bottom:auto}.nf-form-content .list-select-wrap>div.label-left div{width:59%;left:40.5%;right:40px}.nf-form-content .list-select-wrap>div select{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;z-index:2}.nf-form-content .listmultiselect-wrap select{-webkit-appearance:normal;-moz-appearance:normal;appearance:normal}.checkbox-wrap .nf-field-element label,.checkbox-wrap .nf-field-label label,.listcheckbox-wrap .nf-field-element label,.listcheckbox-wrap .nf-field-label label{position:relative;margin-left:30px}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{border:1px solid;content:"";width:18px;height:18px;position:absolute;left:-28px;bottom:0}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{content:"\f00c";font-family:FontAwesome;font-size:24px;position:absolute;bottom:0;z-index:2}.checkbox-container .nf-field-element input{display:none}.checkbox-container.label-above label{height:50px;margin:0;display:block}.checkbox-container.label-above label:before{left:-2px;bottom:-16px}.checkbox-container.label-above label:after{left:0;bottom:-16px}.checkbox-container.label-below label{display:block;margin:20px 0 0}.checkbox-container.label-below label:before{left:-2px;bottom:auto;top:-27px}.checkbox-container.label-below label:after{left:0;bottom:auto;top:-25px}.checkbox-container.label-left .nf-field-label{width:38%;padding-right:5%}.checkbox-container.label-left .nf-field-element{width:58%}.checkbox-container.label-left label{margin:0;display:block}.checkbox-container.label-left label:before{left:auto;top:-2px;right:-36px}.checkbox-container.label-left label:after{left:auto;top:0;right:-31px}.checkbox-container.label-right .nf-field-label{padding:0;order:10}.checkbox-container.label-right .nf-field-element{order:5;display:none}.checkbox-container.label-right label{margin:0 0 0 30px;display:block}.checkbox-container.label-right label:before{left:-30px;top:0}.checkbox-container.label-right label:after{left:-28px;top:0}.checkbox-container.label-right .field-wrap{display:flex}.checkbox-container.label-right .field-wrap>div{width:100%}.checkbox-container.label-hidden label{height:0;margin:0;display:block}.checkbox-container.label-hidden label:after{left:0;bottom:0;visibility:visible}.checkbox-container.label-hidden label.nf-checked-label:before{left:-2px;bottom:0;visibility:visible}.listcheckbox-container .nf-field-label label:after{background:transparent!important;border:0}.listcheckbox-container .nf-field-element input{display:none}.listcheckbox-container .nf-field-element label{margin-left:30px!important}.listcheckbox-container .nf-field-element label:before{top:1px;left:-30px;bottom:auto}.listcheckbox-container .nf-field-element label:after{top:3px;bottom:auto}.listcheckbox-container.label-above .nf-field-label label,.listcheckbox-container.label-below .nf-field-label label,.listcheckbox-container.label-right .nf-field-label label{margin:0}.listcheckbox-container.label-above .nf-field-label label:before,.listcheckbox-container.label-below .nf-field-label label:before,.listcheckbox-container.label-right .nf-field-label label:before{left:-30px}.listradio-wrap .nf-field-element label{position:relative;margin-left:30px!important}.listradio-wrap .nf-field-element label:after{border-radius:50%;content:"";width:18px;height:18px;position:absolute;left:-30px;bottom:1px;top:.05em}.listradio-wrap .nf-field-element label.nf-checked-label:before{border-radius:50%;content:"";height:10px;width:10px;position:absolute;left:-26px;bottom:5px;z-index:2;top:.25em}.listradio-wrap .nf-field-element input{display:none}input[type=checkbox].nf-toggle{background:transparent;border:0;box-shadow:0 0 0;margin:10px;height:18px;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;cursor:pointer}input[type=checkbox].nf-toggle:after{background:#bcbdbf;border:2px solid #bcbdbf;border-radius:20px;content:"";position:absolute;top:-4px;left:-4px;width:46px;height:24px;transition:all .3s ease}input[type=checkbox].nf-toggle:before{background:#fff;border-radius:20px;content:"";position:absolute;top:-1px;left:0;width:18px;height:18px;z-index:99;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:after{background:#90ee90;border:2px solid #90ee90;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:before{top:-1px;left:20px;transition:all .3s ease}.label-right input[type=checkbox].nf-toggle{padding:0 50px 0 0}.label-left input[type=checkbox].nf-toggle{padding:0;margin-left:22px;margin-top:20px}.nf-icons .nf-field-element{position:relative}.nf-icons .nf-field-element:before{font-family:FontAwesome;font-size:20px;position:absolute;left:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;z-index:1}.nf-icons .address-wrap .nf-field-element input,.nf-icons .city-wrap .nf-field-element input,.nf-icons .creditcardcvc-wrap .nf-field-element input,.nf-icons .creditcardexpiration-wrap .nf-field-element input,.nf-icons .creditcardfullname-wrap .nf-field-element input,.nf-icons .creditcardnumber-wrap .nf-field-element input,.nf-icons .creditcardzip-wrap .nf-field-element input,.nf-icons .date-wrap .nf-field-element input,.nf-icons .email-wrap .nf-field-element input,.nf-icons .firstname-wrap .nf-field-element input,.nf-icons .lastname-wrap .nf-field-element input,.nf-icons .number-wrap .nf-field-element input,.nf-icons .phone-wrap .nf-field-element input,.nf-icons .quantity-wrap .nf-field-element input,.nf-icons .state-wrap .nf-field-element input,.nf-icons .zip-wrap .nf-field-element input{padding-left:60px}.nf-icons.right .nf-field-element:before{left:auto;right:1px}.nf-icons.right .address-wrap>div input,.nf-icons.right .city-wrap>div input,.nf-icons.right .creditcardcvc-wrap>div input,.nf-icons.right .creditcardexpiration-wrap>div input,.nf-icons.right .creditcardfullname-wrap>div input,.nf-icons.right .creditcardnumber-wrap>div input,.nf-icons.right .creditcardzip-wrap>div input,.nf-icons.right .date-wrap>div input,.nf-icons.right .email-wrap>div input,.nf-icons.right .firstname-wrap>div input,.nf-icons.right .lastname-wrap>div input,.nf-icons.right .number-wrap>div input,.nf-icons.right .phone-wrap>div input,.nf-icons.right .quantity-wrap>div input,.nf-icons.right .state-wrap>div input,.nf-icons.right .zip-wrap>div input{padding-left:12px;padding-right:60px}.nf-icons .date-wrap .nf-field-element:before{content:"\f073"}.nf-icons .number-wrap .nf-field-element:before,.nf-icons .quantity-wrap>div:before{content:"\f292"}.nf-icons .email-wrap .nf-field-element:before{content:"\f0e0"}.nf-icons .phone-wrap .nf-field-element:before{content:"\f095"}.nf-icons .firstname-wrap .nf-field-element:before,.nf-icons .lastname-wrap .nf-field-element:before{content:"\f007"}.nf-icons .address-wrap .nf-field-element:before,.nf-icons .city-wrap .nf-field-element:before,.nf-icons .state-wrap .nf-field-element:before,.nf-icons .zip-wrap .nf-field-element:before{content:"\f041"}.nf-icons .creditcardcvc-wrap .nf-field-element:before,.nf-icons .creditcardexpiration-wrap .nf-field-element:before,.nf-icons .creditcardfullname-wrap .nf-field-element:before,.nf-icons .creditcardnumber-wrap .nf-field-element:before,.nf-icons .creditcardzip-wrap .nf-field-element:before{content:"\f283"}.nf-field-element .date-and-time{margin-bottom:5px}.nf-field-element .hour{padding:5px;border-right:0}.nf-field-element .ampm,.nf-field-element .minute{padding:5px;border-left:0}.nf-form-content .list-select-wrap .nf-field-element>div,.nf-form-content input:not([type=button]),.nf-form-content textarea{background:#f7f7f7;border:1px solid #c4c4c4;border-radius:0;box-shadow:none;color:#787878;transition:all .5s}.nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-form-content input:not([type=button]):focus,.nf-form-content textarea:focus{background:#fff;border-color:#919191;color:#919191;outline:none;transition:all .5s}.nf-form-content button,.nf-form-content input[type=button],.nf-form-content input[type=submit]{background:#333;border:0;color:#f7f7f7;transition:all .5s}.nf-form-content button:hover,.nf-form-content input[type=button]:hover,.nf-form-content input[type=submit]:hover{background:#c4c4c4;color:#787878;transition:all .5s}.nf-form-content select.ninja-forms-field{color:#787878}.nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.list-select-wrap div:after{color:#787878;transition:all .5s}.list-select-wrap select:active+div,.list-select-wrap select:focus+div{background:#fff!important;border-color:#919191!important;transition:all .5s}.listradio-wrap .nf-field-element label:after{background:#f7f7f7;border:2px solid #c4c4c4;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#333;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:before{background:#333}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{background:#f7f7f7;border-color:#c4c4c4;transition:all .5s}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{color:#f7f7f7;opacity:0;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:after,.checkbox-wrap .nf-field-label label.nf-checked-label:after,.listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#b7b7b7;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:before,.checkbox-wrap .nf-field-label label.nf-checked-label:before,.listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#333;opacity:1;transition:all .5s}.nf-error{position:relative}.nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-error .nf-error-msg{color:#e80000}.nf-pass{position:relative}.nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-icons .nf-field-element:before{background:#c4c4c4;color:#f7f7f7}.nf-help{color:#333}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div,.nf-brown .nf-form-content input:not([type=button]),.nf-brown .nf-form-content textarea{background:#f3efdd;border:1px solid #d8cc92;border-radius:0;box-shadow:none;color:#9a8837;transition:all .5s}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-brown .nf-form-content input:not([type=button]):focus,.nf-brown .nf-form-content textarea:focus{background:#fff;border-color:#bea846;color:#bea846;outline:none;transition:all .5s}.nf-brown .nf-form-content button,.nf-brown .nf-form-content input[type=button],.nf-brown .nf-form-content input[type=submit]{background:#736628;border:0;color:#f3efdd;transition:all .5s}.nf-brown .nf-form-content button:hover,.nf-brown .nf-form-content input[type=button]:hover,.nf-brown .nf-form-content input[type=submit]:hover{background:#d8cc92;color:#9a8837;transition:all .5s}.nf-brown .nf-form-content select.ninja-forms-field{color:#9a8837}.nf-brown .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-brown .list-select-wrap div:after{color:#9a8837;transition:all .5s}.nf-brown .list-select-wrap select:active+div,.nf-brown .list-select-wrap select:focus+div{background:#fff!important;border-color:#bea846!important;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label:after{background:#f3efdd;border:2px solid #d8cc92;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#736628;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#736628}.nf-brown .checkbox-wrap .nf-field-element label:after,.nf-brown .checkbox-wrap .nf-field-label label:after,.nf-brown .listcheckbox-wrap .nf-field-element label:after,.nf-brown .listcheckbox-wrap .nf-field-label label:after{background:#f3efdd;border-color:#d8cc92;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label:before,.nf-brown .checkbox-wrap .nf-field-label label:before,.nf-brown .listcheckbox-wrap .nf-field-element label:before,.nf-brown .listcheckbox-wrap .nf-field-label label:before{color:#f3efdd;opacity:0;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#d2c37f;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#736628;opacity:1;transition:all .5s}.nf-brown .nf-error{position:relative}.nf-brown .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-brown .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-brown .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-error .nf-error-msg{color:#e80000}.nf-brown .nf-pass{position:relative}.nf-brown .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-brown .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-brown .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-brown .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-brown .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-brown .nf-icons .nf-field-element:before{background:#d8cc92;color:#f3efdd}.nf-brown .nf-help{color:#736628}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div,.nf-red .nf-form-content input:not([type=button]),.nf-red .nf-form-content textarea{background:#f0e3e3;border:1px solid #cca1a1;border-radius:0;box-shadow:none;color:#8a4a4a;transition:all .5s}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-red .nf-form-content input:not([type=button]):focus,.nf-red .nf-form-content textarea:focus{background:#fff;border-color:#a95e5e;color:#a95e5e;outline:none;transition:all .5s}.nf-red .nf-form-content button,.nf-red .nf-form-content input[type=button],.nf-red .nf-form-content input[type=submit]{background:#8a5252;border:0;color:#f0e3e3;transition:all .5s}.nf-red .nf-form-content button:hover,.nf-red .nf-form-content input[type=button]:hover,.nf-red .nf-form-content input[type=submit]:hover{background:#cca1a1;color:#8a4a4a;transition:all .5s}.nf-red .nf-form-content select.ninja-forms-field{color:#8a4a4a}.nf-red .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-red .list-select-wrap div:after{color:#8a4a4a;transition:all .5s}.nf-red .list-select-wrap select:active+div,.nf-red .list-select-wrap select:focus+div{background:#fff!important;border-color:#a95e5e!important;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label:after{background:#f0e3e3;border:2px solid #cca1a1;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#8a5252;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#8a5252}.nf-red .checkbox-wrap .nf-field-element label:after,.nf-red .checkbox-wrap .nf-field-label label:after,.nf-red .listcheckbox-wrap .nf-field-element label:after,.nf-red .listcheckbox-wrap .nf-field-label label:after{background:#f0e3e3;border-color:#cca1a1;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label:before,.nf-red .checkbox-wrap .nf-field-label label:before,.nf-red .listcheckbox-wrap .nf-field-element label:before,.nf-red .listcheckbox-wrap .nf-field-label label:before{color:#f0e3e3;opacity:0;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#c49090;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#8a5252;opacity:1;transition:all .5s}.nf-red .nf-error{position:relative}.nf-red .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-red .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-red .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-error .nf-error-msg{color:#e80000}.nf-red .nf-pass{position:relative}.nf-red .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-red .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-red .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-red .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-red .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-red .nf-icons .nf-field-element:before{background:#cca1a1;color:#f0e3e3}.nf-red .nf-help{color:#8a5252}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div,.nf-blue .nf-form-content input:not([type=button]),.nf-blue .nf-form-content textarea{background:#dfeff5;border:1px solid #91c8dd;border-radius:0;box-shadow:none;color:#3384a2;transition:all .5s}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-blue .nf-form-content input:not([type=button]):focus,.nf-blue .nf-form-content textarea:focus{background:#fff;border-color:#44a1c4;color:#44a1c4;outline:none;transition:all .5s}.nf-blue .nf-form-content button,.nf-blue .nf-form-content input[type=button],.nf-blue .nf-form-content input[type=submit]{background:#4f9dbf;border:0;color:#dfeff5;transition:all .5s}.nf-blue .nf-form-content button:hover,.nf-blue .nf-form-content input[type=button]:hover,.nf-blue .nf-form-content input[type=submit]:hover{background:#91c8dd;color:#3384a2;transition:all .5s}.nf-blue .nf-form-content select.ninja-forms-field{color:#3384a2}.nf-blue .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-blue .list-select-wrap div:after{color:#3384a2;transition:all .5s}.nf-blue .list-select-wrap select:active+div,.nf-blue .list-select-wrap select:focus+div{background:#fff!important;border-color:#44a1c4!important;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label:after{background:#dfeff5;border:2px solid #91c8dd;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#4f9dbf;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#4f9dbf}.nf-blue .checkbox-wrap .nf-field-element label:after,.nf-blue .checkbox-wrap .nf-field-label label:after,.nf-blue .listcheckbox-wrap .nf-field-element label:after,.nf-blue .listcheckbox-wrap .nf-field-label label:after{background:#dfeff5;border-color:#91c8dd;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label:before,.nf-blue .checkbox-wrap .nf-field-label label:before,.nf-blue .listcheckbox-wrap .nf-field-element label:before,.nf-blue .listcheckbox-wrap .nf-field-label label:before{color:#dfeff5;opacity:0;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#7ebed7;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#4f9dbf;opacity:1;transition:all .5s}.nf-blue .nf-error{position:relative}.nf-blue .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-blue .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-blue .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-error .nf-error-msg{color:#e80000}.nf-blue .nf-pass{position:relative}.nf-blue .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-blue .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-blue .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-blue .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-blue .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-blue .nf-icons .nf-field-element:before{background:#91c8dd;color:#dfeff5}.nf-blue .nf-help{color:#4f9dbf}@media only screen and (max-width:800px){.nf-field-container .nf-field-label{margin-bottom:10px!important;padding:0;width:100%;order:5}.nf-field-container .nf-field-label label{text-align:left}.nf-field-container .nf-field-description{margin:0;width:100%;order:10}.nf-field-container .nf-field-element{width:100%;order:15}.nf-field-container .checkbox-wrap .nf-field-label{width:auto}.nf-field-container .checkbox-wrap .nf-field-label label{position:relative;margin-left:30px}.nf-field-container .checkbox-wrap .nf-field-label label:after{left:-28px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-label label:before{left:-30px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-element{width:20px}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:both;float:none;margin:0;width:100%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:0}}
|
2 |
/*# sourceMappingURL=display-opinions-light.css.map */
|
1 |
+
.ninja-forms-form-wrap *,.ninja-forms-form-wrap :after,.ninja-forms-form-wrap :before{-ms-box-sizing:border-box;box-sizing:border-box}.nf-response-msg{display:none}#ninja_forms_required_items,.nf-field-container{clear:both;position:relative;margin-bottom:25px}#ninja_forms_required_items:after,.nf-field-container:after{clear:both;content:"";display:block}#ninja_forms_required_items.hidden-container,#ninja_forms_required_items.hr-container,.nf-field-container.hidden-container,.nf-field-container.hr-container{margin:0;height:auto}#ninja_forms_required_items.hidden-container .nf-field-label,#ninja_forms_required_items.hr-container .nf-field-label,#ninja_forms_required_items.html-container .nf-field-label,.nf-field-container.hidden-container .nf-field-label,.nf-field-container.hr-container .nf-field-label,.nf-field-container.html-container .nf-field-label{display:none}.nf-field-label label{font-weight:700;margin:0;padding:0}.nf-field-element{position:relative}.nf-field-element input,.nf-field-element select,.nf-field-element textarea{margin:0;width:auto;height:auto;vertical-align:inherit}.nf-field-element textarea{height:200px}.nf-field-description p:last-child{margin:0}.nf-help{background:url(../img/help-info.png) no-repeat;display:inline-block;width:16px;height:16px}.nf-input-limit{font-size:12px;margin-top:5px}.nf-static{padding:0 10px}.nf-after-field .nf-error-msg{margin-right:10px}.list-checkbox-wrap .nf-field-element li,.list-checkbox-wrap .nf-field-element ul,.list-image-wrap .nf-field-element li,.list-image-wrap .nf-field-element ul,.list-radio-wrap .nf-field-element li,.list-radio-wrap .nf-field-element ul{list-style:none!important;margin:0!important;padding:0!important}.list-checkbox-wrap .nf-field-element li input,.list-checkbox-wrap .nf-field-element ul input,.list-image-wrap .nf-field-element li input,.list-image-wrap .nf-field-element ul input,.list-radio-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element ul input{margin-right:5px}.list-checkbox-wrap .nf-field-element li,.list-image-wrap .nf-field-element li,.list-radio-wrap .nf-field-element li{padding-left:10px;margin:0 0 5px!important;text-indent:0!important}.list-checkbox-wrap .nf-field-element li label,.list-image-wrap .nf-field-element li label,.list-radio-wrap .nf-field-element li label{display:block;float:none;width:auto;margin-left:1.5em}.list-checkbox-wrap .nf-field-element li input,.list-image-wrap .nf-field-element li input,.list-radio-wrap .nf-field-element li input{width:auto!important;float:left;margin-top:.25em}.listimage-wrap li{width:100%;height:100%;display:inline-grid}.listimage-wrap li label{padding:5px;border:2px solid transparent}.listimage-wrap li label.nf-checked-label{border:2px solid #007acc;transition:all .5s}.listimage-wrap li label img{display:block}.listimage-wrap li input{display:none}.product-wrap>div input{width:80px!important}.product-wrap>div .nf-product-field span{padding:0 5px}.starrating-wrap .star{border-bottom:0}.nf-form-hp{position:absolute;visibility:hidden}.list-select-wrap div div{display:none}.nf-error-msg,.ninja-forms-req-symbol{color:#e80000}.nf-error.listimage-wrap .nf-field-element ul,.nf-error .ninja-forms-field{border:1px solid #e80000}.nf-field-submit-error{padding:15px}.ninja-forms-noscript-message{background:#f1f1f1;border:4px dashed #ccc;color:#333;display:block;font-size:20px;margin:20px 0;padding:40px;text-align:center}.two-col-list ul li{float:left;width:50%}.three-col-list ul li{float:left;width:33.33%}.four-col-list ul li{float:left;width:25%}.five-col-list ul li{float:left;width:20%}.six-col-list ul li{float:left;width:16.66%}body .pika-label{background:transparent}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:none;float:left;margin-left:2.564102564102564%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:20px}.nf-form-cont .five-sixths:after,.nf-form-cont .four-sixths:after,.nf-form-cont .one-fourth:after,.nf-form-cont .one-half:after,.nf-form-cont .one-sixth:after,.nf-form-cont .one-third:after,.nf-form-cont .three-fourths:after,.nf-form-cont .three-sixths:after,.nf-form-cont .two-fourths:after,.nf-form-cont .two-sixths:after,.nf-form-cont .two-thirds:after{clear:both;content:"";display:block}.nf-form-cont .one-half,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths{width:48.717948717948715%}.nf-form-cont .one-third,.nf-form-cont .two-sixths{width:31.623931623931625%}.nf-form-cont .four-sixths,.nf-form-cont .two-thirds{width:65.81196581196582%}.nf-form-cont .one-fourth{width:23.076923076923077%}.nf-form-cont .three-fourths{width:74.35897435897436%}.nf-form-cont .one-sixth{width:14.52991452991453%}.nf-form-cont .five-sixths{width:82.90598290598291%}.nf-form-cont .first{clear:both;margin-left:0}.note-popover{display:none!important}.nf-form-wrap .note-editor{border:0!important}.nf-form-wrap .note-editor .note-toolbar:after{clear:both;content:"";display:block}.nf-form-wrap .note-editor .note-editable{background:#f9f9f9;border:1px solid #f1f1f1;display:block}.nf-form-wrap .note-editor .note-editable p{font-size:16px}.nf-form-wrap .note-editor .note-editable ul{list-style-type:disc;margin-left:2em}.nf-form-wrap .note-editor .note-editable table td{border:1px solid #ccc;width:auto}.nf-form-wrap .note-editor .modal{display:none}.nf-form-wrap .note-editor .btn-group{float:left}.nf-form-wrap .note-editor .btn-group.note-tools{float:right}.nf-form-wrap .note-editor .btn{background:#f9f9f9;border:0;border-radius:4px;color:#666;cursor:pointer;margin-right:2px;padding-top:4px}.nf-form-wrap .note-editor .btn.disabled{background:transparent;color:#aaa}.nf-form-wrap .note-editor .btn.disabled .merge-tags{background:#f9f9f9;color:#666}.nf-form-wrap .note-editor button[type=button]{padding:4px;width:auto;height:auto}.nf-form-wrap .note-editor .dropdown-toggle{position:relative;display:inline-block;top:0}.nf-form-wrap .note-editor .dropdown-toggle:after{content:"";width:0}.nf-form-wrap .tooltip{position:absolute;z-index:1070;display:block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.nf-form-wrap .tooltip.in{filter:alpha(opacity=90);opacity:.9}.nf-form-wrap .tooltip.top{padding:5px 0;margin-top:-3px}.nf-form-wrap .tooltip.right{padding:0 5px;margin-left:3px}.nf-form-wrap .tooltip.bottom{padding:5px 0;margin-top:3px}.nf-form-wrap .tooltip.left{padding:0 5px;margin-left:-3px}.nf-form-wrap .tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.nf-form-wrap .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.nf-form-wrap .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.nf-form-wrap .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.nf-form-wrap .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.nf-form-wrap .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.nf-form-wrap .dropdown-menu{position:absolute;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175)}.nf-form-wrap .dropdown-menu.pull-right{right:0;left:auto}.nf-form-wrap .dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nf-form-wrap .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.nf-form-wrap .dropdown-menu>li>a:focus,.nf-form-wrap .dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.nf-form-wrap .dropdown-menu>.active>a,.nf-form-wrap .dropdown-menu>.active>a:focus,.nf-form-wrap .dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.nf-form-wrap .dropdown-menu>.disabled>a,.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{color:#777}.nf-form-wrap .dropdown-menu>.disabled>a:focus,.nf-form-wrap .dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.nf-form-wrap .open>.dropdown-menu{display:block}.nf-form-wrap .open>a{outline:0}.nf-form-wrap .dropdown-menu-right{right:0;left:auto}.nf-form-wrap .dropdown-menu-left{right:auto;left:0}.nf-form-wrap .dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.nf-form-wrap .dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.nf-form-wrap .pull-right>.dropdown-menu{right:0;left:auto}.nf-form-wrap .dropup .caret,.nf-form-wrap .navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.nf-form-wrap .dropup .dropdown-menu,.nf-form-wrap .navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.nf-form-wrap .navbar-right .dropdown-menu{right:0;left:auto}.nf-form-wrap .navbar-right .dropdown-menu-left{right:auto;left:0}}.nf-form-wrap .btn-group-justified>.btn-group .dropdown-menu{left:auto}.nf-form-wrap .nav-justified>.dropdown .dropdown-menu,.nf-form-wrap .nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.nf-form-wrap .nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.nf-form-wrap .navbar-nav .open .dropdown-menu .dropdown-header,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a{line-height:20px}.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.nf-form-wrap .navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.nf-form-wrap .navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (max-width:767px){.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}@media (max-width:767px){.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.nf-form-wrap .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.nf-loading-spinner{width:40px;height:40px;margin:100px auto;background-color:hsla(0,0%,81.6%,.5);border-radius:100%;-webkit-animation:nf-scaleout 1s ease-in-out infinite;animation:nf-scaleout 1s ease-in-out infinite}@-webkit-keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}@keyframes nf-scaleout{0%{transform:scale(0)}to{transform:scale(1);opacity:0}}.field-wrap{display:flex}.field-wrap>label{display:block}.field-wrap .pikaday__container,.field-wrap .pikaday__display,.field-wrap>div input,.field-wrap select,.field-wrap textarea{width:100%}.field-wrap>div input[type=checkbox],.field-wrap button,.field-wrap input[type=button],.field-wrap input[type=submit]{width:auto}.nf-field-label{order:5}.nf-field-description{width:100%;order:10}.nf-field-element{order:15}.label-above .nf-field-label{margin-bottom:10px}.label-below .nf-field-label{margin-top:10px;order:15}.label-below .nf-field-element{order:5}.label-hidden .field-wrap{flex-wrap:wrap}.label-hidden .nf-field-label{height:0;margin:0!important;width:100%;visibility:hidden}.label-hidden .nf-field-description{width:100%;order:20}.label-hidden .nf-field-element{width:100%}.label-left .field-wrap{flex-direction:row;flex-wrap:wrap}.label-left .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-right:2%;text-align:right;width:35%;order:5}.label-left .nf-field-label label{width:100%}.label-left .nf-field-description{margin-left:35%}.label-left .nf-field-element{display:inline-block;width:65%;order:10}.label-left .nf-after-field{margin-left:36.5%}.label-right .field-wrap{flex-direction:row}.label-right .nf-field-label{display:flex;flex-direction:row;align-items:center;padding-left:2%;width:35%;order:10}.label-right .nf-field-description{margin-right:35%;order:15}.label-right .nf-field-element{display:inline-block;width:65%;order:5}.label-right .checkbox-wrap .nf-field-label{width:auto}.label-right .checkbox-wrap .nf-field-element{width:20px}.label-right .nf-after-field{width:65%}.label-above .field-wrap,.label-below .field-wrap{flex-direction:column;flex-flow:wrap}.label-above .nf-field-element,.label-below .nf-field-element{margin:0;width:100%}.label-left .listcheckbox-wrap .nf-field-label,.label-left .listradio-wrap .nf-field-label,.label-left .textarea-wrap .nf-field-label,.label-right .listcheckbox-wrap .nf-field-label,.label-right .listradio-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{align-items:flex-start}.label-left .textarea-wrap .nf-field-label,.label-right .textarea-wrap .nf-field-label{margin-top:5px}.label-left .hr-wrap,.label-left .html-wrap,.label-right .hr-wrap,.label-right .html-wrap{display:block}.label-left .hr-wrap .nf-field-element,.label-left .html-wrap .nf-field-element,.label-right .hr-wrap .nf-field-element,.label-right .html-wrap .nf-field-element{display:block;margin:0;width:100%}.nf-repeater-fieldsets fieldset{margin-bottom:1em}.nf-remove-fieldset{color:red;font-size:1.5em;background-color:transparent;border:thin solid red;padding:.1em .4em;float:right;margin-top:-1em}.nf-help{background:none}.nf-field-description{font-size:14px}.nf-form-content{padding:5px;max-width:1000px;margin:0 auto}.nf-form-content label{font-size:18px;line-height:20px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content .ninja-forms-field{font-size:16px;margin:0;padding:12px}.nf-form-content .listselect-wrap .nf-field-element div,.nf-form-content input.ninja-forms-field,.nf-form-content select.ninja-forms-field:not([multiple]){height:50px}.nf-form-content textarea.ninja-forms-field{height:200px}.nf-form-content hr.ninja-forms-field{padding:0}.nf-form-content input[type=checkbox].ninja-forms-field,.nf-form-content input[type=radio].ninja-forms-field{height:auto}.nf-form-content .listcheckbox-wrap li,.nf-form-content .listradio-wrap li{margin-bottom:12px!important;line-height:0}.nf-form-content .nf-product-field span{padding-right:16px}.nf-form-content .nf-product-field .nf-field-qty{font-size:16px;padding:5px;width:80px!important}.nf-form-content .nf-static{background:transparent;border:0;font-weight:700;padding:0}.nf-form-content .label-above .nf-field-label,.nf-form-content .label-below .nf-field-label,.nf-form-content .label-hidden .nf-field-label{margin-bottom:10px;padding:0}.nf-form-content .label-below .nf-field-label{margin-bottom:0;margin-top:10px}.nf-form-content .label-right .nf-field-label{margin:0}.nf-form-content .label-right>input[type=radio],.nf-form-content .label-right input[type=checkbox],.nf-form-content .label-right ul{margin-right:1%}.nf-form-content .list-select-wrap>div{position:relative}.nf-form-content .list-select-wrap>div div{display:block;position:absolute;font-size:16px;line-height:16px;margin:0;padding:16px;height:50px;top:0;right:0;left:0;z-index:1}.nf-form-content .list-select-wrap>div div:after{content:"\f078";font-family:FontAwesome;font-size:20px;position:absolute;right:10px;bottom:0;height:50px;line-height:50px}.nf-form-content .list-select-wrap>div.label-right div{width:59%}.nf-form-content .list-select-wrap>div.label-below div{top:0;bottom:auto}.nf-form-content .list-select-wrap>div.label-left div{width:59%;left:40.5%;right:40px}.nf-form-content .list-select-wrap>div select{background:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;z-index:2}.nf-form-content .listmultiselect-wrap select{-webkit-appearance:normal;-moz-appearance:normal;appearance:normal}.checkbox-wrap .nf-field-element label,.checkbox-wrap .nf-field-label label,.listcheckbox-wrap .nf-field-element label,.listcheckbox-wrap .nf-field-label label{position:relative;margin-left:30px}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{border:1px solid;content:"";width:18px;height:18px;position:absolute;left:-28px;bottom:0}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{content:"\f00c";font-family:FontAwesome;font-size:24px;position:absolute;bottom:0;z-index:2}.checkbox-container .nf-field-element input{display:inherit;opacity:0}.checkbox-container.label-above label{height:50px;margin:0;display:block}.checkbox-container.label-above label:before{left:-2px;bottom:-16px}.checkbox-container.label-above label:after{left:0;bottom:-16px}.checkbox-container.label-below label{display:block;margin:20px 0 0}.checkbox-container.label-below label:before{left:-2px;bottom:auto;top:-27px}.checkbox-container.label-below label:after{left:0;bottom:auto;top:-25px}.checkbox-container.label-left .nf-field-label{width:38%;padding-right:5%}.checkbox-container.label-left .nf-field-element{width:58%}.checkbox-container.label-left label{margin:0;display:block}.checkbox-container.label-left label:before{left:auto;top:-2px;right:-36px}.checkbox-container.label-left label:after{left:auto;top:0;right:-31px}.checkbox-container.label-right .nf-field-label{padding:0;order:10}.checkbox-container.label-right .nf-field-element{order:5;display:inline;position:absolute;opacity:0}.checkbox-container.label-right label{margin:0 0 0 30px;display:block}.checkbox-container.label-right label:before{left:-30px;top:0}.checkbox-container.label-right label:after{left:-28px;top:0}.checkbox-container.label-right .field-wrap{display:flex}.checkbox-container.label-right .field-wrap>div{width:100%}.checkbox-container.label-hidden label{height:0;margin:0;display:block}.checkbox-container.label-hidden label:after{left:0;bottom:0;visibility:visible}.checkbox-container.label-hidden label.nf-checked-label:before{left:-2px;bottom:0;visibility:visible}.listcheckbox-container .nf-field-label label:after{background:transparent!important;border:0}.listcheckbox-container .nf-field-element input{display:inherit;opacity:0}.listcheckbox-container .nf-field-element label{margin-left:30px!important}.listcheckbox-container .nf-field-element label:before{top:1px;left:-30px;bottom:auto}.listcheckbox-container .nf-field-element label:after{top:3px;bottom:auto}.listcheckbox-container.label-above .nf-field-label label,.listcheckbox-container.label-below .nf-field-label label,.listcheckbox-container.label-right .nf-field-label label{margin:0}.listcheckbox-container.label-above .nf-field-label label:before,.listcheckbox-container.label-below .nf-field-label label:before,.listcheckbox-container.label-right .nf-field-label label:before{left:-30px}.listradio-wrap .nf-field-element label{position:relative;margin-left:30px!important}.listradio-wrap .nf-field-element label:after{border-radius:50%;content:"";width:18px;height:18px;position:absolute;left:-30px;bottom:1px;top:.05em}.listradio-wrap .nf-field-element label.nf-checked-label:before{border-radius:50%;content:"";height:10px;width:10px;position:absolute;left:-26px;bottom:5px;z-index:2;top:.25em}.listradio-wrap .nf-field-element input{display:inherit}input[type=checkbox].nf-toggle{background:transparent;border:0;box-shadow:0 0 0;margin:10px;height:18px;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;cursor:pointer}input[type=checkbox].nf-toggle:after{background:#bcbdbf;border:2px solid #bcbdbf;border-radius:20px;content:"";position:absolute;top:-4px;left:-4px;width:46px;height:24px;transition:all .3s ease}input[type=checkbox].nf-toggle:before{background:#fff;border-radius:20px;content:"";position:absolute;top:-1px;left:0;width:18px;height:18px;z-index:99;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:after{background:#90ee90;border:2px solid #90ee90;transition:all .3s ease}input[type=checkbox].nf-toggle:checked:before{top:-1px;left:20px;transition:all .3s ease}.label-right input[type=checkbox].nf-toggle{padding:0 50px 0 0}.label-left input[type=checkbox].nf-toggle{padding:0;margin-left:22px;margin-top:20px}.nf-icons .nf-field-element{position:relative}.nf-icons .nf-field-element:before{font-family:FontAwesome;font-size:20px;position:absolute;left:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;z-index:1}.nf-icons .address-wrap .nf-field-element input,.nf-icons .city-wrap .nf-field-element input,.nf-icons .creditcardcvc-wrap .nf-field-element input,.nf-icons .creditcardexpiration-wrap .nf-field-element input,.nf-icons .creditcardfullname-wrap .nf-field-element input,.nf-icons .creditcardnumber-wrap .nf-field-element input,.nf-icons .creditcardzip-wrap .nf-field-element input,.nf-icons .date-wrap .nf-field-element input,.nf-icons .email-wrap .nf-field-element input,.nf-icons .firstname-wrap .nf-field-element input,.nf-icons .lastname-wrap .nf-field-element input,.nf-icons .number-wrap .nf-field-element input,.nf-icons .phone-wrap .nf-field-element input,.nf-icons .quantity-wrap .nf-field-element input,.nf-icons .state-wrap .nf-field-element input,.nf-icons .zip-wrap .nf-field-element input{padding-left:60px}.nf-icons.right .nf-field-element:before{left:auto;right:1px}.nf-icons.right .address-wrap>div input,.nf-icons.right .city-wrap>div input,.nf-icons.right .creditcardcvc-wrap>div input,.nf-icons.right .creditcardexpiration-wrap>div input,.nf-icons.right .creditcardfullname-wrap>div input,.nf-icons.right .creditcardnumber-wrap>div input,.nf-icons.right .creditcardzip-wrap>div input,.nf-icons.right .date-wrap>div input,.nf-icons.right .email-wrap>div input,.nf-icons.right .firstname-wrap>div input,.nf-icons.right .lastname-wrap>div input,.nf-icons.right .number-wrap>div input,.nf-icons.right .phone-wrap>div input,.nf-icons.right .quantity-wrap>div input,.nf-icons.right .state-wrap>div input,.nf-icons.right .zip-wrap>div input{padding-left:12px;padding-right:60px}.nf-icons .date-wrap .nf-field-element:before{content:"\f073"}.nf-icons .number-wrap .nf-field-element:before,.nf-icons .quantity-wrap>div:before{content:"\f292"}.nf-icons .email-wrap .nf-field-element:before{content:"\f0e0"}.nf-icons .phone-wrap .nf-field-element:before{content:"\f095"}.nf-icons .firstname-wrap .nf-field-element:before,.nf-icons .lastname-wrap .nf-field-element:before{content:"\f007"}.nf-icons .address-wrap .nf-field-element:before,.nf-icons .city-wrap .nf-field-element:before,.nf-icons .state-wrap .nf-field-element:before,.nf-icons .zip-wrap .nf-field-element:before{content:"\f041"}.nf-icons .creditcardcvc-wrap .nf-field-element:before,.nf-icons .creditcardexpiration-wrap .nf-field-element:before,.nf-icons .creditcardfullname-wrap .nf-field-element:before,.nf-icons .creditcardnumber-wrap .nf-field-element:before,.nf-icons .creditcardzip-wrap .nf-field-element:before{content:"\f283"}.nf-field-element .date-and-time{margin-bottom:5px}.nf-field-element .hour{padding:5px;border-right:0}.nf-field-element .ampm,.nf-field-element .minute{padding:5px;border-left:0}.nf-form-content .list-select-wrap .nf-field-element>div,.nf-form-content input:not([type=button]),.nf-form-content textarea{background:#f7f7f7;border:1px solid #c4c4c4;border-radius:0;box-shadow:none;color:#787878;transition:all .5s}.nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-form-content input:not([type=button]):focus,.nf-form-content textarea:focus{background:#fff;border-color:#919191;color:#919191;outline:none;transition:all .5s}.nf-form-content button,.nf-form-content input[type=button],.nf-form-content input[type=submit]{background:#333;border:0;color:#f7f7f7;transition:all .5s}.nf-form-content button:hover,.nf-form-content input[type=button]:hover,.nf-form-content input[type=submit]:hover{background:#c4c4c4;color:#787878;transition:all .5s}.nf-form-content select.ninja-forms-field{color:#787878}.nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.list-select-wrap div:after{color:#787878;transition:all .5s}.list-select-wrap select:active+div,.list-select-wrap select:focus+div{background:#fff!important;border-color:#919191!important;transition:all .5s}.listradio-wrap .nf-field-element label:after{background:#f7f7f7;border:2px solid #c4c4c4;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#333;transition:all .5s}.listradio-wrap .nf-field-element label.nf-checked-label:before{background:#333}.checkbox-wrap .nf-field-element label:after,.checkbox-wrap .nf-field-label label:after,.listcheckbox-wrap .nf-field-element label:after,.listcheckbox-wrap .nf-field-label label:after{background:#f7f7f7;border-color:#c4c4c4;transition:all .5s}.checkbox-wrap .nf-field-element label:before,.checkbox-wrap .nf-field-label label:before,.listcheckbox-wrap .nf-field-element label:before,.listcheckbox-wrap .nf-field-label label:before{color:#f7f7f7;opacity:0;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:after,.checkbox-wrap .nf-field-label label.nf-checked-label:after,.listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#b7b7b7;transition:all .5s}.checkbox-wrap .nf-field-element label.nf-checked-label:before,.checkbox-wrap .nf-field-label label.nf-checked-label:before,.listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#333;opacity:1;transition:all .5s}.nf-error{position:relative}.nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-error .nf-error-msg{color:#e80000}.nf-pass{position:relative}.nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-icons .nf-field-element:before{background:#c4c4c4;color:#f7f7f7}.nf-help{color:#333}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div,.nf-brown .nf-form-content input:not([type=button]),.nf-brown .nf-form-content textarea{background:#f3efdd;border:1px solid #d8cc92;border-radius:0;box-shadow:none;color:#9a8837;transition:all .5s}.nf-brown .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-brown .nf-form-content input:not([type=button]):focus,.nf-brown .nf-form-content textarea:focus{background:#fff;border-color:#bea846;color:#bea846;outline:none;transition:all .5s}.nf-brown .nf-form-content button,.nf-brown .nf-form-content input[type=button],.nf-brown .nf-form-content input[type=submit]{background:#736628;border:0;color:#f3efdd;transition:all .5s}.nf-brown .nf-form-content button:hover,.nf-brown .nf-form-content input[type=button]:hover,.nf-brown .nf-form-content input[type=submit]:hover{background:#d8cc92;color:#9a8837;transition:all .5s}.nf-brown .nf-form-content select.ninja-forms-field{color:#9a8837}.nf-brown .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-brown .list-select-wrap div:after{color:#9a8837;transition:all .5s}.nf-brown .list-select-wrap select:active+div,.nf-brown .list-select-wrap select:focus+div{background:#fff!important;border-color:#bea846!important;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label:after{background:#f3efdd;border:2px solid #d8cc92;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#736628;transition:all .5s}.nf-brown .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#736628}.nf-brown .checkbox-wrap .nf-field-element label:after,.nf-brown .checkbox-wrap .nf-field-label label:after,.nf-brown .listcheckbox-wrap .nf-field-element label:after,.nf-brown .listcheckbox-wrap .nf-field-label label:after{background:#f3efdd;border-color:#d8cc92;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label:before,.nf-brown .checkbox-wrap .nf-field-label label:before,.nf-brown .listcheckbox-wrap .nf-field-element label:before,.nf-brown .listcheckbox-wrap .nf-field-label label:before{color:#f3efdd;opacity:0;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#d2c37f;transition:all .5s}.nf-brown .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-brown .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#736628;opacity:1;transition:all .5s}.nf-brown .nf-error{position:relative}.nf-brown .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-brown .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-brown .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-error .nf-error-msg{color:#e80000}.nf-brown .nf-pass{position:relative}.nf-brown .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-brown .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-brown .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-brown .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-brown .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-brown .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-brown .nf-icons .nf-field-element:before{background:#d8cc92;color:#f3efdd}.nf-brown .nf-help{color:#736628}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div,.nf-red .nf-form-content input:not([type=button]),.nf-red .nf-form-content textarea{background:#f0e3e3;border:1px solid #cca1a1;border-radius:0;box-shadow:none;color:#8a4a4a;transition:all .5s}.nf-red .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-red .nf-form-content input:not([type=button]):focus,.nf-red .nf-form-content textarea:focus{background:#fff;border-color:#a95e5e;color:#a95e5e;outline:none;transition:all .5s}.nf-red .nf-form-content button,.nf-red .nf-form-content input[type=button],.nf-red .nf-form-content input[type=submit]{background:#8a5252;border:0;color:#f0e3e3;transition:all .5s}.nf-red .nf-form-content button:hover,.nf-red .nf-form-content input[type=button]:hover,.nf-red .nf-form-content input[type=submit]:hover{background:#cca1a1;color:#8a4a4a;transition:all .5s}.nf-red .nf-form-content select.ninja-forms-field{color:#8a4a4a}.nf-red .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-red .list-select-wrap div:after{color:#8a4a4a;transition:all .5s}.nf-red .list-select-wrap select:active+div,.nf-red .list-select-wrap select:focus+div{background:#fff!important;border-color:#a95e5e!important;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label:after{background:#f0e3e3;border:2px solid #cca1a1;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#8a5252;transition:all .5s}.nf-red .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#8a5252}.nf-red .checkbox-wrap .nf-field-element label:after,.nf-red .checkbox-wrap .nf-field-label label:after,.nf-red .listcheckbox-wrap .nf-field-element label:after,.nf-red .listcheckbox-wrap .nf-field-label label:after{background:#f0e3e3;border-color:#cca1a1;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label:before,.nf-red .checkbox-wrap .nf-field-label label:before,.nf-red .listcheckbox-wrap .nf-field-element label:before,.nf-red .listcheckbox-wrap .nf-field-label label:before{color:#f0e3e3;opacity:0;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#c49090;transition:all .5s}.nf-red .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-red .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#8a5252;opacity:1;transition:all .5s}.nf-red .nf-error{position:relative}.nf-red .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-red .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-red .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-error .nf-error-msg{color:#e80000}.nf-red .nf-pass{position:relative}.nf-red .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-red .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-red .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-red .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-red .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-red .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-red .nf-icons .nf-field-element:before{background:#cca1a1;color:#f0e3e3}.nf-red .nf-help{color:#8a5252}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div,.nf-blue .nf-form-content input:not([type=button]),.nf-blue .nf-form-content textarea{background:#dfeff5;border:1px solid #91c8dd;border-radius:0;box-shadow:none;color:#3384a2;transition:all .5s}.nf-blue .nf-form-content .list-select-wrap .nf-field-element>div:focus,.nf-blue .nf-form-content input:not([type=button]):focus,.nf-blue .nf-form-content textarea:focus{background:#fff;border-color:#44a1c4;color:#44a1c4;outline:none;transition:all .5s}.nf-blue .nf-form-content button,.nf-blue .nf-form-content input[type=button],.nf-blue .nf-form-content input[type=submit]{background:#4f9dbf;border:0;color:#dfeff5;transition:all .5s}.nf-blue .nf-form-content button:hover,.nf-blue .nf-form-content input[type=button]:hover,.nf-blue .nf-form-content input[type=submit]:hover{background:#91c8dd;color:#3384a2;transition:all .5s}.nf-blue .nf-form-content select.ninja-forms-field{color:#3384a2}.nf-blue .nf-form-content select.ninja-forms-field:focus{background:transparent;border:0;box-shadow:none;outline:none}.nf-blue .list-select-wrap div:after{color:#3384a2;transition:all .5s}.nf-blue .list-select-wrap select:active+div,.nf-blue .list-select-wrap select:focus+div{background:#fff!important;border-color:#44a1c4!important;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label:after{background:#dfeff5;border:2px solid #91c8dd;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:after{border-color:#4f9dbf;transition:all .5s}.nf-blue .listradio-wrap .nf-field-element label.nf-checked-label:before{background:#4f9dbf}.nf-blue .checkbox-wrap .nf-field-element label:after,.nf-blue .checkbox-wrap .nf-field-label label:after,.nf-blue .listcheckbox-wrap .nf-field-element label:after,.nf-blue .listcheckbox-wrap .nf-field-label label:after{background:#dfeff5;border-color:#91c8dd;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label:before,.nf-blue .checkbox-wrap .nf-field-label label:before,.nf-blue .listcheckbox-wrap .nf-field-element label:before,.nf-blue .listcheckbox-wrap .nf-field-label label:before{color:#dfeff5;opacity:0;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:after,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:after{border-color:#7ebed7;transition:all .5s}.nf-blue .checkbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .checkbox-wrap .nf-field-label label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-element label.nf-checked-label:before,.nf-blue .listcheckbox-wrap .nf-field-label label.nf-checked-label:before{color:#4f9dbf;opacity:1;transition:all .5s}.nf-blue .nf-error{position:relative}.nf-blue .nf-error .ninja-forms-field{border-color:#e80000!important;transition:all .5s}.nf-blue .nf-error.field-wrap .nf-field-element:after{background:#e80000;color:#fff;font-family:FontAwesome;font-size:20px;content:"\f12a";position:absolute;top:1px;right:1px;bottom:1px;height:48px;width:50px;line-height:50px;text-align:center;transition:all .5s}.nf-blue .nf-error.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-error .nf-error-msg{color:#e80000}.nf-blue .nf-pass{position:relative}.nf-blue .nf-pass .ninja-forms-field{border-color:green!important;transition:all .5s}.nf-blue .nf-pass.field-wrap .nf-field-element:after{color:green;font-family:FontAwesome;font-size:30px;content:"\f058";position:absolute;top:0;right:16px;height:50px;line-height:50px;transition:all .5s}.nf-blue .nf-pass.field-wrap.checkbox-wrap .nf-field-element:after{display:none}.nf-blue .nf-field-submit-error{border:1px solid;margin:10px 0;padding:15px 15px 15px 50px;position:relative;z-index:1}.nf-blue .nf-field-submit-error:after{content:"\f06a";font-family:FontAwesome;font-size:24px;position:absolute;top:0;left:15px;height:50px;line-height:50px;z-index:2}.nf-blue .nf-field-submit-error{border-color:#d8000c;color:#d8000c;background-color:#ffbaba}.nf-blue .nf-icons .nf-field-element:before{background:#91c8dd;color:#dfeff5}.nf-blue .nf-help{color:#4f9dbf}@media only screen and (max-width:800px){.nf-field-container .nf-field-label{margin-bottom:10px!important;padding:0;width:100%;order:5}.nf-field-container .nf-field-label label{text-align:left}.nf-field-container .nf-field-description{margin:0;width:100%;order:10}.nf-field-container .nf-field-element{width:100%;order:15}.nf-field-container .checkbox-wrap .nf-field-label{width:auto}.nf-field-container .checkbox-wrap .nf-field-label label{position:relative;margin-left:30px}.nf-field-container .checkbox-wrap .nf-field-label label:after{left:-28px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-label label:before{left:-30px;bottom:0}.nf-field-container .checkbox-wrap .nf-field-element{width:20px}.nf-form-cont .five-sixths,.nf-form-cont .four-sixths,.nf-form-cont .one-fourth,.nf-form-cont .one-half,.nf-form-cont .one-sixth,.nf-form-cont .one-third,.nf-form-cont .three-fourths,.nf-form-cont .three-sixths,.nf-form-cont .two-fourths,.nf-form-cont .two-sixths,.nf-form-cont .two-thirds{clear:both;float:none;margin:0;width:100%}.nf-form-cont .five-sixths .inside,.nf-form-cont .four-sixths .inside,.nf-form-cont .one-fourth .inside,.nf-form-cont .one-half .inside,.nf-form-cont .one-sixth .inside,.nf-form-cont .one-third .inside,.nf-form-cont .three-fourths .inside,.nf-form-cont .three-sixths .inside,.nf-form-cont .two-fourths .inside,.nf-form-cont .two-sixths .inside,.nf-form-cont .two-thirds .inside{padding:0}}
|
2 |
/*# sourceMappingURL=display-opinions-light.css.map */
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["st-defaults.scss","editor.scss","st-loading.scss","st-label-positions.scss","repeater-field.scss","op-spacing.scss","op-select.scss","op-checkbox.scss","op-radio.scss","op-toggle.scss","op-icons.scss","op-date.scss","op-color.scss","display-opinions-light.scss","op-variables-light.scss","st-media-queries.scss"],"names":[],"mappings":"AAIA,sFAKI,yBAA0B,CAC1B,qBAAsB,CAG1B,iBACI,YAAa,CAGjB,gDAEI,UAAW,CACX,iBAAkB,CAClB,kBAAmB,CAJvB,4DAMQ,UAAW,CACX,UAAW,CACX,aAAc,CARtB,4JAYQ,QAAS,CACT,WAAY,CAbpB,0UAoBY,YAAa,CAKzB,sBAEQ,eAAiB,CACjB,QAAS,CACT,SAAU,CAGlB,kBACI,iBAAkB,CADtB,4EAKQ,QAAS,CACT,UAAW,CACX,WAAY,CACZ,sBAAuB,CAR/B,2BAWQ,YAAa,CAGrB,mCAEQ,QAAS,CAGjB,SACI,8CAAmD,CACnD,oBAAqB,CACrB,UAAW,CACX,WAAY,CAGhB,gBACI,cAAe,CACf,cAAe,CAEnB,WACI,cAAe,CAEnB,8BAEQ,iBAAkB,CAe1B,0OAKY,yBAA2B,CAC3B,kBAAoB,CACpB,mBAAqB,CAPjC,8QASgB,gBAAiB,CATjC,qHAaY,iBAAkB,CAClB,wBAA0B,CAC1B,uBAA+B,CAf3C,uIAkBgB,aAAc,CACd,UAAc,CAEd,UAAW,CACX,iBAAkB,CAtBlC,uIAyBgB,oBAAsB,CACtB,UAAW,CACX,gBAAiB,CAMjC,mBAEQ,UAAW,CACX,WAAY,CACZ,mBAAoB,CAJ5B,yBAMY,WAAY,CAGZ,4BAAyB,CATrC,0CAagB,wBAAqB,CACrB,kBAAmB,CAdnC,6BAiBgB,aAAc,CAjB9B,yBAqBY,YAAa,CAQzB,wBAGY,oBAAsB,CAHlC,yCAOgB,aAAc,CAS9B,uBACI,eAAgB,CAOpB,YACI,iBAAkB,CAClB,iBAAkB,CAMtB,0BA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ClB,KAAM,CACN,SAAU,CACV,WAAY,CACZ,gBAAiB,CACjB,SAAU,CCxJlB,gCD6JI,oBAAqB,CACrB,aAAc,CACd,wBAAyB,CC/J7B,4CDoKQ,kBEhN2B,CFiN3B,aCxKM,CAGd,kBD0KI,aC5KY,CE3ChB,yCACI,oCAEQ,4BAA8B,CAC9B,SAAU,CACV,UAAW,CACX,OAAQ,CALhB,0CAOY,eAAgB,CAP5B,0CAWQ,QAAS,CACT,UAAW,CACX,QAAS,CAbjB,sCAgBQ,UAAW,CACX,QAAS,CAjBjB,mDAqBY,UAAW,CArBvB,yDAuBgB,iBAAkB,CAClB,gBAAiB,CAxBjC,+DA0BoB,UAAW,CACX,QAAS,CA3B7B,gEA8BoB,UAAW,CACX,QAAS,CA/B7B,qDAoCY,UAAW,CAIvB,kSAYQ,UAAW,CACX,UAAW,CACX,QAAS,CACT,UAAW,CAfnB,0XAiBY,SAAU,CACb","file":"display-opinions-light.css","sourcesContent":["/*\n * Ninja Forms - Form Display Structure\n */\n\n.ninja-forms-form-wrap *,\n.ninja-forms-form-wrap *:after,\n.ninja-forms-form-wrap *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.nf-response-msg {\n display: none;\n}\n\n.nf-field-container,\n#ninja_forms_required_items {\n clear: both;\n position: relative;\n margin-bottom: 25px;\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n &.hidden-container,\n &.hr-container {\n margin: 0;\n height: auto;\n .nf-field-label {\n display: none;\n }\n }\n &.html-container {\n .nf-field-label {\n display: none;\n }\n }\n}\n\n.nf-field-label {\n label {\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n}\n.nf-field-element {\n position: relative;\n input,\n select,\n textarea {\n margin: 0;\n width: auto;\n height: auto;\n vertical-align: inherit;\n }\n textarea {\n height: 200px;\n }\n}\n.nf-field-description {\n p:last-child {\n margin: 0;\n }\n}\n.nf-help {\n background: url( '../img/help-info.png' ) no-repeat;\n display: inline-block;\n width: 16px;\n height: 16px;\n}\n\n.nf-input-limit {\n font-size: 12px;\n margin-top: 5px;\n}\n.nf-static {\n padding: 0 10px;\n}\n.nf-after-field {\n .nf-error-msg {\n margin-right: 10px;\n //text-align: right;\n }\n}\n\n/* ---------------------------------\nCHECKBOX FIELD\n----------------------------------*/\n\n\n\n/* ---------------------------------\nRADIO & CHECKBOX LISTS\n----------------------------------*/\n\n.list-radio-wrap,\n.list-checkbox-wrap,\n.list-image-wrap {\n .nf-field-element {\n ul, li {\n list-style: none !important;\n margin: 0 !important;\n padding: 0 !important;\n input {\n margin-right: 5px;\n }\n }\n li {\n padding-left: 10px;\n margin: 0 0 5px !important;\n text-indent: initial !important;\n label {\n //display: inline;\n display: block;\n float: initial;\n //margin: 0;\n width: auto;\n margin-left: 1.5em;\n }\n input {\n width: auto !important;\n float: left;\n margin-top: .25em;\n }\n }\n }\n}\n\n.listimage-wrap {\n li {\n width: 100%;\n height: 100%;\n display: inline-grid;\n label {\n padding: 5px;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n &.nf-checked-label {\n border-width: 2px;\n border-style: solid;\n border-color: #007acc;\n transition: all .5s;\n }\n img {\n display: block;\n }\n }\n input {\n display: none;\n }\n }\n}\n\n/* ---------------------------------\nPRODUCT FIELD\n----------------------------------*/\n.product-wrap {\n > div {\n input {\n width: 80px !important;\n }\n .nf-product-field {\n span {\n padding: 0 5px;\n }\n }\n }\n}\n\n/* ---------------------------------\nSTAR RATING\n----------------------------------*/\n.starrating-wrap .star {\n border-bottom: 0;\n}\n\n/* ---------------------------------\nHONEYPOT\n----------------------------------*/\n\n.nf-form-hp {\n position: absolute;\n visibility: hidden;\n}\n\n/* ---------------------------------\nSELECT LIST\n----------------------------------*/\n.list-select-wrap {\n div div {\n display: none;\n }\n}\n\n\n/* ---------------------------------\nCOLORS\nAs minimal as possible\n----------------------------------*/\n.ninja-forms-req-symbol,\n.nf-error-msg {\n color: #E80000;\n}\n.nf-error {\n .ninja-forms-field {\n border: 1px solid #E80000;\n }\n &.listimage-wrap {\n .nf-field-element {\n ul {\n border: 1px solid #E80000;\n }\n }\n }\n}\n.nf-field-submit-error {\n padding: 15px;\n}\n\n.ninja-forms-noscript-message {\n background: #f1f1f1;\n border: 4px dashed #ccc;\n color: #333;\n display: block;\n font-size: 20px;\n margin: 20px 0;\n padding: 40px;\n text-align: center;\n}\n\n/* ---------------------------------\nHELPER CLASSES\n----------------------------------*/\n.two-col-list {\n ul {\n li {\n float: left;\n width: 50%\n }\n }\n}\n.three-col-list {\n ul {\n li {\n float: left;\n width: 33.33%\n }\n }\n}\n.four-col-list {\n ul {\n li {\n float: left;\n width: 25%\n }\n }\n}\n.five-col-list {\n ul {\n li {\n float: left;\n width: 20%\n }\n }\n}\n.six-col-list {\n ul {\n li {\n float: left;\n width: 16.66%\n }\n }\n}\n\n\nbody {\n .pika-label {\n background: transparent;\n }\n}\n\n/* Column Classes\n Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css\n--------------------------------------------- */\n.nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: initial;\n float: left;\n margin-left: 2.564102564102564%;\n .inside {\n padding: 20px;\n }\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n\n .one-half,\n .three-sixths,\n .two-fourths {\n width: 48.717948717948715%;\n }\n\n .one-third,\n .two-sixths {\n width: 31.623931623931625%;\n }\n\n .four-sixths,\n .two-thirds {\n width: 65.81196581196582%;\n }\n\n .one-fourth {\n width: 23.076923076923077%;\n }\n\n .three-fourths {\n width: 74.35897435897436%;\n }\n\n .one-sixth {\n width: 14.52991452991453%;\n }\n\n .five-sixths {\n width: 82.90598290598291%;\n }\n\n .first {\n clear: both;\n margin-left: 0;\n }\n}\n",".note-popover {\n display: none !important;\n}\n.nf-form-wrap {\n .note-editor {\n border: 0 !important;\n .note-toolbar {\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n .note-editable {\n background: #f9f9f9;\n border: 1px solid #f1f1f1;\n display: block;\n p {\n font-size: 16px;\n }\n ul {\n list-style-type: disc;\n margin-left: 2em;\n }\n table {\n td {\n border: 1px solid #ccc;\n width: auto;\n }\n }\n }\n .modal {\n display: none;\n }\n .btn-group {\n float: left;\n &.note-tools {\n float: right;\n }\n }\n .btn {\n background: #f9f9f9;\n border: 0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n margin-right: 2px;\n padding-top: 4px;\n &.disabled {\n background: transparent;\n color: #aaa;\n .merge-tags {\n background: #f9f9f9;\n color: #666;\n }\n }\n }\n button[type=button] {\n padding: 4px;\n width: auto;\n height: auto;\n }\n .dropdown-toggle {\n position: relative;\n display: inline-block;\n top: 0;\n &::after {\n content: \"\";\n width: 0;\n }\n }\n }\n .tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n white-space: normal;\n filter: alpha(opacity=0);\n opacity: 0;\n\n line-break: auto;\n }\n .tooltip.in {\n filter: alpha(opacity=90);\n opacity: .9;\n }\n .tooltip.top {\n padding: 5px 0;\n margin-top: -3px;\n }\n .tooltip.right {\n padding: 0 5px;\n margin-left: 3px;\n }\n .tooltip.bottom {\n padding: 5px 0;\n margin-top: 3px;\n }\n .tooltip.left {\n padding: 0 5px;\n margin-left: -3px;\n }\n .tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n }\n .tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-left .tooltip-arrow {\n right: 5px;\n bottom: 0;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n }\n .tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n }\n .tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .dropdown-menu {\n position: absolute;\n // top: 100%;\n // left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n font-size: 14px;\n text-align: left;\n list-style: none;\n background-color: #fff;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, .15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n }\n .dropdown-menu.pull-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n }\n .dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333;\n white-space: nowrap;\n }\n .dropdown-menu > li > a:hover,\n .dropdown-menu > li > a:focus {\n color: #262626;\n text-decoration: none;\n background-color: #f5f5f5;\n }\n .dropdown-menu > .active > a,\n .dropdown-menu > .active > a:hover,\n .dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n background-color: #337ab7;\n outline: 0;\n }\n .dropdown-menu > .disabled > a,\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n color: #777;\n }\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n cursor: not-allowed;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n }\n .open > .dropdown-menu {\n display: block;\n }\n .open > a {\n outline: 0;\n }\n .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n .dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777;\n white-space: nowrap;\n }\n .dropdown-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 990;\n }\n .pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n }\n .dropup .caret,\n .navbar-fixed-bottom .dropdown .caret {\n content: \"\";\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n }\n .dropup .dropdown-menu,\n .navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n @media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n right: 0;\n left: auto;\n }\n .navbar-right .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n }\n .btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n }\n .nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n }\n .navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n }\n @media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n }\n}\n",".nf-loading-spinner {\n width: 40px;\n height: 40px;\n margin: 100px auto;\n background-color: rgba(208,208,208,.5);\n\n border-radius: 100%;\n animation: nf-scaleout 1.0s infinite ease-in-out;\n}\n\n@-webkit-keyframes nf-scaleout {\n 0% { transform: scale(0) }\n 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}\n\n@keyframes nf-scaleout {\n 0% {\n transform: scale(0);\n } 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}","/* ---------------------------------\nSTANDARDIZE ALL FIELDS\n----------------------------------*/\n.field-wrap {\n display: flex;\n //flex-wrap:wrap;\n > label {\n display: block;\n }\n > div input,\n textarea,\n select,\n .pikaday__container,\n .pikaday__display {\n width: 100%;\n }\n > div input[type=\"checkbox\"] {\n width: auto;\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n width: auto;\n }\n .nf-product-field {\n // .nf-element {\n // width: 100%;\n // }\n }\n}\n\n.nf-field-label {\n order: 5;\n}\n.nf-field-description {\n width: 100%;\n order: 10;\n}\n.nf-field-element {\n order: 15;\n}\n\n\n/* ---------------------------------\nLABEL ABOVE\n----------------------------------*/\n.label-above {\n .nf-field-label {\n margin-bottom: 10px;\n }\n}\n\n/* ---------------------------------\nLABEL BELOW\n----------------------------------*/\n.label-below {\n .nf-field-label {\n margin-top: 10px;\n order: 15;\n }\n .nf-field-element {\n order: 5;\n }\n}\n\n/* ---------------------------------\nLABEL HIDDEN\n----------------------------------*/\n.label-hidden {\n .field-wrap {\n flex-wrap: wrap;\n }\n .nf-field-label {\n height: 0;\n margin: 0 !important;\n width: 100%;\n visibility: hidden;\n }\n .nf-field-description {\n width: 100%;\n order: 20;\n }\n .nf-field-element {\n width: 100%;\n }\n}\n\n/* ---------------------------------\nLABEL LEFT\n----------------------------------*/\n.label-left {\n .field-wrap {\n flex-direction: row;\n flex-wrap: wrap;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-right: 2%;\n text-align: right;\n width: 35%;\n order: 5;\n label {\n width: 100%;\n }\n }\n .nf-field-description {\n margin-left: 35%;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 10;\n }\n .nf-after-field {\n margin-left: 36.5%;\n }\n}\n\n/* ---------------------------------\nLABEL RIGHT\n----------------------------------*/\n.label-right {\n .field-wrap {\n flex-direction: row;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: 2%;\n width: 35%;\n order: 10;\n }\n .nf-field-description {\n margin-right: 35%;\n order: 15;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 5;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n }\n .nf-field-element {\n width: 20px;\n }\n }\n .nf-after-field {\n width: 65%;\n }\n}\n/* ---------------------------------\nADJUST SOME LABEL ABOVE & BELOW ISSUES\n----------------------------------*/\n.label-below,\n.label-above {\n .field-wrap {\n flex-direction: column;\n flex-flow: wrap;\n }\n .nf-field-element {\n margin: 0;\n width: 100%;\n }\n .checkbox-wrap {\n .nf-field-label {\n //margin: 0;\n }\n }\n}\n\n/* ---------------------------------\nADJUST SOME LABEL LEFT & RIGHT ISSUES\n----------------------------------*/\n.label-left,\n.label-right {\n .textarea-wrap,\n .listradio-wrap,\n .listcheckbox-wrap {\n .nf-field-label {\n align-items: flex-start;\n }\n }\n .textarea-wrap {\n .nf-field-label {\n margin-top: 5px;\n }\n }\n .html-wrap,\n .hr-wrap {\n display: block;\n .nf-field-element {\n display: block;\n margin: 0;\n width: 100%;\n }\n }\n}\n\n/* ---------------------------------\nFIELD DESCRIPTION POSITIONS\n----------------------------------*/\n",".nf-repeater-fieldsets{\n fieldset {\n margin-bottom: 1em;\n }\n}\n\n.nf-remove-fieldset {\n color: red;\n font-size: 1.5em;\n background-color: transparent;\n border: thin solid red;\n padding: 0.1em 0.4em;\n float: right;\n margin-top: -1em;\n}",".nf-help {\n background: none;\n}\n.nf-field-description {\n font-size: 14px;\n}\n.nf-form-content {\n padding: 5px;\n max-width: 1000px;\n margin: 0 auto;\n label {\n font-size: 18px;\n line-height: 20px;\n }\n .ninja-forms-field,\n .listselect-wrap .nf-field-element div {\n font-size: 16px;\n margin: 0;\n padding: 12px;\n }\n input.ninja-forms-field,\n select.ninja-forms-field:not([multiple]),\n .listselect-wrap .nf-field-element div {\n height: 50px;\n }\n textarea.ninja-forms-field {\n height: 200px;\n }\n hr.ninja-forms-field {\n padding: 0;\n }\n input[type=\"radio\"].ninja-forms-field,\n input[type=\"checkbox\"].ninja-forms-field {\n height: auto;\n }\n .listradio-wrap,\n .listcheckbox-wrap {\n li {\n margin-bottom: 12px !important;\n line-height: 0;\n }\n }\n .nf-product-field {\n &.ninja-forms-field {\n // background: transparent;\n // border: 0;\n // padding: 0;\n }\n span {\n padding-right: 16px;\n }\n .nf-field-qty {\n font-size: 16px;\n padding: 5px;\n width: 80px !important;\n }\n }\n .listselect-wrap,\n .liststate-wrap,\n .listcountry-wrap {\n select {\n //height: 50px;\n }\n }\n .nf-static {\n background: transparent;\n border: 0;\n font-weight: bold;\n padding: 0;\n }\n .label-above,\n .label-below,\n .label-hidden {\n .nf-field-label {\n margin-bottom: 10px;\n padding: 0;\n }\n }\n .label-below {\n .nf-field-label {\n margin-bottom: 0;\n margin-top: 10px;\n }\n }\n .label-right {\n .nf-field-label {\n margin: 0;\n }\n > input,\n textarea,\n select,\n .nf-product-field,\n .starrating,\n .nf-static,\n .pikaday__container {\n // margin-right: 1%;\n }\n > input[type=radio],\n input[type=checkbox] {\n margin-right: 1%;\n }\n ul {\n margin-right: 1%;\n }\n }\n .label-left {\n // > label {\n // margin: 0;\n // }\n // > input,\n // textarea,\n // select,\n // .pikaday__container {\n // // margin-left: 1%;\n // }\n // > input[type=radio],\n // input[type=checkbox] {\n // margin-left: 1%;\n // }\n // ul {\n // margin-left: 15px;\n // }\n }\n}\n","\n.nf-form-content {\n .list-select-wrap > div {\n position: relative;\n div {\n display: block;\n position: absolute;\n font-size: 16px;\n line-height: 16px;\n margin: 0;\n padding: 16px;\n height: 50px;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1;\n &::after {\n content: \"\\f078\";\n font-family: FontAwesome;\n font-size: 20px;\n //font-weight: bold;\n //transform: rotate(90deg);\n position: absolute;\n right: 10px;\n bottom: 0;\n height: 50px;\n line-height: 50px;\n }\n }\n &.label-right {\n div {\n width: 59%;\n // &::after {\n // right: 20px;\n // }\n }\n }\n &.label-below {\n div {\n top: 0;\n bottom: auto;\n }\n }\n &.label-left {\n div {\n width: 59%;\n left: 40.5%;\n right: 40px;\n }\n }\n select {\n background: transparent;\n border: 0;\n appearance: none;\n position: relative;\n z-index: 2;\n }\n }\n .listmultiselect-wrap {\n select {\n appearance: normal;\n }\n }\n}\n",".checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n border: 1px solid;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -28px;\n bottom: 0;\n }\n &::before {\n content: \"\\f00c\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n bottom: 0;\n opacity: 0;\n z-index: 2;\n }\n }\n }\n}\n.checkbox-container {\n .nf-field-element {\n input {\n display: none;\n }\n }\n &.label-above,\n &.label-below {\n // .nf-field-element {\n // input {\n // display: none;\n // }\n // }\n }\n &.label-above {\n label {\n height: 50px;\n margin: 0;\n display: block;\n &::before {\n left: -2px;\n bottom: -16px;\n }\n &::after {\n left: 0;\n bottom: -16px;\n }\n }\n }\n &.label-below {\n label {\n margin: 0;\n display: block;\n margin-top: 20px;\n &::before {\n left: -2px;\n bottom: auto;\n top: -27px;\n }\n &::after {\n left: 0;\n bottom: auto;\n top: -25px;\n }\n }\n }\n &.label-left {\n .nf-field-label {\n width: 38%;\n padding-right: 5%;\n }\n .nf-field-element {\n width: 58%;\n }\n label {\n margin: 0;\n display: block;\n &::before {\n left: auto;\n top: -2px;\n right: -36px;\n }\n &::after {\n left: auto;\n top: 0;\n right: -31px;\n }\n }\n }\n &.label-right {\n .nf-field-label {\n padding: 0;\n order: 10;\n }\n .nf-field-element {\n order: 5;\n display: none;\n }\n label {\n margin: 0 0 0 30px;\n display: block;\n &::before {\n left: -30px;\n top: 0;\n }\n &::after {\n left: -28px;\n top: 0;\n }\n }\n .field-wrap {\n display: flex;\n > div {\n width: 100%;\n }\n }\n label {\n &::after {\n // Commenting this line out to deal with checkbox list issues.\n // Leaving it in place because it may need to be re-visited in the future.\n //top: 2px !important;\n }\n }\n }\n &.label-hidden {\n label {\n height: 0;\n margin: 0;\n display: block;\n &::after {\n left: 0;\n bottom: 0;\n visibility: visible;\n }\n &.nf-checked-label {\n &::before {\n left: -2px;\n bottom: 0;\n visibility: visible;\n }\n }\n }\n }\n}\n.listcheckbox-container {\n .nf-field-label {\n label {\n &::after {\n background: transparent !important;\n border: 0;\n }\n }\n }\n .nf-field-element {\n input {\n display: none;\n }\n label {\n margin-left: 30px !important;\n &::before {\n top: 1px;\n left: -30px;\n bottom: auto;\n }\n &::after {\n top: 3px;\n bottom: auto;\n }\n }\n }\n &.label-above,\n &.label-below,\n &.label-right {\n .nf-field-label {\n label {\n margin: 0;\n &::before {\n left: -30px;\n }\n }\n }\n }\n}\n",".listradio-wrap {\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px !important;\n &::after {\n border-radius: 50%;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -30px;\n bottom: 1px;\n top: .05em;\n }\n &.nf-checked-label {\n &::before {\n border-radius: 50%;\n content: \"\";\n height: 10px;\n width: 10px;\n position: absolute;\n left: -26px;\n bottom: 5px;\n z-index: 2;\n top: .25em;\n }\n }\n }\n input {\n display: none;\n }\n }\n}\n","input[type=checkbox].nf-toggle {\n background: transparent;\n border: 0;\n box-shadow: 0 0 0;\n margin: 10px;\n height: 18px;\n appearance: none;\n position: relative;\n cursor: pointer;\n &::after {\n background: #BCBDBF;\n border: 2px solid #BCBDBF;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -4px;\n left: -4px;\n width: 46px;\n height: 24px;\n transition: all 0.3s ease;\n }\n &::before {\n background: #fff;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -1px;\n left: 0;\n width: 18px;\n height: 18px;\n z-index: 99;\n transition: all 0.3s ease;\n }\n &:checked {\n &::after {\n background: lightgreen;\n border: 2px solid lightgreen;\n transition: all 0.3s ease;\n }\n &::before {\n top: -1px;\n left: 20px;\n transition: all 0.3s ease;\n }\n }\n .label-right & {\n padding: 0 50px 0 0;\n }\n .label-left & {\n padding: 0;\n margin-left: 22px;\n margin-top: 20px;\n }\n}\n",".nf-icons {\n .nf-field-element {\n position: relative;\n &::before {\n //border: 1px;\n font-family: FontAwesome;\n font-size: 20px;\n position: absolute;\n left: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n z-index: 1;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n .nf-field-element {\n input {\n padding-left: 60px;\n }\n }\n }\n &.right {\n .nf-field-element {\n &::before {\n left: auto;\n right: 1px;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n > div {\n input {\n padding-left: 12px;\n padding-right: 60px;\n }\n }\n }\n }\n .date-wrap .nf-field-element::before {\n content: \"\\f073\";\n }\n .number-wrap .nf-field-element::before,\n .quantity-wrap > div::before {\n content: \"\\f292\";\n }\n .email-wrap .nf-field-element::before {\n content: \"\\f0e0\";\n }\n .phone-wrap .nf-field-element::before {\n content: \"\\f095\";\n }\n .firstname-wrap .nf-field-element::before,\n .lastname-wrap .nf-field-element::before {\n content: \"\\f007\";\n }\n .address-wrap .nf-field-element::before,\n .city-wrap .nf-field-element::before,\n .state-wrap .nf-field-element::before,\n .zip-wrap .nf-field-element::before {\n content: \"\\f041\";\n }\n .creditcardfullname-wrap .nf-field-element::before,\n .creditcardnumber-wrap .nf-field-element::before,\n .creditcardcvc-wrap .nf-field-element::before,\n .creditcardexpiration-wrap .nf-field-element::before,\n .creditcardzip-wrap .nf-field-element::before {\n content: \"\\f283\";\n }\n}\n",".nf-field-element {\n\t.date-and-time {\n\t\tmargin-bottom: 5px;\n\t}\n\t.hour {\n\t\tpadding: 5px;\n\t\tborder-right: 0;\n\t}\n\t.minute {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n\t.ampm {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n}",".nf-form-content {\n input:not([type='button']),\n textarea,\n .list-select-wrap .nf-field-element > div {\n background: $field-background;\n border: 1px solid $field-border;\n border-radius: 0;\n box-shadow: none;\n color: $field-font;\n transition: all .5s;\n &:focus {\n background: $focus-background;\n border-color: $focus-border;\n //box-shadow: -3px 3px 10px #ccc;\n color: $focus-font;\n outline: none;\n transition: all .5s;\n }\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n background: $accent;\n border: 0;\n color: $field-background;\n transition: all .5s;\n &:hover {\n background: $field-border;\n color: $field-font;\n transition: all .5s;\n }\n }\n select.ninja-forms-field {\n color: $field-font;\n &:focus {\n background: transparent;\n border: 0;\n box-shadow: none;\n outline: none;\n }\n }\n}\n\n.list-select-wrap {\n div {\n &::after {\n color: $field-font;\n transition: all .5s;\n }\n }\n select {\n &:active,\n &:focus {\n + div {\n background: $focus-background !important;\n border-color: $focus-border !important;\n transition: all .5s;\n }\n }\n }\n}\n\n.listradio-wrap {\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border: 2px solid $field-border;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n border-color: $selected-font;\n transition: all .5s;\n }\n &::before {\n background: $selected-font;\n }\n }\n }\n }\n}\n\n.checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border-color: $field-border;\n transition: all .5s;\n }\n &::before {\n color: $field-background;\n opacity: 0;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n //background: $accent;\n border-color: $selected-border;\n transition: all .5s;\n }\n &::before {\n color: $selected-font;\n opacity: 100;\n transition: all .5s;\n }\n }\n }\n }\n}\n\n.nf-error {\n position: relative;\n .ninja-forms-field {\n border-color: #E80000 !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n background: #E80000;\n color: #fff;\n font-family: FontAwesome;\n font-size: 20px;\n content: \"\\f12a\";\n position: absolute;\n top: 1px;\n right: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n .nf-error-msg {\n color: #E80000;\n }\n}\n.checkbox-container {\n .nf-after-field .nf-error-msg {\n //text-align: left;\n }\n}\n.nf-pass {\n position: relative;\n .ninja-forms-field {\n border-color: green !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n color: green;\n font-family: FontAwesome;\n font-size: 30px;\n content: \"\\f058\";\n position: absolute;\n top: 0;\n right: 16px;\n height: 50px;\n line-height: 50px;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n // &.field-wrap::before {\n // border-color: green !important;\n // }\n}\n\n.nf-field-submit-error {\n border: 1px solid;\n margin: 10px 0px;\n padding: 15px 15px 15px 50px;\n position: relative;\n z-index: 1;\n &::after {\n content: \"\\f06a\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n top: 0;\n left: 15px;\n height: 50px;\n line-height: 50px;\n z-index: 2;\n }\n}\n\n.nf-field-submit-error {\n border-color: #D8000C;\n color: #D8000C;\n background-color: #FFBABA;\n}\n\n.nf-icons {\n .nf-field-element::before {\n background: $field-border;\n color: $field-background;\n }\n}\n\n.nf-help {\n color: $selected-font;\n}\n","@import \"display-structure\";\n\n@import \"op-spacing\";\n//@import \"op-columns\";\n@import \"op-select\";\n@import \"op-checkbox\";\n@import \"op-radio\";\n@import \"op-toggle\";\n@import \"op-icons\";\n@import \"op-date\";\n\n/* ---------------------------------\nDEFAULT LIGHT COLORS\n----------------------------------*/\n$base: #f7f7f7;\n$accent: #333;\n@import \"op-variables-light\";\n@import \"op-color\";\n\n/* ---------------------------------\nLIGHT COLORS - nf-brown\n----------------------------------*/\n$base: #F3EFDD;\n$accent: #736628;\n@import \"op-variables-light\";\n.nf-brown {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nLIGHT COLORS - nf-red\n----------------------------------*/\n$base: #F0E3E3;\n$accent: #8A5252;\n@import \"op-variables-light\";\n.nf-red {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nLIGHT COLORS - nf-blue\n----------------------------------*/\n$base: #DFEFF5;\n$accent: #4F9DBF;\n@import \"op-variables-light\";\n.nf-blue {\n @import \"op-color\";\n}\n\n@import \"st-media-queries\";\n","$field-background: $base;\n$field-border: darken( $base, 20% );\n$field-font: darken( $base, 50% );\n\n$focus-background: lighten( $base, 10% );\n$focus-border: darken( $field-border, 20% );\n$focus-font: lighten( $field-font, 10% );\n\n$selected-background: lighten( $base, 10% );\n$selected-border: darken( $field-border, 5% );\n$selected-font: $accent;\n","@media only screen and (max-width: 800px) {\n .nf-field-container {\n .nf-field-label {\n margin-bottom: 10px !important;\n padding: 0;\n width: 100%;\n order: 5;\n label {\n text-align: left;\n }\n }\n .nf-field-description {\n margin: 0;\n width: 100%;\n order: 10;\n }\n .nf-field-element {\n width: 100%;\n order: 15;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n left: -28px;\n bottom: 0;\n }\n &::before {\n left: -30px;\n bottom: 0;\n }\n }\n }\n .nf-field-element {\n width: 20px;\n }\n }\n }\n .nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: both;\n float: none;\n margin: 0;\n width: 100%;\n .inside {\n padding: 0;\n }\n }\n }\n}\n"]}
|
1 |
+
{"version":3,"sources":["st-defaults.scss","editor.scss","st-loading.scss","st-label-positions.scss","repeater-field.scss","op-spacing.scss","op-select.scss","op-checkbox.scss","op-radio.scss","op-toggle.scss","op-icons.scss","op-date.scss","op-color.scss","display-opinions-light.scss","op-variables-light.scss","st-media-queries.scss"],"names":[],"mappings":"AAIA,sFAKI,yBAA0B,CAC1B,qBAAsB,CAG1B,iBACI,YAAa,CAGjB,gDAEI,UAAW,CACX,iBAAkB,CAClB,kBAAmB,CAJvB,4DAMQ,UAAW,CACX,UAAW,CACX,aAAc,CARtB,4JAYQ,QAAS,CAC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AS,CAjBjB,mDAqBY,UAAW,CArBvB,yDAuBgB,iBAAkB,CAClB,gBAAiB,CAxBjC,+DA0BoB,UAAW,CACX,QAAS,CA3B7B,gEA8BoB,UAAW,CACX,QAAS,CA/B7B,qDAoCY,UAAW,CAIvB,kSAYQ,UAAW,CACX,UAAW,CACX,QAAS,CACT,UAAW,CAfnB,0XAiBY,SAAU,CACb","file":"display-opinions-light.css","sourcesContent":["/*\n * Ninja Forms - Form Display Structure\n */\n\n.ninja-forms-form-wrap *,\n.ninja-forms-form-wrap *:after,\n.ninja-forms-form-wrap *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.nf-response-msg {\n display: none;\n}\n\n.nf-field-container,\n#ninja_forms_required_items {\n clear: both;\n position: relative;\n margin-bottom: 25px;\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n &.hidden-container,\n &.hr-container {\n margin: 0;\n height: auto;\n .nf-field-label {\n display: none;\n }\n }\n &.html-container {\n .nf-field-label {\n display: none;\n }\n }\n}\n\n.nf-field-label {\n label {\n font-weight: bold;\n margin: 0;\n padding: 0;\n }\n}\n.nf-field-element {\n position: relative;\n input,\n select,\n textarea {\n margin: 0;\n width: auto;\n height: auto;\n vertical-align: inherit;\n }\n textarea {\n height: 200px;\n }\n}\n.nf-field-description {\n p:last-child {\n margin: 0;\n }\n}\n.nf-help {\n background: url( '../img/help-info.png' ) no-repeat;\n display: inline-block;\n width: 16px;\n height: 16px;\n}\n\n.nf-input-limit {\n font-size: 12px;\n margin-top: 5px;\n}\n.nf-static {\n padding: 0 10px;\n}\n.nf-after-field {\n .nf-error-msg {\n margin-right: 10px;\n //text-align: right;\n }\n}\n\n/* ---------------------------------\nCHECKBOX FIELD\n----------------------------------*/\n\n\n\n/* ---------------------------------\nRADIO & CHECKBOX LISTS\n----------------------------------*/\n\n.list-radio-wrap,\n.list-checkbox-wrap,\n.list-image-wrap {\n .nf-field-element {\n ul, li {\n list-style: none !important;\n margin: 0 !important;\n padding: 0 !important;\n input {\n margin-right: 5px;\n }\n }\n li {\n padding-left: 10px;\n margin: 0 0 5px !important;\n text-indent: initial !important;\n label {\n //display: inline;\n display: block;\n float: initial;\n //margin: 0;\n width: auto;\n margin-left: 1.5em;\n }\n input {\n width: auto !important;\n float: left;\n margin-top: .25em;\n }\n }\n }\n}\n\n.listimage-wrap {\n li {\n width: 100%;\n height: 100%;\n display: inline-grid;\n label {\n padding: 5px;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n &.nf-checked-label {\n border-width: 2px;\n border-style: solid;\n border-color: #007acc;\n transition: all .5s;\n }\n img {\n display: block;\n }\n }\n input {\n display: none;\n }\n }\n}\n\n/* ---------------------------------\nPRODUCT FIELD\n----------------------------------*/\n.product-wrap {\n > div {\n input {\n width: 80px !important;\n }\n .nf-product-field {\n span {\n padding: 0 5px;\n }\n }\n }\n}\n\n/* ---------------------------------\nSTAR RATING\n----------------------------------*/\n.starrating-wrap .star {\n border-bottom: 0;\n}\n\n/* ---------------------------------\nHONEYPOT\n----------------------------------*/\n\n.nf-form-hp {\n position: absolute;\n visibility: hidden;\n}\n\n/* ---------------------------------\nSELECT LIST\n----------------------------------*/\n.list-select-wrap {\n div div {\n display: none;\n }\n}\n\n\n/* ---------------------------------\nCOLORS\nAs minimal as possible\n----------------------------------*/\n.ninja-forms-req-symbol,\n.nf-error-msg {\n color: #E80000;\n}\n.nf-error {\n .ninja-forms-field {\n border: 1px solid #E80000;\n }\n &.listimage-wrap {\n .nf-field-element {\n ul {\n border: 1px solid #E80000;\n }\n }\n }\n}\n.nf-field-submit-error {\n padding: 15px;\n}\n\n.ninja-forms-noscript-message {\n background: #f1f1f1;\n border: 4px dashed #ccc;\n color: #333;\n display: block;\n font-size: 20px;\n margin: 20px 0;\n padding: 40px;\n text-align: center;\n}\n\n/* ---------------------------------\nHELPER CLASSES\n----------------------------------*/\n.two-col-list {\n ul {\n li {\n float: left;\n width: 50%\n }\n }\n}\n.three-col-list {\n ul {\n li {\n float: left;\n width: 33.33%\n }\n }\n}\n.four-col-list {\n ul {\n li {\n float: left;\n width: 25%\n }\n }\n}\n.five-col-list {\n ul {\n li {\n float: left;\n width: 20%\n }\n }\n}\n.six-col-list {\n ul {\n li {\n float: left;\n width: 16.66%\n }\n }\n}\n\n\nbody {\n .pika-label {\n background: transparent;\n }\n}\n\n/* Column Classes\n Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css\n--------------------------------------------- */\n.nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: initial;\n float: left;\n margin-left: 2.564102564102564%;\n .inside {\n padding: 20px;\n }\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n\n .one-half,\n .three-sixths,\n .two-fourths {\n width: 48.717948717948715%;\n }\n\n .one-third,\n .two-sixths {\n width: 31.623931623931625%;\n }\n\n .four-sixths,\n .two-thirds {\n width: 65.81196581196582%;\n }\n\n .one-fourth {\n width: 23.076923076923077%;\n }\n\n .three-fourths {\n width: 74.35897435897436%;\n }\n\n .one-sixth {\n width: 14.52991452991453%;\n }\n\n .five-sixths {\n width: 82.90598290598291%;\n }\n\n .first {\n clear: both;\n margin-left: 0;\n }\n}\n",".note-popover {\n display: none !important;\n}\n.nf-form-wrap {\n .note-editor {\n border: 0 !important;\n .note-toolbar {\n &::after {\n clear: both;\n content: \"\";\n display: block;\n }\n }\n .note-editable {\n background: #f9f9f9;\n border: 1px solid #f1f1f1;\n display: block;\n p {\n font-size: 16px;\n }\n ul {\n list-style-type: disc;\n margin-left: 2em;\n }\n table {\n td {\n border: 1px solid #ccc;\n width: auto;\n }\n }\n }\n .modal {\n display: none;\n }\n .btn-group {\n float: left;\n &.note-tools {\n float: right;\n }\n }\n .btn {\n background: #f9f9f9;\n border: 0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n margin-right: 2px;\n padding-top: 4px;\n &.disabled {\n background: transparent;\n color: #aaa;\n .merge-tags {\n background: #f9f9f9;\n color: #666;\n }\n }\n }\n button[type=button] {\n padding: 4px;\n width: auto;\n height: auto;\n }\n .dropdown-toggle {\n position: relative;\n display: inline-block;\n top: 0;\n &::after {\n content: \"\";\n width: 0;\n }\n }\n }\n .tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n white-space: normal;\n filter: alpha(opacity=0);\n opacity: 0;\n\n line-break: auto;\n }\n .tooltip.in {\n filter: alpha(opacity=90);\n opacity: .9;\n }\n .tooltip.top {\n padding: 5px 0;\n margin-top: -3px;\n }\n .tooltip.right {\n padding: 0 5px;\n margin-left: 3px;\n }\n .tooltip.bottom {\n padding: 5px 0;\n margin-top: 3px;\n }\n .tooltip.left {\n padding: 0 5px;\n margin-left: -3px;\n }\n .tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n }\n .tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-left .tooltip-arrow {\n right: 5px;\n bottom: 0;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n }\n .tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n }\n .tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n }\n .tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n }\n .dropdown-menu {\n position: absolute;\n // top: 100%;\n // left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n font-size: 14px;\n text-align: left;\n list-style: none;\n background-color: #fff;\n -webkit-background-clip: padding-box;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, .15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, .175);\n }\n .dropdown-menu.pull-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n }\n .dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333;\n white-space: nowrap;\n }\n .dropdown-menu > li > a:hover,\n .dropdown-menu > li > a:focus {\n color: #262626;\n text-decoration: none;\n background-color: #f5f5f5;\n }\n .dropdown-menu > .active > a,\n .dropdown-menu > .active > a:hover,\n .dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n background-color: #337ab7;\n outline: 0;\n }\n .dropdown-menu > .disabled > a,\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n color: #777;\n }\n .dropdown-menu > .disabled > a:hover,\n .dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n cursor: not-allowed;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n }\n .open > .dropdown-menu {\n display: block;\n }\n .open > a {\n outline: 0;\n }\n .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n .dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777;\n white-space: nowrap;\n }\n .dropdown-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 990;\n }\n .pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n }\n .dropup .caret,\n .navbar-fixed-bottom .dropdown .caret {\n content: \"\";\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n }\n .dropup .dropdown-menu,\n .navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n @media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n right: 0;\n left: auto;\n }\n .navbar-right .dropdown-menu-left {\n right: auto;\n left: 0;\n }\n }\n .btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n }\n .nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n .nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n }\n .navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n @media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n }\n @media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n }\n}\n",".nf-loading-spinner {\n width: 40px;\n height: 40px;\n margin: 100px auto;\n background-color: rgba(208,208,208,.5);\n\n border-radius: 100%;\n animation: nf-scaleout 1.0s infinite ease-in-out;\n}\n\n@-webkit-keyframes nf-scaleout {\n 0% { transform: scale(0) }\n 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}\n\n@keyframes nf-scaleout {\n 0% {\n transform: scale(0);\n } 100% {\n transform: scale(1.0);\n opacity: 0;\n }\n}","/* ---------------------------------\nSTANDARDIZE ALL FIELDS\n----------------------------------*/\n.field-wrap {\n display: flex;\n //flex-wrap:wrap;\n > label {\n display: block;\n }\n > div input,\n textarea,\n select,\n .pikaday__container,\n .pikaday__display {\n width: 100%;\n }\n > div input[type=\"checkbox\"] {\n width: auto;\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n width: auto;\n }\n .nf-product-field {\n // .nf-element {\n // width: 100%;\n // }\n }\n}\n\n.nf-field-label {\n order: 5;\n}\n.nf-field-description {\n width: 100%;\n order: 10;\n}\n.nf-field-element {\n order: 15;\n}\n\n\n/* ---------------------------------\nLABEL ABOVE\n----------------------------------*/\n.label-above {\n .nf-field-label {\n margin-bottom: 10px;\n }\n}\n\n/* ---------------------------------\nLABEL BELOW\n----------------------------------*/\n.label-below {\n .nf-field-label {\n margin-top: 10px;\n order: 15;\n }\n .nf-field-element {\n order: 5;\n }\n}\n\n/* ---------------------------------\nLABEL HIDDEN\n----------------------------------*/\n.label-hidden {\n .field-wrap {\n flex-wrap: wrap;\n }\n .nf-field-label {\n height: 0;\n margin: 0 !important;\n width: 100%;\n visibility: hidden;\n }\n .nf-field-description {\n width: 100%;\n order: 20;\n }\n .nf-field-element {\n width: 100%;\n }\n}\n\n/* ---------------------------------\nLABEL LEFT\n----------------------------------*/\n.label-left {\n .field-wrap {\n flex-direction: row;\n flex-wrap: wrap;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-right: 2%;\n text-align: right;\n width: 35%;\n order: 5;\n label {\n width: 100%;\n }\n }\n .nf-field-description {\n margin-left: 35%;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 10;\n }\n .nf-after-field {\n margin-left: 36.5%;\n }\n}\n\n/* ---------------------------------\nLABEL RIGHT\n----------------------------------*/\n.label-right {\n .field-wrap {\n flex-direction: row;\n }\n .nf-field-label {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: 2%;\n width: 35%;\n order: 10;\n }\n .nf-field-description {\n margin-right: 35%;\n order: 15;\n }\n .nf-field-element {\n display: inline-block;\n width: 65%;\n order: 5;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n }\n .nf-field-element {\n width: 20px;\n }\n }\n .nf-after-field {\n width: 65%;\n }\n}\n/* ---------------------------------\nADJUST SOME LABEL ABOVE & BELOW ISSUES\n----------------------------------*/\n.label-below,\n.label-above {\n .field-wrap {\n flex-direction: column;\n flex-flow: wrap;\n }\n .nf-field-element {\n margin: 0;\n width: 100%;\n }\n .checkbox-wrap {\n .nf-field-label {\n //margin: 0;\n }\n }\n}\n\n/* ---------------------------------\nADJUST SOME LABEL LEFT & RIGHT ISSUES\n----------------------------------*/\n.label-left,\n.label-right {\n .textarea-wrap,\n .listradio-wrap,\n .listcheckbox-wrap {\n .nf-field-label {\n align-items: flex-start;\n }\n }\n .textarea-wrap {\n .nf-field-label {\n margin-top: 5px;\n }\n }\n .html-wrap,\n .hr-wrap {\n display: block;\n .nf-field-element {\n display: block;\n margin: 0;\n width: 100%;\n }\n }\n}\n\n/* ---------------------------------\nFIELD DESCRIPTION POSITIONS\n----------------------------------*/\n",".nf-repeater-fieldsets{\n fieldset {\n margin-bottom: 1em;\n }\n}\n\n.nf-remove-fieldset {\n color: red;\n font-size: 1.5em;\n background-color: transparent;\n border: thin solid red;\n padding: 0.1em 0.4em;\n float: right;\n margin-top: -1em;\n}",".nf-help {\n background: none;\n}\n.nf-field-description {\n font-size: 14px;\n}\n.nf-form-content {\n padding: 5px;\n max-width: 1000px;\n margin: 0 auto;\n label {\n font-size: 18px;\n line-height: 20px;\n }\n .ninja-forms-field,\n .listselect-wrap .nf-field-element div {\n font-size: 16px;\n margin: 0;\n padding: 12px;\n }\n input.ninja-forms-field,\n select.ninja-forms-field:not([multiple]),\n .listselect-wrap .nf-field-element div {\n height: 50px;\n }\n textarea.ninja-forms-field {\n height: 200px;\n }\n hr.ninja-forms-field {\n padding: 0;\n }\n input[type=\"radio\"].ninja-forms-field,\n input[type=\"checkbox\"].ninja-forms-field {\n height: auto;\n }\n .listradio-wrap,\n .listcheckbox-wrap {\n li {\n margin-bottom: 12px !important;\n line-height: 0;\n }\n }\n .nf-product-field {\n &.ninja-forms-field {\n // background: transparent;\n // border: 0;\n // padding: 0;\n }\n span {\n padding-right: 16px;\n }\n .nf-field-qty {\n font-size: 16px;\n padding: 5px;\n width: 80px !important;\n }\n }\n .listselect-wrap,\n .liststate-wrap,\n .listcountry-wrap {\n select {\n //height: 50px;\n }\n }\n .nf-static {\n background: transparent;\n border: 0;\n font-weight: bold;\n padding: 0;\n }\n .label-above,\n .label-below,\n .label-hidden {\n .nf-field-label {\n margin-bottom: 10px;\n padding: 0;\n }\n }\n .label-below {\n .nf-field-label {\n margin-bottom: 0;\n margin-top: 10px;\n }\n }\n .label-right {\n .nf-field-label {\n margin: 0;\n }\n > input,\n textarea,\n select,\n .nf-product-field,\n .starrating,\n .nf-static,\n .pikaday__container {\n // margin-right: 1%;\n }\n > input[type=radio],\n input[type=checkbox] {\n margin-right: 1%;\n }\n ul {\n margin-right: 1%;\n }\n }\n .label-left {\n // > label {\n // margin: 0;\n // }\n // > input,\n // textarea,\n // select,\n // .pikaday__container {\n // // margin-left: 1%;\n // }\n // > input[type=radio],\n // input[type=checkbox] {\n // margin-left: 1%;\n // }\n // ul {\n // margin-left: 15px;\n // }\n }\n}\n","\n.nf-form-content {\n .list-select-wrap > div {\n position: relative;\n div {\n display: block;\n position: absolute;\n font-size: 16px;\n line-height: 16px;\n margin: 0;\n padding: 16px;\n height: 50px;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1;\n &::after {\n content: \"\\f078\";\n font-family: FontAwesome;\n font-size: 20px;\n //font-weight: bold;\n //transform: rotate(90deg);\n position: absolute;\n right: 10px;\n bottom: 0;\n height: 50px;\n line-height: 50px;\n }\n }\n &.label-right {\n div {\n width: 59%;\n // &::after {\n // right: 20px;\n // }\n }\n }\n &.label-below {\n div {\n top: 0;\n bottom: auto;\n }\n }\n &.label-left {\n div {\n width: 59%;\n left: 40.5%;\n right: 40px;\n }\n }\n select {\n background: transparent;\n border: 0;\n appearance: none;\n position: relative;\n z-index: 2;\n }\n }\n .listmultiselect-wrap {\n select {\n appearance: normal;\n }\n }\n}\n",".checkbox-wrap,\r\n.listcheckbox-wrap {\r\n .nf-field-label,\r\n .nf-field-element {\r\n label {\r\n position: relative;\r\n margin-left: 30px;\r\n &::after {\r\n border: 1px solid;\r\n content: \"\";\r\n width: 18px;\r\n height: 18px;\r\n position: absolute;\r\n left: -28px;\r\n bottom: 0;\r\n }\r\n &::before {\r\n content: \"\\f00c\";\r\n font-family: FontAwesome;\r\n font-size: 24px;\r\n position: absolute;\r\n bottom: 0;\r\n opacity: 0;\r\n z-index: 2;\r\n }\r\n }\r\n }\r\n}\r\n.checkbox-container {\r\n .nf-field-element {\r\n input {\r\n display: inherit;\r\n opacity: 0;\r\n }\r\n }\r\n &.label-above,\r\n &.label-below {\r\n // .nf-field-element {\r\n // input {\r\n // display: none;\r\n // }\r\n // }\r\n }\r\n &.label-above {\r\n label {\r\n height: 50px;\r\n margin: 0;\r\n display: block;\r\n &::before {\r\n left: -2px;\r\n bottom: -16px;\r\n }\r\n &::after {\r\n left: 0;\r\n bottom: -16px;\r\n }\r\n }\r\n }\r\n &.label-below {\r\n label {\r\n margin: 0;\r\n display: block;\r\n margin-top: 20px;\r\n &::before {\r\n left: -2px;\r\n bottom: auto;\r\n top: -27px;\r\n }\r\n &::after {\r\n left: 0;\r\n bottom: auto;\r\n top: -25px;\r\n }\r\n }\r\n }\r\n &.label-left {\r\n .nf-field-label {\r\n width: 38%;\r\n padding-right: 5%;\r\n }\r\n .nf-field-element {\r\n width: 58%;\r\n }\r\n label {\r\n margin: 0;\r\n display: block;\r\n &::before {\r\n left: auto;\r\n top: -2px;\r\n right: -36px;\r\n }\r\n &::after {\r\n left: auto;\r\n top: 0;\r\n right: -31px;\r\n }\r\n }\r\n }\r\n &.label-right {\r\n .nf-field-label {\r\n padding: 0;\r\n order: 10;\r\n }\r\n .nf-field-element {\r\n order: 5;\r\n display: inline;\r\n position: absolute;\r\n opacity: 0;\r\n }\r\n label {\r\n margin: 0 0 0 30px;\r\n display: block;\r\n &::before {\r\n left: -30px;\r\n top: 0;\r\n }\r\n &::after {\r\n left: -28px;\r\n top: 0;\r\n }\r\n }\r\n .field-wrap {\r\n display: flex;\r\n > div {\r\n width: 100%;\r\n }\r\n }\r\n label {\r\n &::after {\r\n // Commenting this line out to deal with checkbox list issues.\r\n // Leaving it in place because it may need to be re-visited in the future.\r\n //top: 2px !important;\r\n }\r\n }\r\n }\r\n &.label-hidden {\r\n label {\r\n height: 0;\r\n margin: 0;\r\n display: block;\r\n &::after {\r\n left: 0;\r\n bottom: 0;\r\n visibility: visible;\r\n }\r\n &.nf-checked-label {\r\n &::before {\r\n left: -2px;\r\n bottom: 0;\r\n visibility: visible;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n.listcheckbox-container {\r\n .nf-field-label {\r\n label {\r\n &::after {\r\n background: transparent !important;\r\n border: 0;\r\n }\r\n }\r\n }\r\n .nf-field-element {\r\n input {\r\n display: inherit;\r\n opacity: 0;\r\n }\r\n label {\r\n margin-left: 30px !important;\r\n &::before {\r\n top: 1px;\r\n left: -30px;\r\n bottom: auto;\r\n }\r\n &::after {\r\n top: 3px;\r\n bottom: auto;\r\n }\r\n }\r\n }\r\n &.label-above,\r\n &.label-below,\r\n &.label-right {\r\n .nf-field-label {\r\n label {\r\n margin: 0;\r\n &::before {\r\n left: -30px;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n",".listradio-wrap {\n .nf-field-element {\n label {\n position: relative;\n margin-left: 30px !important;\n &::after {\n border-radius: 50%;\n content: \"\";\n width: 18px;\n height: 18px;\n position: absolute;\n left: -30px;\n bottom: 1px;\n top: .05em;\n }\n &.nf-checked-label {\n &::before {\n border-radius: 50%;\n content: \"\";\n height: 10px;\n width: 10px;\n position: absolute;\n left: -26px;\n bottom: 5px;\n z-index: 2;\n top: .25em;\n }\n }\n }\n input {\n display: inherit;\n }\n }\n}\n","input[type=checkbox].nf-toggle {\n background: transparent;\n border: 0;\n box-shadow: 0 0 0;\n margin: 10px;\n height: 18px;\n appearance: none;\n position: relative;\n cursor: pointer;\n &::after {\n background: #BCBDBF;\n border: 2px solid #BCBDBF;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -4px;\n left: -4px;\n width: 46px;\n height: 24px;\n transition: all 0.3s ease;\n }\n &::before {\n background: #fff;\n border-radius: 20px;\n content: \"\";\n position: absolute;\n top: -1px;\n left: 0;\n width: 18px;\n height: 18px;\n z-index: 99;\n transition: all 0.3s ease;\n }\n &:checked {\n &::after {\n background: lightgreen;\n border: 2px solid lightgreen;\n transition: all 0.3s ease;\n }\n &::before {\n top: -1px;\n left: 20px;\n transition: all 0.3s ease;\n }\n }\n .label-right & {\n padding: 0 50px 0 0;\n }\n .label-left & {\n padding: 0;\n margin-left: 22px;\n margin-top: 20px;\n }\n}\n",".nf-icons {\n .nf-field-element {\n position: relative;\n &::before {\n //border: 1px;\n font-family: FontAwesome;\n font-size: 20px;\n position: absolute;\n left: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n z-index: 1;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n .nf-field-element {\n input {\n padding-left: 60px;\n }\n }\n }\n &.right {\n .nf-field-element {\n &::before {\n left: auto;\n right: 1px;\n }\n }\n .date-wrap,\n .number-wrap,\n .quantity-wrap,\n .email-wrap,\n .phone-wrap,\n .firstname-wrap,\n .lastname-wrap,\n .address-wrap,\n .city-wrap,\n .state-wrap,\n .zip-wrap,\n .creditcardfullname-wrap,\n .creditcardnumber-wrap,\n .creditcardcvc-wrap,\n .creditcardexpiration-wrap,\n .creditcardzip-wrap {\n > div {\n input {\n padding-left: 12px;\n padding-right: 60px;\n }\n }\n }\n }\n .date-wrap .nf-field-element::before {\n content: \"\\f073\";\n }\n .number-wrap .nf-field-element::before,\n .quantity-wrap > div::before {\n content: \"\\f292\";\n }\n .email-wrap .nf-field-element::before {\n content: \"\\f0e0\";\n }\n .phone-wrap .nf-field-element::before {\n content: \"\\f095\";\n }\n .firstname-wrap .nf-field-element::before,\n .lastname-wrap .nf-field-element::before {\n content: \"\\f007\";\n }\n .address-wrap .nf-field-element::before,\n .city-wrap .nf-field-element::before,\n .state-wrap .nf-field-element::before,\n .zip-wrap .nf-field-element::before {\n content: \"\\f041\";\n }\n .creditcardfullname-wrap .nf-field-element::before,\n .creditcardnumber-wrap .nf-field-element::before,\n .creditcardcvc-wrap .nf-field-element::before,\n .creditcardexpiration-wrap .nf-field-element::before,\n .creditcardzip-wrap .nf-field-element::before {\n content: \"\\f283\";\n }\n}\n",".nf-field-element {\n\t.date-and-time {\n\t\tmargin-bottom: 5px;\n\t}\n\t.hour {\n\t\tpadding: 5px;\n\t\tborder-right: 0;\n\t}\n\t.minute {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n\t.ampm {\n\t\tpadding: 5px;\n\t\tborder-left: 0;\n\t}\n}",".nf-form-content {\n input:not([type='button']),\n textarea,\n .list-select-wrap .nf-field-element > div {\n background: $field-background;\n border: 1px solid $field-border;\n border-radius: 0;\n box-shadow: none;\n color: $field-font;\n transition: all .5s;\n &:focus {\n background: $focus-background;\n border-color: $focus-border;\n //box-shadow: -3px 3px 10px #ccc;\n color: $focus-font;\n outline: none;\n transition: all .5s;\n }\n }\n input[type=\"submit\"],\n input[type=\"button\"],\n button {\n background: $accent;\n border: 0;\n color: $field-background;\n transition: all .5s;\n &:hover {\n background: $field-border;\n color: $field-font;\n transition: all .5s;\n }\n }\n select.ninja-forms-field {\n color: $field-font;\n &:focus {\n background: transparent;\n border: 0;\n box-shadow: none;\n outline: none;\n }\n }\n}\n\n.list-select-wrap {\n div {\n &::after {\n color: $field-font;\n transition: all .5s;\n }\n }\n select {\n &:active,\n &:focus {\n + div {\n background: $focus-background !important;\n border-color: $focus-border !important;\n transition: all .5s;\n }\n }\n }\n}\n\n.listradio-wrap {\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border: 2px solid $field-border;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n border-color: $selected-font;\n transition: all .5s;\n }\n &::before {\n background: $selected-font;\n }\n }\n }\n }\n}\n\n.checkbox-wrap,\n.listcheckbox-wrap {\n .nf-field-label,\n .nf-field-element {\n label {\n &::after {\n background: $field-background;\n border-color: $field-border;\n transition: all .5s;\n }\n &::before {\n color: $field-background;\n opacity: 0;\n transition: all .5s;\n }\n &.nf-checked-label {\n &::after {\n //background: $accent;\n border-color: $selected-border;\n transition: all .5s;\n }\n &::before {\n color: $selected-font;\n opacity: 100;\n transition: all .5s;\n }\n }\n }\n }\n}\n\n.nf-error {\n position: relative;\n .ninja-forms-field {\n border-color: #E80000 !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n background: #E80000;\n color: #fff;\n font-family: FontAwesome;\n font-size: 20px;\n content: \"\\f12a\";\n position: absolute;\n top: 1px;\n right: 1px;\n bottom: 1px;\n height: 48px;\n width: 50px;\n line-height: 50px;\n text-align: center;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n .nf-error-msg {\n color: #E80000;\n }\n}\n.checkbox-container {\n .nf-after-field .nf-error-msg {\n //text-align: left;\n }\n}\n.nf-pass {\n position: relative;\n .ninja-forms-field {\n border-color: green !important;\n transition: all .5s;\n }\n &.field-wrap {\n .nf-field-element::after {\n color: green;\n font-family: FontAwesome;\n font-size: 30px;\n content: \"\\f058\";\n position: absolute;\n top: 0;\n right: 16px;\n height: 50px;\n line-height: 50px;\n transition: all .5s;\n }\n &.checkbox-wrap {\n .nf-field-element::after {\n display: none;\n }\n }\n }\n // &.field-wrap::before {\n // border-color: green !important;\n // }\n}\n\n.nf-field-submit-error {\n border: 1px solid;\n margin: 10px 0px;\n padding: 15px 15px 15px 50px;\n position: relative;\n z-index: 1;\n &::after {\n content: \"\\f06a\";\n font-family: FontAwesome;\n font-size: 24px;\n position: absolute;\n top: 0;\n left: 15px;\n height: 50px;\n line-height: 50px;\n z-index: 2;\n }\n}\n\n.nf-field-submit-error {\n border-color: #D8000C;\n color: #D8000C;\n background-color: #FFBABA;\n}\n\n.nf-icons {\n .nf-field-element::before {\n background: $field-border;\n color: $field-background;\n }\n}\n\n.nf-help {\n color: $selected-font;\n}\n","@import \"display-structure\";\n\n@import \"op-spacing\";\n//@import \"op-columns\";\n@import \"op-select\";\n@import \"op-checkbox\";\n@import \"op-radio\";\n@import \"op-toggle\";\n@import \"op-icons\";\n@import \"op-date\";\n\n/* ---------------------------------\nDEFAULT LIGHT COLORS\n----------------------------------*/\n$base: #f7f7f7;\n$accent: #333;\n@import \"op-variables-light\";\n@import \"op-color\";\n\n/* ---------------------------------\nLIGHT COLORS - nf-brown\n----------------------------------*/\n$base: #F3EFDD;\n$accent: #736628;\n@import \"op-variables-light\";\n.nf-brown {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nLIGHT COLORS - nf-red\n----------------------------------*/\n$base: #F0E3E3;\n$accent: #8A5252;\n@import \"op-variables-light\";\n.nf-red {\n @import \"op-color\";\n}\n\n/* ---------------------------------\nLIGHT COLORS - nf-blue\n----------------------------------*/\n$base: #DFEFF5;\n$accent: #4F9DBF;\n@import \"op-variables-light\";\n.nf-blue {\n @import \"op-color\";\n}\n\n@import \"st-media-queries\";\n","$field-background: $base;\n$field-border: darken( $base, 20% );\n$field-font: darken( $base, 50% );\n\n$focus-background: lighten( $base, 10% );\n$focus-border: darken( $field-border, 20% );\n$focus-font: lighten( $field-font, 10% );\n\n$selected-background: lighten( $base, 10% );\n$selected-border: darken( $field-border, 5% );\n$selected-font: $accent;\n","@media only screen and (max-width: 800px) {\n .nf-field-container {\n .nf-field-label {\n margin-bottom: 10px !important;\n padding: 0;\n width: 100%;\n order: 5;\n label {\n text-align: left;\n }\n }\n .nf-field-description {\n margin: 0;\n width: 100%;\n order: 10;\n }\n .nf-field-element {\n width: 100%;\n order: 15;\n }\n .checkbox-wrap {\n .nf-field-label {\n width: auto;\n label {\n position: relative;\n margin-left: 30px;\n &::after {\n left: -28px;\n bottom: 0;\n }\n &::before {\n left: -30px;\n bottom: 0;\n }\n }\n }\n .nf-field-element {\n width: 20px;\n }\n }\n }\n .nf-form-cont {\n .five-sixths,\n .four-sixths,\n .one-fourth,\n .one-half,\n .one-sixth,\n .one-third,\n .three-fourths,\n .three-sixths,\n .two-fourths,\n .two-sixths,\n .two-thirds {\n clear: both;\n float: none;\n margin: 0;\n width: 100%;\n .inside {\n padding: 0;\n }\n }\n }\n}\n"]}
|
@@ -66,6 +66,10 @@ jQuery( document ).ready( function( $ ) {
|
|
66 |
new NinjaBatchProcessor( settings );
|
67 |
} );
|
68 |
|
|
|
|
|
|
|
|
|
69 |
/**
|
70 |
* Selecting a file within an input field triggers a jQuery change event.
|
71 |
*
|
66 |
new NinjaBatchProcessor( settings );
|
67 |
} );
|
68 |
|
69 |
+
$( document ).on( 'change', '#nf_import_fields', function( e ) {
|
70 |
+
jQuery( '#nf_import_security' ).val(nfAdmin.batchNonce);
|
71 |
+
});
|
72 |
+
|
73 |
/**
|
74 |
* Selecting a file within an input field triggers a jQuery change event.
|
75 |
*
|
File without changes
|
@@ -81,18 +81,67 @@ var nfRecaptcha = Marionette.Object.extend( {
|
|
81 |
|
82 |
var grecaptchaID = grecaptcha.render( jQuery( this )[0], opts );
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
} );
|
92 |
}
|
93 |
-
|
94 |
} );
|
95 |
|
96 |
var nfRenderRecaptcha = function() {
|
97 |
new nfRecaptcha();
|
98 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
var grecaptchaID = grecaptcha.render( jQuery( this )[0], opts );
|
83 |
|
84 |
+
if ( opts.size === 'invisible' ) {
|
85 |
+
try {
|
86 |
+
grecaptcha.execute( grecaptchaID );
|
87 |
+
} catch( e ){
|
88 |
+
console.log( 'Notice: Error trying to execute grecaptcha.' );
|
89 |
+
}
|
90 |
+
}
|
91 |
} );
|
92 |
}
|
|
|
93 |
} );
|
94 |
|
95 |
var nfRenderRecaptcha = function() {
|
96 |
new nfRecaptcha();
|
97 |
+
}
|
98 |
+
|
99 |
+
const nf_check_recaptcha_consent = () => {
|
100 |
+
|
101 |
+
let stored_responses = [], services = [];
|
102 |
+
|
103 |
+
//Cookie check
|
104 |
+
if(!check_data_for_recaptcha_consent()){
|
105 |
+
stored_responses.push( false );
|
106 |
+
services.push("missing_cookie");
|
107 |
+
}
|
108 |
+
|
109 |
+
//Build response with services gathered and print it in global scope
|
110 |
+
const response = {
|
111 |
+
"consent_state": stored_responses,
|
112 |
+
"services" : services
|
113 |
+
};
|
114 |
+
|
115 |
+
nfFrontEnd.nf_consent_status_response = response;
|
116 |
+
//Display filterable status to add extra consent check
|
117 |
+
let nf_consent_status_extra_check = new CustomEvent('nf_consent_status_check', {detail: response});
|
118 |
+
document.dispatchEvent(nf_consent_status_extra_check);
|
119 |
+
|
120 |
+
return nfFrontEnd.nf_consent_status_response;
|
121 |
+
}
|
122 |
+
//Get specific recaptcha cookie
|
123 |
+
const check_data_for_recaptcha_consent = () => {
|
124 |
+
return getCookie("_grecaptcha") !== "";
|
125 |
+
}
|
126 |
+
//Get a cookie
|
127 |
+
const getCookie = (cname) => {
|
128 |
+
let name = cname + "=";
|
129 |
+
let decodedCookie = decodeURIComponent(document.cookie);
|
130 |
+
let ca = decodedCookie.split(';');
|
131 |
+
for(let i = 0; i <ca.length; i++) {
|
132 |
+
let c = ca[i];
|
133 |
+
while (c.charAt(0) == ' ') {
|
134 |
+
c = c.substring(1);
|
135 |
+
}
|
136 |
+
if (c.indexOf(name) == 0) {
|
137 |
+
return c.substring(name.length, c.length);
|
138 |
+
}
|
139 |
+
}
|
140 |
+
return "";
|
141 |
+
}
|
142 |
+
|
143 |
+
const reload_after_consent = ( submitFieldID, layoutView ) => {
|
144 |
+
nfRadio.channel( 'fields' ).request("remove:error", submitFieldID, "recaptcha-v3-missing");
|
145 |
+
nfRadio.channel( 'fields' ).request("remove:error", submitFieldID, "recaptcha-v3-consent");
|
146 |
+
nfRadio.channel( 'form' ).trigger( 'render:view', layoutView );
|
147 |
+
}
|
@@ -1,17430 +1,2 @@
|
|
1 |
-
(function () {
|
2 |
-
/**
|
3 |
-
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
4 |
-
* Available via the MIT or new BSD license.
|
5 |
-
* see: http://github.com/jrburke/almond for details
|
6 |
-
*/
|
7 |
-
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
8 |
-
//be followed.
|
9 |
-
/*jslint sloppy: true */
|
10 |
-
/*global setTimeout: false */
|
11 |
-
|
12 |
-
var requirejs, require, define;
|
13 |
-
(function (undef) {
|
14 |
-
var main, req, makeMap, handlers,
|
15 |
-
defined = {},
|
16 |
-
waiting = {},
|
17 |
-
config = {},
|
18 |
-
defining = {},
|
19 |
-
hasOwn = Object.prototype.hasOwnProperty,
|
20 |
-
aps = [].slice,
|
21 |
-
jsSuffixRegExp = /\.js$/;
|
22 |
-
|
23 |
-
function hasProp(obj, prop) {
|
24 |
-
return hasOwn.call(obj, prop);
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Given a relative module name, like ./something, normalize it to
|
29 |
-
* a real name that can be mapped to a path.
|
30 |
-
* @param {String} name the relative name
|
31 |
-
* @param {String} baseName a real name that the name arg is relative
|
32 |
-
* to.
|
33 |
-
* @returns {String} normalized name
|
34 |
-
*/
|
35 |
-
function normalize(name, baseName) {
|
36 |
-
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
37 |
-
foundI, foundStarMap, starI, i, j, part,
|
38 |
-
baseParts = baseName && baseName.split("/"),
|
39 |
-
map = config.map,
|
40 |
-
starMap = (map && map['*']) || {};
|
41 |
-
|
42 |
-
//Adjust any relative paths.
|
43 |
-
if (name && name.charAt(0) === ".") {
|
44 |
-
//If have a base name, try to normalize against it,
|
45 |
-
//otherwise, assume it is a top-level require that will
|
46 |
-
//be relative to baseUrl in the end.
|
47 |
-
if (baseName) {
|
48 |
-
name = name.split('/');
|
49 |
-
lastIndex = name.length - 1;
|
50 |
-
|
51 |
-
// Node .js allowance:
|
52 |
-
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
53 |
-
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
54 |
-
}
|
55 |
-
|
56 |
-
//Lop off the last part of baseParts, so that . matches the
|
57 |
-
//"directory" and not name of the baseName's module. For instance,
|
58 |
-
//baseName of "one/two/three", maps to "one/two/three.js", but we
|
59 |
-
//want the directory, "one/two" for this normalization.
|
60 |
-
name = baseParts.slice(0, baseParts.length - 1).concat(name);
|
61 |
-
|
62 |
-
//start trimDots
|
63 |
-
for (i = 0; i < name.length; i += 1) {
|
64 |
-
part = name[i];
|
65 |
-
if (part === ".") {
|
66 |
-
name.splice(i, 1);
|
67 |
-
i -= 1;
|
68 |
-
} else if (part === "..") {
|
69 |
-
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
|
70 |
-
//End of the line. Keep at least one non-dot
|
71 |
-
//path segment at the front so it can be mapped
|
72 |
-
//correctly to disk. Otherwise, there is likely
|
73 |
-
//no path mapping for a path starting with '..'.
|
74 |
-
//This can still fail, but catches the most reasonable
|
75 |
-
//uses of ..
|
76 |
-
break;
|
77 |
-
} else if (i > 0) {
|
78 |
-
name.splice(i - 1, 2);
|
79 |
-
i -= 2;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
83 |
-
//end trimDots
|
84 |
-
|
85 |
-
name = name.join("/");
|
86 |
-
} else if (name.indexOf('./') === 0) {
|
87 |
-
// No baseName, so this is ID is resolved relative
|
88 |
-
// to baseUrl, pull off the leading dot.
|
89 |
-
name = name.substring(2);
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
//Apply map config if available.
|
94 |
-
if ((baseParts || starMap) && map) {
|
95 |
-
nameParts = name.split('/');
|
96 |
-
|
97 |
-
for (i = nameParts.length; i > 0; i -= 1) {
|
98 |
-
nameSegment = nameParts.slice(0, i).join("/");
|
99 |
-
|
100 |
-
if (baseParts) {
|
101 |
-
//Find the longest baseName segment match in the config.
|
102 |
-
//So, do joins on the biggest to smallest lengths of baseParts.
|
103 |
-
for (j = baseParts.length; j > 0; j -= 1) {
|
104 |
-
mapValue = map[baseParts.slice(0, j).join('/')];
|
105 |
-
|
106 |
-
//baseName segment has config, find if it has one for
|
107 |
-
//this name.
|
108 |
-
if (mapValue) {
|
109 |
-
mapValue = mapValue[nameSegment];
|
110 |
-
if (mapValue) {
|
111 |
-
//Match, update name to the new value.
|
112 |
-
foundMap = mapValue;
|
113 |
-
foundI = i;
|
114 |
-
break;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
if (foundMap) {
|
121 |
-
break;
|
122 |
-
}
|
123 |
-
|
124 |
-
//Check for a star map match, but just hold on to it,
|
125 |
-
//if there is a shorter segment match later in a matching
|
126 |
-
//config, then favor over this star map.
|
127 |
-
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
128 |
-
foundStarMap = starMap[nameSegment];
|
129 |
-
starI = i;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
if (!foundMap && foundStarMap) {
|
134 |
-
foundMap = foundStarMap;
|
135 |
-
foundI = starI;
|
136 |
-
}
|
137 |
-
|
138 |
-
if (foundMap) {
|
139 |
-
nameParts.splice(0, foundI, foundMap);
|
140 |
-
name = nameParts.join('/');
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
return name;
|
145 |
-
}
|
146 |
-
|
147 |
-
function makeRequire(relName, forceSync) {
|
148 |
-
return function () {
|
149 |
-
//A version of a require function that passes a moduleName
|
150 |
-
//value for items that may need to
|
151 |
-
//look up paths relative to the moduleName
|
152 |
-
var args = aps.call(arguments, 0);
|
153 |
-
|
154 |
-
//If first arg is not require('string'), and there is only
|
155 |
-
//one arg, it is the array form without a callback. Insert
|
156 |
-
//a null so that the following concat is correct.
|
157 |
-
if (typeof args[0] !== 'string' && args.length === 1) {
|
158 |
-
args.push(null);
|
159 |
-
}
|
160 |
-
return req.apply(undef, args.concat([relName, forceSync]));
|
161 |
-
};
|
162 |
-
}
|
163 |
-
|
164 |
-
function makeNormalize(relName) {
|
165 |
-
return function (name) {
|
166 |
-
return normalize(name, relName);
|
167 |
-
};
|
168 |
-
}
|
169 |
-
|
170 |
-
function makeLoad(depName) {
|
171 |
-
return function (value) {
|
172 |
-
defined[depName] = value;
|
173 |
-
};
|
174 |
-
}
|
175 |
-
|
176 |
-
function callDep(name) {
|
177 |
-
if (hasProp(waiting, name)) {
|
178 |
-
var args = waiting[name];
|
179 |
-
delete waiting[name];
|
180 |
-
defining[name] = true;
|
181 |
-
main.apply(undef, args);
|
182 |
-
}
|
183 |
-
|
184 |
-
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
185 |
-
throw new Error('No ' + name);
|
186 |
-
}
|
187 |
-
return defined[name];
|
188 |
-
}
|
189 |
-
|
190 |
-
//Turns a plugin!resource to [plugin, resource]
|
191 |
-
//with the plugin being undefined if the name
|
192 |
-
//did not have a plugin prefix.
|
193 |
-
function splitPrefix(name) {
|
194 |
-
var prefix,
|
195 |
-
index = name ? name.indexOf('!') : -1;
|
196 |
-
if (index > -1) {
|
197 |
-
prefix = name.substring(0, index);
|
198 |
-
name = name.substring(index + 1, name.length);
|
199 |
-
}
|
200 |
-
return [prefix, name];
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Makes a name map, normalizing the name, and using a plugin
|
205 |
-
* for normalization if necessary. Grabs a ref to plugin
|
206 |
-
* too, as an optimization.
|
207 |
-
*/
|
208 |
-
makeMap = function (name, relName) {
|
209 |
-
var plugin,
|
210 |
-
parts = splitPrefix(name),
|
211 |
-
prefix = parts[0];
|
212 |
-
|
213 |
-
name = parts[1];
|
214 |
-
|
215 |
-
if (prefix) {
|
216 |
-
prefix = normalize(prefix, relName);
|
217 |
-
plugin = callDep(prefix);
|
218 |
-
}
|
219 |
-
|
220 |
-
//Normalize according
|
221 |
-
if (prefix) {
|
222 |
-
if (plugin && plugin.normalize) {
|
223 |
-
name = plugin.normalize(name, makeNormalize(relName));
|
224 |
-
} else {
|
225 |
-
name = normalize(name, relName);
|
226 |
-
}
|
227 |
-
} else {
|
228 |
-
name = normalize(name, relName);
|
229 |
-
parts = splitPrefix(name);
|
230 |
-
prefix = parts[0];
|
231 |
-
name = parts[1];
|
232 |
-
if (prefix) {
|
233 |
-
plugin = callDep(prefix);
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
//Using ridiculous property names for space reasons
|
238 |
-
return {
|
239 |
-
f: prefix ? prefix + '!' + name : name, //fullName
|
240 |
-
n: name,
|
241 |
-
pr: prefix,
|
242 |
-
p: plugin
|
243 |
-
};
|
244 |
-
};
|
245 |
-
|
246 |
-
function makeConfig(name) {
|
247 |
-
return function () {
|
248 |
-
return (config && config.config && config.config[name]) || {};
|
249 |
-
};
|
250 |
-
}
|
251 |
-
|
252 |
-
handlers = {
|
253 |
-
require: function (name) {
|
254 |
-
return makeRequire(name);
|
255 |
-
},
|
256 |
-
exports: function (name) {
|
257 |
-
var e = defined[name];
|
258 |
-
if (typeof e !== 'undefined') {
|
259 |
-
return e;
|
260 |
-
} else {
|
261 |
-
return (defined[name] = {});
|
262 |
-
}
|
263 |
-
},
|
264 |
-
module: function (name) {
|
265 |
-
return {
|
266 |
-
id: name,
|
267 |
-
uri: '',
|
268 |
-
exports: defined[name],
|
269 |
-
config: makeConfig(name)
|
270 |
-
};
|
271 |
-
}
|
272 |
-
};
|
273 |
-
|
274 |
-
main = function (name, deps, callback, relName) {
|
275 |
-
var cjsModule, depName, ret, map, i,
|
276 |
-
args = [],
|
277 |
-
callbackType = typeof callback,
|
278 |
-
usingExports;
|
279 |
-
|
280 |
-
//Use name if no relName
|
281 |
-
relName = relName || name;
|
282 |
-
|
283 |
-
//Call the callback to define the module, if necessary.
|
284 |
-
if (callbackType === 'undefined' || callbackType === 'function') {
|
285 |
-
//Pull out the defined dependencies and pass the ordered
|
286 |
-
//values to the callback.
|
287 |
-
//Default to [require, exports, module] if no deps
|
288 |
-
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
289 |
-
for (i = 0; i < deps.length; i += 1) {
|
290 |
-
map = makeMap(deps[i], relName);
|
291 |
-
depName = map.f;
|
292 |
-
|
293 |
-
//Fast path CommonJS standard dependencies.
|
294 |
-
if (depName === "require") {
|
295 |
-
args[i] = handlers.require(name);
|
296 |
-
} else if (depName === "exports") {
|
297 |
-
//CommonJS module spec 1.1
|
298 |
-
args[i] = handlers.exports(name);
|
299 |
-
usingExports = true;
|
300 |
-
} else if (depName === "module") {
|
301 |
-
//CommonJS module spec 1.1
|
302 |
-
cjsModule = args[i] = handlers.module(name);
|
303 |
-
} else if (hasProp(defined, depName) ||
|
304 |
-
hasProp(waiting, depName) ||
|
305 |
-
hasProp(defining, depName)) {
|
306 |
-
args[i] = callDep(depName);
|
307 |
-
} else if (map.p) {
|
308 |
-
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
309 |
-
args[i] = defined[depName];
|
310 |
-
} else {
|
311 |
-
throw new Error(name + ' missing ' + depName);
|
312 |
-
}
|
313 |
-
}
|
314 |
-
|
315 |
-
ret = callback ? callback.apply(defined[name], args) : undefined;
|
316 |
-
|
317 |
-
if (name) {
|
318 |
-
//If setting exports via "module" is in play,
|
319 |
-
//favor that over return value and exports. After that,
|
320 |
-
//favor a non-undefined return value over exports use.
|
321 |
-
if (cjsModule && cjsModule.exports !== undef &&
|
322 |
-
cjsModule.exports !== defined[name]) {
|
323 |
-
defined[name] = cjsModule.exports;
|
324 |
-
} else if (ret !== undef || !usingExports) {
|
325 |
-
//Use the return value from the function.
|
326 |
-
defined[name] = ret;
|
327 |
-
}
|
328 |
-
}
|
329 |
-
} else if (name) {
|
330 |
-
//May just be an object definition for the module. Only
|
331 |
-
//worry about defining if have a module name.
|
332 |
-
defined[name] = callback;
|
333 |
-
}
|
334 |
-
};
|
335 |
-
|
336 |
-
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
337 |
-
if (typeof deps === "string") {
|
338 |
-
if (handlers[deps]) {
|
339 |
-
//callback in this case is really relName
|
340 |
-
return handlers[deps](callback);
|
341 |
-
}
|
342 |
-
//Just return the module wanted. In this scenario, the
|
343 |
-
//deps arg is the module name, and second arg (if passed)
|
344 |
-
//is just the relName.
|
345 |
-
//Normalize module name, if it contains . or ..
|
346 |
-
return callDep(makeMap(deps, callback).f);
|
347 |
-
} else if (!deps.splice) {
|
348 |
-
//deps is a config object, not an array.
|
349 |
-
config = deps;
|
350 |
-
if (config.deps) {
|
351 |
-
req(config.deps, config.callback);
|
352 |
-
}
|
353 |
-
if (!callback) {
|
354 |
-
return;
|
355 |
-
}
|
356 |
-
|
357 |
-
if (callback.splice) {
|
358 |
-
//callback is an array, which means it is a dependency list.
|
359 |
-
//Adjust args if there are dependencies
|
360 |
-
deps = callback;
|
361 |
-
callback = relName;
|
362 |
-
relName = null;
|
363 |
-
} else {
|
364 |
-
deps = undef;
|
365 |
-
}
|
366 |
-
}
|
367 |
-
|
368 |
-
//Support require(['a'])
|
369 |
-
callback = callback || function () {};
|
370 |
-
|
371 |
-
//If relName is a function, it is an errback handler,
|
372 |
-
//so remove it.
|
373 |
-
if (typeof relName === 'function') {
|
374 |
-
relName = forceSync;
|
375 |
-
forceSync = alt;
|
376 |
-
}
|
377 |
-
|
378 |
-
//Simulate async callback;
|
379 |
-
if (forceSync) {
|
380 |
-
main(undef, deps, callback, relName);
|
381 |
-
} else {
|
382 |
-
//Using a non-zero value because of concern for what old browsers
|
383 |
-
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
384 |
-
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
385 |
-
//If want a value immediately, use require('id') instead -- something
|
386 |
-
//that works in almond on the global level, but not guaranteed and
|
387 |
-
//unlikely to work in other AMD implementations.
|
388 |
-
setTimeout(function () {
|
389 |
-
main(undef, deps, callback, relName);
|
390 |
-
}, 4);
|
391 |
-
}
|
392 |
-
|
393 |
-
return req;
|
394 |
-
};
|
395 |
-
|
396 |
-
/**
|
397 |
-
* Just drops the config on the floor, but returns req in case
|
398 |
-
* the config return value is used.
|
399 |
-
*/
|
400 |
-
req.config = function (cfg) {
|
401 |
-
return req(cfg);
|
402 |
-
};
|
403 |
-
|
404 |
-
/**
|
405 |
-
* Expose module registry for debugging and tooling
|
406 |
-
*/
|
407 |
-
requirejs._defined = defined;
|
408 |
-
|
409 |
-
define = function (name, deps, callback) {
|
410 |
-
if (typeof name !== 'string') {
|
411 |
-
throw new Error('See almond README: incorrect module build, no module name');
|
412 |
-
}
|
413 |
-
|
414 |
-
//This module may not have dependencies
|
415 |
-
if (!deps.splice) {
|
416 |
-
//deps is not an array, so probably means
|
417 |
-
//an object literal or factory function for
|
418 |
-
//the value. Adjust args.
|
419 |
-
callback = deps;
|
420 |
-
deps = [];
|
421 |
-
}
|
422 |
-
|
423 |
-
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
424 |
-
waiting[name] = [name, deps, callback];
|
425 |
-
}
|
426 |
-
};
|
427 |
-
|
428 |
-
define.amd = {
|
429 |
-
jQuery: true
|
430 |
-
};
|
431 |
-
}());
|
432 |
-
|
433 |
-
define("../lib/almond", function(){});
|
434 |
-
|
435 |
-
/**
|
436 |
-
* Renders an application menu item from a domain model.
|
437 |
-
*
|
438 |
-
* @package Ninja Forms builder
|
439 |
-
* @subpackage App
|
440 |
-
* @copyright (c) 2015 WP Ninjas
|
441 |
-
* @since 3.0
|
442 |
-
*/
|
443 |
-
define( 'views/app/menuItem',[], function() {
|
444 |
-
var view = Marionette.ItemView.extend({
|
445 |
-
tagName: 'div',
|
446 |
-
template: '#tmpl-nf-app-menu-item',
|
447 |
-
|
448 |
-
initialize: function() {
|
449 |
-
// Listen for domain changes and re-render when we detect one.
|
450 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.render );
|
451 |
-
// When we change the model (to disable it, for example), re-render.
|
452 |
-
this.model.on( 'change', this.render, this );
|
453 |
-
},
|
454 |
-
|
455 |
-
/**
|
456 |
-
* When we render this view, remove the extra <div> tag created by backbone.
|
457 |
-
*
|
458 |
-
* @since 3.0
|
459 |
-
* @return void
|
460 |
-
*/
|
461 |
-
onRender: function() {
|
462 |
-
this.$el = this.$el.children();
|
463 |
-
this.$el.unwrap();
|
464 |
-
this.setElement( this.$el );
|
465 |
-
},
|
466 |
-
|
467 |
-
// Listen for clicks on our app menu.
|
468 |
-
events: {
|
469 |
-
'click a': 'clickAppMenu'
|
470 |
-
},
|
471 |
-
|
472 |
-
/**
|
473 |
-
* When we click on a menu item, fire a radio event.
|
474 |
-
* This lets us separate the logic from the click event and view.
|
475 |
-
* We pass this.model so that we know what item was clicked.
|
476 |
-
*
|
477 |
-
* @since 3.0
|
478 |
-
* @param Object e event
|
479 |
-
* @return return
|
480 |
-
*/
|
481 |
-
clickAppMenu: function( e ) {
|
482 |
-
nfRadio.channel( 'app' ).trigger( 'click:menu', e, this.model );
|
483 |
-
},
|
484 |
-
|
485 |
-
/**
|
486 |
-
* These functions are available to templates, and help us to remove logic from template files.
|
487 |
-
*
|
488 |
-
* @since 3.0
|
489 |
-
* @return Object
|
490 |
-
*/
|
491 |
-
templateHelpers: function() {
|
492 |
-
return {
|
493 |
-
/**
|
494 |
-
* If we have any dashicons in our model, render them.
|
495 |
-
*
|
496 |
-
* @since 3.0
|
497 |
-
* @return string
|
498 |
-
*/
|
499 |
-
renderDashicons: function() {
|
500 |
-
if ( ! this.dashicons ) return '';
|
501 |
-
|
502 |
-
var icon = document.createElement( 'span' );
|
503 |
-
icon.classList.add( 'dashicons' );
|
504 |
-
icon.classList.add( this.dashicons );
|
505 |
-
|
506 |
-
return icon.outerHTML;
|
507 |
-
},
|
508 |
-
/**
|
509 |
-
* Render classes for our menu item, including active.
|
510 |
-
*
|
511 |
-
* @since 3.0
|
512 |
-
* @return string
|
513 |
-
*/
|
514 |
-
renderClasses: function() {
|
515 |
-
var classes = this.classes;
|
516 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
517 |
-
if ( currentDomain.get( 'id' ) == this.id ) {
|
518 |
-
classes += ' active';
|
519 |
-
}
|
520 |
-
return classes;
|
521 |
-
},
|
522 |
-
/**
|
523 |
-
* If our menu is a link (like preview), render its url.
|
524 |
-
*
|
525 |
-
* @since 3.0
|
526 |
-
* @return string
|
527 |
-
*/
|
528 |
-
renderUrl: function() {
|
529 |
-
if ( '' != this.url ) {
|
530 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
531 |
-
return this.url + formModel.get( 'id' );
|
532 |
-
} else {
|
533 |
-
return '#';
|
534 |
-
}
|
535 |
-
},
|
536 |
-
/**
|
537 |
-
* If our menu is a link (like preview), render its target.
|
538 |
-
*
|
539 |
-
* @since 3.0
|
540 |
-
* @return string
|
541 |
-
*/
|
542 |
-
renderTarget: function() {
|
543 |
-
if ( '' != this.url ) {
|
544 |
-
return '_blank';
|
545 |
-
} else {
|
546 |
-
return '_self';
|
547 |
-
}
|
548 |
-
},
|
549 |
-
|
550 |
-
/**
|
551 |
-
* If our menu item is disabled, output 'disabled'
|
552 |
-
*
|
553 |
-
* @since 3.0
|
554 |
-
* @return string
|
555 |
-
*/
|
556 |
-
renderDisabled: function() {
|
557 |
-
if ( this.disabled ) {
|
558 |
-
return 'disabled';
|
559 |
-
} else {
|
560 |
-
return '';
|
561 |
-
}
|
562 |
-
}
|
563 |
-
}
|
564 |
-
}
|
565 |
-
|
566 |
-
});
|
567 |
-
|
568 |
-
return view;
|
569 |
-
} );
|
570 |
-
|
571 |
-
/**
|
572 |
-
* Collection view that takes our app menu items and renders an individual view for each.
|
573 |
-
*
|
574 |
-
* @package Ninja Forms builder
|
575 |
-
* @subpackage App
|
576 |
-
* @copyright (c) 2015 WP Ninjas
|
577 |
-
* @since 3.0
|
578 |
-
*/
|
579 |
-
define( 'views/app/menu',['views/app/menuItem'], function( appMenuItemView ) {
|
580 |
-
var view = Marionette.CollectionView.extend( {
|
581 |
-
tagName: 'div',
|
582 |
-
childView: appMenuItemView,
|
583 |
-
|
584 |
-
/**
|
585 |
-
* When we show this view, get rid of the extra <div> tag added by backbone.
|
586 |
-
*
|
587 |
-
* @since 3.0
|
588 |
-
* @return void
|
589 |
-
*/
|
590 |
-
onShow: function() {
|
591 |
-
jQuery( this.el ).find( 'li:last' ).unwrap();
|
592 |
-
}
|
593 |
-
} );
|
594 |
-
|
595 |
-
return view;
|
596 |
-
} );
|
597 |
-
/**
|
598 |
-
* Renders the action buttons to the right of the app menu. i.e. Publish
|
599 |
-
*
|
600 |
-
* @package Ninja Forms builder
|
601 |
-
* @subpackage App
|
602 |
-
* @copyright (c) 2015 WP Ninjas
|
603 |
-
* @since 3.0
|
604 |
-
*/
|
605 |
-
define( 'views/app/menuButtons',[], function() {
|
606 |
-
var view = Marionette.ItemView.extend({
|
607 |
-
tagName: 'span',
|
608 |
-
template: '#tmpl-nf-app-header-action-button',
|
609 |
-
|
610 |
-
initialize: function() {
|
611 |
-
// Listen to changes on the app 'clean' state. When it changes, re-render.
|
612 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:clean', this.render, this );
|
613 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:loading', this.render, this );
|
614 |
-
|
615 |
-
this.listenTo( nfRadio.channel( 'app' ), 'response:updateDB', this.bounceIcon, this );
|
616 |
-
},
|
617 |
-
|
618 |
-
/**
|
619 |
-
* These functions are available to templates, and help us to remove logic from template files.
|
620 |
-
*
|
621 |
-
* @since 3.0
|
622 |
-
* @return Object
|
623 |
-
*/
|
624 |
-
templateHelpers: function () {
|
625 |
-
var that = this;
|
626 |
-
return {
|
627 |
-
|
628 |
-
/**
|
629 |
-
* Render our Publish button. If we're loading, render the loading version.
|
630 |
-
*
|
631 |
-
* @since 3.0
|
632 |
-
* @return string
|
633 |
-
*/
|
634 |
-
renderPublish: function() {
|
635 |
-
if ( that.publishWidth ) {
|
636 |
-
this.publishWidth = that.publishWidth + 'px';
|
637 |
-
} else {
|
638 |
-
this.publishWidth = 'auto';
|
639 |
-
}
|
640 |
-
|
641 |
-
if ( nfRadio.channel( 'app' ).request( 'get:setting', 'loading' ) ) {
|
642 |
-
var template = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-add-header-publish-loading' );
|
643 |
-
} else {
|
644 |
-
var template = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-app-header-publish-button' );
|
645 |
-
}
|
646 |
-
return template( this );
|
647 |
-
},
|
648 |
-
|
649 |
-
/**
|
650 |
-
* If our app state is clean, disable publish.
|
651 |
-
*
|
652 |
-
* @since 3.0
|
653 |
-
* @return string
|
654 |
-
*/
|
655 |
-
maybeDisabled: function() {
|
656 |
-
if ( nfRadio.channel( 'app' ).request( 'get:setting', 'clean' ) ) {
|
657 |
-
return 'disabled';
|
658 |
-
} else {
|
659 |
-
return '';
|
660 |
-
}
|
661 |
-
},
|
662 |
-
|
663 |
-
/**
|
664 |
-
* [DEPRECATED] If our app isn't clean, render our 'viewChanges' button.
|
665 |
-
* @since version
|
666 |
-
* @return {[type]} [description]
|
667 |
-
*/
|
668 |
-
maybeRenderCancel: function() {
|
669 |
-
return '';
|
670 |
-
},
|
671 |
-
|
672 |
-
renderPublicLink: function() {
|
673 |
-
// Don't show public link if the form has a temp ID
|
674 |
-
var formModel = Backbone.Radio.channel('app').request('get:formModel');
|
675 |
-
if (isNaN(formModel.get('id'))) { return };
|
676 |
-
// Otherwise, display normally
|
677 |
-
var publicLink = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-app-header-public-link' );
|
678 |
-
return publicLink( this );
|
679 |
-
},
|
680 |
-
};
|
681 |
-
},
|
682 |
-
|
683 |
-
onShow: function() {
|
684 |
-
var publishEL = jQuery( this.el ).find( '.publish' );
|
685 |
-
// this.publishWidth = jQuery( publishEL ).outerWidth( true );
|
686 |
-
},
|
687 |
-
|
688 |
-
/**
|
689 |
-
* Listen for clicks on the Publish or view changes button.
|
690 |
-
* @type {Object}
|
691 |
-
*/
|
692 |
-
events: {
|
693 |
-
'click .publish': 'clickPublish',
|
694 |
-
'click .viewChanges': 'clickViewChanges',
|
695 |
-
'click .publicLink': 'clickPublicLink',
|
696 |
-
},
|
697 |
-
|
698 |
-
/**
|
699 |
-
* When we click publish, trigger a radio event.
|
700 |
-
* This lets us separate the logic from the click event and view.
|
701 |
-
*
|
702 |
-
* @since 3.0
|
703 |
-
* @param Object e event
|
704 |
-
* @return void
|
705 |
-
*/
|
706 |
-
clickPublish: function( e ) {
|
707 |
-
nfRadio.channel( 'app' ).trigger( 'click:publish', e );
|
708 |
-
},
|
709 |
-
|
710 |
-
/**
|
711 |
-
* When we click view changes, trigger a radio event.
|
712 |
-
* This lets us separate the logic from the click event and view.
|
713 |
-
*
|
714 |
-
* @since 3.0
|
715 |
-
* @param Object e event
|
716 |
-
* @return void
|
717 |
-
*/
|
718 |
-
clickViewChanges: function( e ) {
|
719 |
-
nfRadio.channel( 'app' ).trigger( 'click:viewChanges', e );
|
720 |
-
},
|
721 |
-
|
722 |
-
clickPublicLink: function( e ) {
|
723 |
-
nfRadio.channel( 'app' ).trigger( 'click:publicLink', e );
|
724 |
-
},
|
725 |
-
|
726 |
-
bounceIcon: function( changeModel ) {
|
727 |
-
jQuery( this.el ).find( '.dashicons-backup' ).effect( 'bounce', { times: 3 }, 600 );
|
728 |
-
}
|
729 |
-
|
730 |
-
});
|
731 |
-
|
732 |
-
return view;
|
733 |
-
} );
|
734 |
-
|
735 |
-
/**
|
736 |
-
* Renders the action buttons to the right of the app menu. i.e. Publish
|
737 |
-
*
|
738 |
-
* @package Ninja Forms builder
|
739 |
-
* @subpackage App
|
740 |
-
* @copyright (c) 2015 WP Ninjas
|
741 |
-
* @since 3.0
|
742 |
-
*/
|
743 |
-
define( 'views/app/mobileMenuButton',[], function() {
|
744 |
-
var view = Marionette.ItemView.extend({
|
745 |
-
tagName: 'span',
|
746 |
-
template: '#tmpl-nf-mobile-menu-button',
|
747 |
-
|
748 |
-
initialize: function() {
|
749 |
-
// Listen to changes on the app 'clean' state. When it changes, re-render.
|
750 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:clean', this.render, this );
|
751 |
-
},
|
752 |
-
|
753 |
-
/**
|
754 |
-
* These functions are available to templates, and help us to remove logic from template files.
|
755 |
-
*
|
756 |
-
* @since 3.0
|
757 |
-
* @return Object
|
758 |
-
*/
|
759 |
-
templateHelpers: function () {
|
760 |
-
var that = this;
|
761 |
-
return {
|
762 |
-
/**
|
763 |
-
* If our app state is clean, disable button.
|
764 |
-
*
|
765 |
-
* @since 3.0
|
766 |
-
* @return string
|
767 |
-
*/
|
768 |
-
maybeDisabled: function() {
|
769 |
-
if ( nfRadio.channel( 'app' ).request( 'get:setting', 'clean' ) ) {
|
770 |
-
return 'disabled';
|
771 |
-
} else {
|
772 |
-
return '';
|
773 |
-
}
|
774 |
-
}
|
775 |
-
};
|
776 |
-
},
|
777 |
-
|
778 |
-
/**
|
779 |
-
* Listen for clicks on the mobile menu button.
|
780 |
-
* @type {Object}
|
781 |
-
*/
|
782 |
-
events: {
|
783 |
-
'click .nf-mobile-menu': 'clickMobileMenu'
|
784 |
-
},
|
785 |
-
|
786 |
-
/**
|
787 |
-
* When we click publish, trigger a radio event.
|
788 |
-
* This lets us separate the logic from the click event and view.
|
789 |
-
*
|
790 |
-
* @since 3.0
|
791 |
-
* @param Object e event
|
792 |
-
* @return void
|
793 |
-
*/
|
794 |
-
clickMobileMenu: function( e) {
|
795 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
796 |
-
jQuery( builderEl ).toggleClass( 'nf-menu-expand' );
|
797 |
-
}
|
798 |
-
});
|
799 |
-
|
800 |
-
return view;
|
801 |
-
} );
|
802 |
-
/**
|
803 |
-
* Main application header. Includes links to all of our domains.
|
804 |
-
*
|
805 |
-
* @package Ninja Forms builder
|
806 |
-
* @subpackage App
|
807 |
-
* @copyright (c) 2015 WP Ninjas
|
808 |
-
* @since 3.0
|
809 |
-
*/
|
810 |
-
define( 'views/app/header',['views/app/menu', 'views/app/menuButtons', 'views/app/mobileMenuButton'], function( appMenuCollectionView, appMenuButtonsView, mobileMenuButtonView ) {
|
811 |
-
var view = Marionette.LayoutView.extend( {
|
812 |
-
tagName: 'div',
|
813 |
-
template: '#tmpl-nf-app-header',
|
814 |
-
|
815 |
-
regions: {
|
816 |
-
// Menu is our main app menu.
|
817 |
-
menu: '.nf-app-menu',
|
818 |
-
// Buttons represents the 'view changes' and 'Publish' buttons.
|
819 |
-
buttons: '.nf-app-buttons',
|
820 |
-
mobileMenuButton: '.nf-mobile-menu-button'
|
821 |
-
},
|
822 |
-
|
823 |
-
/**
|
824 |
-
* Since this is a layout region, we need to fill the two areas: menu and buttons whenever we show this view.
|
825 |
-
*
|
826 |
-
* @since 3.0
|
827 |
-
* @return void
|
828 |
-
*/
|
829 |
-
onRender: function() {
|
830 |
-
// Get our domains
|
831 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
832 |
-
// show the menu area using the appropriate view, passing our domain collection.
|
833 |
-
this.menu.show( new appMenuCollectionView( { collection: appDomainCollection } ) );
|
834 |
-
this.buttons.show( new appMenuButtonsView() );
|
835 |
-
this.mobileMenuButton.show( new mobileMenuButtonView() );
|
836 |
-
},
|
837 |
-
|
838 |
-
events: {
|
839 |
-
'click #nf-logo': 'clickLogo'
|
840 |
-
},
|
841 |
-
|
842 |
-
clickLogo: function( e ) {
|
843 |
-
|
844 |
-
}
|
845 |
-
|
846 |
-
} );
|
847 |
-
|
848 |
-
return view;
|
849 |
-
} );
|
850 |
-
/**
|
851 |
-
* Renders our sub-header. i.e. add new field, add new action, etc.
|
852 |
-
*
|
853 |
-
* @package Ninja Forms builder
|
854 |
-
* @subpackage App
|
855 |
-
* @copyright (c) 2015 WP Ninjas
|
856 |
-
* @since 3.0
|
857 |
-
*/
|
858 |
-
define( 'views/app/subHeader',[], function() {
|
859 |
-
var view = Marionette.ItemView.extend({
|
860 |
-
tagName: 'div',
|
861 |
-
template: '#tmpl-nf-sub-header'
|
862 |
-
});
|
863 |
-
|
864 |
-
return view;
|
865 |
-
} );
|
866 |
-
/**
|
867 |
-
* Renders our builder header.
|
868 |
-
*
|
869 |
-
* This is a layout view and handles two regions:
|
870 |
-
* app - menu/buttons
|
871 |
-
* subapp - title, add new field, etc.
|
872 |
-
*
|
873 |
-
* @package Ninja Forms builder
|
874 |
-
* @subpackage App
|
875 |
-
* @copyright (c) 2015 WP Ninjas
|
876 |
-
* @since 3.0
|
877 |
-
*/
|
878 |
-
define( 'views/app/builderHeader',[ 'views/app/header', 'views/app/subHeader' ], function( appHeaderView, appSubHeaderView ) {
|
879 |
-
|
880 |
-
var view = Marionette.LayoutView.extend({
|
881 |
-
tagName: "div",
|
882 |
-
template: "#tmpl-nf-header",
|
883 |
-
|
884 |
-
regions: {
|
885 |
-
app: "#nf-app-header",
|
886 |
-
formTitle: "#nf-app-form-title",
|
887 |
-
appSub: "#nf-app-sub-header"
|
888 |
-
},
|
889 |
-
|
890 |
-
initialize: function() {
|
891 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.changeSubHeader );
|
892 |
-
},
|
893 |
-
|
894 |
-
onShow: function() {
|
895 |
-
this.app.show( new appHeaderView() );
|
896 |
-
|
897 |
-
var formData = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
898 |
-
var formSettings = formData.get( 'settings' );
|
899 |
-
|
900 |
-
var formTitleView = nfRadio.channel( 'views' ).request( 'get:formTitle' );
|
901 |
-
this.formTitle.show( new formTitleView( { model: formSettings } ) );
|
902 |
-
|
903 |
-
this.changeSubHeader();
|
904 |
-
},
|
905 |
-
|
906 |
-
changeSubHeader: function() {
|
907 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
908 |
-
var subHeaderView = currentDomain.get( 'getSubHeaderView' ).call( currentDomain );
|
909 |
-
this.appSub.show( subHeaderView );
|
910 |
-
}
|
911 |
-
});
|
912 |
-
|
913 |
-
return view;
|
914 |
-
} );
|
915 |
-
/**
|
916 |
-
* Renders our builder.
|
917 |
-
*
|
918 |
-
* This is a layout view and handles three regions:
|
919 |
-
* gutterLeft - gutter to the left of our main content area
|
920 |
-
* body - main content area
|
921 |
-
* gutterRight - gutter to the right of our main content area
|
922 |
-
*
|
923 |
-
* @package Ninja Forms builder
|
924 |
-
* @subpackage App
|
925 |
-
* @copyright (c) 2016 WP Ninjas
|
926 |
-
* @since 3.0
|
927 |
-
*/
|
928 |
-
define( 'views/app/main',[], function() {
|
929 |
-
|
930 |
-
var view = Marionette.LayoutView.extend({
|
931 |
-
tagName: 'div',
|
932 |
-
template: '#tmpl-nf-main',
|
933 |
-
className: 'nf-main-test',
|
934 |
-
maybeDone: false,
|
935 |
-
|
936 |
-
offsetRight: false,
|
937 |
-
offsetLeft: false,
|
938 |
-
|
939 |
-
regions: {
|
940 |
-
gutterLeft: '#nf-main-gutter-left',
|
941 |
-
body: '#nf-main-body',
|
942 |
-
gutterRight: '#nf-main-gutter-right'
|
943 |
-
},
|
944 |
-
|
945 |
-
initialize: function() {
|
946 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.render );
|
947 |
-
nfRadio.channel( 'app' ).reply( 'get:mainEl', this.getMainEl, this );
|
948 |
-
|
949 |
-
/*
|
950 |
-
* Make sure that our gutters resize to match our screen upon resize or drawer open/close.
|
951 |
-
*/
|
952 |
-
jQuery( window ).on( 'resize', { context: this }, this.resizeBothGutters );
|
953 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'before:open', this.setBothGuttersAbsolute );
|
954 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', this.setBothGuttersFixed );
|
955 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'before:close', this.setBothGuttersAbsolute );
|
956 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'closed', this.setBothGuttersFixed );
|
957 |
-
// ... or Domain Change.
|
958 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', function(){
|
959 |
-
// @todo Using a timeout feels like a hack, but there may be a timing issue here.
|
960 |
-
setTimeout(function(){
|
961 |
-
nfRadio.channel( 'app' ).request( 'update:gutters' );
|
962 |
-
}, 300, this );
|
963 |
-
}, this );
|
964 |
-
|
965 |
-
|
966 |
-
/*
|
967 |
-
* Reply to messages requesting that we resize our gutters.
|
968 |
-
*/
|
969 |
-
nfRadio.channel( 'app' ).reply( 'update:gutters', this.updateGutters, this );
|
970 |
-
},
|
971 |
-
|
972 |
-
onShow: function() {
|
973 |
-
nfRadio.channel( 'main' ).trigger( 'show:main', this );
|
974 |
-
},
|
975 |
-
|
976 |
-
onRender: function() {
|
977 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
978 |
-
var bodyView = currentDomain.get( 'getMainContentView' ).call( currentDomain );
|
979 |
-
this.body.show( bodyView );
|
980 |
-
|
981 |
-
var gutterLeftView = currentDomain.get( 'getGutterLeftView' ).call( currentDomain );
|
982 |
-
this.gutterLeft.show( gutterLeftView );
|
983 |
-
|
984 |
-
var gutterRightView = currentDomain.get( 'getGutterRightView' ).call( currentDomain );
|
985 |
-
this.gutterRight.show( gutterRightView );
|
986 |
-
|
987 |
-
nfRadio.channel( 'main' ).trigger( 'render:main' );
|
988 |
-
},
|
989 |
-
|
990 |
-
getMainEl: function() {
|
991 |
-
return jQuery( this.el ).parent();
|
992 |
-
},
|
993 |
-
|
994 |
-
onAttach: function() {
|
995 |
-
this.initialGutterResize();
|
996 |
-
},
|
997 |
-
|
998 |
-
onBeforeDestroy: function() {
|
999 |
-
jQuery( window ).off( 'resize', this.resize );
|
1000 |
-
},
|
1001 |
-
|
1002 |
-
initialGutterResize: function() {
|
1003 |
-
this.resizeGutter( this.gutterLeft.el );
|
1004 |
-
this.resizeGutter( this.gutterRight.el );
|
1005 |
-
this.setBothGuttersFixed( this );
|
1006 |
-
},
|
1007 |
-
|
1008 |
-
resizeBothGutters: function( e ) {
|
1009 |
-
var context = ( e ) ? e.data.context : this;
|
1010 |
-
|
1011 |
-
var leftEl = context.gutterLeft.el;
|
1012 |
-
var rightEl = context.gutterRight.el;
|
1013 |
-
|
1014 |
-
context.resizeGutter( leftEl, context );
|
1015 |
-
context.resizeGutter( rightEl, context );
|
1016 |
-
|
1017 |
-
context.setBothGuttersAbsolute( context );
|
1018 |
-
|
1019 |
-
/*
|
1020 |
-
* Clear our timeout. If the timeout runs, it means we've stopped resizing.
|
1021 |
-
*/
|
1022 |
-
clearTimeout( context.maybeDone );
|
1023 |
-
/*
|
1024 |
-
* Add our timeout.
|
1025 |
-
*/
|
1026 |
-
context.maybeDone = setTimeout( context.setBothGuttersFixed, 100, context );
|
1027 |
-
},
|
1028 |
-
|
1029 |
-
resizeGutter: function( el, context ) {
|
1030 |
-
var top = jQuery( el ).offset().top;
|
1031 |
-
var viewHeight = jQuery( window ).height();
|
1032 |
-
var height = viewHeight - top;
|
1033 |
-
jQuery( el ).height( height );
|
1034 |
-
},
|
1035 |
-
|
1036 |
-
setBothGuttersFixed: function( context ) {
|
1037 |
-
context = context || this;
|
1038 |
-
|
1039 |
-
var offsetLeft = jQuery( context.gutterLeft.el ).offset();
|
1040 |
-
var topLeft = offsetLeft.top;
|
1041 |
-
var leftLeft = offsetLeft.left;
|
1042 |
-
|
1043 |
-
jQuery( context.gutterLeft.el ).css( { position: 'fixed', left: leftLeft, top: topLeft } ); var offsetLeft = jQuery( context.gutterLeft.el ).offset();
|
1044 |
-
|
1045 |
-
var offsetRight = jQuery( context.gutterRight.el ).offset();
|
1046 |
-
var topRight = offsetRight.top;
|
1047 |
-
var leftRight = offsetRight.left;
|
1048 |
-
|
1049 |
-
jQuery( context.gutterRight.el ).css( { position: 'fixed', left: leftRight, top: topRight } );
|
1050 |
-
},
|
1051 |
-
|
1052 |
-
setBothGuttersAbsolute: function( context ) {
|
1053 |
-
context = context || this;
|
1054 |
-
|
1055 |
-
var offsetLeft = jQuery( context.gutterLeft.el ).offset();
|
1056 |
-
var offsetRight = jQuery( context.gutterRight.el ).offset();
|
1057 |
-
|
1058 |
-
var scrollTop = jQuery( '#nf-main' ).scrollTop();
|
1059 |
-
|
1060 |
-
jQuery( context.gutterLeft.el ).css( { position: 'absolute', left: 0, top: scrollTop } );
|
1061 |
-
jQuery( context.gutterRight.el ).css( { position: 'absolute', top: scrollTop, right: 0, left: 'auto' } );
|
1062 |
-
},
|
1063 |
-
|
1064 |
-
updateGutters: function() {
|
1065 |
-
this.resizeBothGutters();
|
1066 |
-
}
|
1067 |
-
|
1068 |
-
});
|
1069 |
-
|
1070 |
-
return view;
|
1071 |
-
} );
|
1072 |
-
|
1073 |
-
/**
|
1074 |
-
* Renders an application menu item from a domain model.
|
1075 |
-
*
|
1076 |
-
* @package Ninja Forms builder
|
1077 |
-
* @subpackage App
|
1078 |
-
* @copyright (c) 2015 WP Ninjas
|
1079 |
-
* @since 3.0
|
1080 |
-
*/
|
1081 |
-
define( 'views/app/mobileMenuItem',[], function() {
|
1082 |
-
var view = Marionette.ItemView.extend({
|
1083 |
-
tagName: 'div',
|
1084 |
-
template: '#tmpl-nf-mobile-menu-item',
|
1085 |
-
|
1086 |
-
/**
|
1087 |
-
* When we render this view, remove the extra <div> tag created by backbone.
|
1088 |
-
*
|
1089 |
-
* @since 3.0
|
1090 |
-
* @return void
|
1091 |
-
*/
|
1092 |
-
onRender: function() {
|
1093 |
-
this.$el = this.$el.children();
|
1094 |
-
this.$el.unwrap();
|
1095 |
-
this.setElement( this.$el );
|
1096 |
-
},
|
1097 |
-
|
1098 |
-
// Listen for clicks on our app menu.
|
1099 |
-
events: {
|
1100 |
-
'click a': 'clickAppMenu'
|
1101 |
-
},
|
1102 |
-
|
1103 |
-
/**
|
1104 |
-
* When we click on a menu item, fire a radio event.
|
1105 |
-
* This lets us separate the logic from the click event and view.
|
1106 |
-
* We pass this.model so that we know what item was clicked.
|
1107 |
-
*
|
1108 |
-
* @since 3.0
|
1109 |
-
* @param Object e event
|
1110 |
-
* @return return
|
1111 |
-
*/
|
1112 |
-
clickAppMenu: function( e ) {
|
1113 |
-
nfRadio.channel( 'app' ).trigger( 'click:menu', e, this.model );
|
1114 |
-
},
|
1115 |
-
|
1116 |
-
/**
|
1117 |
-
* These functions are available to templates, and help us to remove logic from template files.
|
1118 |
-
*
|
1119 |
-
* @since 3.0
|
1120 |
-
* @return Object
|
1121 |
-
*/
|
1122 |
-
templateHelpers: function() {
|
1123 |
-
return {
|
1124 |
-
/**
|
1125 |
-
* If we have any dashicons in our model, render them.
|
1126 |
-
*
|
1127 |
-
* @since 3.0
|
1128 |
-
* @return string
|
1129 |
-
*/
|
1130 |
-
renderDashicons: function() {
|
1131 |
-
if ( ! this.mobileDashicon ) return '';
|
1132 |
-
|
1133 |
-
var icon = document.createElement( 'span' );
|
1134 |
-
icon.classList.add( 'dashicons' );
|
1135 |
-
icon.classList.add( this.mobileDashicon );
|
1136 |
-
|
1137 |
-
return icon.outerHTML;
|
1138 |
-
},
|
1139 |
-
/**
|
1140 |
-
* Render classes for our menu item, including active.
|
1141 |
-
*
|
1142 |
-
* @since 3.0
|
1143 |
-
* @return string
|
1144 |
-
*/
|
1145 |
-
renderClasses: function() {
|
1146 |
-
var classes = this.classes;
|
1147 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
1148 |
-
if ( currentDomain.get( 'id' ) == this.id ) {
|
1149 |
-
classes += ' active';
|
1150 |
-
}
|
1151 |
-
return classes;
|
1152 |
-
},
|
1153 |
-
/**
|
1154 |
-
* If our menu is a link (like preview), render its url.
|
1155 |
-
*
|
1156 |
-
* @since 3.0
|
1157 |
-
* @return string
|
1158 |
-
*/
|
1159 |
-
renderUrl: function() {
|
1160 |
-
if ( '' != this.url ) {
|
1161 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
1162 |
-
return this.url + formModel.get( 'id' );
|
1163 |
-
} else {
|
1164 |
-
return '#';
|
1165 |
-
}
|
1166 |
-
},
|
1167 |
-
/**
|
1168 |
-
* If our menu is a link (like preview), render its target.
|
1169 |
-
*
|
1170 |
-
* @since 3.0
|
1171 |
-
* @return string
|
1172 |
-
*/
|
1173 |
-
renderTarget: function() {
|
1174 |
-
if ( '' != this.url ) {
|
1175 |
-
return '_blank';
|
1176 |
-
} else {
|
1177 |
-
return '_self';
|
1178 |
-
}
|
1179 |
-
},
|
1180 |
-
|
1181 |
-
/**
|
1182 |
-
* If our menu item is disabled, output 'disabled'
|
1183 |
-
*
|
1184 |
-
* @since 3.0
|
1185 |
-
* @return string
|
1186 |
-
*/
|
1187 |
-
renderDisabled: function() {
|
1188 |
-
if ( this.disabled ) {
|
1189 |
-
return 'disabled';
|
1190 |
-
} else {
|
1191 |
-
return '';
|
1192 |
-
}
|
1193 |
-
}
|
1194 |
-
}
|
1195 |
-
}
|
1196 |
-
});
|
1197 |
-
|
1198 |
-
return view;
|
1199 |
-
} );
|
1200 |
-
|
1201 |
-
/**
|
1202 |
-
* Single item view used for the menu drawer.
|
1203 |
-
*
|
1204 |
-
* @package Ninja Forms builder
|
1205 |
-
* @subpackage App
|
1206 |
-
* @copyright (c) 2015 WP Ninjas
|
1207 |
-
* @since 3.0
|
1208 |
-
*/
|
1209 |
-
define( 'views/app/mobileMenu',['views/app/mobileMenuItem'], function( mobileMenuItemView ) {
|
1210 |
-
var view = Marionette.CompositeView.extend({
|
1211 |
-
tagName: 'div',
|
1212 |
-
template: '#tmpl-nf-mobile-menu',
|
1213 |
-
childView: mobileMenuItemView,
|
1214 |
-
|
1215 |
-
initialize: function() {
|
1216 |
-
// Listen to changes on the app 'clean' state. When it changes, re-render.
|
1217 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:clean', this.render, this );
|
1218 |
-
},
|
1219 |
-
|
1220 |
-
attachHtml: function( collectionView, childView ) {
|
1221 |
-
jQuery( collectionView.el ).find( '.secondary' ).append( childView.el );
|
1222 |
-
},
|
1223 |
-
|
1224 |
-
templateHelpers: function() {
|
1225 |
-
return {
|
1226 |
-
/**
|
1227 |
-
* If our app state is clean, disable button.
|
1228 |
-
*
|
1229 |
-
* @since 3.0
|
1230 |
-
* @return string
|
1231 |
-
*/
|
1232 |
-
maybeDisabled: function() {
|
1233 |
-
if ( nfRadio.channel( 'app' ).request( 'get:setting', 'clean' ) ) {
|
1234 |
-
return 'disabled';
|
1235 |
-
} else {
|
1236 |
-
return '';
|
1237 |
-
}
|
1238 |
-
}
|
1239 |
-
};
|
1240 |
-
},
|
1241 |
-
|
1242 |
-
events: {
|
1243 |
-
'click .nf-publish': 'clickPublish'
|
1244 |
-
},
|
1245 |
-
|
1246 |
-
/**
|
1247 |
-
* When we click publish, trigger a radio event.
|
1248 |
-
* This lets us separate the logic from the click event and view.
|
1249 |
-
*
|
1250 |
-
* @since 3.0
|
1251 |
-
* @param Object e event
|
1252 |
-
* @return void
|
1253 |
-
*/
|
1254 |
-
clickPublish: function( e ) {
|
1255 |
-
nfRadio.channel( 'app' ).trigger( 'click:publish', e );
|
1256 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
1257 |
-
jQuery( builderEl ).toggleClass( 'nf-menu-expand' );
|
1258 |
-
},
|
1259 |
-
});
|
1260 |
-
|
1261 |
-
return view;
|
1262 |
-
} );
|
1263 |
-
/**
|
1264 |
-
* Empty drawer content view.
|
1265 |
-
* Called before we close the drawer.
|
1266 |
-
*
|
1267 |
-
* @package Ninja Forms builder
|
1268 |
-
* @subpackage App
|
1269 |
-
* @copyright (c) 2015 WP Ninjas
|
1270 |
-
* @since 3.0
|
1271 |
-
*/
|
1272 |
-
define( 'views/app/drawer/contentEmpty',[], function() {
|
1273 |
-
var view = Marionette.ItemView.extend({
|
1274 |
-
tagName: 'div',
|
1275 |
-
template: '#tmpl-nf-empty'
|
1276 |
-
});
|
1277 |
-
|
1278 |
-
return view;
|
1279 |
-
} );
|
1280 |
-
/**
|
1281 |
-
* Renders our drawer region
|
1282 |
-
*
|
1283 |
-
* @package Ninja Forms builder
|
1284 |
-
* @subpackage App
|
1285 |
-
* @copyright (c) 2015 WP Ninjas
|
1286 |
-
* @since 3.0
|
1287 |
-
*/
|
1288 |
-
define( 'views/app/drawer',['views/app/drawer/contentEmpty'], function( drawerEmptyView ) {
|
1289 |
-
|
1290 |
-
var view = Marionette.LayoutView.extend( {
|
1291 |
-
template: '#tmpl-nf-drawer',
|
1292 |
-
|
1293 |
-
regions: {
|
1294 |
-
header: '#nf-drawer-header',
|
1295 |
-
content: '#nf-drawer-content',
|
1296 |
-
footer: '#nf-drawer-footer'
|
1297 |
-
},
|
1298 |
-
|
1299 |
-
initialize: function() {
|
1300 |
-
nfRadio.channel( 'app' ).reply( 'get:drawerEl', this.getEl, this );
|
1301 |
-
nfRadio.channel( 'drawer' ).reply( 'load:drawerContent', this.loadContent, this );
|
1302 |
-
nfRadio.channel( 'drawer' ).reply( 'empty:drawerContent', this.emptyContent, this );
|
1303 |
-
},
|
1304 |
-
|
1305 |
-
onShow: function() {
|
1306 |
-
jQuery( this.el ).parent().perfectScrollbar();
|
1307 |
-
},
|
1308 |
-
|
1309 |
-
loadContent: function( drawerID, data ) {
|
1310 |
-
var drawer = nfRadio.channel( 'app' ).request( 'get:drawer', drawerID );
|
1311 |
-
var contentView = drawer.get( 'getContentView' ).call( drawer, data );
|
1312 |
-
var headerView = drawer.get( 'getHeaderView' ).call( drawer, data );
|
1313 |
-
var footerView = drawer.get( 'getFooterView' ).call( drawer, data );
|
1314 |
-
|
1315 |
-
this.header.show( headerView );
|
1316 |
-
this.content.show( contentView );
|
1317 |
-
this.footer.show( footerView );
|
1318 |
-
|
1319 |
-
},
|
1320 |
-
|
1321 |
-
emptyContent: function() {
|
1322 |
-
this.header.empty();
|
1323 |
-
this.content.empty();
|
1324 |
-
this.footer.empty();
|
1325 |
-
},
|
1326 |
-
|
1327 |
-
getEl: function() {
|
1328 |
-
return jQuery( this.el ).parent();
|
1329 |
-
},
|
1330 |
-
|
1331 |
-
events: {
|
1332 |
-
'click .nf-toggle-drawer': 'clickToggleDrawer'
|
1333 |
-
},
|
1334 |
-
|
1335 |
-
clickToggleDrawer: function() {
|
1336 |
-
nfRadio.channel( 'app' ).trigger( 'click:toggleDrawerSize' );
|
1337 |
-
}
|
1338 |
-
|
1339 |
-
} );
|
1340 |
-
|
1341 |
-
return view;
|
1342 |
-
} );
|
1343 |
-
|
1344 |
-
/**
|
1345 |
-
* Single item view used for merge tags.
|
1346 |
-
*
|
1347 |
-
* @package Ninja Forms builder
|
1348 |
-
* @subpackage App
|
1349 |
-
* @copyright (c) 2015 WP Ninjas
|
1350 |
-
* @since 3.0
|
1351 |
-
*/
|
1352 |
-
define( 'views/app/drawer/mergeTagItem',[], function() {
|
1353 |
-
var view = Marionette.ItemView.extend({
|
1354 |
-
tagName: 'li',
|
1355 |
-
|
1356 |
-
template: '#tmpl-nf-merge-tags-item',
|
1357 |
-
|
1358 |
-
onBeforeDestroy: function() {
|
1359 |
-
this.model.off( 'change:active', this.render );
|
1360 |
-
},
|
1361 |
-
|
1362 |
-
initialize: function() {
|
1363 |
-
this.model.on( 'change:active', this.render, this );
|
1364 |
-
},
|
1365 |
-
|
1366 |
-
events: {
|
1367 |
-
'click a': 'clickTag'
|
1368 |
-
},
|
1369 |
-
|
1370 |
-
clickTag: function( e ) {
|
1371 |
-
nfRadio.channel( 'mergeTags' ).trigger( 'click:mergeTag', e, this.model );
|
1372 |
-
},
|
1373 |
-
|
1374 |
-
templateHelpers: function() {
|
1375 |
-
return {
|
1376 |
-
renderClasses: function() {
|
1377 |
-
if ( this.active ) {
|
1378 |
-
return 'active';
|
1379 |
-
}
|
1380 |
-
}
|
1381 |
-
}
|
1382 |
-
}
|
1383 |
-
});
|
1384 |
-
|
1385 |
-
return view;
|
1386 |
-
} );
|
1387 |
-
/**
|
1388 |
-
* Merge tags popup section
|
1389 |
-
*
|
1390 |
-
* @package Ninja Forms builder
|
1391 |
-
* @subpackage App
|
1392 |
-
* @copyright (c) 2015 WP Ninjas
|
1393 |
-
* @since 3.0
|
1394 |
-
*/
|
1395 |
-
define( 'views/app/drawer/mergeTagsSection',['views/app/drawer/mergeTagItem'], function( mergeTagItemView ) {
|
1396 |
-
var view = Marionette.CompositeView.extend({
|
1397 |
-
tagName: 'div',
|
1398 |
-
childView: mergeTagItemView,
|
1399 |
-
template: '#tmpl-nf-merge-tags-section',
|
1400 |
-
|
1401 |
-
initialize: function() {
|
1402 |
-
this.collection = this.model.get( 'tags' );
|
1403 |
-
this.model.on( 'change', this.render, this );
|
1404 |
-
if ( 'fields' == this.model.get( 'id' ) ) {
|
1405 |
-
// var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
1406 |
-
// fieldCollection.on( 'all', this.updateFields, this );
|
1407 |
-
}
|
1408 |
-
},
|
1409 |
-
|
1410 |
-
onBeforeDestroy: function() {
|
1411 |
-
this.model.off( 'change', this.render );
|
1412 |
-
if ( 'fields' == this.model.get( 'id' ) ) {
|
1413 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
1414 |
-
fieldCollection.off( 'all', this.updateFields, this );
|
1415 |
-
}
|
1416 |
-
},
|
1417 |
-
|
1418 |
-
attachHtml: function( collectionView, childView ) {
|
1419 |
-
jQuery( collectionView.el ).find( '.merge-tags' ).append( childView.el );
|
1420 |
-
},
|
1421 |
-
|
1422 |
-
updateFields: function() {
|
1423 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
1424 |
-
this.model.set( 'tags', fieldCollection );
|
1425 |
-
}
|
1426 |
-
});
|
1427 |
-
|
1428 |
-
return view;
|
1429 |
-
} );
|
1430 |
-
/**
|
1431 |
-
* Model that represents our merge tags.
|
1432 |
-
*
|
1433 |
-
* @package Ninja Forms builder
|
1434 |
-
* @subpackage App
|
1435 |
-
* @copyright (c) 2015 WP Ninjas
|
1436 |
-
* @since 3.0
|
1437 |
-
*/
|
1438 |
-
define( 'models/app/mergeTagModel',[], function() {
|
1439 |
-
var model = Backbone.Model.extend( {
|
1440 |
-
defaults: {
|
1441 |
-
active: false,
|
1442 |
-
exclude: false
|
1443 |
-
}
|
1444 |
-
} );
|
1445 |
-
|
1446 |
-
return model;
|
1447 |
-
} );
|
1448 |
-
/**
|
1449 |
-
* Collections of merge tags.
|
1450 |
-
*
|
1451 |
-
* @package Ninja Forms builder
|
1452 |
-
* @subpackage App
|
1453 |
-
* @copyright (c) 2015 WP Ninjas
|
1454 |
-
* @since 3.0
|
1455 |
-
*/
|
1456 |
-
define( 'models/app/mergeTagCollection',['models/app/mergeTagModel'], function( mergeTagModel ) {
|
1457 |
-
var collection = Backbone.Collection.extend( {
|
1458 |
-
model: mergeTagModel
|
1459 |
-
} );
|
1460 |
-
return collection;
|
1461 |
-
} );
|
1462 |
-
/**
|
1463 |
-
* Merge tags popup
|
1464 |
-
*
|
1465 |
-
* @package Ninja Forms builder
|
1466 |
-
* @subpackage App
|
1467 |
-
* @copyright (c) 2015 WP Ninjas
|
1468 |
-
* @since 3.0
|
1469 |
-
*/
|
1470 |
-
define( 'views/app/drawer/mergeTagsContent',['views/app/drawer/mergeTagsSection', 'models/app/mergeTagCollection'], function( mergeTagsSectionView, MergeTagCollection ) {
|
1471 |
-
var view = Marionette.CollectionView.extend({
|
1472 |
-
tagName: 'div',
|
1473 |
-
template: '#tmpl-nf-merge-tags-content',
|
1474 |
-
childView: mergeTagsSectionView,
|
1475 |
-
|
1476 |
-
initialize: function() {
|
1477 |
-
nfRadio.channel( 'mergeTags' ).reply( 'get:view', this.getMergeTagsView, this );
|
1478 |
-
},
|
1479 |
-
|
1480 |
-
reRender: function( settingModel ) {
|
1481 |
-
var mergeTagCollection = nfRadio.channel( 'mergeTags' ).request( 'get:collection' );
|
1482 |
-
var defaultGroups = mergeTagCollection.where( { default_group: true } );
|
1483 |
-
|
1484 |
-
/*
|
1485 |
-
* For the Actions Domain, Add Calc Merge Tags as a Default Group.
|
1486 |
-
*/
|
1487 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
1488 |
-
if( 'actions' == currentDomain.get( 'id' ) ){
|
1489 |
-
var calcMergeTagGroup = mergeTagCollection.where( { id: 'calcs' } );
|
1490 |
-
defaultGroups = defaultGroups.concat( calcMergeTagGroup );
|
1491 |
-
}
|
1492 |
-
|
1493 |
-
this.collection = new MergeTagCollection( defaultGroups );
|
1494 |
-
var that = this;
|
1495 |
-
var useMergeTags = settingModel.get( 'use_merge_tags' );
|
1496 |
-
if ( 'object' == typeof useMergeTags ) {
|
1497 |
-
if ( 'undefined' != typeof useMergeTags.exclude ) {
|
1498 |
-
_.each( useMergeTags.exclude, function( exclude ) {
|
1499 |
-
that.collection.remove( exclude )
|
1500 |
-
} );
|
1501 |
-
}
|
1502 |
-
|
1503 |
-
if ( 'undefined' != typeof useMergeTags.include ) {
|
1504 |
-
_.each( mergeTagCollection.models, function( sectionModel ) {
|
1505 |
-
if ( -1 != useMergeTags.include.indexOf( sectionModel.get( 'id' ) ) ) {
|
1506 |
-
// console.log( sectionModel );
|
1507 |
-
that.collection.add( sectionModel );
|
1508 |
-
}
|
1509 |
-
} );
|
1510 |
-
}
|
1511 |
-
}
|
1512 |
-
|
1513 |
-
this.render();
|
1514 |
-
},
|
1515 |
-
|
1516 |
-
getMergeTagsView: function() {
|
1517 |
-
return this;
|
1518 |
-
}
|
1519 |
-
});
|
1520 |
-
|
1521 |
-
return view;
|
1522 |
-
} );
|
1523 |
-
/**
|
1524 |
-
* Builder view.
|
1525 |
-
*
|
1526 |
-
* This layout view has regions that represent our application areas:
|
1527 |
-
* header
|
1528 |
-
* main
|
1529 |
-
* menuDrawer - Mobile side-menu
|
1530 |
-
* drawer
|
1531 |
-
*
|
1532 |
-
* @package Ninja Forms builder
|
1533 |
-
* @subpackage App
|
1534 |
-
* @copyright (c) 2015 WP Ninjas
|
1535 |
-
* @since 3.0
|
1536 |
-
*/
|
1537 |
-
define( 'views/app/builder',['views/app/builderHeader', 'views/app/main', 'views/app/mobileMenu', 'views/app/drawer', 'views/app/drawer/mergeTagsContent'], function( headerView, mainView, mobileMenuView, drawerView, mergeTagsContentView ) {
|
1538 |
-
var view = Marionette.LayoutView.extend( {
|
1539 |
-
template: "#tmpl-nf-builder",
|
1540 |
-
el: '#nf-builder',
|
1541 |
-
|
1542 |
-
regions: {
|
1543 |
-
header: "#nf-header",
|
1544 |
-
main: "#nf-main",
|
1545 |
-
menuDrawer: "#nf-menu-drawer",
|
1546 |
-
drawer: "#nf-drawer",
|
1547 |
-
mergeTagsContent: '.merge-tags-content'
|
1548 |
-
},
|
1549 |
-
|
1550 |
-
initialize: function() {
|
1551 |
-
// Respond to requests asking for the builder dom element.
|
1552 |
-
nfRadio.channel( 'app' ).reply( 'get:builderEl', this.getBuilderEl, this );
|
1553 |
-
// Respond to requests asking for the builder view
|
1554 |
-
nfRadio.channel( 'app' ).reply( 'get:builderView', this.getBuilderView, this );
|
1555 |
-
// Layout views aren't self-rendering.
|
1556 |
-
this.render();
|
1557 |
-
var mergeTags = nfRadio.channel( 'mergeTags' ).request( 'get:collection' );
|
1558 |
-
var mergeTagsClone = mergeTags.clone();
|
1559 |
-
this.mergeTagsContent.show( new mergeTagsContentView( { collection: mergeTagsClone } ) );
|
1560 |
-
// Show our header.
|
1561 |
-
this.header.show( new headerView() );
|
1562 |
-
// Show our main content.
|
1563 |
-
this.main.show( new mainView() );
|
1564 |
-
// Show our mobile menu
|
1565 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
1566 |
-
this.menuDrawer.show( new mobileMenuView( { collection: appDomainCollection } ) );
|
1567 |
-
// Show our drawer.
|
1568 |
-
this.drawer.show( new drawerView() );
|
1569 |
-
|
1570 |
-
|
1571 |
-
},
|
1572 |
-
|
1573 |
-
onRender: function() {
|
1574 |
-
|
1575 |
-
},
|
1576 |
-
|
1577 |
-
getBuilderEl: function() {
|
1578 |
-
return this.el;
|
1579 |
-
},
|
1580 |
-
|
1581 |
-
getBuilderView: function() {
|
1582 |
-
return this;
|
1583 |
-
},
|
1584 |
-
|
1585 |
-
// Listen for clicks
|
1586 |
-
events: {
|
1587 |
-
'click .nf-open-drawer': 'openDrawer',
|
1588 |
-
'click .nf-change-domain': 'changeDomain',
|
1589 |
-
'click .nf-close-drawer': 'closeDrawer'
|
1590 |
-
},
|
1591 |
-
|
1592 |
-
/**
|
1593 |
-
* Someone clicked to open a drawer, so fire a radio event.
|
1594 |
-
* This lets us separate the logic from the click event and view.
|
1595 |
-
*
|
1596 |
-
* @since 3.0
|
1597 |
-
* @param Object e event
|
1598 |
-
* @return void
|
1599 |
-
*/
|
1600 |
-
openDrawer: function( e ) {
|
1601 |
-
nfRadio.channel( 'app' ).trigger( 'click:openDrawer', e );
|
1602 |
-
},
|
1603 |
-
/**
|
1604 |
-
* Someone clicked to close a drawer, so fire a radio event.
|
1605 |
-
* This lets us separate the logic from the click event and view.
|
1606 |
-
*
|
1607 |
-
* @since 3.0
|
1608 |
-
* @return void
|
1609 |
-
*/
|
1610 |
-
closeDrawer: function() {
|
1611 |
-
nfRadio.channel( 'app' ).trigger( 'click:closeDrawer' );
|
1612 |
-
},
|
1613 |
-
/**
|
1614 |
-
* Someone clicked to change the domain, so fire a radio event.
|
1615 |
-
* This lets us separate the logic from the click event and view.
|
1616 |
-
*
|
1617 |
-
* @since 3.0
|
1618 |
-
* @param Object e event
|
1619 |
-
* @return void
|
1620 |
-
*/
|
1621 |
-
changeDomain: function( e ) {
|
1622 |
-
nfRadio.channel( 'app' ).trigger( 'click:menu', e );
|
1623 |
-
}
|
1624 |
-
|
1625 |
-
} );
|
1626 |
-
|
1627 |
-
return view;
|
1628 |
-
} );
|
1629 |
-
|
1630 |
-
|
1631 |
-
define( 'controllers/app/remote',[], function() {
|
1632 |
-
return Marionette.Object.extend( {
|
1633 |
-
initialize: function() {
|
1634 |
-
this.listenTo( nfRadio.channel( 'setting' ), 'remote', this.addListener );
|
1635 |
-
},
|
1636 |
-
|
1637 |
-
addListener: function( model, dataModel ) {
|
1638 |
-
|
1639 |
-
var listenTo = model.get( 'remote' ).listen;
|
1640 |
-
|
1641 |
-
// TODO: Change seems to be triggering twice on each update.
|
1642 |
-
this.listenTo( nfRadio.channel( 'fieldSetting-' + listenTo ), 'update:setting', this.updateSetting );
|
1643 |
-
this.listenTo( nfRadio.channel( 'actionSetting-' + listenTo ), 'update:setting', this.updateSetting );
|
1644 |
-
|
1645 |
-
this.listenTo( nfRadio.channel( 'setting-type-' + model.get( 'type' ) ), 'click:extra', this.clickExtra );
|
1646 |
-
|
1647 |
-
model.listenTo( nfRadio.channel( 'setting-remote' ), 'get:remote', this.getRemote, model );
|
1648 |
-
|
1649 |
-
// Auto-trigger get:remote on drawer load.
|
1650 |
-
nfRadio.channel( 'setting-remote' ).trigger( 'get:remote', dataModel );
|
1651 |
-
},
|
1652 |
-
|
1653 |
-
clickExtra: function( e, settingModel, dataModel, settingView ) {
|
1654 |
-
jQuery( e.srcElement ).addClass( 'spin' );
|
1655 |
-
nfRadio.channel( 'setting-remote' ).trigger( 'get:remote', dataModel );
|
1656 |
-
},
|
1657 |
-
|
1658 |
-
updateSetting: function( dataModel, settingModel ) {
|
1659 |
-
nfRadio.channel( 'setting-remote' ).trigger( 'get:remote', dataModel );
|
1660 |
-
},
|
1661 |
-
|
1662 |
-
getRemote: function( dataModel ) {
|
1663 |
-
|
1664 |
-
var remote = this.get( 'remote' );
|
1665 |
-
|
1666 |
-
var data = {
|
1667 |
-
parentValue: dataModel.get( remote.listen ),
|
1668 |
-
action: remote.action,
|
1669 |
-
security: ( remote.security ) ? remote.security : nfAdmin.ajaxNonce
|
1670 |
-
};
|
1671 |
-
|
1672 |
-
// TODO: Disable setting and lock drawer while updating.
|
1673 |
-
var that = this;
|
1674 |
-
jQuery.post( ajaxurl, data, function( response ){
|
1675 |
-
var response = JSON.parse( response );
|
1676 |
-
|
1677 |
-
if( 'textbox' == that.get( 'type' ) ) {
|
1678 |
-
dataModel.set( that.get('name'), response.value );
|
1679 |
-
}
|
1680 |
-
|
1681 |
-
if( 'select' == that.get( 'type' ) ) {
|
1682 |
-
that.set( 'options', response.options );
|
1683 |
-
that.trigger( 'rerender' );
|
1684 |
-
}
|
1685 |
-
});
|
1686 |
-
},
|
1687 |
-
|
1688 |
-
});
|
1689 |
-
} );
|
1690 |
-
/**
|
1691 |
-
* Handles opening and closing our drawer. This is where we display settings for fields, actions, and settings.
|
1692 |
-
*
|
1693 |
-
* @package Ninja Forms builder
|
1694 |
-
* @subpackage Main App
|
1695 |
-
* @copyright (c) 2015 WP Ninjas
|
1696 |
-
* @since 3.0
|
1697 |
-
*/
|
1698 |
-
define( 'controllers/app/drawer',[], function() {
|
1699 |
-
var controller = Marionette.Object.extend( {
|
1700 |
-
initialize: function() {
|
1701 |
-
// Listen to our drawer-related click events.
|
1702 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:openDrawer', this.clickOpenDrawer );
|
1703 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:closeDrawer', this.closeDrawer );
|
1704 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:toggleDrawerSize', this.toggleDrawerSize );
|
1705 |
-
|
1706 |
-
// Reply to direct requests to open or close the drawer.
|
1707 |
-
nfRadio.channel( 'app' ).reply( 'open:drawer', this.openDrawer, this );
|
1708 |
-
nfRadio.channel( 'app' ).reply( 'close:drawer', this.closeDrawer, this );
|
1709 |
-
|
1710 |
-
/*
|
1711 |
-
* When we close the drawer, we have to figure out what the right position should be.
|
1712 |
-
* This listens to requests from other parts of our app asking what the closed right position is.
|
1713 |
-
*/
|
1714 |
-
nfRadio.channel( 'drawer' ).reply( 'get:closedRightPos', this.getClosedDrawerPos, this );
|
1715 |
-
|
1716 |
-
// Reply to requests to prevent our drawer from closing
|
1717 |
-
nfRadio.channel( 'drawer' ).reply( 'prevent:close', this.preventClose, this );
|
1718 |
-
// Reply to requests to enable drawer closing
|
1719 |
-
nfRadio.channel( 'drawer' ).reply( 'enable:close', this.enableClose, this );
|
1720 |
-
// Reply to requests for our disabled/enabled state.
|
1721 |
-
nfRadio.channel( 'drawer' ).reply( 'get:preventClose', this.maybePreventClose, this );
|
1722 |
-
|
1723 |
-
/*
|
1724 |
-
* Object that holds our array of 'prevent close' values.
|
1725 |
-
* We use an array so that registered requests can unregister and not affect each other.
|
1726 |
-
*/
|
1727 |
-
this.objPreventClose = {};
|
1728 |
-
|
1729 |
-
/*
|
1730 |
-
* Listen to focus events on the filter and stop our interval when it happens.
|
1731 |
-
* This is to fix a bug that can cause the filter to gain focus every few seconds.
|
1732 |
-
*/
|
1733 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'filter:focused', this.filterFocused );
|
1734 |
-
},
|
1735 |
-
|
1736 |
-
/**
|
1737 |
-
* Handles closing our drawer
|
1738 |
-
* @since 3.0
|
1739 |
-
* @return void
|
1740 |
-
*/
|
1741 |
-
closeDrawer: function() {
|
1742 |
-
// Get our current domain.
|
1743 |
-
var currentDrawer = nfRadio.channel( 'app' ).request( 'get:currentDrawer' );
|
1744 |
-
if ( ! currentDrawer || this.maybePreventClose() ) {
|
1745 |
-
return false;
|
1746 |
-
}
|
1747 |
-
|
1748 |
-
// Triggers the before close drawer action on our current domain's drawer channel.
|
1749 |
-
nfRadio.channel( 'drawer-' + currentDrawer.get( 'id' ) ).trigger( 'before:closeDrawer' );
|
1750 |
-
/*
|
1751 |
-
* The 'before:closeDrawer' message is deprecated as of version 3.0 in favour of 'before:close'.
|
1752 |
-
* TODO: Remove this radio message in the future.
|
1753 |
-
*/
|
1754 |
-
nfRadio.channel( 'drawer' ).trigger( 'before:closeDrawer' );
|
1755 |
-
nfRadio.channel( 'drawer' ).trigger( 'before:close' );
|
1756 |
-
// Send a message to our drawer to empty its contents.
|
1757 |
-
nfRadio.channel( 'drawer' ).request( 'empty:drawerContent' );
|
1758 |
-
|
1759 |
-
// To close our drawer, we have to add our closed class to the builder and remove the opened class.
|
1760 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
1761 |
-
jQuery( builderEl ).addClass( 'nf-drawer-closed' ).removeClass( 'nf-drawer-opened' );
|
1762 |
-
jQuery( builderEl ).removeClass( 'disable-main' );
|
1763 |
-
|
1764 |
-
// Get the right position of our closed drawer. Should be container size in -px.
|
1765 |
-
var rightClosed = this.getClosedDrawerPos();
|
1766 |
-
|
1767 |
-
// Get our drawer element and give change the 'right' property to our closed position.
|
1768 |
-
var drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
1769 |
-
jQuery( drawerEl ).css( { 'right': rightClosed } );
|
1770 |
-
|
1771 |
-
// In order to access properties in 'this' context in our interval below, we have to set it here.
|
1772 |
-
var that = this;
|
1773 |
-
|
1774 |
-
/*
|
1775 |
-
* Since jQuery can't bind to a CSS change, we poll every .15 seconds to see if we've closed the drawer.
|
1776 |
-
*
|
1777 |
-
* Once our drawer is closed, we:
|
1778 |
-
* clear our interval
|
1779 |
-
* request that the app change it's current drawer to false
|
1780 |
-
* trigger a drawer closed message
|
1781 |
-
*/
|
1782 |
-
this.checkCloseDrawerPos = setInterval( function() {
|
1783 |
-
if ( rightClosed == jQuery( drawerEl ).css( 'right' ) ) {
|
1784 |
-
clearInterval( that.checkCloseDrawerPos );
|
1785 |
-
nfRadio.channel( 'app' ).request( 'update:currentDrawer', false );
|
1786 |
-
nfRadio.channel( 'drawer' ).trigger( 'closed' );
|
1787 |
-
/*
|
1788 |
-
* Reset the add new button z-index to 98.
|
1789 |
-
*/
|
1790 |
-
jQuery( '.nf-master-control' ).css( 'z-index', 98 );
|
1791 |
-
// jQuery( drawerEl ).scrollTop( 0 );
|
1792 |
-
}
|
1793 |
-
}, 150 );
|
1794 |
-
},
|
1795 |
-
|
1796 |
-
/**
|
1797 |
-
* Click handler for our 'open drawer' event.
|
1798 |
-
* @since 3.0
|
1799 |
-
* @param e jQuery event
|
1800 |
-
* @return void
|
1801 |
-
*/
|
1802 |
-
clickOpenDrawer: function( e ) {
|
1803 |
-
var drawerID = jQuery( e.target ).data( 'drawerid' );
|
1804 |
-
this.openDrawer( drawerID );
|
1805 |
-
},
|
1806 |
-
|
1807 |
-
/**
|
1808 |
-
* Open our drawer.
|
1809 |
-
*
|
1810 |
-
* @since 3.0
|
1811 |
-
* @param string drawerID ID of the drawer we want to open.
|
1812 |
-
* @param object data Optional data that we want to pass to the drawer.
|
1813 |
-
* @return void
|
1814 |
-
*/
|
1815 |
-
openDrawer: function( drawerID, data ) {
|
1816 |
-
if ( this.maybePreventClose() ) {
|
1817 |
-
return false;
|
1818 |
-
}
|
1819 |
-
|
1820 |
-
// If we haven't sent a data object, set the variable to an empty object.
|
1821 |
-
data = data || {};
|
1822 |
-
|
1823 |
-
/*
|
1824 |
-
* If we're dealing with something that has a model, set the proper active state.
|
1825 |
-
*
|
1826 |
-
* TODO: Make this more dynamic. I'm not sure that it fits in the drawer controller.
|
1827 |
-
*/
|
1828 |
-
if ( 'undefined' != typeof data.model ) {
|
1829 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
1830 |
-
var currentDomainID = currentDomain.get( 'id' );
|
1831 |
-
nfRadio.channel( currentDomainID ).request( 'clear:editActive' );
|
1832 |
-
data.model.set( 'editActive', true );
|
1833 |
-
this.dataModel = data.model;
|
1834 |
-
}
|
1835 |
-
|
1836 |
-
// Send out a message requesting our drawer view to load the content for our drawer ID.
|
1837 |
-
nfRadio.channel( 'drawer' ).request( 'load:drawerContent', drawerID, data );
|
1838 |
-
nfRadio.channel( 'drawer' ).trigger( 'before:open' );
|
1839 |
-
|
1840 |
-
// To open our drawer, we have to add our opened class to our builder element and remove the closed class.
|
1841 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
1842 |
-
jQuery( builderEl ).addClass( 'nf-drawer-opened' ).removeClass( 'nf-drawer-closed' );
|
1843 |
-
|
1844 |
-
// To open our drawer, we have to set the right position of our drawer to 0px.
|
1845 |
-
var drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
1846 |
-
jQuery( drawerEl ).css( { 'right': '0px' } );
|
1847 |
-
|
1848 |
-
// In order to access properties in 'this' context in our interval below, we have to set it here.
|
1849 |
-
var that = this;
|
1850 |
-
|
1851 |
-
/*
|
1852 |
-
* Since jQuery can't bind to a CSS change, we poll every .15 seconds to see if we've opened the drawer.
|
1853 |
-
*
|
1854 |
-
* Once our drawer is opened, we:
|
1855 |
-
* clear our interval
|
1856 |
-
* focus our filter
|
1857 |
-
* request that the app update its current drawer to the one we opened
|
1858 |
-
* trigger a drawer opened message
|
1859 |
-
*/
|
1860 |
-
this.hasFocus = false;
|
1861 |
-
|
1862 |
-
/*
|
1863 |
-
* Set our add new button z-index to 0;
|
1864 |
-
*/
|
1865 |
-
jQuery( '.nf-master-control' ).css( 'z-index', 0 );
|
1866 |
-
|
1867 |
-
this.checkOpenDrawerPos = setInterval( function() {
|
1868 |
-
if ( '0px' == jQuery( drawerEl ).css( 'right' ) ) {
|
1869 |
-
clearInterval( that.checkOpenDrawerPos );
|
1870 |
-
if ( ! that.hasFocus ) {
|
1871 |
-
that.focusFilter();
|
1872 |
-
that.hasFocus = true;
|
1873 |
-
nfRadio.channel( 'app' ).request( 'update:currentDrawer', drawerID );
|
1874 |
-
jQuery( drawerEl ).scrollTop( 0 );
|
1875 |
-
nfRadio.channel( 'drawer' ).trigger( 'opened' );
|
1876 |
-
}
|
1877 |
-
}
|
1878 |
-
}, 150 );
|
1879 |
-
},
|
1880 |
-
|
1881 |
-
/**
|
1882 |
-
* Toggle the drawer from half to full screen and vise-versa
|
1883 |
-
* @since 3.0
|
1884 |
-
* @return void
|
1885 |
-
*/
|
1886 |
-
toggleDrawerSize: function() {
|
1887 |
-
// Get our drawer element.
|
1888 |
-
var drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
1889 |
-
// toggle our drawer size class.
|
1890 |
-
jQuery( drawerEl ).toggleClass( 'nf-drawer-expand' );
|
1891 |
-
},
|
1892 |
-
|
1893 |
-
/**
|
1894 |
-
* Focus our filter
|
1895 |
-
* @since 3.0
|
1896 |
-
* @return void
|
1897 |
-
*/
|
1898 |
-
focusFilter: function() {
|
1899 |
-
// Get our filter element
|
1900 |
-
var filterEl = nfRadio.channel( 'drawer' ).request( 'get:filterEl' );
|
1901 |
-
// Focus
|
1902 |
-
jQuery( filterEl ).focus();
|
1903 |
-
},
|
1904 |
-
|
1905 |
-
/**
|
1906 |
-
* Get the CSS right position (in px) of the closed drawer element.
|
1907 |
-
* This is calculated by:
|
1908 |
-
* getting the width of the builder element
|
1909 |
-
* add 300 pixels
|
1910 |
-
* make it negative
|
1911 |
-
*
|
1912 |
-
* @since 3.0
|
1913 |
-
* @return void
|
1914 |
-
*/
|
1915 |
-
getClosedDrawerPos: function() {
|
1916 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
1917 |
-
var closedPos = jQuery( builderEl ).width() + 300;
|
1918 |
-
return '-' + closedPos + 'px';
|
1919 |
-
},
|
1920 |
-
|
1921 |
-
/**
|
1922 |
-
* Check to see if anything has registered a prevent close key.
|
1923 |
-
*
|
1924 |
-
* @since 3.0
|
1925 |
-
* @return boolean
|
1926 |
-
*/
|
1927 |
-
maybePreventClose: function() {
|
1928 |
-
if ( 0 == Object.keys( this.objPreventClose ).length ) {
|
1929 |
-
return false;
|
1930 |
-
} else {
|
1931 |
-
return true;
|
1932 |
-
}
|
1933 |
-
},
|
1934 |
-
|
1935 |
-
/**
|
1936 |
-
* Register a prevent close key.
|
1937 |
-
*
|
1938 |
-
* @since 3.0
|
1939 |
-
* @param string key unique id for our 'prevent close' setting.
|
1940 |
-
* @return void
|
1941 |
-
*/
|
1942 |
-
preventClose: function( key ) {
|
1943 |
-
this.objPreventClose[ key ] = true;
|
1944 |
-
/*
|
1945 |
-
* When we disable closing the drawer, add the disable class.
|
1946 |
-
*/
|
1947 |
-
// Get our current drawer.
|
1948 |
-
this.dataModel.set( 'drawerDisabled', true );
|
1949 |
-
},
|
1950 |
-
|
1951 |
-
/**
|
1952 |
-
* Remove a previously registered prevent close key.
|
1953 |
-
*
|
1954 |
-
* @since 3.0
|
1955 |
-
* @param string key unique id for our 'prevent close' setting.
|
1956 |
-
* @return void
|
1957 |
-
*/
|
1958 |
-
enableClose: function( key ) {
|
1959 |
-
delete this.objPreventClose[ key ];
|
1960 |
-
/*
|
1961 |
-
* When we remove all of our disables preventing closing the drawer, remove the disable class.
|
1962 |
-
*/
|
1963 |
-
if ( ! this.maybePreventClose() && 'undefined' != typeof this.dataModel ) {
|
1964 |
-
// Get our current drawer.
|
1965 |
-
this.dataModel.set( 'drawerDisabled', false );
|
1966 |
-
}
|
1967 |
-
},
|
1968 |
-
|
1969 |
-
/**
|
1970 |
-
* When we focus our filter, make sure that our open drawer interval is cleared.
|
1971 |
-
*
|
1972 |
-
* @since 3.0
|
1973 |
-
* @return void
|
1974 |
-
*/
|
1975 |
-
filterFocused: function() {
|
1976 |
-
clearInterval( this.checkOpenDrawerPos );
|
1977 |
-
},
|
1978 |
-
|
1979 |
-
getPreventClose: function() {
|
1980 |
-
return this.objPreventClose;
|
1981 |
-
}
|
1982 |
-
});
|
1983 |
-
|
1984 |
-
return controller;
|
1985 |
-
} );
|
1986 |
-
/**
|
1987 |
-
* Default drawer header.
|
1988 |
-
*
|
1989 |
-
* Includes our filter/search and 'Done' button.
|
1990 |
-
*
|
1991 |
-
* @package Ninja Forms builder
|
1992 |
-
* @subpackage App
|
1993 |
-
* @copyright (c) 2015 WP Ninjas
|
1994 |
-
* @since 3.0
|
1995 |
-
*/
|
1996 |
-
define( 'views/app/drawer/headerDefault',[], function() {
|
1997 |
-
var view = Marionette.ItemView.extend({
|
1998 |
-
tagName: 'div',
|
1999 |
-
template: '#tmpl-nf-drawer-header-default',
|
2000 |
-
|
2001 |
-
initialize: function() {
|
2002 |
-
if ( this.model ) {
|
2003 |
-
// Listen for our drawer being disabled.
|
2004 |
-
this.model.on( 'change:drawerDisabled', this.render, this );
|
2005 |
-
}
|
2006 |
-
},
|
2007 |
-
|
2008 |
-
/**
|
2009 |
-
* When we render, remove the extra div added by backbone and add listeners related to our filter.
|
2010 |
-
*
|
2011 |
-
* @since 3.0
|
2012 |
-
* @return void
|
2013 |
-
*/
|
2014 |
-
onRender: function() {
|
2015 |
-
// Remove extra wrapping div.
|
2016 |
-
this.$el = this.$el.children();
|
2017 |
-
this.$el.unwrap();
|
2018 |
-
this.setElement( this.$el );
|
2019 |
-
// Respond to requests related to our filter.
|
2020 |
-
nfRadio.channel( 'drawer' ).reply( 'clear:filter', this.clearFilter, this );
|
2021 |
-
nfRadio.channel( 'drawer' ).reply( 'blur:filter', this.blurFilter, this );
|
2022 |
-
nfRadio.channel( 'drawer' ).reply( 'get:filterEl', this.getEl, this );
|
2023 |
-
},
|
2024 |
-
|
2025 |
-
onBeforeDestroy: function() {
|
2026 |
-
if ( this.model ) {
|
2027 |
-
this.model.off( 'change:drawerDisabled', this.render );
|
2028 |
-
}
|
2029 |
-
},
|
2030 |
-
|
2031 |
-
events: {
|
2032 |
-
'keyup .nf-filter' : 'maybeChangeFilter',
|
2033 |
-
'input .nf-filter' : 'changeFilter',
|
2034 |
-
'focus input' : 'getFocus'
|
2035 |
-
},
|
2036 |
-
|
2037 |
-
/**
|
2038 |
-
* When the filter text is changed, trigger an event on our current drawer.
|
2039 |
-
* This lets us keep the logic separate from the click event and view.
|
2040 |
-
*
|
2041 |
-
* @since 3.0
|
2042 |
-
* @param Object e event
|
2043 |
-
* @return void
|
2044 |
-
*/
|
2045 |
-
changeFilter: function( e ) {
|
2046 |
-
var currentDrawer = nfRadio.channel( 'app' ).request( 'get:currentDrawer' );
|
2047 |
-
nfRadio.channel( 'drawer-' + currentDrawer.get( 'id' ) ).trigger( 'change:filter', e.target.value, e );
|
2048 |
-
},
|
2049 |
-
|
2050 |
-
/**
|
2051 |
-
* The user pressed a key. If it's the enter key, then run the change filter function.
|
2052 |
-
*
|
2053 |
-
* @since 3.0
|
2054 |
-
* @param Object e event
|
2055 |
-
* @return void
|
2056 |
-
*/
|
2057 |
-
maybeChangeFilter: function( e ) {
|
2058 |
-
if ( 13 == e.keyCode ) {
|
2059 |
-
e.addObject = true;
|
2060 |
-
this.changeFilter( e );
|
2061 |
-
}
|
2062 |
-
},
|
2063 |
-
|
2064 |
-
/**
|
2065 |
-
* Clear our filter.
|
2066 |
-
*
|
2067 |
-
* This triggers 'input' on the field, which will trigger a change if necessary.
|
2068 |
-
*
|
2069 |
-
* @since 3.0
|
2070 |
-
* @return void
|
2071 |
-
*/
|
2072 |
-
clearFilter: function() {
|
2073 |
-
var filterEl = jQuery( this.el ).find( '.nf-filter' );
|
2074 |
-
if ( '' != jQuery.trim( filterEl.val() ) ) {
|
2075 |
-
filterEl.val('');
|
2076 |
-
filterEl.trigger( 'input' );
|
2077 |
-
filterEl.focus();
|
2078 |
-
}
|
2079 |
-
},
|
2080 |
-
|
2081 |
-
/**
|
2082 |
-
* Fire the 'blur' event on our filter. Used to force a change event when the user tabs.
|
2083 |
-
*
|
2084 |
-
* @since 3.0
|
2085 |
-
* @return void
|
2086 |
-
*/
|
2087 |
-
blurFilter: function() {
|
2088 |
-
jQuery( this.el ).find( '.nf-filter' ).blur();
|
2089 |
-
},
|
2090 |
-
|
2091 |
-
/**
|
2092 |
-
* Return our filter dom element.
|
2093 |
-
*
|
2094 |
-
* @since 3.0
|
2095 |
-
* @return Object
|
2096 |
-
*/
|
2097 |
-
getEl: function() {
|
2098 |
-
return jQuery( this.el ).find( '.nf-filter' );
|
2099 |
-
},
|
2100 |
-
|
2101 |
-
getFocus: function() {
|
2102 |
-
nfRadio.channel( 'drawer' ).trigger( 'filter:focused' );
|
2103 |
-
},
|
2104 |
-
|
2105 |
-
templateHelpers: function() {
|
2106 |
-
return {
|
2107 |
-
renderDisabled: function() {
|
2108 |
-
// Get our current domain.
|
2109 |
-
if ( this.drawerDisabled ) {
|
2110 |
-
return 'disabled';
|
2111 |
-
} else {
|
2112 |
-
return '';
|
2113 |
-
}
|
2114 |
-
}
|
2115 |
-
}
|
2116 |
-
}
|
2117 |
-
});
|
2118 |
-
|
2119 |
-
return view;
|
2120 |
-
} );
|
2121 |
-
/**
|
2122 |
-
* Default drawer footer
|
2123 |
-
*
|
2124 |
-
* @package Ninja Forms builder
|
2125 |
-
* @subpackage App
|
2126 |
-
* @copyright (c) 2015 WP Ninjas
|
2127 |
-
* @since 3.0
|
2128 |
-
*/
|
2129 |
-
define( 'views/app/drawer/footerDefault',[], function() {
|
2130 |
-
var view = Marionette.ItemView.extend({
|
2131 |
-
tagName: 'div',
|
2132 |
-
template: '#tmpl-nf-empty'
|
2133 |
-
});
|
2134 |
-
|
2135 |
-
return view;
|
2136 |
-
} );
|
2137 |
-
define( 'models/app/drawerModel',['views/app/drawer/headerDefault', 'views/app/drawer/footerDefault'], function( defaultHeaderView, defaultFooterView ) {
|
2138 |
-
var model = Backbone.Model.extend( {
|
2139 |
-
defaults: {
|
2140 |
-
getHeaderView: function( data ) {
|
2141 |
-
return new defaultHeaderView( data );
|
2142 |
-
},
|
2143 |
-
|
2144 |
-
getFooterView: function( data ) {
|
2145 |
-
return new defaultFooterView( data );
|
2146 |
-
}
|
2147 |
-
}
|
2148 |
-
} );
|
2149 |
-
|
2150 |
-
return model;
|
2151 |
-
} );
|
2152 |
-
/**
|
2153 |
-
* Collection that holds all of our drawer models.
|
2154 |
-
*
|
2155 |
-
* @package Ninja Forms builder
|
2156 |
-
* @subpackage Fields
|
2157 |
-
* @copyright (c) 2015 WP Ninjas
|
2158 |
-
* @since 3.0
|
2159 |
-
*/
|
2160 |
-
define( 'models/app/drawerCollection',['models/app/drawerModel'], function( drawerModel ) {
|
2161 |
-
var collection = Backbone.Collection.extend( {
|
2162 |
-
model: drawerModel
|
2163 |
-
} );
|
2164 |
-
return collection;
|
2165 |
-
} );
|
2166 |
-
define( 'views/fields/drawer/stagedField',[], function() {
|
2167 |
-
var view = Marionette.ItemView.extend({
|
2168 |
-
tagName: 'div',
|
2169 |
-
template: '#tmpl-nf-drawer-staged-field',
|
2170 |
-
|
2171 |
-
onRender: function() {
|
2172 |
-
this.$el = this.$el.children();
|
2173 |
-
this.$el.unwrap();
|
2174 |
-
this.setElement( this.$el );
|
2175 |
-
},
|
2176 |
-
|
2177 |
-
events: {
|
2178 |
-
'click .dashicons-dismiss': 'removeStagedField'
|
2179 |
-
},
|
2180 |
-
|
2181 |
-
removeStagedField: function( el ) {
|
2182 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'click:removeStagedField', el, this.model );
|
2183 |
-
}
|
2184 |
-
});
|
2185 |
-
|
2186 |
-
return view;
|
2187 |
-
} );
|
2188 |
-
|
2189 |
-
define( 'views/fields/drawer/stagingEmpty',[], function() {
|
2190 |
-
var view = Marionette.ItemView.extend({
|
2191 |
-
tagName: 'div',
|
2192 |
-
template: '#tmpl-nf-drawer-staged-fields-empty',
|
2193 |
-
|
2194 |
-
onRender: function() {
|
2195 |
-
this.$el = this.$el.children();
|
2196 |
-
this.$el.unwrap();
|
2197 |
-
this.setElement( this.$el );
|
2198 |
-
}
|
2199 |
-
});
|
2200 |
-
|
2201 |
-
return view;
|
2202 |
-
} );
|
2203 |
-
define( 'views/fields/drawer/stagingCollection',['views/fields/drawer/stagedField', 'views/fields/drawer/stagingEmpty'], function( stagedFieldView, stagedFieldsEmptyView ) {
|
2204 |
-
var view = Marionette.CollectionView.extend( {
|
2205 |
-
tagName: 'div',
|
2206 |
-
childView: stagedFieldView,
|
2207 |
-
emptyView: stagedFieldsEmptyView,
|
2208 |
-
|
2209 |
-
activeClass: 'nf-staged-fields-active', // CSS Class for showing the reservoir.
|
2210 |
-
|
2211 |
-
initialize: function() {
|
2212 |
-
nfRadio.channel( 'app' ).reply( 'get:stagedFieldsEl', this.getStagedFieldsEl, this );
|
2213 |
-
},
|
2214 |
-
|
2215 |
-
onShow: function() {
|
2216 |
-
|
2217 |
-
this.$el = jQuery( this.el ).parent();
|
2218 |
-
jQuery( this.$el ).find( 'span:first' ).unwrap();
|
2219 |
-
this.setElement( this.$el );
|
2220 |
-
|
2221 |
-
var that = this;
|
2222 |
-
|
2223 |
-
jQuery( this.el ).sortable( {
|
2224 |
-
placeholder: 'nf-staged-fields-sortable-placeholder',
|
2225 |
-
helper: 'clone',
|
2226 |
-
tolerance: 'pointer',
|
2227 |
-
over: function( e, ui ) {
|
2228 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'over:stagedFields', e, ui );
|
2229 |
-
},
|
2230 |
-
|
2231 |
-
out: function( e, ui ) {
|
2232 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'out:stagedFields', ui );
|
2233 |
-
},
|
2234 |
-
|
2235 |
-
receive: function( e, ui ) {
|
2236 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'receive:stagedFields', ui );
|
2237 |
-
},
|
2238 |
-
|
2239 |
-
update: function( e, ui ) {
|
2240 |
-
nfRadio.channel( 'fields' ).request( 'sort:staging' );
|
2241 |
-
},
|
2242 |
-
|
2243 |
-
start: function( e, ui ) {
|
2244 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'start:stagedFields', ui );
|
2245 |
-
|
2246 |
-
},
|
2247 |
-
|
2248 |
-
stop: function( e, ui ) {
|
2249 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'stop:stagedFields', ui );
|
2250 |
-
}
|
2251 |
-
} );
|
2252 |
-
|
2253 |
-
jQuery( this.el ).parent().draggable( {
|
2254 |
-
opacity: 0.9,
|
2255 |
-
connectToSortable: '.nf-field-type-droppable',
|
2256 |
-
appendTo: '#nf-main',
|
2257 |
-
refreshPositions: true,
|
2258 |
-
grid: [ 3, 3 ],
|
2259 |
-
tolerance: 'pointer',
|
2260 |
-
|
2261 |
-
helper: function( e ) {
|
2262 |
-
var width = jQuery( e.target ).parent().width();
|
2263 |
-
var height = jQuery( e.target ).parent().height();
|
2264 |
-
var element = jQuery( e.target ).parent().clone();
|
2265 |
-
var left = width / 4;
|
2266 |
-
var top = height / 2;
|
2267 |
-
jQuery( this ).draggable( 'option', 'cursorAt', { top: top, left: left } );
|
2268 |
-
jQuery( element ).css( 'z-index', 1000 );
|
2269 |
-
return element;
|
2270 |
-
},
|
2271 |
-
|
2272 |
-
start: function( e, ui ) {
|
2273 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'startDrag:fieldStaging', this, ui );
|
2274 |
-
},
|
2275 |
-
stop: function( e, ui ) {
|
2276 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'stopDrag:fieldStaging', this, ui );
|
2277 |
-
}
|
2278 |
-
} );
|
2279 |
-
},
|
2280 |
-
|
2281 |
-
getStagedFieldsEl: function() {
|
2282 |
-
return jQuery( this.el );
|
2283 |
-
},
|
2284 |
-
|
2285 |
-
onAddChild: function() {
|
2286 |
-
jQuery( this.el ).addClass( this.activeClass );
|
2287 |
-
},
|
2288 |
-
|
2289 |
-
onRemoveChild: function() {
|
2290 |
-
if( this.hasStagedFields() ) return;
|
2291 |
-
jQuery( this.el ).removeClass( this.activeClass );
|
2292 |
-
},
|
2293 |
-
|
2294 |
-
hasStagedFields: function() {
|
2295 |
-
return 0 != this.collection.length;
|
2296 |
-
}
|
2297 |
-
|
2298 |
-
} );
|
2299 |
-
|
2300 |
-
return view;
|
2301 |
-
} );
|
2302 |
-
/**
|
2303 |
-
* Model for our staged field.
|
2304 |
-
*
|
2305 |
-
* @package Ninja Forms builder
|
2306 |
-
* @subpackage Fields
|
2307 |
-
* @copyright (c) 2015 WP Ninjas
|
2308 |
-
* @since 3.0
|
2309 |
-
*/
|
2310 |
-
define( 'models/fields/stagingModel',[], function() {
|
2311 |
-
var model = Backbone.Model.extend( {
|
2312 |
-
} );
|
2313 |
-
|
2314 |
-
return model;
|
2315 |
-
} );
|
2316 |
-
/**
|
2317 |
-
* Collection of staged fields.
|
2318 |
-
*
|
2319 |
-
* @package Ninja Forms builder
|
2320 |
-
* @subpackage Fields
|
2321 |
-
* @copyright (c) 2015 WP Ninjas
|
2322 |
-
* @since 3.0
|
2323 |
-
*/
|
2324 |
-
define( 'models/fields/stagingCollection',['models/fields/stagingModel'], function( stagingModel ) {
|
2325 |
-
var collection = Backbone.Collection.extend( {
|
2326 |
-
model: stagingModel,
|
2327 |
-
comparator: 'order'
|
2328 |
-
} );
|
2329 |
-
return collection;
|
2330 |
-
} );
|
2331 |
-
define( 'views/fields/drawer/typeSection',[], function() {
|
2332 |
-
var view = Marionette.ItemView.extend({
|
2333 |
-
tagName: 'div',
|
2334 |
-
template: '#tmpl-nf-drawer-field-type-section',
|
2335 |
-
|
2336 |
-
initialize: function() {
|
2337 |
-
_.bindAll( this, 'render' );
|
2338 |
-
nfRadio.channel( 'fields' ).reply( 'get:typeSection', this.getTypeSection, this );
|
2339 |
-
},
|
2340 |
-
|
2341 |
-
onRender: function() {
|
2342 |
-
this.$el = this.$el.children();
|
2343 |
-
this.$el.unwrap();
|
2344 |
-
this.setElement( this.$el );
|
2345 |
-
|
2346 |
-
this.dragging = false;
|
2347 |
-
var that = this;
|
2348 |
-
/*
|
2349 |
-
* If we're on a mobile device, we don't want to enable dragging for our field type buttons.
|
2350 |
-
*/
|
2351 |
-
if ( ! nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
2352 |
-
jQuery( this.el ).find( 'div.nf-field-type-draggable' ).draggable( {
|
2353 |
-
opacity: 0.9,
|
2354 |
-
tolerance: 'pointer',
|
2355 |
-
connectToSortable: '.nf-field-type-droppable',
|
2356 |
-
refreshPositions: true,
|
2357 |
-
grid: [ 5, 5 ],
|
2358 |
-
appendTo: '#nf-builder',
|
2359 |
-
|
2360 |
-
helper: function( e ) {
|
2361 |
-
var width = jQuery( e.target ).parent().width();
|
2362 |
-
var height = jQuery( e.target ).parent().height();
|
2363 |
-
var element = jQuery( e.target ).parent().clone();
|
2364 |
-
var left = width / 4;
|
2365 |
-
var top = height / 2;
|
2366 |
-
jQuery( this ).draggable( 'option', 'cursorAt', { top: top, left: left } );
|
2367 |
-
jQuery( element ).css( 'z-index', 1000 );
|
2368 |
-
return element;
|
2369 |
-
},
|
2370 |
-
|
2371 |
-
start: function( e, ui ) {
|
2372 |
-
that.dragging = true;
|
2373 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'startDrag:type', this, ui );
|
2374 |
-
},
|
2375 |
-
|
2376 |
-
stop: function( e, ui ) {
|
2377 |
-
that.dragging = false;
|
2378 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'stopDrag:type', this, ui );
|
2379 |
-
},
|
2380 |
-
|
2381 |
-
drag: function(e, ui) {
|
2382 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'drag:type', this, ui, e );
|
2383 |
-
}
|
2384 |
-
|
2385 |
-
} ).disableSelection();
|
2386 |
-
|
2387 |
-
jQuery( this.el ).find( '.nf-item' ).focus( function() {
|
2388 |
-
jQuery( this ).addClass( 'active' );
|
2389 |
-
} ).blur( function() {
|
2390 |
-
jQuery( this ).removeClass( 'active' );
|
2391 |
-
} );
|
2392 |
-
}
|
2393 |
-
},
|
2394 |
-
|
2395 |
-
events: {
|
2396 |
-
'click .nf-item': 'clickFieldType',
|
2397 |
-
'keydown .nf-item': 'maybeClickFieldType',
|
2398 |
-
'mousedown .nf-item': 'mousedownFieldType'
|
2399 |
-
},
|
2400 |
-
|
2401 |
-
clickFieldType: function( e ) {
|
2402 |
-
if ( ! this.dragging ) {
|
2403 |
-
nfRadio.channel( 'drawer' ).trigger( 'click:fieldType', e );
|
2404 |
-
}
|
2405 |
-
},
|
2406 |
-
|
2407 |
-
mousedownFieldType: function( e ) {
|
2408 |
-
jQuery( e.target).addClass( 'clicked' );
|
2409 |
-
setTimeout( function() {
|
2410 |
-
jQuery( e.target ).removeClass( 'clicked' );
|
2411 |
-
}, 1500 );
|
2412 |
-
},
|
2413 |
-
|
2414 |
-
maybeClickFieldType: function( e ) {
|
2415 |
-
if ( 13 == e.keyCode ) {
|
2416 |
-
this.clickFieldType( e );
|
2417 |
-
nfRadio.channel( 'drawer' ).request( 'clear:filter' );
|
2418 |
-
}
|
2419 |
-
},
|
2420 |
-
|
2421 |
-
templateHelpers: function() {
|
2422 |
-
return {
|
2423 |
-
renderFieldTypes: function() {
|
2424 |
-
var html = document.createElement( 'span' );
|
2425 |
-
var that = this;
|
2426 |
-
_.each( this.fieldTypes, function( id ) {
|
2427 |
-
var type = nfRadio.channel( 'fields' ).request( 'get:type', id );
|
2428 |
-
var nicename = type.get( 'nicename' );
|
2429 |
-
var icon = type.get( 'icon' );
|
2430 |
-
var renderType = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-drawer-field-type-button' );
|
2431 |
-
var templateHTML = renderType( { id: id, nicename: nicename, icon: icon, type: type, savedField: that.savedField } );
|
2432 |
-
var htmlFragments = document.createRange().createContextualFragment( templateHTML );
|
2433 |
-
html.appendChild( htmlFragments );
|
2434 |
-
} );
|
2435 |
-
return html.innerHTML;
|
2436 |
-
},
|
2437 |
-
|
2438 |
-
savedField: function() {
|
2439 |
-
if( this.type.get( 'savedField' ) ) {
|
2440 |
-
return 'nf-saved';
|
2441 |
-
} else {
|
2442 |
-
return '';
|
2443 |
-
}
|
2444 |
-
}
|
2445 |
-
}
|
2446 |
-
},
|
2447 |
-
|
2448 |
-
getTypeSection: function() {
|
2449 |
-
return this.el;
|
2450 |
-
}
|
2451 |
-
});
|
2452 |
-
|
2453 |
-
return view;
|
2454 |
-
} );
|
2455 |
-
|
2456 |
-
define( 'views/fields/drawer/typeSectionCollection',['views/fields/drawer/typeSection'], function( fieldTypeSectionView ) {
|
2457 |
-
var view = Marionette.CollectionView.extend( {
|
2458 |
-
tagName: 'div',
|
2459 |
-
childView: fieldTypeSectionView,
|
2460 |
-
|
2461 |
-
onShow: function() {
|
2462 |
-
jQuery( this.el ).find( '.nf-settings' ).unwrap();
|
2463 |
-
nfRadio.channel( 'fields' ).request( 'clear:editActive' );
|
2464 |
-
}
|
2465 |
-
} );
|
2466 |
-
|
2467 |
-
return view;
|
2468 |
-
} );
|
2469 |
-
define( 'views/fields/drawer/addField',['views/fields/drawer/stagingCollection', 'models/fields/stagingCollection', 'views/fields/drawer/typeSectionCollection'], function( drawerStagingView, StagingCollection, fieldTypeSectionCollectionView ) {
|
2470 |
-
|
2471 |
-
var view = Marionette.LayoutView.extend( {
|
2472 |
-
template: '#tmpl-nf-drawer-content-add-field',
|
2473 |
-
|
2474 |
-
regions: {
|
2475 |
-
staging: '#nf-drawer-staging .nf-reservoir',
|
2476 |
-
primary: '#nf-drawer-primary',
|
2477 |
-
secondary: '#nf-drawer-secondary'
|
2478 |
-
},
|
2479 |
-
|
2480 |
-
initialize: function() {
|
2481 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'filter:fieldTypes', this.filterFieldTypes );
|
2482 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'clear:filter', this.removeFieldTypeFilter );
|
2483 |
-
|
2484 |
-
this.savedCollection = nfRadio.channel( 'fields' ).request( 'get:savedFields' );
|
2485 |
-
this.primaryCollection = this.savedCollection;
|
2486 |
-
|
2487 |
-
this.fieldTypeSectionCollection = nfRadio.channel( 'fields' ).request( 'get:typeSections' );
|
2488 |
-
this.secondaryCollection = this.fieldTypeSectionCollection;
|
2489 |
-
|
2490 |
-
},
|
2491 |
-
|
2492 |
-
onShow: function() {
|
2493 |
-
var stagingCollection = nfRadio.channel( 'fields' ).request( 'get:staging' );
|
2494 |
-
this.staging.show( new drawerStagingView( { collection: stagingCollection } ) );
|
2495 |
-
|
2496 |
-
this.primary.show( new fieldTypeSectionCollectionView( { collection: this.primaryCollection } ) );
|
2497 |
-
this.secondary.show( new fieldTypeSectionCollectionView( { collection: this.secondaryCollection } ) );
|
2498 |
-
},
|
2499 |
-
|
2500 |
-
getEl: function() {
|
2501 |
-
return jQuery( this.el ).parent();
|
2502 |
-
},
|
2503 |
-
|
2504 |
-
filterFieldTypes: function( filteredSectionCollection ) {
|
2505 |
-
this.primary.reset();
|
2506 |
-
this.secondary.reset();
|
2507 |
-
this.filteredSectionCollection = filteredSectionCollection;
|
2508 |
-
this.primary.show( new fieldTypeSectionCollectionView( { collection: this.filteredSectionCollection } ) );
|
2509 |
-
},
|
2510 |
-
|
2511 |
-
removeFieldTypeFilter: function () {
|
2512 |
-
this.primary.show( new fieldTypeSectionCollectionView( { collection: this.savedCollection } ) );
|
2513 |
-
this.secondary.show( new fieldTypeSectionCollectionView( { collection: this.fieldTypeSectionCollection } ) );
|
2514 |
-
}
|
2515 |
-
|
2516 |
-
} );
|
2517 |
-
|
2518 |
-
return view;
|
2519 |
-
} );
|
2520 |
-
define( 'views/app/drawer/itemSettingCollection',[], function() {
|
2521 |
-
var view = Marionette.CollectionView.extend( {
|
2522 |
-
tagName: 'div',
|
2523 |
-
|
2524 |
-
initialize: function( data ) {
|
2525 |
-
this.childViewOptions = { dataModel: data.dataModel };
|
2526 |
-
},
|
2527 |
-
|
2528 |
-
getChildView: function( model ) {
|
2529 |
-
return nfRadio.channel( 'app' ).request( 'get:settingChildView', model );
|
2530 |
-
}
|
2531 |
-
} );
|
2532 |
-
|
2533 |
-
return view;
|
2534 |
-
} );
|
2535 |
-
define( 'views/app/drawer/itemSettingGroup',['views/app/drawer/itemSettingCollection'], function( itemSettingCollectionView ) {
|
2536 |
-
var view = Marionette.LayoutView.extend({
|
2537 |
-
tagName: 'div',
|
2538 |
-
template: '#tmpl-nf-drawer-content-edit-field-setting-group',
|
2539 |
-
|
2540 |
-
regions: {
|
2541 |
-
settings: '.nf-field-settings'
|
2542 |
-
},
|
2543 |
-
|
2544 |
-
initialize: function( data ) {
|
2545 |
-
this.model.on( 'change', this.render, this );
|
2546 |
-
this.dataModel = data.dataModel;
|
2547 |
-
},
|
2548 |
-
|
2549 |
-
onBeforeDestroy: function() {
|
2550 |
-
this.model.off( 'change', this.render );
|
2551 |
-
},
|
2552 |
-
|
2553 |
-
onRender: function() {
|
2554 |
-
|
2555 |
-
this.settings.show( new itemSettingCollectionView( { collection: this.model.get( 'settings' ), dataModel: this.dataModel } ) );
|
2556 |
-
|
2557 |
-
if(!nfAdmin.devMode) {
|
2558 |
-
// Only check if not for calculations.
|
2559 |
-
if(0 == this.$el.find('.calculations').length){
|
2560 |
-
var visibleSettings = false;
|
2561 |
-
this.$el.find('.nf-setting').each(function(index, setting) {
|
2562 |
-
if( 'none' !== setting.style.display ){
|
2563 |
-
visibleSettings = true;
|
2564 |
-
return false; //Exit jQuery each loop.
|
2565 |
-
}
|
2566 |
-
});
|
2567 |
-
if(!visibleSettings) {
|
2568 |
-
this.$el.hide();
|
2569 |
-
}
|
2570 |
-
}
|
2571 |
-
}
|
2572 |
-
|
2573 |
-
if ( this.model.get( 'display' ) ) {
|
2574 |
-
// ...
|
2575 |
-
} else {
|
2576 |
-
this.settings.empty();
|
2577 |
-
}
|
2578 |
-
|
2579 |
-
nfRadio.channel( 'drawer' ).trigger( 'render:settingGroup', this );
|
2580 |
-
},
|
2581 |
-
|
2582 |
-
events: {
|
2583 |
-
'click .toggle': 'clickToggleGroup'
|
2584 |
-
},
|
2585 |
-
|
2586 |
-
clickToggleGroup: function( e ) {
|
2587 |
-
nfRadio.channel( 'drawer' ).trigger( 'click:toggleSettingGroup', e, this.model );
|
2588 |
-
},
|
2589 |
-
|
2590 |
-
templateHelpers: function() {
|
2591 |
-
return {
|
2592 |
-
renderLabel: function() {
|
2593 |
-
if ( '' != this.label ) {
|
2594 |
-
var groupLabel = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-drawer-content-edit-setting-group-label' );
|
2595 |
-
return groupLabel( this );
|
2596 |
-
} else {
|
2597 |
-
return '';
|
2598 |
-
}
|
2599 |
-
},
|
2600 |
-
|
2601 |
-
renderArrowDir: function() {
|
2602 |
-
if ( this.display ) {
|
2603 |
-
return 'down';
|
2604 |
-
} else {
|
2605 |
-
return 'right';
|
2606 |
-
}
|
2607 |
-
}
|
2608 |
-
}
|
2609 |
-
}
|
2610 |
-
});
|
2611 |
-
|
2612 |
-
return view;
|
2613 |
-
} );
|
2614 |
-
define( 'views/app/drawer/itemSettingGroupCollection',['views/app/drawer/itemSettingGroup'], function( itemSettingGroupView ) {
|
2615 |
-
var view = Marionette.CollectionView.extend( {
|
2616 |
-
tagName: 'div',
|
2617 |
-
childView: itemSettingGroupView,
|
2618 |
-
|
2619 |
-
initialize: function( data ) {
|
2620 |
-
this.childViewOptions = { dataModel: data.dataModel };
|
2621 |
-
}
|
2622 |
-
} );
|
2623 |
-
|
2624 |
-
return view;
|
2625 |
-
} );
|
2626 |
-
define( 'views/app/drawer/editSettings',['views/app/drawer/itemSettingGroupCollection'], function( itemSettingGroupCollectionView ) {
|
2627 |
-
var view = Marionette.LayoutView.extend({
|
2628 |
-
tagName: 'div',
|
2629 |
-
template: '#tmpl-nf-drawer-content-edit-settings',
|
2630 |
-
|
2631 |
-
regions: {
|
2632 |
-
settingTitle: '.nf-setting-title',
|
2633 |
-
settingGroups: '.nf-setting-groups'
|
2634 |
-
},
|
2635 |
-
|
2636 |
-
initialize: function( data ) {
|
2637 |
-
this.dataModel = data.model;
|
2638 |
-
this.groupCollection = data.groupCollection;
|
2639 |
-
},
|
2640 |
-
|
2641 |
-
onRender: function() {
|
2642 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
2643 |
-
var titleView = currentDomain.get( 'getSettingsTitleView' ).call( currentDomain, { model: this.model } );
|
2644 |
-
|
2645 |
-
this.settingTitle.show( titleView );
|
2646 |
-
this.settingGroups.show( new itemSettingGroupCollectionView( { collection: this.groupCollection, dataModel: this.dataModel } ) );
|
2647 |
-
},
|
2648 |
-
|
2649 |
-
templateHelpers: function () {
|
2650 |
-
return {
|
2651 |
-
maybeRenderTitle: function() {
|
2652 |
-
if ( 'undefined' !== typeof this.type ) {
|
2653 |
-
var title = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-drawer-content-edit-settings-title' );
|
2654 |
-
return title( this );
|
2655 |
-
} else {
|
2656 |
-
return '';
|
2657 |
-
}
|
2658 |
-
},
|
2659 |
-
|
2660 |
-
renderTypeNicename: function() {
|
2661 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
2662 |
-
var domainID = currentDomain.get( 'id' );
|
2663 |
-
var type = nfRadio.channel( domainID ).request( 'get:type', this.type );
|
2664 |
-
return type.get( 'nicename' );
|
2665 |
-
},
|
2666 |
-
};
|
2667 |
-
},
|
2668 |
-
});
|
2669 |
-
|
2670 |
-
return view;
|
2671 |
-
} );
|
2672 |
-
/**
|
2673 |
-
* Edit Settings drawer header.
|
2674 |
-
*
|
2675 |
-
* Includes our 'Done' button.
|
2676 |
-
*
|
2677 |
-
* @package Ninja Forms builder
|
2678 |
-
* @subpackage App
|
2679 |
-
* @copyright (c) 2015 WP Ninjas
|
2680 |
-
* @since 3.0
|
2681 |
-
*/
|
2682 |
-
define( 'views/app/drawer/headerEditSettings',[], function() {
|
2683 |
-
var view = Marionette.ItemView.extend({
|
2684 |
-
tagName: 'div',
|
2685 |
-
template: '#tmpl-nf-drawer-header-edit-settings',
|
2686 |
-
|
2687 |
-
initialize: function() {
|
2688 |
-
if ( this.model ) {
|
2689 |
-
// Listen for our drawer being disabled.
|
2690 |
-
this.model.on( 'change:drawerDisabled', this.render, this );
|
2691 |
-
}
|
2692 |
-
},
|
2693 |
-
|
2694 |
-
onBeforeDestroy: function() {
|
2695 |
-
if ( this.model ) {
|
2696 |
-
this.model.off( 'change:drawerDisabled', this.render );
|
2697 |
-
}
|
2698 |
-
},
|
2699 |
-
|
2700 |
-
templateHelpers: function() {
|
2701 |
-
return {
|
2702 |
-
renderDisabled: function() {
|
2703 |
-
// Get our current domain.
|
2704 |
-
if ( this.drawerDisabled ) {
|
2705 |
-
return 'disabled';
|
2706 |
-
} else {
|
2707 |
-
return '';
|
2708 |
-
}
|
2709 |
-
}
|
2710 |
-
}
|
2711 |
-
}
|
2712 |
-
});
|
2713 |
-
|
2714 |
-
return view;
|
2715 |
-
} );
|
2716 |
-
/**
|
2717 |
-
* Button to add an action to the form.
|
2718 |
-
*
|
2719 |
-
* TODO: make dynamic
|
2720 |
-
*
|
2721 |
-
* @package Ninja Forms builder
|
2722 |
-
* @subpackage Actions
|
2723 |
-
* @copyright (c) 2015 WP Ninjas
|
2724 |
-
* @since 3.0
|
2725 |
-
*/
|
2726 |
-
define( 'views/actions/drawer/typeButton',[], function() {
|
2727 |
-
var view = Marionette.ItemView.extend({
|
2728 |
-
tagName: 'div',
|
2729 |
-
template: '#tmpl-nf-drawer-action-type-button',
|
2730 |
-
|
2731 |
-
onRender: function() {
|
2732 |
-
|
2733 |
-
jQuery( this.el ).disableSelection();
|
2734 |
-
|
2735 |
-
if ( 'installed' == this.model.get( 'section') ) {
|
2736 |
-
var that = this;
|
2737 |
-
jQuery( this.el ).draggable( {
|
2738 |
-
opacity: 0.9,
|
2739 |
-
tolerance: 'intersect',
|
2740 |
-
scroll: false,
|
2741 |
-
helper: 'clone',
|
2742 |
-
|
2743 |
-
start: function( e, ui ) {
|
2744 |
-
that.dragging = true;
|
2745 |
-
nfRadio.channel( 'drawer-addAction' ).trigger( 'startDrag:type', this, ui );
|
2746 |
-
},
|
2747 |
-
|
2748 |
-
stop: function( e, ui ) {
|
2749 |
-
that.dragging = false;
|
2750 |
-
nfRadio.channel( 'drawer-addAction' ).trigger( 'stopDrag:type', this, ui );
|
2751 |
-
}
|
2752 |
-
|
2753 |
-
} );
|
2754 |
-
}
|
2755 |
-
|
2756 |
-
},
|
2757 |
-
|
2758 |
-
events: {
|
2759 |
-
'click .nf-item': 'clickAddAction'
|
2760 |
-
},
|
2761 |
-
|
2762 |
-
clickAddAction: function( e ) {
|
2763 |
-
if ( ! this.dragging ) {
|
2764 |
-
if ( 'installed' == this.model.get( 'section' ) ) { // Is this an installed action?
|
2765 |
-
nfRadio.channel( 'actions' ).trigger( 'click:addAction', this.model );
|
2766 |
-
} else { // This isn't an installed action
|
2767 |
-
var modalContent = this.model.get( 'modal_content' );
|
2768 |
-
|
2769 |
-
var actionModal = new jBox( 'Modal', {
|
2770 |
-
content: modalContent,
|
2771 |
-
zIndex:99999999,
|
2772 |
-
closeButton: 'box',
|
2773 |
-
overlay: true,
|
2774 |
-
width: 600,
|
2775 |
-
repositionOnOpen: true,
|
2776 |
-
reposition: true
|
2777 |
-
});
|
2778 |
-
|
2779 |
-
actionModal.open();
|
2780 |
-
// window.open( this.model.get( 'link' ), '_blank' );
|
2781 |
-
}
|
2782 |
-
}
|
2783 |
-
},
|
2784 |
-
|
2785 |
-
templateHelpers: function() {
|
2786 |
-
return {
|
2787 |
-
renderClasses: function() {
|
2788 |
-
var classes = 'nf-item';
|
2789 |
-
if ( '' != jQuery.trim( this.image ) ) {
|
2790 |
-
classes += ' nf-has-img';
|
2791 |
-
}
|
2792 |
-
|
2793 |
-
if ( 'installed' == this.section ) {
|
2794 |
-
classes += ' nf-action-type';
|
2795 |
-
}
|
2796 |
-
return classes;
|
2797 |
-
},
|
2798 |
-
|
2799 |
-
renderStyle: function() {
|
2800 |
-
if ( '' != jQuery.trim( this.image ) ) {
|
2801 |
-
|
2802 |
-
// This is being used in a template, so carefully consider the order of double/single quotes.
|
2803 |
-
return "background-image: url('" + jQuery.trim( this.image ) + "')";
|
2804 |
-
} else {
|
2805 |
-
return '';
|
2806 |
-
}
|
2807 |
-
}
|
2808 |
-
}
|
2809 |
-
}
|
2810 |
-
});
|
2811 |
-
|
2812 |
-
return view;
|
2813 |
-
} );
|
2814 |
-
|
2815 |
-
define( 'views/actions/drawer/typeCollection',['views/actions/drawer/typeButton'], function( actionTypeButtonView ) {
|
2816 |
-
var view = Marionette.CompositeView.extend( {
|
2817 |
-
template: '#tmpl-nf-drawer-action-type-section',
|
2818 |
-
childView: actionTypeButtonView,
|
2819 |
-
|
2820 |
-
templateHelpers: function() {
|
2821 |
-
var that = this;
|
2822 |
-
return {
|
2823 |
-
hasContents: function() {
|
2824 |
-
return that.collection.length > 0;
|
2825 |
-
},
|
2826 |
-
|
2827 |
-
renderNicename: function() {
|
2828 |
-
return that.collection.nicename;
|
2829 |
-
},
|
2830 |
-
|
2831 |
-
renderClasses: function() {
|
2832 |
-
return that.collection.slug;
|
2833 |
-
}
|
2834 |
-
}
|
2835 |
-
},
|
2836 |
-
|
2837 |
-
attachHtml: function( collectionView, childView ) {
|
2838 |
-
jQuery( collectionView.el ).find( '.action-types' ).append( childView.el );
|
2839 |
-
}
|
2840 |
-
} );
|
2841 |
-
|
2842 |
-
return view;
|
2843 |
-
} );
|
2844 |
-
/**
|
2845 |
-
* Model that represents our setting.
|
2846 |
-
*
|
2847 |
-
* When the model is created, we trigger the init event in two radio channels.
|
2848 |
-
*
|
2849 |
-
* This lets specific types of settings modify the model before anything uses it.
|
2850 |
-
*
|
2851 |
-
* Fieldset, for instance, uses this hook to instantiate its settings as a collection.
|
2852 |
-
*
|
2853 |
-
* @package Ninja Forms builder
|
2854 |
-
* @subpackage App
|
2855 |
-
* @copyright (c) 2015 WP Ninjas
|
2856 |
-
* @since 3.0
|
2857 |
-
*/
|
2858 |
-
define( 'models/app/settingModel',[], function() {
|
2859 |
-
var model = Backbone.Model.extend( {
|
2860 |
-
defaults: {
|
2861 |
-
settings: false,
|
2862 |
-
hide_merge_tags: false,
|
2863 |
-
error: false
|
2864 |
-
},
|
2865 |
-
|
2866 |
-
initialize: function() {
|
2867 |
-
// Send out two messages saying that we've initialized a setting model.
|
2868 |
-
nfRadio.channel( 'app' ).trigger( 'init:settingModel', this );
|
2869 |
-
nfRadio.channel( this.get( 'type' ) ).trigger( 'init:settingModel', this );
|
2870 |
-
nfRadio.channel( 'setting-name-' + this.get( 'name' ) ).trigger( 'init:settingModel', this );
|
2871 |
-
this.on( 'change:error', this.maybePreventUI, this );
|
2872 |
-
|
2873 |
-
/*
|
2874 |
-
* If we have an objectType set on our collection, then we're creating a model for the generic settings collection.
|
2875 |
-
* If we're using merge tags in this setting
|
2876 |
-
*/
|
2877 |
-
if( 'undefined' == typeof this.collection ) return;
|
2878 |
-
|
2879 |
-
if ( this.get( 'use_merge_tags' ) && 'undefined' != typeof this.collection.options.objectType ) {
|
2880 |
-
this.listenTo( nfRadio.channel( 'app' ), 'update:fieldKey', this.updateKey );
|
2881 |
-
}
|
2882 |
-
},
|
2883 |
-
|
2884 |
-
/**
|
2885 |
-
* When a field key is updated, send out a radio message requesting that this setting be checked for the old key.
|
2886 |
-
* We want to send the message on the objectType channel.
|
2887 |
-
* This means that if this setting is for fields, it will trigger on the fields channel, actions, etc.
|
2888 |
-
*
|
2889 |
-
* @since 3.0
|
2890 |
-
* @param Backbone.Model keyModel data model representing the field for which the key just changed
|
2891 |
-
* @return void
|
2892 |
-
*/
|
2893 |
-
updateKey: function( keyModel ) {
|
2894 |
-
nfRadio.channel( 'app' ).trigger( 'fire:updateFieldKey', keyModel, this );
|
2895 |
-
},
|
2896 |
-
|
2897 |
-
maybePreventUI: function() {
|
2898 |
-
if ( this.get( 'error' ) ) {
|
2899 |
-
nfRadio.channel( 'drawer' ).request( 'prevent:close', 'setting-' + this.get( 'name' ) + '-error' );
|
2900 |
-
nfRadio.channel( 'app' ).request( 'prevent:changeDomain', 'setting-' + this.get( 'name' ) + '-error' );
|
2901 |
-
} else {
|
2902 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close', 'setting-' + this.get( 'name' ) + '-error' );
|
2903 |
-
nfRadio.channel( 'app' ).request( 'enable:changeDomain', 'setting-' + this.get( 'name' ) + '-error' );
|
2904 |
-
}
|
2905 |
-
}
|
2906 |
-
} );
|
2907 |
-
|
2908 |
-
return model;
|
2909 |
-
} );
|
2910 |
-
/**
|
2911 |
-
* Collections of settings for each field type.
|
2912 |
-
*
|
2913 |
-
* @package Ninja Forms builder
|
2914 |
-
* @subpackage Fields
|
2915 |
-
* @copyright (c) 2015 WP Ninjas
|
2916 |
-
* @since 3.0
|
2917 |
-
*/
|
2918 |
-
define( 'models/app/settingCollection',['models/app/settingModel'], function( settingModel ) {
|
2919 |
-
var collection = Backbone.Collection.extend( {
|
2920 |
-
model: settingModel,
|
2921 |
-
|
2922 |
-
initialize: function( models, options ) {
|
2923 |
-
this.options = options || {};
|
2924 |
-
}
|
2925 |
-
} );
|
2926 |
-
return collection;
|
2927 |
-
} );
|
2928 |
-
/**
|
2929 |
-
* Model that represents our type settings groups.
|
2930 |
-
*
|
2931 |
-
* @package Ninja Forms builder
|
2932 |
-
* @subpackage Fields
|
2933 |
-
* @copyright (c) 2015 WP Ninjas
|
2934 |
-
* @since 3.0
|
2935 |
-
*/
|
2936 |
-
define( 'models/app/settingGroupModel',[ 'models/app/settingCollection' ], function( SettingCollection ) {
|
2937 |
-
var model = Backbone.Model.extend( {
|
2938 |
-
defaults: {
|
2939 |
-
display: false
|
2940 |
-
},
|
2941 |
-
|
2942 |
-
initialize: function( options ) {
|
2943 |
-
if ( false == this.get( 'settings' ) instanceof Backbone.Collection ) {
|
2944 |
-
this.set( 'settings', new SettingCollection( this.get( 'settings' ) ) );
|
2945 |
-
}
|
2946 |
-
}
|
2947 |
-
} );
|
2948 |
-
|
2949 |
-
return model;
|
2950 |
-
} );
|
2951 |
-
/**
|
2952 |
-
* Collection of our type settings groups.
|
2953 |
-
*
|
2954 |
-
* @package Ninja Forms builder
|
2955 |
-
* @subpackage Fields
|
2956 |
-
* @copyright (c) 2015 WP Ninjas
|
2957 |
-
* @since 3.0
|
2958 |
-
*/
|
2959 |
-
define( 'models/app/settingGroupCollection',['models/app/settingGroupModel'], function( settingGroupModel ) {
|
2960 |
-
var collection = Backbone.Collection.extend( {
|
2961 |
-
model: settingGroupModel
|
2962 |
-
} );
|
2963 |
-
return collection;
|
2964 |
-
} );
|
2965 |
-
/**
|
2966 |
-
* Model for our field type
|
2967 |
-
*
|
2968 |
-
* @package Ninja Forms builder
|
2969 |
-
* @subpackage Fields
|
2970 |
-
* @copyright (c) 2015 WP Ninjas
|
2971 |
-
* @since 3.0
|
2972 |
-
*/
|
2973 |
-
define( 'models/app/typeModel',[ 'models/app/settingGroupCollection' ], function( SettingGroupCollection ) {
|
2974 |
-
var model = Backbone.Model.extend( {
|
2975 |
-
initialize: function() {
|
2976 |
-
if ( false === this.get( 'settingGroups' ) instanceof Backbone.Collection ) {
|
2977 |
-
this.set( 'settingGroups', new SettingGroupCollection( this.get( 'settingGroups' ) ) );
|
2978 |
-
}
|
2979 |
-
|
2980 |
-
nfRadio.channel( 'fields' ).trigger( 'init:typeModel', this );
|
2981 |
-
}
|
2982 |
-
} );
|
2983 |
-
|
2984 |
-
return model;
|
2985 |
-
} );
|
2986 |
-
/**
|
2987 |
-
* Collection that holds our field type models.
|
2988 |
-
*
|
2989 |
-
* @package Ninja Forms builder
|
2990 |
-
* @subpackage Fields
|
2991 |
-
* @copyright (c) 2015 WP Ninjas
|
2992 |
-
* @since 3.0
|
2993 |
-
*/
|
2994 |
-
define( 'models/app/typeCollection',['models/app/typeModel'], function( typeModel ) {
|
2995 |
-
var collection = Backbone.Collection.extend( {
|
2996 |
-
model: typeModel,
|
2997 |
-
type: false,
|
2998 |
-
|
2999 |
-
initialize: function( models, options ) {
|
3000 |
-
_.each( options, function( option, key ) {
|
3001 |
-
this[ key ] = option;
|
3002 |
-
}, this );
|
3003 |
-
}
|
3004 |
-
} );
|
3005 |
-
return collection;
|
3006 |
-
} );
|
3007 |
-
/**
|
3008 |
-
* Add action drawer.
|
3009 |
-
*
|
3010 |
-
* TODO: make dynamic
|
3011 |
-
*
|
3012 |
-
* @package Ninja Forms builder
|
3013 |
-
* @subpackage Actions
|
3014 |
-
* @copyright (c) 2015 WP Ninjas
|
3015 |
-
* @since 3.0
|
3016 |
-
*/
|
3017 |
-
define( 'views/actions/drawer/addAction',['views/actions/drawer/typeCollection', 'models/app/typeCollection'], function( actionTypeCollectionView, actionTypeCollection ) {
|
3018 |
-
|
3019 |
-
var view = Marionette.LayoutView.extend( {
|
3020 |
-
template: '#tmpl-nf-drawer-content-add-action',
|
3021 |
-
|
3022 |
-
regions: {
|
3023 |
-
primary: '#nf-drawer-primary',
|
3024 |
-
|
3025 |
-
payments: '#nf-drawer-secondary-payments',
|
3026 |
-
marketing: '#nf-drawer-secondary-marketing',
|
3027 |
-
management: '#nf-drawer-secondary-management',
|
3028 |
-
workflow: '#nf-drawer-secondary-workflow',
|
3029 |
-
notifications: '#nf-drawer-secondary-notifications',
|
3030 |
-
misc: '#nf-drawer-secondary-misc',
|
3031 |
-
},
|
3032 |
-
|
3033 |
-
initialize: function() {
|
3034 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'filter:actionTypes', this.filteractionTypes );
|
3035 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'clear:filter', this.removeactionTypeFilter );
|
3036 |
-
|
3037 |
-
this.installedActions = nfRadio.channel( 'actions' ).request( 'get:installedActions' );
|
3038 |
-
this.primaryCollection = this.installedActions;
|
3039 |
-
|
3040 |
-
this.availableActions = nfRadio.channel( 'actions' ).request( 'get:availableActions' );
|
3041 |
-
this.updateAvailableActionGroups();
|
3042 |
-
},
|
3043 |
-
|
3044 |
-
onShow: function() {
|
3045 |
-
this.primary.show( new actionTypeCollectionView( { collection: this.primaryCollection } ) );
|
3046 |
-
|
3047 |
-
this.payments.show( new actionTypeCollectionView( { collection: this.paymentsCollection } ) );
|
3048 |
-
this.marketing.show( new actionTypeCollectionView( { collection: this.marketingCollection } ) );
|
3049 |
-
this.management.show( new actionTypeCollectionView( { collection: this.managementCollection } ) );
|
3050 |
-
this.workflow.show( new actionTypeCollectionView( { collection: this.workflowCollection } ) );
|
3051 |
-
this.notifications.show( new actionTypeCollectionView( { collection: this.notificationsCollection } ) );
|
3052 |
-
this.misc.show( new actionTypeCollectionView( { collection: this.miscCollection } ) );
|
3053 |
-
},
|
3054 |
-
|
3055 |
-
getEl: function() {
|
3056 |
-
return jQuery( this.el ).parent();
|
3057 |
-
},
|
3058 |
-
|
3059 |
-
filteractionTypes: function( filteredInstalled, filteredAvailable ) {
|
3060 |
-
this.primary.reset().show( new actionTypeCollectionView( { collection: filteredInstalled } ) );
|
3061 |
-
|
3062 |
-
this.availableActions = filteredAvailable;
|
3063 |
-
this.updateAvailableActionGroups();
|
3064 |
-
this.payments.reset().show( new actionTypeCollectionView( { collection: this.paymentsCollection } ) );
|
3065 |
-
this.marketing.reset().show( new actionTypeCollectionView( { collection: this.marketingCollection } ) );
|
3066 |
-
this.management.reset().show( new actionTypeCollectionView( { collection: this.managementCollection } ) );
|
3067 |
-
this.workflow.reset().show( new actionTypeCollectionView( { collection: this.workflowCollection } ) );
|
3068 |
-
this.notifications.reset().show( new actionTypeCollectionView( { collection: this.notificationsCollection } ) );
|
3069 |
-
this.misc.reset().show( new actionTypeCollectionView( { collection: this.miscCollection } ) );
|
3070 |
-
|
3071 |
-
},
|
3072 |
-
|
3073 |
-
removeactionTypeFilter: function () {
|
3074 |
-
this.primary.show( new actionTypeCollectionView( { collection: this.primaryCollection } ) );
|
3075 |
-
|
3076 |
-
this.availableActions = nfRadio.channel( 'actions' ).request( 'get:availableActions' );
|
3077 |
-
this.updateAvailableActionGroups();
|
3078 |
-
this.payments.show( new actionTypeCollectionView( { collection: this.paymentsCollection } ) );
|
3079 |
-
this.marketing.show( new actionTypeCollectionView( { collection: this.marketingCollection } ) );
|
3080 |
-
this.management.show( new actionTypeCollectionView( { collection: this.managementCollection } ) );
|
3081 |
-
this.workflow.show( new actionTypeCollectionView( { collection: this.workflowCollection } ) );
|
3082 |
-
this.notifications.show( new actionTypeCollectionView( { collection: this.notificationsCollection } ) );
|
3083 |
-
this.misc.show( new actionTypeCollectionView( { collection: this.miscCollection } ) );
|
3084 |
-
},
|
3085 |
-
|
3086 |
-
updateAvailableActionGroups: function() {
|
3087 |
-
this.paymentsCollection = new actionTypeCollection(
|
3088 |
-
this.availableActions.where({group: 'payments'}),
|
3089 |
-
{
|
3090 |
-
slug: 'payments',
|
3091 |
-
nicename: nfi18n.paymentsActionNicename
|
3092 |
-
}
|
3093 |
-
);
|
3094 |
-
|
3095 |
-
this.marketingCollection = new actionTypeCollection(
|
3096 |
-
this.availableActions.where({group: 'marketing'}),
|
3097 |
-
{
|
3098 |
-
slug: 'marketing',
|
3099 |
-
nicename: nfi18n.marketingActionNicename
|
3100 |
-
}
|
3101 |
-
);
|
3102 |
-
|
3103 |
-
this.managementCollection = new actionTypeCollection(
|
3104 |
-
this.availableActions.where({group: 'management'}),
|
3105 |
-
{
|
3106 |
-
slug: 'management',
|
3107 |
-
nicename: nfi18n.managementActionNicename
|
3108 |
-
}
|
3109 |
-
);
|
3110 |
-
|
3111 |
-
this.workflowCollection = new actionTypeCollection(
|
3112 |
-
this.availableActions.where({group: 'workflow'}),
|
3113 |
-
{
|
3114 |
-
slug: 'workflow',
|
3115 |
-
nicename: nfi18n.workflowActionNicename
|
3116 |
-
}
|
3117 |
-
);
|
3118 |
-
|
3119 |
-
this.notificationsCollection = new actionTypeCollection(
|
3120 |
-
this.availableActions.where({group: 'notifications'}),
|
3121 |
-
{
|
3122 |
-
slug: 'notifications',
|
3123 |
-
nicename: nfi18n.notificationsActionNicename
|
3124 |
-
}
|
3125 |
-
);
|
3126 |
-
|
3127 |
-
this.miscCollection = new actionTypeCollection(
|
3128 |
-
this.availableActions.where({group: 'misc'}),
|
3129 |
-
{
|
3130 |
-
slug: 'misc',
|
3131 |
-
nicename: nfi18n.miscActionNicename
|
3132 |
-
}
|
3133 |
-
);
|
3134 |
-
}
|
3135 |
-
|
3136 |
-
} );
|
3137 |
-
|
3138 |
-
return view;
|
3139 |
-
} );
|
3140 |
-
/**
|
3141 |
-
* Individual change item.
|
3142 |
-
*
|
3143 |
-
* @package Ninja Forms builder
|
3144 |
-
* @subpackage App
|
3145 |
-
* @copyright (c) 2015 WP Ninjas
|
3146 |
-
* @since 3.0
|
3147 |
-
*/
|
3148 |
-
define( 'views/app/drawer/contentViewChangesItem',[], function() {
|
3149 |
-
var view = Marionette.ItemView.extend({
|
3150 |
-
tagName: 'div',
|
3151 |
-
template: '#tmpl-nf-drawer-content-view-changes-item',
|
3152 |
-
|
3153 |
-
initialize: function() {
|
3154 |
-
this.model.on( 'change:disabled', this.render, this );
|
3155 |
-
},
|
3156 |
-
|
3157 |
-
onBeforeDestroy: function() {
|
3158 |
-
this.model.off( 'change:disabled', this.render );
|
3159 |
-
},
|
3160 |
-
|
3161 |
-
/**
|
3162 |
-
* When we render this element, remove the extra wrapping <div> that backbone creates.
|
3163 |
-
*
|
3164 |
-
* @since 3.0
|
3165 |
-
* @return void
|
3166 |
-
*/
|
3167 |
-
onRender: function() {
|
3168 |
-
this.$el = this.$el.children();
|
3169 |
-
this.$el.unwrap();
|
3170 |
-
this.setElement( this.$el );
|
3171 |
-
},
|
3172 |
-
|
3173 |
-
events: {
|
3174 |
-
'click .undoSingle': 'undoSingle'
|
3175 |
-
},
|
3176 |
-
|
3177 |
-
undoSingle: function( e ) {
|
3178 |
-
nfRadio.channel( 'drawer' ).trigger( 'click:undoSingle', this.model );
|
3179 |
-
}
|
3180 |
-
});
|
3181 |
-
|
3182 |
-
return view;
|
3183 |
-
} );
|
3184 |
-
/**
|
3185 |
-
* Changes collection view.
|
3186 |
-
*
|
3187 |
-
* @package Ninja Forms builder
|
3188 |
-
* @subpackage App
|
3189 |
-
* @copyright (c) 2015 WP Ninjas
|
3190 |
-
* @since 3.0
|
3191 |
-
*/
|
3192 |
-
define( 'views/app/drawer/contentViewChanges',['views/app/drawer/contentViewChangesItem'], function( viewChangesItem ) {
|
3193 |
-
var view = Marionette.CollectionView.extend( {
|
3194 |
-
tagName: 'table',
|
3195 |
-
className: 'nf-changes',
|
3196 |
-
childView: viewChangesItem
|
3197 |
-
} );
|
3198 |
-
|
3199 |
-
return view;
|
3200 |
-
} );
|
3201 |
-
|
3202 |
-
/**
|
3203 |
-
* Handles clicks on the 'view changes' button in the header.
|
3204 |
-
*
|
3205 |
-
* @package Ninja Forms builder
|
3206 |
-
* @subpackage App
|
3207 |
-
* @copyright (c) 2015 WP Ninjas
|
3208 |
-
* @since 3.0
|
3209 |
-
*/
|
3210 |
-
define( 'views/app/drawer/headerViewChanges',[], function() {
|
3211 |
-
var view = Marionette.ItemView.extend({
|
3212 |
-
tagName: 'div',
|
3213 |
-
template: '#tmpl-nf-drawer-header-view-changes',
|
3214 |
-
|
3215 |
-
events: {
|
3216 |
-
'click .undoChanges': 'clickUndoChanges'
|
3217 |
-
},
|
3218 |
-
|
3219 |
-
clickUndoChanges: function( e ) {
|
3220 |
-
nfRadio.channel( 'drawer' ).trigger( 'click:undoChanges' );
|
3221 |
-
}
|
3222 |
-
});
|
3223 |
-
|
3224 |
-
return view;
|
3225 |
-
} );
|
3226 |
-
/**
|
3227 |
-
* Error view used for settings.
|
3228 |
-
*
|
3229 |
-
* @package Ninja Forms builder
|
3230 |
-
* @subpackage App
|
3231 |
-
* @copyright (c) 2015 WP Ninjas
|
3232 |
-
* @since 3.0
|
3233 |
-
*/
|
3234 |
-
define( 'views/app/drawer/settingError',[], function() {
|
3235 |
-
var view = Marionette.ItemView.extend({
|
3236 |
-
tagName: 'div',
|
3237 |
-
template: '#tmpl-nf-edit-setting-error'
|
3238 |
-
});
|
3239 |
-
|
3240 |
-
return view;
|
3241 |
-
} );
|
3242 |
-
define( 'views/app/drawer/itemSetting',['views/app/drawer/mergeTagsContent', 'views/app/drawer/settingError'], function( mergeTagsContentView, settingErrorView ) {
|
3243 |
-
var view = Marionette.LayoutView.extend({
|
3244 |
-
tagName: 'div',
|
3245 |
-
template: '#tmpl-nf-edit-setting-wrap',
|
3246 |
-
|
3247 |
-
regions: {
|
3248 |
-
error: '.nf-setting-error'
|
3249 |
-
},
|
3250 |
-
|
3251 |
-
initialize: function( data ) {
|
3252 |
-
this.dataModel = data.dataModel;
|
3253 |
-
/*
|
3254 |
-
* Send out a request on the setting-type-{type} channel asking if we should render on dataModel change.
|
3255 |
-
* Defaults to false.
|
3256 |
-
* This lets specific settings, like RTEs, say that they don't want to be re-rendered when their data model changes.
|
3257 |
-
*/
|
3258 |
-
var renderOnChange = ( 'undefined' == typeof nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).request( 'renderOnChange' ) ) ? false : nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).request( 'renderOnChange' );
|
3259 |
-
|
3260 |
-
if ( renderOnChange ) {
|
3261 |
-
this.dataModel.on( 'change:' + this.model.get( 'name' ), this.render, this );
|
3262 |
-
}
|
3263 |
-
|
3264 |
-
this.model.on( 'change:error', this.renderError, this );
|
3265 |
-
this.model.on( 'change:warning', this.renderWarning, this );
|
3266 |
-
|
3267 |
-
var deps = this.model.get( 'deps' );
|
3268 |
-
if ( deps ) {
|
3269 |
-
// If we don't have a 'settings' property, this is a legacy depdency setup.
|
3270 |
-
if ( 'undefined' == typeof deps.settings ) {
|
3271 |
-
deps.settings = [];
|
3272 |
-
_.each(deps, function(dep, name){
|
3273 |
-
if( 'settings' !== name ) {
|
3274 |
-
deps.settings.push( { name: name, value: dep } );
|
3275 |
-
}
|
3276 |
-
});
|
3277 |
-
deps.match = 'all';
|
3278 |
-
}
|
3279 |
-
|
3280 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
3281 |
-
let name = deps.settings[i].name;
|
3282 |
-
this.dataModel.on( 'change:' + name, this.render, this );
|
3283 |
-
}
|
3284 |
-
}
|
3285 |
-
|
3286 |
-
/**
|
3287 |
-
* For settings that require a remote refresh
|
3288 |
-
* add an "update"/refresh icon to the label.
|
3289 |
-
*/
|
3290 |
-
var remote = this.model.get( 'remote' );
|
3291 |
-
if( remote ) {
|
3292 |
-
if( 'undefined' != typeof remote.refresh || remote.refresh ) {
|
3293 |
-
var labelText, updateIcon, updateLink, labelWrapper;
|
3294 |
-
|
3295 |
-
labelText = document.createTextNode( this.model.get('label') );
|
3296 |
-
|
3297 |
-
updateIcon = document.createElement( 'span' );
|
3298 |
-
updateIcon.classList.add( 'dashicons', 'dashicons-update' );
|
3299 |
-
|
3300 |
-
updateLink = document.createElement( 'a' );
|
3301 |
-
updateLink.classList.add( 'extra' );
|
3302 |
-
updateLink.appendChild( updateIcon );
|
3303 |
-
|
3304 |
-
// Wrap the label text and icon/link in a parent element.
|
3305 |
-
labelWrapper = document.createElement( 'span' );
|
3306 |
-
labelWrapper.appendChild( labelText );
|
3307 |
-
labelWrapper.appendChild( updateLink );
|
3308 |
-
|
3309 |
-
// The model expects a string value.
|
3310 |
-
this.model.set('label', labelWrapper.innerHTML );
|
3311 |
-
}
|
3312 |
-
|
3313 |
-
nfRadio.channel( 'setting' ).trigger( 'remote', this.model, this.dataModel, this );
|
3314 |
-
this.model.on( 'rerender', this.render, this );
|
3315 |
-
}
|
3316 |
-
|
3317 |
-
/*
|
3318 |
-
* When our drawer opens, send out a radio message on our setting type channel.
|
3319 |
-
*/
|
3320 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', this.drawerOpened );
|
3321 |
-
|
3322 |
-
/*
|
3323 |
-
* When our drawer closes, send out a radio message on our setting type channel.
|
3324 |
-
*/
|
3325 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'closed', this.drawerClosed );
|
3326 |
-
},
|
3327 |
-
|
3328 |
-
onBeforeDestroy: function() {
|
3329 |
-
this.dataModel.off( 'change:' + this.model.get( 'name' ), this.render );
|
3330 |
-
this.model.off( 'change:error', this.renderError );
|
3331 |
-
|
3332 |
-
var deps = this.model.get( 'deps' );
|
3333 |
-
if ( deps ) {
|
3334 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
3335 |
-
let name = deps.settings[i].name;
|
3336 |
-
this.dataModel.off( 'change:' + name, this.render );
|
3337 |
-
}
|
3338 |
-
}
|
3339 |
-
|
3340 |
-
if( this.model.get( 'remote' ) ) {
|
3341 |
-
this.model.off( 'rerender', this.render, this );
|
3342 |
-
}
|
3343 |
-
|
3344 |
-
/*
|
3345 |
-
* Send out a radio message.
|
3346 |
-
*/
|
3347 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'destroy:setting', this.model, this.dataModel, this );
|
3348 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'destroy:setting', this.model, this.dataModel, this );
|
3349 |
-
|
3350 |
-
/*
|
3351 |
-
* Unescape any HTML being saved if we are a textbox.
|
3352 |
-
*/
|
3353 |
-
if ( 'textbox' == this.model.get( 'type' ) ) {
|
3354 |
-
var setting = this.model.get( 'name' );
|
3355 |
-
var value = this.dataModel.get( setting );
|
3356 |
-
this.dataModel.set( setting, _.unescape( value ), { silent: true } );
|
3357 |
-
}
|
3358 |
-
|
3359 |
-
},
|
3360 |
-
|
3361 |
-
onBeforeRender: function() {
|
3362 |
-
/*
|
3363 |
-
* We want to escape any HTML being output if we are a textbox.
|
3364 |
-
*/
|
3365 |
-
if ( 'textbox' == this.model.get( 'type' ) ) {
|
3366 |
-
var setting = this.model.get( 'name' );
|
3367 |
-
var value = this.dataModel.get( setting );
|
3368 |
-
this.dataModel.set( setting, _.escape( value ), { silent: true } );
|
3369 |
-
}
|
3370 |
-
|
3371 |
-
nfRadio.channel( 'app' ).trigger( 'before:renderSetting', this.model, this.dataModel );
|
3372 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'before:renderSetting', this.model, this.dataModel, this );
|
3373 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'before:renderSetting', this.model, this.dataModel, this );
|
3374 |
-
},
|
3375 |
-
|
3376 |
-
onRender: function() {
|
3377 |
-
this.mergeTagsContentView = false;
|
3378 |
-
var that = this;
|
3379 |
-
|
3380 |
-
/*
|
3381 |
-
* Send out a radio message.
|
3382 |
-
*/
|
3383 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
3384 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
3385 |
-
|
3386 |
-
jQuery( this.el ).find( '.nf-help' ).each(function() {
|
3387 |
-
var content = jQuery(this).next('.nf-help-text');
|
3388 |
-
jQuery( this ).jBox( 'Tooltip', {
|
3389 |
-
content: content,
|
3390 |
-
maxWidth: 200,
|
3391 |
-
theme: 'TooltipBorder',
|
3392 |
-
trigger: 'click',
|
3393 |
-
closeOnClick: true
|
3394 |
-
})
|
3395 |
-
});
|
3396 |
-
|
3397 |
-
if ( this.model.get( 'use_merge_tags' ) ) {
|
3398 |
-
nfRadio.channel( 'mergeTags' ).request( 'init', this );
|
3399 |
-
}
|
3400 |
-
|
3401 |
-
/*
|
3402 |
-
* Apply Setting Field Masks
|
3403 |
-
*/
|
3404 |
-
var mask = this.model.get( 'mask' );
|
3405 |
-
|
3406 |
-
if( typeof mask != "undefined" ){
|
3407 |
-
|
3408 |
-
var input = jQuery( this.$el ).find( 'input' );
|
3409 |
-
jQuery( input ).attr( 'contentEditable', true );
|
3410 |
-
switch( mask.type ){
|
3411 |
-
case 'numeric':
|
3412 |
-
input.autoNumeric({
|
3413 |
-
aSep: thousandsSeparator,
|
3414 |
-
aDec: decimalPoint
|
3415 |
-
});
|
3416 |
-
break;
|
3417 |
-
case 'currency':
|
3418 |
-
|
3419 |
-
var currency = nfRadio.channel( 'settings' ).request( 'get:setting', 'currency' );
|
3420 |
-
var currencySymbol = nfAdmin.currencySymbols[ currency ] || '';
|
3421 |
-
|
3422 |
-
input.autoNumeric({
|
3423 |
-
aSign: jQuery('<div />').html(currencySymbol).text(),
|
3424 |
-
aSep: thousandsSeparator,
|
3425 |
-
aDec: decimalPoint
|
3426 |
-
});
|
3427 |
-
break;
|
3428 |
-
case 'custom':
|
3429 |
-
if( mask.format ) input.mask( mask.format );
|
3430 |
-
break;
|
3431 |
-
default:
|
3432 |
-
// TODO: Error Logging.
|
3433 |
-
console.log( 'Notice: Mask type of "' + mask.type + '" is not supported.' );
|
3434 |
-
}
|
3435 |
-
}
|
3436 |
-
|
3437 |
-
this.renderError();
|
3438 |
-
},
|
3439 |
-
|
3440 |
-
onShow: function() {
|
3441 |
-
/*
|
3442 |
-
* Send out a radio message.
|
3443 |
-
*/
|
3444 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'show:setting', this.model, this.dataModel, this );
|
3445 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'show:setting', this.model, this.dataModel, this );
|
3446 |
-
},
|
3447 |
-
|
3448 |
-
onAttach: function() {
|
3449 |
-
/*
|
3450 |
-
* Send out a radio message.
|
3451 |
-
*/
|
3452 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
3453 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
3454 |
-
},
|
3455 |
-
|
3456 |
-
renderError: function() {
|
3457 |
-
if ( this.model.get( 'error' ) ) {
|
3458 |
-
jQuery( this.el ).find( '.nf-setting' ).addClass( 'nf-error' );
|
3459 |
-
this.error.show( new settingErrorView( { model: this.model } ) );
|
3460 |
-
} else {
|
3461 |
-
jQuery( this.el ).find( '.nf-setting' ).removeClass( 'nf-error' );
|
3462 |
-
this.error.empty();
|
3463 |
-
}
|
3464 |
-
},
|
3465 |
-
|
3466 |
-
renderWarning: function() {
|
3467 |
-
if ( this.model.get( 'warning' ) ) {
|
3468 |
-
jQuery( this.el ).find( '.nf-setting' ).addClass( 'nf-warning' );
|
3469 |
-
this.error.show( new settingErrorView( { model: this.model } ) );
|
3470 |
-
} else {
|
3471 |
-
jQuery( this.el ).find( '.nf-setting' ).removeClass( 'nf-warning' );
|
3472 |
-
this.error.empty();
|
3473 |
-
}
|
3474 |
-
},
|
3475 |
-
|
3476 |
-
templateHelpers: function () {
|
3477 |
-
var that = this;
|
3478 |
-
return {
|
3479 |
-
|
3480 |
-
renderVisible: function() {
|
3481 |
-
|
3482 |
-
if(!nfAdmin.devMode){
|
3483 |
-
if('Action' == that.dataModel.get('objectType') && 'email' == that.dataModel.get('type')){
|
3484 |
-
if('cc' == this.name) return 'style="display:none;"';
|
3485 |
-
if('bcc' == this.name) return 'style="display:none;"';
|
3486 |
-
if('from_name' == this.name) return 'style="display:none;"';
|
3487 |
-
if('from_address' == this.name) return 'style="display:none;"';
|
3488 |
-
if('email_format' == this.name) return 'style="display:none;"';
|
3489 |
-
}
|
3490 |
-
|
3491 |
-
if('Action' == that.dataModel.get('objectType') && 'save' == that.dataModel.get('type')){
|
3492 |
-
if('submitter_email' == this.name) return 'style="display:none;"';
|
3493 |
-
}
|
3494 |
-
|
3495 |
-
if('label_pos' == this.name) return 'style="display:none;"';
|
3496 |
-
if('input_limit' == this.name) return 'style="display:none;"';
|
3497 |
-
if('input_limit_type' == this.name) return 'style="display:none;"';
|
3498 |
-
if('input_limit_msg' == this.name) return 'style="display:none;"';
|
3499 |
-
if('help_text' == this.name) return 'style="display:none;"';
|
3500 |
-
if('disable_input' == this.name) return 'style="display:none;"';
|
3501 |
-
if('disable_browser_autocomplete' == this.name) return 'style="display:none;"';
|
3502 |
-
if('mask' == this.name) return 'style="display:none;"';
|
3503 |
-
if('custom_mask' == this.name) return 'style="display:none;"';
|
3504 |
-
if('custom_name_attribute' == this.name) return 'style="display:none;"';
|
3505 |
-
if('personally_identifiable' == this.name) return 'style="display:none;"';
|
3506 |
-
|
3507 |
-
// "administration" settings
|
3508 |
-
if('key' == this.name) return 'style="display:none;"';
|
3509 |
-
if('admin_label' == this.name) return 'style="display:none;"';
|
3510 |
-
if('num_sort' == this.name) return 'style="display:none;"';
|
3511 |
-
if('user_state' == this.name) return 'style="display:none;"';
|
3512 |
-
|
3513 |
-
|
3514 |
-
if('checkbox' == that.dataModel.get('type')){
|
3515 |
-
if('checked_value' == this.name) return 'style="display:none;"';
|
3516 |
-
if('unchecked_value' == this.name) return 'style="display:none;"';
|
3517 |
-
if('checked_calc_value' == this.name) return 'style="display:none;"';
|
3518 |
-
if('unchecked_calc_value' == this.name) return 'style="display:none;"';
|
3519 |
-
}
|
3520 |
-
|
3521 |
-
if('starrating' == that.dataModel.get('type')){
|
3522 |
-
if('default' == this.name) return 'style="display:none;"';
|
3523 |
-
}
|
3524 |
-
|
3525 |
-
if('listmultiselect' == that.dataModel.get('type')){
|
3526 |
-
if('box_size' == this.name) return 'style="display:none;"';
|
3527 |
-
}
|
3528 |
-
|
3529 |
-
if('date' == that.dataModel.get('type')){
|
3530 |
-
if('year_range_start' == this.name) return 'style="display:none;"';
|
3531 |
-
if('year_range_end' == this.name) return 'style="display:none;"';
|
3532 |
-
}
|
3533 |
-
}
|
3534 |
-
|
3535 |
-
return nfRadio.channel( 'settings' ).request( 'check:deps', this, that );
|
3536 |
-
},
|
3537 |
-
|
3538 |
-
renderSetting: function(){
|
3539 |
-
if ( 'undefined' != typeof that.dataModel.get( this.name ) ) {
|
3540 |
-
this.value = that.dataModel.get( this.name );
|
3541 |
-
} else if ( 'undefined' == typeof this.value ) {
|
3542 |
-
this.value = '';
|
3543 |
-
}
|
3544 |
-
var setting = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-edit-setting-' + this.type );
|
3545 |
-
return setting( this );
|
3546 |
-
},
|
3547 |
-
|
3548 |
-
renderLabelClasses: function() {
|
3549 |
-
var classes = '';
|
3550 |
-
if ( this.use_merge_tags ) {
|
3551 |
-
classes += ' has-merge-tags';
|
3552 |
-
}
|
3553 |
-
if ( 'rte' == this.type ) {
|
3554 |
-
classes += ' rte';
|
3555 |
-
}
|
3556 |
-
|
3557 |
-
return classes;
|
3558 |
-
},
|
3559 |
-
|
3560 |
-
renderClasses: function() {
|
3561 |
-
var classes = 'nf-setting ';
|
3562 |
-
if ( 'undefined' != typeof this.width ) {
|
3563 |
-
classes += 'nf-' + this.width;
|
3564 |
-
} else {
|
3565 |
-
classes += ' nf-one-half';
|
3566 |
-
}
|
3567 |
-
|
3568 |
-
if ( this.error ) {
|
3569 |
-
classes += ' nf-error';
|
3570 |
-
}
|
3571 |
-
|
3572 |
-
return classes;
|
3573 |
-
},
|
3574 |
-
|
3575 |
-
renderTooltip: function() {
|
3576 |
-
if ( ! this.help ) return '';
|
3577 |
-
var helpText, helpTextContainer, helpIcon, helpIconLink, helpTextWrapper;
|
3578 |
-
|
3579 |
-
helpText = document.createElement( 'div' );
|
3580 |
-
helpText.innerHTML = this.help;
|
3581 |
-
|
3582 |
-
helpTextContainer = document.createElement( 'div' );
|
3583 |
-
helpTextContainer.classList.add( 'nf-help-text' );
|
3584 |
-
helpTextContainer.appendChild( helpText );
|
3585 |
-
|
3586 |
-
helpIcon = document.createElement( 'span' );
|
3587 |
-
helpIcon.classList.add( 'dashicons', 'dashicons-admin-comments' );
|
3588 |
-
helpIconLink = document.createElement( 'a' );
|
3589 |
-
helpIconLink.classList.add( 'nf-help' );
|
3590 |
-
helpIconLink.setAttribute( 'href', '#' );
|
3591 |
-
helpIconLink.setAttribute( 'tabindex', '-1' );
|
3592 |
-
helpIconLink.appendChild( helpIcon );
|
3593 |
-
|
3594 |
-
helpTextWrapper = document.createElement( 'span' );
|
3595 |
-
helpTextWrapper.appendChild( helpIconLink );
|
3596 |
-
helpTextWrapper.appendChild( helpTextContainer );
|
3597 |
-
|
3598 |
-
// The template expects a string value.
|
3599 |
-
return helpTextWrapper.innerHTML;
|
3600 |
-
},
|
3601 |
-
|
3602 |
-
/*
|
3603 |
-
* Render a select element with only the email fields on the
|
3604 |
-
* form
|
3605 |
-
*/
|
3606 |
-
renderEmailFieldOptions: function() {
|
3607 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
3608 |
-
|
3609 |
-
initialOption = document.createElement( 'option' );
|
3610 |
-
initialOption.value = '';
|
3611 |
-
initialOption.label = '--';
|
3612 |
-
initialOption.innerHTML = '--';
|
3613 |
-
|
3614 |
-
var select_value = '';
|
3615 |
-
var select = document.createElement( 'select' );
|
3616 |
-
select.classList.add( 'setting' );
|
3617 |
-
select.setAttribute( 'data-id', 'my_seledt' );
|
3618 |
-
select.appendChild( initialOption );
|
3619 |
-
|
3620 |
-
var index = 0;
|
3621 |
-
var that = this;
|
3622 |
-
fields.each( function( field ) {
|
3623 |
-
// Check for the field type in our lookup array and...
|
3624 |
-
if( 'email' != field.get( 'type' ) ) {
|
3625 |
-
// Return if the type is in our lookup array.
|
3626 |
-
return '';
|
3627 |
-
}
|
3628 |
-
|
3629 |
-
var option = document.createElement( 'option' );
|
3630 |
-
|
3631 |
-
option.value = field.get( 'key' );
|
3632 |
-
option.innerHTML = field.get( 'label' );
|
3633 |
-
option.label = field.get( 'label' );
|
3634 |
-
|
3635 |
-
if( that.value === field.get( 'key' ) ) {
|
3636 |
-
option.setAttribute( 'selected', 'selected' );
|
3637 |
-
}
|
3638 |
-
select.appendChild( option );
|
3639 |
-
index = index + 1;
|
3640 |
-
});
|
3641 |
-
|
3642 |
-
label = document.createElement( 'label' );
|
3643 |
-
label.classList.add( 'nf-select' );
|
3644 |
-
|
3645 |
-
label.appendChild( select );
|
3646 |
-
|
3647 |
-
// Select Lists need an empty '<div></div>' for styling purposes.
|
3648 |
-
emptyContainer = document.createElement( 'div' );
|
3649 |
-
label.appendChild( emptyContainer );
|
3650 |
-
|
3651 |
-
// The template requires a string.
|
3652 |
-
return label.innerHTML;
|
3653 |
-
},
|
3654 |
-
|
3655 |
-
renderMergeTags: function() {
|
3656 |
-
if ( this.use_merge_tags && ! this.hide_merge_tags ) {
|
3657 |
-
return '<span class="dashicons dashicons-list-view merge-tags"></span>';
|
3658 |
-
} else {
|
3659 |
-
return '';
|
3660 |
-
}
|
3661 |
-
},
|
3662 |
-
|
3663 |
-
/**
|
3664 |
-
* Renders min and/or max attributes for the number input
|
3665 |
-
*
|
3666 |
-
* @returns {string}
|
3667 |
-
*/
|
3668 |
-
renderMinMax: function() {
|
3669 |
-
var minMaxStr = '';
|
3670 |
-
// if we have a min value set, then output it
|
3671 |
-
if( 'undefined' != typeof this.min_val && null != this.min_val && jQuery.isNumeric( this.min_val ) ) {
|
3672 |
-
minMaxStr = minMaxStr + "min='" + this.min_val + "'";
|
3673 |
-
}
|
3674 |
-
|
3675 |
-
// if we have a max value set, then output it
|
3676 |
-
if( 'undefined' != typeof this.max_val && '' != this.max_val && jQuery.isNumeric( this.max_val ) ) {
|
3677 |
-
minMaxStr = minMaxStr + " max='" + this.max_val + "'";
|
3678 |
-
}
|
3679 |
-
|
3680 |
-
// if we have a step size set, then output it
|
3681 |
-
if( 'undefined' != typeof this.step && '' != this.step && jQuery.isNumeric( this.step ) ) {
|
3682 |
-
minMaxStr = minMaxStr + " step='" + this.step + "'";
|
3683 |
-
}
|
3684 |
-
|
3685 |
-
return minMaxStr;
|
3686 |
-
},
|
3687 |
-
|
3688 |
-
/**
|
3689 |
-
* Returns a string to let the user know the min and/or max
|
3690 |
-
* value for the field
|
3691 |
-
*
|
3692 |
-
* @returns {string}
|
3693 |
-
*/
|
3694 |
-
renderMinMaxHelper: function() {
|
3695 |
-
var minMaxHelperStr = '';
|
3696 |
-
// if we have a min value output it to the helper text
|
3697 |
-
if( 'undefined' != typeof this.min_val && null != this.min_val && jQuery.isNumeric( this.min_val ) ) {
|
3698 |
-
// empty string? then add '('
|
3699 |
-
if( 0 == minMaxHelperStr.length ) {
|
3700 |
-
minMaxHelperStr = "(";
|
3701 |
-
}
|
3702 |
-
minMaxHelperStr = minMaxHelperStr + nfi18n.minVal + ": " + this.min_val;
|
3703 |
-
}
|
3704 |
-
|
3705 |
-
// if we have a max value output it to the helper text
|
3706 |
-
if( 'undefined' != typeof this.max_val && '' != this.max_val && jQuery.isNumeric( this.max_val ) ) {
|
3707 |
-
// empty string? then add '('
|
3708 |
-
if( 0 == minMaxHelperStr.length ) {
|
3709 |
-
minMaxHelperStr = "(";
|
3710 |
-
} else {
|
3711 |
-
// else, we know we have a min so add a comma
|
3712 |
-
minMaxHelperStr = minMaxHelperStr + ", ";
|
3713 |
-
}
|
3714 |
-
minMaxHelperStr = minMaxHelperStr + nfi18n.maxVal + ": " + this.max_val;
|
3715 |
-
}
|
3716 |
-
|
3717 |
-
// if not an empty string, then add ')'
|
3718 |
-
if( 0 < minMaxHelperStr.length ) {
|
3719 |
-
minMaxHelperStr = minMaxHelperStr + ")";
|
3720 |
-
}
|
3721 |
-
|
3722 |
-
return minMaxHelperStr;
|
3723 |
-
},
|
3724 |
-
}
|
3725 |
-
},
|
3726 |
-
|
3727 |
-
events: {
|
3728 |
-
'change .setting': 'changeSetting',
|
3729 |
-
'keyup .setting': 'keyUpSetting',
|
3730 |
-
'click .setting': 'clickSetting',
|
3731 |
-
'click .extra': 'clickExtra'
|
3732 |
-
},
|
3733 |
-
|
3734 |
-
changeSetting: function( e ) {
|
3735 |
-
//Check characters set in custom classes match sanitize_html_class
|
3736 |
-
if ( 'textbox' == this.model.get( 'type' ) && this.model.get('name').endsWith("_class" )) {
|
3737 |
-
const regexp = /^[a-zA-Z 0-9-_]+$/;
|
3738 |
-
if(e.target.value.search(regexp) === -1 && '' !== e.target.value){
|
3739 |
-
this.model.set('error', "HTML classes only allow - _ and alphanumeric characters." )
|
3740 |
-
} else if(e.target.value.search(regexp) === 0 || '' === e.target.value){
|
3741 |
-
this.model.unset('error');
|
3742 |
-
}
|
3743 |
-
} else if( 'textbox' == this.model.get( 'type' ) && this.model.get('name') === "title" ){
|
3744 |
-
const regexp = /[/"<>`]/;
|
3745 |
-
if(e.target.value.search(regexp) !== -1 && '' !== e.target.value){
|
3746 |
-
const foundIndex = e.target.value.search(regexp);
|
3747 |
-
const foundChar = e.target.value.charAt(foundIndex);
|
3748 |
-
this.model.set('error', "The forbidden " + foundChar + " character was found. Title must not contain / \" < > ` characters.")
|
3749 |
-
} else if(e.target.value.search(regexp) === -1 || '' === e.target.value){
|
3750 |
-
this.model.unset('error');
|
3751 |
-
}
|
3752 |
-
}
|
3753 |
-
nfRadio.channel( 'app' ).trigger( 'change:setting', e, this.model, this.dataModel );
|
3754 |
-
},
|
3755 |
-
|
3756 |
-
keyUpSetting: function( e ) {
|
3757 |
-
nfRadio.channel( 'app' ).trigger( 'keyup:setting', e, this.model, this.dataModel );
|
3758 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'keyup:setting', e, this.model, this.dataModel );
|
3759 |
-
},
|
3760 |
-
|
3761 |
-
clickSetting: function( e ) {
|
3762 |
-
nfRadio.channel( 'app' ).trigger( 'click:setting', e, this.model, this.dataModel );
|
3763 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'click:setting', e, this.model, this.dataModel, this );
|
3764 |
-
},
|
3765 |
-
|
3766 |
-
clickExtra: function( e ) {
|
3767 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'click:extra', e, this.model, this.dataModel, this );
|
3768 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'name' ) ).trigger( 'click:extra', e, this.model, this.dataModel, this );
|
3769 |
-
nfRadio.channel( 'setting-name-' + this.model.get( 'name' ) ).trigger( 'click:extra', e, this.model, this.dataModel, this );
|
3770 |
-
},
|
3771 |
-
|
3772 |
-
drawerOpened: function() {
|
3773 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'drawer:opened', this.model, this.dataModel, this );
|
3774 |
-
},
|
3775 |
-
|
3776 |
-
drawerClosed: function() {
|
3777 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'drawer:closed', this.model, this.dataModel, this );
|
3778 |
-
}
|
3779 |
-
});
|
3780 |
-
|
3781 |
-
return view;
|
3782 |
-
} );
|
3783 |
-
|
3784 |
-
/**
|
3785 |
-
* Changes collection view.
|
3786 |
-
*
|
3787 |
-
* @package Ninja Forms builder
|
3788 |
-
* @subpackage App
|
3789 |
-
* @copyright (c) 2015 WP Ninjas
|
3790 |
-
* @since 3.0
|
3791 |
-
*/
|
3792 |
-
define( 'views/app/drawer/contentPublicLink',['views/app/drawer/itemSetting'], function( itemSettingView) {
|
3793 |
-
var view = Marionette.LayoutView.extend( {
|
3794 |
-
tagName: 'div',
|
3795 |
-
template: '#tmpl-nf-drawer-content-public-link',
|
3796 |
-
|
3797 |
-
regions: {
|
3798 |
-
embedForm: '.embed-form',
|
3799 |
-
enablePublicLink: '.enable-public-link',
|
3800 |
-
copyPublicLink: '.copy-public-link',
|
3801 |
-
},
|
3802 |
-
|
3803 |
-
onRender: function() {
|
3804 |
-
var formModel = Backbone.Radio.channel('app').request('get:formModel');
|
3805 |
-
var formSettingsDataModel = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
3806 |
-
|
3807 |
-
var allowPublicLinkSettingModel = nfRadio.channel( 'settings' ).request( 'get:settingModel', 'allow_public_link' );
|
3808 |
-
this.enablePublicLink.show( new itemSettingView( { model: allowPublicLinkSettingModel, dataModel: formSettingsDataModel } ) );
|
3809 |
-
|
3810 |
-
var embedForm = "[ninja_form id='{FORM_ID}']".replace('{FORM_ID}', formModel.get('id'));
|
3811 |
-
formSettingsDataModel.set('embed_form', embedForm);
|
3812 |
-
|
3813 |
-
var embedFormSettingModel = nfRadio.channel( 'settings' ).request( 'get:settingModel', 'embed_form' );
|
3814 |
-
this.embedForm.show( new itemSettingView( { model: embedFormSettingModel, dataModel: formSettingsDataModel } ) );
|
3815 |
-
|
3816 |
-
var public_link_key = formSettingsDataModel.get('public_link_key');
|
3817 |
-
|
3818 |
-
/**
|
3819 |
-
* Generate a public link key which is follows the format:
|
3820 |
-
* Form Id + 4 consecutive base 36 numbers
|
3821 |
-
*/
|
3822 |
-
if (!public_link_key) {
|
3823 |
-
public_link_key = nfRadio.channel('app').request('generate:publicLinkKey');
|
3824 |
-
}
|
3825 |
-
|
3826 |
-
// apply public link url to settings (ending with key)
|
3827 |
-
var publicLink = nfAdmin.publicLinkStructure.replace('[FORM_ID]', public_link_key);
|
3828 |
-
formSettingsDataModel.set('public_link', publicLink);
|
3829 |
-
|
3830 |
-
// Display public link
|
3831 |
-
var publicLinkSettingModel = nfRadio.channel( 'settings' ).request( 'get:settingModel', 'public_link' );
|
3832 |
-
this.copyPublicLink.show(new itemSettingView( { model: publicLinkSettingModel, dataModel: formSettingsDataModel } ));
|
3833 |
-
},
|
3834 |
-
|
3835 |
-
events: {
|
3836 |
-
'click #embed_form + .js-click-copytext': 'copyFormEmbedHandler',
|
3837 |
-
'click #public_link + div > .js-click-copytext': 'copyPublicLinkHandler',
|
3838 |
-
'click #public_link + div > .js-click-resettext': 'confirmResetPublicLinkHandler',
|
3839 |
-
'click #public_link + div > .js-click-confirm': 'resetPublicLinkHandler',
|
3840 |
-
'click #public_link + div > .js-click-cancel': 'cancelResetPublicLinkHandler'
|
3841 |
-
},
|
3842 |
-
|
3843 |
-
copyFormEmbedHandler: function( e ) {
|
3844 |
-
|
3845 |
-
document.getElementById('embed_form').select();
|
3846 |
-
document.execCommand('copy');
|
3847 |
-
|
3848 |
-
e.target.innerHTML = 'Copied!';
|
3849 |
-
setTimeout(function(){ e.target.innerHTML = 'Copy'; }, 1500);
|
3850 |
-
},
|
3851 |
-
|
3852 |
-
copyPublicLinkHandler: function( e ) {
|
3853 |
-
|
3854 |
-
document.getElementById('public_link').select();
|
3855 |
-
document.execCommand('copy');
|
3856 |
-
|
3857 |
-
e.target.innerHTML = 'Copied!';
|
3858 |
-
setTimeout(function(){ e.target.innerHTML = 'Copy'; }, 1500);
|
3859 |
-
},
|
3860 |
-
|
3861 |
-
confirmResetPublicLinkHandler: function( e ) {
|
3862 |
-
_.each( e.target.parentNode.children, function( node ) {
|
3863 |
-
if ( node.classList.contains( 'js-click-copytext' ) || node.classList.contains( 'js-click-resettext' ) ) {
|
3864 |
-
node.style.display = 'none';
|
3865 |
-
} else {
|
3866 |
-
node.style.display = 'inline-block';
|
3867 |
-
}
|
3868 |
-
} );
|
3869 |
-
},
|
3870 |
-
|
3871 |
-
resetPublicLinkHandler: function ( e ) {
|
3872 |
-
// Generate a new link.
|
3873 |
-
var public_link_key = nfRadio.channel('app').request('generate:publicLinkKey');
|
3874 |
-
var publicLink = nfAdmin.publicLinkStructure.replace('[FORM_ID]', public_link_key);
|
3875 |
-
var formSettingsDataModel = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
3876 |
-
formSettingsDataModel.set('public_link', publicLink);
|
3877 |
-
// Reset the buttons.
|
3878 |
-
this.cancelResetPublicLinkHandler( e );
|
3879 |
-
_.each( e.target.parentNode.children, function( node ) {
|
3880 |
-
if ( node.classList.contains( 'js-click-resettext' ) ) {
|
3881 |
-
node.style.display = 'inline-block';
|
3882 |
-
node.classList.add('primary');
|
3883 |
-
node.classList.remove('secondary');
|
3884 |
-
node.innerHTML = 'Link Reset!';
|
3885 |
-
setTimeout(function(){
|
3886 |
-
node.classList.add('secondary');
|
3887 |
-
node.classList.remove('primary');
|
3888 |
-
node.innerHTML = 'Reset';
|
3889 |
-
}, 1500);
|
3890 |
-
} else {
|
3891 |
-
node.style.display = 'none';
|
3892 |
-
}
|
3893 |
-
if ( node.classList.contains( 'js-click-copytext' ) ) {
|
3894 |
-
setTimeout(function(){
|
3895 |
-
node.style.display = 'inline-block';
|
3896 |
-
}, 1500);
|
3897 |
-
}
|
3898 |
-
} );
|
3899 |
-
// Update the visible public link.
|
3900 |
-
jQuery('#public_link').val( publicLink );
|
3901 |
-
},
|
3902 |
-
|
3903 |
-
cancelResetPublicLinkHandler: function ( e ) {
|
3904 |
-
_.each( e.target.parentNode.children, function( node ) {
|
3905 |
-
if ( node.classList.contains( 'js-click-cancel' ) || node.classList.contains( 'js-click-confirm' ) ) {
|
3906 |
-
node.style.display = 'none';
|
3907 |
-
} else {
|
3908 |
-
node.style.display = 'inline-block';
|
3909 |
-
}
|
3910 |
-
} );
|
3911 |
-
}
|
3912 |
-
} );
|
3913 |
-
|
3914 |
-
return view;
|
3915 |
-
} );
|
3916 |
-
|
3917 |
-
/**
|
3918 |
-
* Handles clicks on the 'view changes' button in the header.
|
3919 |
-
*
|
3920 |
-
* @package Ninja Forms builder
|
3921 |
-
* @subpackage App
|
3922 |
-
* @copyright (c) 2015 WP Ninjas
|
3923 |
-
* @since 3.0
|
3924 |
-
*/
|
3925 |
-
define( 'views/app/drawer/headerPublicLink',[], function() {
|
3926 |
-
var view = Marionette.ItemView.extend({
|
3927 |
-
tagName: 'div',
|
3928 |
-
template: '#tmpl-nf-drawer-header-public-link'
|
3929 |
-
});
|
3930 |
-
|
3931 |
-
return view;
|
3932 |
-
} );
|
3933 |
-
/**
|
3934 |
-
* Changes collection view.
|
3935 |
-
*
|
3936 |
-
* @package Ninja Forms builder
|
3937 |
-
* @subpackage App
|
3938 |
-
* @copyright (c) 2015 WP Ninjas
|
3939 |
-
* @since 3.0
|
3940 |
-
*/
|
3941 |
-
define( 'views/app/drawer/contentNewForm',['views/app/drawer/itemSetting'], function( itemSettingView) {
|
3942 |
-
var view = Marionette.LayoutView.extend( {
|
3943 |
-
tagName: 'div',
|
3944 |
-
template: '#tmpl-nf-drawer-content-new-form',
|
3945 |
-
|
3946 |
-
regions: {
|
3947 |
-
formName: '.new-form-name',
|
3948 |
-
formSubmit: '.new-form-submit'
|
3949 |
-
},
|
3950 |
-
|
3951 |
-
onRender: function() {
|
3952 |
-
var titleSettingModel = nfRadio.channel( 'settings' ).request( 'get:settingModel', 'title' );
|
3953 |
-
var addSubmitSettingModel = nfRadio.channel( 'settings' ).request( 'get:settingModel', 'add_submit' );
|
3954 |
-
var dataModel = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
3955 |
-
this.formName.show( new itemSettingView( { model: titleSettingModel, dataModel: dataModel } ) );
|
3956 |
-
/*
|
3957 |
-
* If we don't have any submit buttons on the form, prompt the user to add one on publish.
|
3958 |
-
*/
|
3959 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
3960 |
-
var submitButtons = fieldCollection.findWhere( { type: 'submit' } );
|
3961 |
-
if ( 'undefined' == typeof submitButtons ) {
|
3962 |
-
this.formSubmit.show( new itemSettingView( { model: addSubmitSettingModel, dataModel: dataModel } ) );
|
3963 |
-
} else {
|
3964 |
-
dataModel.set( 'add_submit', 0 );
|
3965 |
-
}
|
3966 |
-
},
|
3967 |
-
|
3968 |
-
events: {
|
3969 |
-
'click .publish': 'clickPublish'
|
3970 |
-
},
|
3971 |
-
|
3972 |
-
clickPublish: function( e ) {
|
3973 |
-
nfRadio.channel( 'app' ).trigger( 'click:confirmPublish', e );
|
3974 |
-
}
|
3975 |
-
} );
|
3976 |
-
|
3977 |
-
return view;
|
3978 |
-
} );
|
3979 |
-
|
3980 |
-
/**
|
3981 |
-
* Handles clicks on the 'view changes' button in the header.
|
3982 |
-
*
|
3983 |
-
* @package Ninja Forms builder
|
3984 |
-
* @subpackage App
|
3985 |
-
* @copyright (c) 2015 WP Ninjas
|
3986 |
-
* @since 3.0
|
3987 |
-
*/
|
3988 |
-
define( 'views/app/drawer/headerNewForm',[], function() {
|
3989 |
-
var view = Marionette.ItemView.extend({
|
3990 |
-
tagName: 'div',
|
3991 |
-
template: '#tmpl-nf-drawer-header-new-form'
|
3992 |
-
});
|
3993 |
-
|
3994 |
-
return view;
|
3995 |
-
} );
|
3996 |
-
/**
|
3997 |
-
* Config file for our app drawers.
|
3998 |
-
*
|
3999 |
-
* this.collection represents all of our registered drawers.
|
4000 |
-
*
|
4001 |
-
* @package Ninja Forms builder
|
4002 |
-
* @subpackage Main App
|
4003 |
-
* @copyright (c) 2015 WP Ninjas
|
4004 |
-
* @since 3.0
|
4005 |
-
*/
|
4006 |
-
define( 'controllers/app/drawerConfig',[
|
4007 |
-
'models/app/drawerCollection',
|
4008 |
-
'views/fields/drawer/addField',
|
4009 |
-
'views/app/drawer/editSettings',
|
4010 |
-
'views/app/drawer/headerEditSettings',
|
4011 |
-
'views/actions/drawer/addAction',
|
4012 |
-
'views/app/drawer/contentViewChanges',
|
4013 |
-
'views/app/drawer/headerViewChanges',
|
4014 |
-
'views/app/drawer/contentPublicLink',
|
4015 |
-
'views/app/drawer/headerPublicLink',
|
4016 |
-
'views/app/drawer/contentNewForm',
|
4017 |
-
'views/app/drawer/headerNewForm'
|
4018 |
-
], function(
|
4019 |
-
drawerCollection,
|
4020 |
-
addFieldView,
|
4021 |
-
editSettingsView,
|
4022 |
-
editSettingsHeaderView,
|
4023 |
-
addActionView,
|
4024 |
-
viewChangesView,
|
4025 |
-
viewChangesHeaderView,
|
4026 |
-
publicLinkView,
|
4027 |
-
publicLinkHeaderView,
|
4028 |
-
newFormView,
|
4029 |
-
newFormHeaderView,
|
4030 |
-
mobileItemControlsView
|
4031 |
-
) {
|
4032 |
-
var controller = Marionette.Object.extend( {
|
4033 |
-
initialize: function() {
|
4034 |
-
|
4035 |
-
this.collection = new drawerCollection( [
|
4036 |
-
{
|
4037 |
-
id: 'addField',
|
4038 |
-
|
4039 |
-
getContentView: function( data ) {
|
4040 |
-
return new addFieldView( data );
|
4041 |
-
}
|
4042 |
-
},
|
4043 |
-
{
|
4044 |
-
id: 'addAction',
|
4045 |
-
|
4046 |
-
getContentView: function( data ) {
|
4047 |
-
return new addActionView( data );
|
4048 |
-
}
|
4049 |
-
},
|
4050 |
-
{
|
4051 |
-
id: 'editSettings',
|
4052 |
-
|
4053 |
-
/*
|
4054 |
-
* TODO: Add filtering when editing settings. For now, removing them from settings.
|
4055 |
-
*/
|
4056 |
-
getHeaderView: function( data ) {
|
4057 |
-
/*
|
4058 |
-
* Get a custom setting header view if one is set.
|
4059 |
-
* TODO: Currently, this only works for advanced settings.
|
4060 |
-
* This could be used to replace the need for a single config file.
|
4061 |
-
*/
|
4062 |
-
if ( 'undefined' != typeof data.typeModel ) {
|
4063 |
-
var view = nfRadio.channel( data.typeModel.get( 'id' ) ).request( 'get:drawerHeaderView' ) || editSettingsHeaderView;
|
4064 |
-
} else {
|
4065 |
-
var view = editSettingsHeaderView;
|
4066 |
-
}
|
4067 |
-
return new view( data );
|
4068 |
-
},
|
4069 |
-
|
4070 |
-
getContentView: function( data ) {
|
4071 |
-
return new editSettingsView( data );
|
4072 |
-
}
|
4073 |
-
},
|
4074 |
-
{
|
4075 |
-
id: 'viewChanges',
|
4076 |
-
|
4077 |
-
// getHeaderView() is defined by default, but we need to override it for the viewChanges drawer.
|
4078 |
-
getHeaderView: function( data ) {
|
4079 |
-
return new viewChangesHeaderView( data );
|
4080 |
-
},
|
4081 |
-
|
4082 |
-
getContentView: function( data ) {
|
4083 |
-
return new viewChangesView( data );
|
4084 |
-
}
|
4085 |
-
},
|
4086 |
-
{
|
4087 |
-
id: 'publicLink',
|
4088 |
-
|
4089 |
-
// getHeaderView() is defined by default, but we need to override it for the publicLink drawer.
|
4090 |
-
getHeaderView: function( data ) {
|
4091 |
-
return new publicLinkHeaderView( data );
|
4092 |
-
},
|
4093 |
-
|
4094 |
-
getContentView: function( data ) {
|
4095 |
-
return new publicLinkView( data );
|
4096 |
-
}
|
4097 |
-
},
|
4098 |
-
{
|
4099 |
-
id: 'newForm',
|
4100 |
-
|
4101 |
-
// getHeaderView() is defined by default, but we need to override it for the newForm drawer.
|
4102 |
-
getHeaderView: function( data ) {
|
4103 |
-
return new newFormHeaderView( data );
|
4104 |
-
},
|
4105 |
-
|
4106 |
-
getContentView: function( data ) {
|
4107 |
-
return new newFormView( data );
|
4108 |
-
}
|
4109 |
-
}
|
4110 |
-
] );
|
4111 |
-
|
4112 |
-
// Listen for requests for our drawer collection.
|
4113 |
-
nfRadio.channel( 'app' ).reply( 'get:drawerCollection', this.getDrawerCollection, this );
|
4114 |
-
// Listen for requests for specific drawer models.
|
4115 |
-
nfRadio.channel( 'app' ).reply( 'get:drawer', this.getDrawer, this );
|
4116 |
-
},
|
4117 |
-
|
4118 |
-
getDrawerCollection: function() {
|
4119 |
-
return this.collection;
|
4120 |
-
},
|
4121 |
-
|
4122 |
-
getDrawer: function( id ) {
|
4123 |
-
return this.collection.get( id );
|
4124 |
-
}
|
4125 |
-
|
4126 |
-
});
|
4127 |
-
|
4128 |
-
return controller;
|
4129 |
-
} );
|
4130 |
-
/**
|
4131 |
-
* Default settings title view.
|
4132 |
-
*
|
4133 |
-
* @package Ninja Forms builder
|
4134 |
-
* @subpackage App
|
4135 |
-
* @copyright (c) 2015 WP Ninjas
|
4136 |
-
* @since 3.0
|
4137 |
-
*/
|
4138 |
-
define( 'views/app/drawer/defaultSettingsTitle',[], function() {
|
4139 |
-
var view = Marionette.ItemView.extend({
|
4140 |
-
tagName: 'div',
|
4141 |
-
template: '#tmpl-nf-drawer-content-edit-settings-title-default',
|
4142 |
-
|
4143 |
-
templateHelpers: function () {
|
4144 |
-
return {
|
4145 |
-
renderTypeNicename: function() {
|
4146 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
4147 |
-
var domainID = currentDomain.get( 'id' );
|
4148 |
-
var type = nfRadio.channel( domainID ).request( 'get:type', this.type );
|
4149 |
-
if ( 'undefined' != typeof type ) {
|
4150 |
-
return type.get( 'nicename' );
|
4151 |
-
} else {
|
4152 |
-
return '';
|
4153 |
-
}
|
4154 |
-
}
|
4155 |
-
};
|
4156 |
-
},
|
4157 |
-
});
|
4158 |
-
|
4159 |
-
return view;
|
4160 |
-
} );
|
4161 |
-
/**
|
4162 |
-
* Empty view.
|
4163 |
-
*
|
4164 |
-
* @package Ninja Forms builder
|
4165 |
-
* @subpackage App
|
4166 |
-
* @copyright (c) 2015 WP Ninjas
|
4167 |
-
* @since 3.0
|
4168 |
-
*/
|
4169 |
-
define( 'views/app/empty',[], function() {
|
4170 |
-
var view = Marionette.ItemView.extend({
|
4171 |
-
tagName: 'div',
|
4172 |
-
template: '#tmpl-nf-empty'
|
4173 |
-
});
|
4174 |
-
|
4175 |
-
return view;
|
4176 |
-
} );
|
4177 |
-
/**
|
4178 |
-
* Model for our individual domains.
|
4179 |
-
*
|
4180 |
-
* @package Ninja Forms builder
|
4181 |
-
* @subpackage Fields
|
4182 |
-
* @copyright (c) 2015 WP Ninjas
|
4183 |
-
* @since 3.0
|
4184 |
-
*/
|
4185 |
-
define( 'models/app/domainModel',[ 'views/app/drawer/defaultSettingsTitle', 'views/app/empty' ], function( DefaultSettingsTitleView, EmptyView ) {
|
4186 |
-
var model = Backbone.Model.extend( {
|
4187 |
-
defaults: {
|
4188 |
-
dashicons: '',
|
4189 |
-
classes: '',
|
4190 |
-
active: false,
|
4191 |
-
url: '',
|
4192 |
-
hotkeys: false,
|
4193 |
-
disabled: false,
|
4194 |
-
|
4195 |
-
getSettingsTitleView: function( data ) {
|
4196 |
-
return new DefaultSettingsTitleView( data );
|
4197 |
-
},
|
4198 |
-
|
4199 |
-
getDefaultSettingsTitleView: function( data ) {
|
4200 |
-
return new DefaultSettingsTitleView( data );
|
4201 |
-
},
|
4202 |
-
|
4203 |
-
getGutterLeftView: function( data ) {
|
4204 |
-
/*
|
4205 |
-
* Return empty view
|
4206 |
-
*/
|
4207 |
-
return new EmptyView();
|
4208 |
-
},
|
4209 |
-
|
4210 |
-
getGutterRightView: function( data ) {
|
4211 |
-
/*
|
4212 |
-
* Return empty view
|
4213 |
-
*/
|
4214 |
-
return new EmptyView();
|
4215 |
-
}
|
4216 |
-
}
|
4217 |
-
} );
|
4218 |
-
|
4219 |
-
return model;
|
4220 |
-
} );
|
4221 |
-
/**
|
4222 |
-
* Holds all of our domain models.
|
4223 |
-
*
|
4224 |
-
* @package Ninja Forms builder
|
4225 |
-
* @subpackage Fields
|
4226 |
-
* @copyright (c) 2015 WP Ninjas
|
4227 |
-
* @since 3.0
|
4228 |
-
*/
|
4229 |
-
define( 'models/app/domainCollection',['models/app/domainModel'], function( domainModel ) {
|
4230 |
-
var collection = Backbone.Collection.extend( {
|
4231 |
-
model: domainModel
|
4232 |
-
} );
|
4233 |
-
return collection;
|
4234 |
-
} );
|
4235 |
-
define( 'views/fields/subHeader',[], function() {
|
4236 |
-
var view = Marionette.ItemView.extend({
|
4237 |
-
tagName: 'div',
|
4238 |
-
template: '#tmpl-nf-sub-header-fields'
|
4239 |
-
});
|
4240 |
-
|
4241 |
-
return view;
|
4242 |
-
} );
|
4243 |
-
define( 'views/fields/mainContentFieldCollection',[], function() {
|
4244 |
-
var view = Marionette.CollectionView.extend( {
|
4245 |
-
tagName: 'div',
|
4246 |
-
reorderOnSort: true,
|
4247 |
-
|
4248 |
-
getChildView: function() {
|
4249 |
-
return nfRadio.channel( 'views' ).request( 'get:fieldItem' );
|
4250 |
-
},
|
4251 |
-
|
4252 |
-
getEmptyView: function() {
|
4253 |
-
return nfRadio.channel( 'views' ).request( 'get:mainContentEmpty' );
|
4254 |
-
},
|
4255 |
-
|
4256 |
-
initialize: function() {
|
4257 |
-
nfRadio.channel( 'fields' ).reply( 'get:sortableEl', this.getSortableEl, this );
|
4258 |
-
nfRadio.channel( 'fields' ).reply( 'init:sortable', this.initSortable, this );
|
4259 |
-
nfRadio.channel( 'fields' ).reply( 'destroy:sortable', this.destroySortable, this );
|
4260 |
-
},
|
4261 |
-
|
4262 |
-
onRender: function() {
|
4263 |
-
if ( this.collection.models.length > 0 ) {
|
4264 |
-
jQuery( this.el ).addClass( 'nf-field-type-droppable' ).addClass( 'nf-fields-sortable' );
|
4265 |
-
var that = this;
|
4266 |
-
/* TODO: There's a bug with some Android phones and chrome. The fix below hasn't been implement.
|
4267 |
-
|
4268 |
-
* Instantiate our sortable field list, but only if we aren't on a mobile device.
|
4269 |
-
*
|
4270 |
-
* On Android, our sortable list isn't scrollable if it's instantiated at render.
|
4271 |
-
* Instead, for mobile, we need to instantiate our sortable when the user tapholds and then
|
4272 |
-
* destroy it when the drag stops.
|
4273 |
-
*/
|
4274 |
-
// if ( ! nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
4275 |
-
this.initSortable();
|
4276 |
-
// }
|
4277 |
-
}
|
4278 |
-
nfRadio.channel( 'app' ).trigger( 'render:fieldsSortable', this );
|
4279 |
-
},
|
4280 |
-
|
4281 |
-
getSortableEl: function() {
|
4282 |
-
return this.el;
|
4283 |
-
},
|
4284 |
-
|
4285 |
-
initSortable: function() {
|
4286 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
4287 |
-
var tolerance = 'pointer';
|
4288 |
-
} else {
|
4289 |
-
var tolerance = 'intersect';
|
4290 |
-
}
|
4291 |
-
|
4292 |
-
jQuery( this.el ).sortable( {
|
4293 |
-
containment: 'parent',
|
4294 |
-
helper: 'clone',
|
4295 |
-
cancel: '.nf-item-controls',
|
4296 |
-
placeholder: 'nf-fields-sortable-placeholder',
|
4297 |
-
opacity: 0.95,
|
4298 |
-
grid: [ 5, 5 ],
|
4299 |
-
// scroll: false,
|
4300 |
-
appendTo: '#nf-main',
|
4301 |
-
scrollSensitivity: 10,
|
4302 |
-
//connectWith would allow drag and drop between fields already in the builder and the repeatable fieldset ( this is currently an issue until we deal with existing data stored)
|
4303 |
-
//connectWith: '.nf-fields-sortable',
|
4304 |
-
|
4305 |
-
receive: function( e, ui ) {
|
4306 |
-
if ( ui.item.dropping || jQuery(ui.item).hasClass("nf-over-repeater") ) return;
|
4307 |
-
nfRadio.channel( 'app' ).request( 'receive:fieldsSortable', ui );
|
4308 |
-
},
|
4309 |
-
|
4310 |
-
over: function( e, ui ) {
|
4311 |
-
if ( ui.item.dropping ) return;
|
4312 |
-
nfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );
|
4313 |
-
},
|
4314 |
-
|
4315 |
-
out: function( e, ui ) {
|
4316 |
-
if ( ui.item.dropping ) return;
|
4317 |
-
nfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );
|
4318 |
-
},
|
4319 |
-
|
4320 |
-
start: function( e, ui ) {
|
4321 |
-
if ( ui.item.dropping ) return;
|
4322 |
-
nfRadio.channel( 'app' ).request( 'start:fieldsSortable', ui );
|
4323 |
-
},
|
4324 |
-
|
4325 |
-
update: function( e, ui ) {
|
4326 |
-
if ( ui.item.dropping ) return;
|
4327 |
-
nfRadio.channel( 'app' ).request( 'update:fieldsSortable', ui, this );
|
4328 |
-
},
|
4329 |
-
|
4330 |
-
stop: function( e, ui ) {
|
4331 |
-
if ( ui.item.dropping ) return;
|
4332 |
-
nfRadio.channel( 'app' ).request( 'stop:fieldsSortable', ui );
|
4333 |
-
}
|
4334 |
-
} );
|
4335 |
-
},
|
4336 |
-
|
4337 |
-
destroySortable: function() {
|
4338 |
-
jQuery( this.el ).sortable( 'destroy' );
|
4339 |
-
},
|
4340 |
-
|
4341 |
-
onAddChild: function( childView ) {
|
4342 |
-
if ( nfRadio.channel( 'fields' ).request( 'get:adding' ) ) {
|
4343 |
-
childView.$el.hide().show( 'clip' );
|
4344 |
-
nfRadio.channel( 'fields' ).request( 'set:adding', false );
|
4345 |
-
}
|
4346 |
-
}
|
4347 |
-
|
4348 |
-
} );
|
4349 |
-
|
4350 |
-
return view;
|
4351 |
-
} );
|
4352 |
-
|
4353 |
-
define( 'views/fields/drawer/addSavedField',[], function() {
|
4354 |
-
var view = Marionette.ItemView.extend({
|
4355 |
-
tagName: 'div',
|
4356 |
-
template: '#tmpl-nf-add-saved-field',
|
4357 |
-
|
4358 |
-
initialize: function() {
|
4359 |
-
this.model.on( 'change:addSavedLoading', this.renderAddButton, this );
|
4360 |
-
},
|
4361 |
-
|
4362 |
-
onRender: function() {
|
4363 |
-
this.renderAddButton();
|
4364 |
-
},
|
4365 |
-
|
4366 |
-
renderAddButton: function() {
|
4367 |
-
if ( this.model.get( 'addSavedLoading' ) ) {
|
4368 |
-
var button = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-add-saved-field-loading' );
|
4369 |
-
} else {
|
4370 |
-
var button = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-add-saved-field-button' );
|
4371 |
-
}
|
4372 |
-
jQuery( this.el ).find( '.add-button' ).html( button( this ) );
|
4373 |
-
},
|
4374 |
-
|
4375 |
-
onBeforeDestroy: function() {
|
4376 |
-
this.model.off( 'change:addSavedLoading', this.render );
|
4377 |
-
},
|
4378 |
-
|
4379 |
-
events: {
|
4380 |
-
'click .nf-button': 'clickAddSavedField'
|
4381 |
-
},
|
4382 |
-
|
4383 |
-
clickAddSavedField: function( e ) {
|
4384 |
-
nfRadio.channel( 'drawer' ).trigger( 'click:addSavedField', e, this.model );
|
4385 |
-
}
|
4386 |
-
});
|
4387 |
-
|
4388 |
-
return view;
|
4389 |
-
} );
|
4390 |
-
|
4391 |
-
/**
|
4392 |
-
* Fields settings title view.
|
4393 |
-
*
|
4394 |
-
* @package Ninja Forms builder
|
4395 |
-
* @subpackage Fields
|
4396 |
-
* @copyright (c) 2015 WP Ninjas
|
4397 |
-
* @since 3.0
|
4398 |
-
*/
|
4399 |
-
define( 'views/fields/drawer/settingsTitle',['views/fields/drawer/addSavedField'], function( addSavedFieldView ) {
|
4400 |
-
var view = Marionette.LayoutView.extend({
|
4401 |
-
tagName: 'div',
|
4402 |
-
template: '#tmpl-nf-drawer-content-edit-settings-title-fields',
|
4403 |
-
|
4404 |
-
initialize: function() {
|
4405 |
-
this.model.on( 'change:saved', this.render, this );
|
4406 |
-
this.model.on( 'change:label', this.renderjBoxContent, this );
|
4407 |
-
},
|
4408 |
-
|
4409 |
-
regions: {
|
4410 |
-
addSaved: '.nf-add-saved-field'
|
4411 |
-
},
|
4412 |
-
|
4413 |
-
onBeforeDestroy: function() {
|
4414 |
-
this.model.off( 'change:saved', this.render );
|
4415 |
-
this.addSavedjBox.destroy();
|
4416 |
-
this.model.unset( 'jBox', { silent: true } );
|
4417 |
-
},
|
4418 |
-
|
4419 |
-
onRender: function() {
|
4420 |
-
this.renderjBoxContent();
|
4421 |
-
var that = this;
|
4422 |
-
this.addSavedjBox = new jBox( 'Tooltip', {
|
4423 |
-
trigger: 'click',
|
4424 |
-
title: 'Add to Favorite Fields',
|
4425 |
-
position: {
|
4426 |
-
x:'left',
|
4427 |
-
y:'center'
|
4428 |
-
},
|
4429 |
-
outside:'x',
|
4430 |
-
closeOnClick: 'body',
|
4431 |
-
|
4432 |
-
onCreated: function() {
|
4433 |
-
this.setContent( jQuery( that.el ).find( '.nf-add-saved-field' ) );
|
4434 |
-
}
|
4435 |
-
} );
|
4436 |
-
this.addSavedjBox.attach( jQuery( this.el ).find( '.dashicons') );
|
4437 |
-
this.model.set( 'jBox', this.addSavedjBox, { silent: true } );
|
4438 |
-
},
|
4439 |
-
|
4440 |
-
renderjBoxContent: function() {
|
4441 |
-
if ( this.addSaved ) {
|
4442 |
-
this.addSaved.show( new addSavedFieldView( { model: this.model } ) );
|
4443 |
-
}
|
4444 |
-
},
|
4445 |
-
|
4446 |
-
templateHelpers: function () {
|
4447 |
-
return {
|
4448 |
-
renderTypeNicename: function() {
|
4449 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
4450 |
-
var domainID = currentDomain.get( 'id' );
|
4451 |
-
var type = nfRadio.channel( domainID ).request( 'get:type', this.type );
|
4452 |
-
var displayName = type.get( 'nicename' );
|
4453 |
-
|
4454 |
-
if ( this.saved ) {
|
4455 |
-
var realType = nfRadio.channel( domainID ).request( 'get:type', type.get( 'type' ) );
|
4456 |
-
displayName += ' - ' + realType.get( 'nicename' );
|
4457 |
-
}
|
4458 |
-
return displayName;
|
4459 |
-
},
|
4460 |
-
|
4461 |
-
renderSavedStar: function() {
|
4462 |
-
if ( this.saved ) {
|
4463 |
-
var star = 'filled';
|
4464 |
-
} else {
|
4465 |
-
var star = 'empty';
|
4466 |
-
}
|
4467 |
-
return '<span class="dashicons dashicons-star-' + star + '"></span>'
|
4468 |
-
}
|
4469 |
-
};
|
4470 |
-
}
|
4471 |
-
});
|
4472 |
-
|
4473 |
-
return view;
|
4474 |
-
} );
|
4475 |
-
/**
|
4476 |
-
* Add main header.
|
4477 |
-
*
|
4478 |
-
* TODO: make dynamic
|
4479 |
-
*
|
4480 |
-
* @package Ninja Forms builder
|
4481 |
-
* @subpackage Actions
|
4482 |
-
* @copyright (c) 2015 WP Ninjas
|
4483 |
-
* @since 3.0
|
4484 |
-
*/
|
4485 |
-
define( 'views/actions/mainHeader',[], function() {
|
4486 |
-
var view = Marionette.ItemView.extend({
|
4487 |
-
tagName: 'div',
|
4488 |
-
template: '#tmpl-nf-main-header-actions',
|
4489 |
-
|
4490 |
-
initialize: function() {
|
4491 |
-
var actionCollection = nfRadio.channel( 'actions' ).request( 'get:collection' );
|
4492 |
-
this.listenTo( actionCollection, 'add', this.render );
|
4493 |
-
this.listenTo( actionCollection, 'remove', this.render );
|
4494 |
-
},
|
4495 |
-
|
4496 |
-
onRender: function() {
|
4497 |
-
var actionCollection = nfRadio.channel( 'actions' ).request( 'get:collection' );
|
4498 |
-
if ( actionCollection.models.length == 0 ) {
|
4499 |
-
jQuery( this.el ).hide();
|
4500 |
-
} else {
|
4501 |
-
jQuery( this.el ).show();
|
4502 |
-
}
|
4503 |
-
}
|
4504 |
-
});
|
4505 |
-
|
4506 |
-
return view;
|
4507 |
-
} );
|
4508 |
-
/**
|
4509 |
-
* Actions subheader view.
|
4510 |
-
*
|
4511 |
-
* TODO: make dynamic
|
4512 |
-
*
|
4513 |
-
* @package Ninja Forms builder
|
4514 |
-
* @subpackage Actions
|
4515 |
-
* @copyright (c) 2015 WP Ninjas
|
4516 |
-
* @since 3.0
|
4517 |
-
*/
|
4518 |
-
define( 'views/actions/subHeader',[], function() {
|
4519 |
-
var view = Marionette.ItemView.extend({
|
4520 |
-
tagName: 'div',
|
4521 |
-
template: '#tmpl-nf-sub-header-actions'
|
4522 |
-
});
|
4523 |
-
|
4524 |
-
return view;
|
4525 |
-
} );
|
4526 |
-
/**
|
4527 |
-
* Renders an application menu item from a domain model.
|
4528 |
-
*
|
4529 |
-
* @package Ninja Forms builder
|
4530 |
-
* @subpackage App
|
4531 |
-
* @copyright (c) 2015 WP Ninjas
|
4532 |
-
* @since 3.0
|
4533 |
-
*/
|
4534 |
-
define( 'views/app/itemControls',[], function() {
|
4535 |
-
var view = Marionette.ItemView.extend({
|
4536 |
-
tagName: 'div',
|
4537 |
-
template: '#tmpl-nf-item-controls',
|
4538 |
-
|
4539 |
-
initialize: function() {
|
4540 |
-
// Listen for domain changes and re-render when we detect one.
|
4541 |
-
// this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.render );
|
4542 |
-
},
|
4543 |
-
|
4544 |
-
/**
|
4545 |
-
* When we render this view, remove the extra <div> tag created by backbone.
|
4546 |
-
*
|
4547 |
-
* @since 3.0
|
4548 |
-
* @return void
|
4549 |
-
*/
|
4550 |
-
onRender: function() {
|
4551 |
-
// this.$el = this.$el.children();
|
4552 |
-
// this.$el.unwrap();
|
4553 |
-
// this.setElement( this.$el );
|
4554 |
-
//
|
4555 |
-
this.currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
4556 |
-
},
|
4557 |
-
|
4558 |
-
events: {
|
4559 |
-
'mouseover .nf-item-control': 'mouseoverItemControl',
|
4560 |
-
'click .nf-edit-settings': 'clickEdit',
|
4561 |
-
'singletap .nf-item-control': 'singleTapEdit',
|
4562 |
-
'click .nf-item-delete': 'clickDelete',
|
4563 |
-
'click .nf-item-duplicate': 'clickDuplicateField'
|
4564 |
-
},
|
4565 |
-
|
4566 |
-
clickEdit: function( e ) {
|
4567 |
-
if ( ! nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
4568 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', e, this.model );
|
4569 |
-
}
|
4570 |
-
},
|
4571 |
-
|
4572 |
-
singleTapEdit: function( e ) {
|
4573 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', e, this.model );
|
4574 |
-
},
|
4575 |
-
|
4576 |
-
clickDelete: function( e ) {
|
4577 |
-
nfRadio.channel( 'app' ).trigger( 'click:delete', e, this.model );
|
4578 |
-
},
|
4579 |
-
|
4580 |
-
clickDuplicateField: function( e ) {
|
4581 |
-
nfRadio.channel( 'app' ).trigger( 'click:duplicate', e, this.model );
|
4582 |
-
},
|
4583 |
-
|
4584 |
-
mouseoverItemControl: function( e ) {
|
4585 |
-
nfRadio.channel( 'app' ).trigger( 'mouseover:itemControl', e, this.model );
|
4586 |
-
}
|
4587 |
-
});
|
4588 |
-
|
4589 |
-
return view;
|
4590 |
-
} );
|
4591 |
-
/**
|
4592 |
-
* Single action table row
|
4593 |
-
*
|
4594 |
-
* TODO: make dynamic
|
4595 |
-
*
|
4596 |
-
* @package Ninja Forms builder
|
4597 |
-
* @subpackage Actions
|
4598 |
-
* @copyright (c) 2015 WP Ninjas
|
4599 |
-
* @since 3.0
|
4600 |
-
*/
|
4601 |
-
define( 'views/actions/actionItem',['views/app/itemControls'], function( itemControlsView ) {
|
4602 |
-
var view = Marionette.LayoutView.extend({
|
4603 |
-
tagName: 'tr',
|
4604 |
-
template: '#tmpl-nf-action-item',
|
4605 |
-
|
4606 |
-
regions: {
|
4607 |
-
itemControls: '.nf-item-controls'
|
4608 |
-
},
|
4609 |
-
|
4610 |
-
initialize: function() {
|
4611 |
-
this.template = nfRadio.channel( 'actions' ).request( 'get:actionItemTemplate' ) || this.template;
|
4612 |
-
this.model.on( 'change:label', this.render, this );
|
4613 |
-
this.model.on( 'change:editActive', this.render, this );
|
4614 |
-
this.model.on( 'change:active', this.maybeDeactivate, this );
|
4615 |
-
},
|
4616 |
-
|
4617 |
-
onBeforeDestroy: function() {
|
4618 |
-
this.model.off( 'change:label', this.render );
|
4619 |
-
this.model.off( 'change:editActive', this.render );
|
4620 |
-
this.model.off( 'change:active', this.maybeDeactivate );
|
4621 |
-
},
|
4622 |
-
|
4623 |
-
onRender: function() {
|
4624 |
-
if ( this.model.get( 'editActive' ) ) {
|
4625 |
-
jQuery( this.el ).addClass( 'active' );
|
4626 |
-
} else {
|
4627 |
-
jQuery( this.el ).removeClass( 'active' );
|
4628 |
-
}
|
4629 |
-
|
4630 |
-
this.maybeDeactivate();
|
4631 |
-
|
4632 |
-
this.itemControls.show( new itemControlsView( { model: this.model } ) );
|
4633 |
-
},
|
4634 |
-
|
4635 |
-
maybeDeactivate: function() {
|
4636 |
-
if ( 0 == this.model.get( 'active' ) ) {
|
4637 |
-
jQuery( this.el ).addClass( 'deactivated' );
|
4638 |
-
} else {
|
4639 |
-
jQuery( this.el ).removeClass( 'deactivated' );
|
4640 |
-
}
|
4641 |
-
},
|
4642 |
-
|
4643 |
-
events: {
|
4644 |
-
'change input': 'changeToggle',
|
4645 |
-
'click': 'maybeClickEdit'
|
4646 |
-
},
|
4647 |
-
|
4648 |
-
maybeClickEdit: function( e ) {
|
4649 |
-
if ( 'TR' == jQuery( e.target ).parent().prop( 'tagName' ) ) {
|
4650 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', e, this.model );
|
4651 |
-
}
|
4652 |
-
},
|
4653 |
-
|
4654 |
-
changeToggle: function( e ) {
|
4655 |
-
var setting = jQuery( e.target ).data( 'setting' );
|
4656 |
-
var settingModel = nfRadio.channel( 'actions' ).request( 'get:settingModel', setting );
|
4657 |
-
nfRadio.channel( 'app' ).request( 'change:setting', e, settingModel, this.model );
|
4658 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
4659 |
-
},
|
4660 |
-
|
4661 |
-
templateHelpers: function() {
|
4662 |
-
return {
|
4663 |
-
renderToggle: function( settingName ) {
|
4664 |
-
this.settingName = settingName || 'active';
|
4665 |
-
var actionLabel = this.label;
|
4666 |
-
this.label = '';
|
4667 |
-
this.value = this[ this.settingName ];
|
4668 |
-
this.name = this.id + '-' + this.settingName;
|
4669 |
-
var html = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-edit-setting-toggle' );
|
4670 |
-
html = html( this );
|
4671 |
-
this.label = actionLabel;
|
4672 |
-
return html;
|
4673 |
-
},
|
4674 |
-
|
4675 |
-
renderTypeNicename: function() {
|
4676 |
-
var type = nfRadio.channel( 'actions' ).request( 'get:type', this.type );
|
4677 |
-
if ( 'undefined' == typeof type ) return;
|
4678 |
-
|
4679 |
-
return type.get( 'nicename' );
|
4680 |
-
},
|
4681 |
-
|
4682 |
-
/**
|
4683 |
-
* [Deprecated] Tooltips are not currently implemented in the context of the action list.
|
4684 |
-
* However, the template uses a nested template which requires the helper method.
|
4685 |
-
* @returns {string}
|
4686 |
-
*/
|
4687 |
-
renderTooltip: function() {
|
4688 |
-
return '';
|
4689 |
-
},
|
4690 |
-
|
4691 |
-
renderMergeTags: function() {
|
4692 |
-
if ( this.use_merge_tags ) {
|
4693 |
-
return '<span class="dashicons dashicons-list-view merge-tags"></span>';
|
4694 |
-
} else {
|
4695 |
-
return '';
|
4696 |
-
}
|
4697 |
-
}
|
4698 |
-
}
|
4699 |
-
}
|
4700 |
-
});
|
4701 |
-
|
4702 |
-
return view;
|
4703 |
-
} );
|
4704 |
-
|
4705 |
-
define( 'views/actions/mainContentEmpty',[], function() {
|
4706 |
-
var view = Marionette.ItemView.extend({
|
4707 |
-
tagName: 'div',
|
4708 |
-
template: '#tmpl-nf-main-content-actions-empty',
|
4709 |
-
|
4710 |
-
onBeforeDestroy: function() {
|
4711 |
-
jQuery( this.el ).parent().parent().removeClass( 'nf-actions-empty' );
|
4712 |
-
// jQuery( this.el ).parent().removeClass( 'nf-fields-empty-droppable' ).droppable( 'destroy' );
|
4713 |
-
},
|
4714 |
-
|
4715 |
-
onRender: function() {
|
4716 |
-
this.$el = this.$el.children();
|
4717 |
-
this.$el.unwrap();
|
4718 |
-
this.setElement( this.$el );
|
4719 |
-
},
|
4720 |
-
|
4721 |
-
onShow: function() {
|
4722 |
-
jQuery( this.el ).parent().parent().addClass( 'nf-actions-empty' );
|
4723 |
-
// if ( jQuery( this.el ).parent().hasClass( 'ui-sortable' ) ) {
|
4724 |
-
// jQuery( this.el ).parent().sortable( 'destroy' );
|
4725 |
-
// }
|
4726 |
-
// jQuery( this.el ).parent().addClass( 'nf-fields-empty-droppable' );
|
4727 |
-
// jQuery( this.el ).parent().droppable( {
|
4728 |
-
// accept: function( draggable ) {
|
4729 |
-
// if ( jQuery( draggable ).hasClass( 'nf-stage' ) || jQuery( draggable ).hasClass( 'nf-field-type-button' ) ) {
|
4730 |
-
// return true;
|
4731 |
-
// }
|
4732 |
-
// },
|
4733 |
-
// hoverClass: 'nf-droppable-hover',
|
4734 |
-
// tolerance: 'pointer',
|
4735 |
-
// over: function( e, ui ) {
|
4736 |
-
// ui.item = ui.draggable;
|
4737 |
-
// nfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );
|
4738 |
-
// },
|
4739 |
-
// out: function( e, ui ) {
|
4740 |
-
// ui.item = ui.draggable;
|
4741 |
-
// nfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );
|
4742 |
-
// },
|
4743 |
-
// drop: function( e, ui ) {
|
4744 |
-
// ui.item = ui.draggable;
|
4745 |
-
// nfRadio.channel( 'app' ).request( 'receive:fieldsSortable', ui );
|
4746 |
-
// var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
4747 |
-
// fieldCollection.trigger( 'reset', fieldCollection );
|
4748 |
-
// },
|
4749 |
-
// } );
|
4750 |
-
}
|
4751 |
-
});
|
4752 |
-
|
4753 |
-
return view;
|
4754 |
-
} );
|
4755 |
-
/**
|
4756 |
-
* Main content view for our actions.
|
4757 |
-
*
|
4758 |
-
* TODO: make dynamic
|
4759 |
-
*
|
4760 |
-
* @package Ninja Forms builder
|
4761 |
-
* @subpackage Actions
|
4762 |
-
* @copyright (c) 2015 WP Ninjas
|
4763 |
-
* @since 3.0
|
4764 |
-
*/
|
4765 |
-
define( 'views/actions/mainContent',['views/actions/actionItem', 'views/actions/mainContentEmpty'], function( actionView, emptyView ) {
|
4766 |
-
var view = Marionette.CompositeView.extend({
|
4767 |
-
template: '#tmpl-nf-action-table',
|
4768 |
-
childView: actionView,
|
4769 |
-
emptyView: emptyView,
|
4770 |
-
|
4771 |
-
initialize: function() {
|
4772 |
-
this.template = nfRadio.channel( 'actions' ).request( 'get:mainContentTemplate' ) || this.template;
|
4773 |
-
},
|
4774 |
-
|
4775 |
-
onRender: function() {
|
4776 |
-
jQuery( this.el ).droppable( {
|
4777 |
-
accept: '.nf-action-type-draggable',
|
4778 |
-
activeClass: 'nf-droppable-active',
|
4779 |
-
hoverClass: 'nf-droppable-hover',
|
4780 |
-
drop: function( e, ui ) {
|
4781 |
-
nfRadio.channel( 'app' ).request( 'drop:actionType', e, ui );
|
4782 |
-
}
|
4783 |
-
} );
|
4784 |
-
},
|
4785 |
-
|
4786 |
-
attachHtml: function( collectionView, childView ) {
|
4787 |
-
if ( 'undefined' == typeof nfRadio.channel( 'actions' ).request( 'get:type', childView.model.get( 'type' ) ) ) return;
|
4788 |
-
|
4789 |
-
jQuery( collectionView.el ).find( 'tbody' ).append( childView.el );
|
4790 |
-
},
|
4791 |
-
});
|
4792 |
-
|
4793 |
-
return view;
|
4794 |
-
} );
|
4795 |
-
|
4796 |
-
define( 'views/advanced/mainHeader',[], function() {
|
4797 |
-
var view = Marionette.ItemView.extend({
|
4798 |
-
tagName: 'div',
|
4799 |
-
template: '#tmpl-nf-main-header-settings'
|
4800 |
-
});
|
4801 |
-
|
4802 |
-
return view;
|
4803 |
-
} );
|
4804 |
-
define( 'views/advanced/subHeader',[], function() {
|
4805 |
-
var view = Marionette.ItemView.extend({
|
4806 |
-
tagName: 'div',
|
4807 |
-
template: '#tmpl-nf-sub-header-settings'
|
4808 |
-
});
|
4809 |
-
|
4810 |
-
return view;
|
4811 |
-
} );
|
4812 |
-
define( 'views/advanced/settingItem',[], function() {
|
4813 |
-
var view = Marionette.ItemView.extend({
|
4814 |
-
tagName: 'div',
|
4815 |
-
template: '#tmpl-nf-form-setting-type',
|
4816 |
-
|
4817 |
-
onBeforeDestroy: function() {
|
4818 |
-
this.model.off( 'change:editActive', this.updateActiveClass );
|
4819 |
-
},
|
4820 |
-
|
4821 |
-
initialize: function() {
|
4822 |
-
this.model.on( 'change:editActive', this.updateActiveClass, this );
|
4823 |
-
},
|
4824 |
-
|
4825 |
-
events: {
|
4826 |
-
'click': 'clickEdit'
|
4827 |
-
},
|
4828 |
-
|
4829 |
-
clickEdit: function( e ) {
|
4830 |
-
nfRadio.channel( 'settings' ).trigger( 'click:edit', e, this.model );
|
4831 |
-
},
|
4832 |
-
|
4833 |
-
templateHelpers: function() {
|
4834 |
-
return {
|
4835 |
-
renderClasses: function() {
|
4836 |
-
var classes = 'nf-setting-wrap ' + this.id;
|
4837 |
-
if ( this.editActive ) {
|
4838 |
-
classes += ' active';
|
4839 |
-
}
|
4840 |
-
return classes;
|
4841 |
-
}
|
4842 |
-
}
|
4843 |
-
},
|
4844 |
-
|
4845 |
-
updateActiveClass: function() {
|
4846 |
-
if ( this.model.get( 'editActive' ) ) {
|
4847 |
-
jQuery( this.el ).find( '.nf-setting-wrap' ).addClass( 'active' );
|
4848 |
-
} else {
|
4849 |
-
jQuery( this.el ).find( '.nf-setting-wrap' ).removeClass( 'active' );
|
4850 |
-
}
|
4851 |
-
}
|
4852 |
-
});
|
4853 |
-
|
4854 |
-
return view;
|
4855 |
-
} );
|
4856 |
-
define( 'views/advanced/mainContent',['views/advanced/settingItem'], function( settingItem ) {
|
4857 |
-
var view = Marionette.CompositeView.extend({
|
4858 |
-
childView: settingItem,
|
4859 |
-
template: '#tmpl-nf-advanced-main-content',
|
4860 |
-
|
4861 |
-
attachHtml: function( collectionView, childView ) {
|
4862 |
-
jQuery( collectionView.el ).find( '.child-view-container' ).append( childView.el );
|
4863 |
-
}
|
4864 |
-
});
|
4865 |
-
|
4866 |
-
return view;
|
4867 |
-
} );
|
4868 |
-
/**
|
4869 |
-
* Model that represents our form fields.
|
4870 |
-
*
|
4871 |
-
* @package Ninja Forms builder
|
4872 |
-
* @subpackage Fields
|
4873 |
-
* @copyright (c) 2015 WP Ninjas
|
4874 |
-
* @since 3.0
|
4875 |
-
*/
|
4876 |
-
define( 'models/fields/fieldModel',[], function() {
|
4877 |
-
var model = Backbone.Model.extend( {
|
4878 |
-
defaults: {
|
4879 |
-
objectType: 'Field',
|
4880 |
-
objectDomain: 'fields',
|
4881 |
-
editActive: false,
|
4882 |
-
order: 999,
|
4883 |
-
idAttribute: 'id'
|
4884 |
-
},
|
4885 |
-
|
4886 |
-
initialize: function() {
|
4887 |
-
var type = this.get('type');
|
4888 |
-
if ( 'undefined' == typeof type ) return;
|
4889 |
-
|
4890 |
-
// Listen for model attribute changes
|
4891 |
-
this.on( 'change', this.changeSetting, this );
|
4892 |
-
|
4893 |
-
// Get our parent field type.
|
4894 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', this.get( 'type' ) );
|
4895 |
-
var parentType = fieldType.get( 'parentType' );
|
4896 |
-
|
4897 |
-
// Loop through our field type "settingDefaults" and add any default settings.
|
4898 |
-
_.each( fieldType.get( 'settingDefaults' ), function( val, key ) {
|
4899 |
-
if ( 'undefined' == typeof this.get( key ) ) {
|
4900 |
-
this.set( key, val, { silent: true } );
|
4901 |
-
}
|
4902 |
-
}, this );
|
4903 |
-
|
4904 |
-
/*
|
4905 |
-
* If our field type is a saved field, set our field type to the actual field type
|
4906 |
-
*/
|
4907 |
-
if ( 'saved' == fieldType.get( 'section' ) ) {
|
4908 |
-
this.set( 'type', fieldType.get( 'type' ) );
|
4909 |
-
}
|
4910 |
-
|
4911 |
-
if (type === 'listimage') {
|
4912 |
-
this.get = this.listimageGet;
|
4913 |
-
this.set = this.listimageSet;
|
4914 |
-
}
|
4915 |
-
|
4916 |
-
/*
|
4917 |
-
* Trigger an init event on three channels:
|
4918 |
-
*
|
4919 |
-
* fields
|
4920 |
-
* fields-parentType
|
4921 |
-
* field-type
|
4922 |
-
*
|
4923 |
-
* This lets specific field types modify model attributes before anything uses them.
|
4924 |
-
*/
|
4925 |
-
nfRadio.channel( 'fields' ).trigger( 'init:fieldModel', this );
|
4926 |
-
nfRadio.channel( 'fields-' + parentType ).trigger( 'init:fieldModel', this );
|
4927 |
-
nfRadio.channel( 'fields-' + this.get( 'type' ) ).trigger( 'init:fieldModel', this );
|
4928 |
-
|
4929 |
-
this.listenTo( nfRadio.channel( 'app' ), 'fire:updateFieldKey', this.updateFieldKey );
|
4930 |
-
},
|
4931 |
-
|
4932 |
-
listimageGet: function(attr) {
|
4933 |
-
if(attr === 'options') {
|
4934 |
-
attr = 'image_options';
|
4935 |
-
}
|
4936 |
-
|
4937 |
-
return Backbone.Model.prototype.get.call(this, attr);
|
4938 |
-
},
|
4939 |
-
|
4940 |
-
listimageSet: function(attributes, options) {
|
4941 |
-
if ('options' === attributes) {
|
4942 |
-
attributes = 'image_options';
|
4943 |
-
}
|
4944 |
-
return Backbone.Model.prototype.set.call(this, attributes, options);
|
4945 |
-
},
|
4946 |
-
|
4947 |
-
/**
|
4948 |
-
* Fires an event on the fieldSetting-{name} channel saying we've updated a setting.
|
4949 |
-
* When we change the model attributes, fire an event saying we've changed something.
|
4950 |
-
*
|
4951 |
-
* @since 3.0
|
4952 |
-
* @return void
|
4953 |
-
*/
|
4954 |
-
changeSetting: function( model, options ) {
|
4955 |
-
nfRadio.channel( 'fieldSetting-' + _.keys( model.changedAttributes() )[0] ).trigger( 'update:setting', this, options.settingModel ) ;
|
4956 |
-
nfRadio.channel( 'fields' ).trigger( 'update:setting', this, options.settingModel );
|
4957 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', this, options.settingModel );
|
4958 |
-
},
|
4959 |
-
|
4960 |
-
updateFieldKey: function( keyModel, settingModel ) {
|
4961 |
-
nfRadio.channel( 'app' ).trigger( 'replace:fieldKey', this, keyModel, settingModel );
|
4962 |
-
},
|
4963 |
-
|
4964 |
-
/**
|
4965 |
-
* Function used to get the formatted lable of the fieldModel.
|
4966 |
-
*
|
4967 |
-
* @since 3.3.3
|
4968 |
-
* @return String
|
4969 |
-
*/
|
4970 |
-
formatLabel: function() {
|
4971 |
-
// Try to use admin label.
|
4972 |
-
var label = this.get( 'admin_label' );
|
4973 |
-
// If our admin label is empty...
|
4974 |
-
if ( '' == label ) {
|
4975 |
-
// Use the field label instead.
|
4976 |
-
label = this.get( 'label' );
|
4977 |
-
}
|
4978 |
-
return label;
|
4979 |
-
}
|
4980 |
-
} );
|
4981 |
-
|
4982 |
-
return model;
|
4983 |
-
} );
|
4984 |
-
/**
|
4985 |
-
* Collection that holds our field models.
|
4986 |
-
* This is the actual field data created by the user.
|
4987 |
-
*
|
4988 |
-
* We listen to the add and remove events so that we can push the new id to either the new fields or removed fields property.
|
4989 |
-
*
|
4990 |
-
* @package Ninja Forms builder
|
4991 |
-
* @subpackage Fields
|
4992 |
-
* @copyright (c) 2015 WP Ninjas
|
4993 |
-
* @since 3.0
|
4994 |
-
*/
|
4995 |
-
define( 'models/fields/fieldCollection',['models/fields/fieldModel'], function( fieldModel ) {
|
4996 |
-
var collection = Backbone.Collection.extend( {
|
4997 |
-
model: fieldModel,
|
4998 |
-
comparator: function( model ){
|
4999 |
-
return parseInt( model.get( 'order' ) );
|
5000 |
-
},
|
5001 |
-
tmpNum: 1,
|
5002 |
-
|
5003 |
-
initialize: function() {
|
5004 |
-
this.on( 'add', this.addField, this );
|
5005 |
-
this.on( 'remove', this.removeField, this );
|
5006 |
-
|
5007 |
-
this.listenTo( this, 'add:field', this.addNewField );
|
5008 |
-
this.listenTo( this, 'append:field', this.appendNewField );
|
5009 |
-
this.listenTo( this, 'remove:field', this.removeFieldResponse );
|
5010 |
-
this.newIDs = [];
|
5011 |
-
},
|
5012 |
-
|
5013 |
-
/**
|
5014 |
-
* When we add a field, push the id onto our new fields property.
|
5015 |
-
* This lets us tell the server that this is a new field to be added rather than a field to be updated.
|
5016 |
-
*
|
5017 |
-
* @since 3.0
|
5018 |
-
* @param void
|
5019 |
-
*/
|
5020 |
-
addField: function( model ) {
|
5021 |
-
this.newIDs.push( model.get( 'id' ) );
|
5022 |
-
},
|
5023 |
-
|
5024 |
-
/**
|
5025 |
-
* When we remove a field, push the id onto our removed fields property.
|
5026 |
-
*
|
5027 |
-
* @since 3.0
|
5028 |
-
* @param void
|
5029 |
-
*/
|
5030 |
-
removeField: function( model ) {
|
5031 |
-
this.removedIDs = this.removedIDs || {};
|
5032 |
-
this.removedIDs[ model.get( 'id' ) ] = model.get( 'id' );
|
5033 |
-
},
|
5034 |
-
|
5035 |
-
addNewField: function( model ) {
|
5036 |
-
this.add( model );
|
5037 |
-
},
|
5038 |
-
|
5039 |
-
appendNewField: function( model ) {
|
5040 |
-
if ( 0 == this.length ) {
|
5041 |
-
var order = 0;
|
5042 |
-
} else {
|
5043 |
-
var order = this.at( this.length -1 ).get( 'order' ) + 1;
|
5044 |
-
}
|
5045 |
-
|
5046 |
-
model.set( 'order', order, { silent: true } );
|
5047 |
-
this.add( model );
|
5048 |
-
},
|
5049 |
-
|
5050 |
-
removeFieldResponse: function( model ) {
|
5051 |
-
this.remove( model );
|
5052 |
-
},
|
5053 |
-
|
5054 |
-
fieldExists: function( fieldModel ) {
|
5055 |
-
return -1 != this.indexOf( fieldModel );
|
5056 |
-
}
|
5057 |
-
} );
|
5058 |
-
return collection;
|
5059 |
-
} );
|
5060 |
-
|
5061 |
-
/**
|
5062 |
-
* Config file for our app domains.
|
5063 |
-
*
|
5064 |
-
* this.collection represents all of our app domain (fields, actions, settings) information.
|
5065 |
-
*
|
5066 |
-
* This doesn't store the current domain, but rather all the data about each.
|
5067 |
-
*
|
5068 |
-
* This data includes:
|
5069 |
-
* hotkeys
|
5070 |
-
* header view
|
5071 |
-
* subheader view
|
5072 |
-
* content view
|
5073 |
-
*
|
5074 |
-
* @package Ninja Forms builder
|
5075 |
-
* @subpackage Main App
|
5076 |
-
* @copyright (c) 2015 WP Ninjas
|
5077 |
-
* @since 3.0
|
5078 |
-
*/
|
5079 |
-
define( 'controllers/app/domainConfig',[
|
5080 |
-
// Require our domain collection
|
5081 |
-
'models/app/domainCollection',
|
5082 |
-
// Require our fields domain files
|
5083 |
-
'views/fields/subHeader',
|
5084 |
-
'views/fields/mainContentFieldCollection',
|
5085 |
-
'views/fields/drawer/settingsTitle',
|
5086 |
-
// Require our actions domain files
|
5087 |
-
'views/actions/mainHeader',
|
5088 |
-
'views/actions/subHeader',
|
5089 |
-
'views/actions/mainContent',
|
5090 |
-
// Require our settings domain files
|
5091 |
-
'views/advanced/mainHeader',
|
5092 |
-
'views/advanced/subHeader',
|
5093 |
-
'views/advanced/mainContent',
|
5094 |
-
// Empty View
|
5095 |
-
'views/app/empty',
|
5096 |
-
// FieldCollection: used by the default formContentData filter
|
5097 |
-
'models/fields/fieldCollection'
|
5098 |
-
],
|
5099 |
-
function(
|
5100 |
-
appDomainCollection,
|
5101 |
-
fieldsSubHeaderView,
|
5102 |
-
FieldsMainContentFieldCollectionView,
|
5103 |
-
fieldsSettingsTitleView,
|
5104 |
-
actionsMainHeaderView,
|
5105 |
-
actionsSubHeaderView,
|
5106 |
-
actionsMainContentView,
|
5107 |
-
settingsMainHeaderView,
|
5108 |
-
settingsSubHeaderView,
|
5109 |
-
settingsMainContentView,
|
5110 |
-
EmptyView,
|
5111 |
-
FieldCollection
|
5112 |
-
) {
|
5113 |
-
var controller = Marionette.Object.extend( {
|
5114 |
-
initialize: function() {
|
5115 |
-
/*
|
5116 |
-
* Add our default formContentView filter.
|
5117 |
-
*/
|
5118 |
-
nfRadio.channel( 'formContent' ).request( 'add:viewFilter', this.defaultFormContentView, 10, this );
|
5119 |
-
|
5120 |
-
/*
|
5121 |
-
* Add our default formContentData filter.
|
5122 |
-
*/
|
5123 |
-
nfRadio.channel( 'formContent' ).request( 'add:loadFilter', this.defaultFormContentLoad, 10, this );
|
5124 |
-
|
5125 |
-
/*
|
5126 |
-
* Add our default formContentGutterView filters.
|
5127 |
-
*/
|
5128 |
-
nfRadio.channel( 'formContentGutters' ).request( 'add:leftFilter', this.defaultFormContentGutterView, 10, this );
|
5129 |
-
nfRadio.channel( 'formContentGutters' ).request( 'add:rightFilter', this.defaultFormContentGutterView, 10, this );
|
5130 |
-
|
5131 |
-
// Define our app domains
|
5132 |
-
this.collection = new appDomainCollection( [
|
5133 |
-
{
|
5134 |
-
id: 'fields',
|
5135 |
-
nicename: nfi18n.domainFormFields,
|
5136 |
-
hotkeys: {
|
5137 |
-
'Esc' : 'close:drawer',
|
5138 |
-
'Ctrl+Shift+n' : 'add:newField',
|
5139 |
-
'Ctrl+Shift+a' : 'changeDomain:actions',
|
5140 |
-
'Ctrl+Shift+s' : 'changeDomain:settings',
|
5141 |
-
'Alt+Ctrl+t' : 'open:mergeTags',
|
5142 |
-
'up' : 'up:mergeTags',
|
5143 |
-
'down' : 'down:mergeTags',
|
5144 |
-
'Shift+return' : 'return:mergeTags'
|
5145 |
-
},
|
5146 |
-
mobileDashicon: 'dashicons-menu',
|
5147 |
-
|
5148 |
-
getSubHeaderView: function() {
|
5149 |
-
return new fieldsSubHeaderView();
|
5150 |
-
},
|
5151 |
-
|
5152 |
-
/**
|
5153 |
-
* Get the formContent view that should be used in our builder.
|
5154 |
-
* Uses two filters:
|
5155 |
-
* 1) One for our formContentData
|
5156 |
-
* 2) One for our formContentView
|
5157 |
-
*
|
5158 |
-
* If we don't have any view filters, we use the default formContentView.
|
5159 |
-
*
|
5160 |
-
* @since 3.0
|
5161 |
-
* @return formContentView backbone view.
|
5162 |
-
*/
|
5163 |
-
getMainContentView: function( collection ) {
|
5164 |
-
var formContentData = nfRadio.channel( 'settings' ).request( 'get:setting', 'formContentData' );
|
5165 |
-
|
5166 |
-
/*
|
5167 |
-
* As of version 3.0, 'fieldContentsData' has deprecated in favour of 'formContentData'.
|
5168 |
-
* If we don't have this setting, then we check for this deprecated value.
|
5169 |
-
*
|
5170 |
-
* Set our fieldContentsData to our form setting 'fieldContentsData'
|
5171 |
-
*
|
5172 |
-
* TODO: Remove this backwards compatibility eventually.
|
5173 |
-
*/
|
5174 |
-
if ( ! formContentData ) {
|
5175 |
-
formContentData = nfRadio.channel( 'settings' ).request( 'get:setting', 'fieldContentsData' );
|
5176 |
-
}
|
5177 |
-
|
5178 |
-
/*
|
5179 |
-
* If we don't have a filter for our formContentData, default to fieldCollection.
|
5180 |
-
*/
|
5181 |
-
var formContentLoadFilters = nfRadio.channel( 'formContent' ).request( 'get:loadFilters' );
|
5182 |
-
|
5183 |
-
/*
|
5184 |
-
* Get our first filter, this will be the one with the highest priority.
|
5185 |
-
*/
|
5186 |
-
var sortedArray = _.without( formContentLoadFilters, undefined );
|
5187 |
-
var callback = _.first( sortedArray );
|
5188 |
-
formContentData = callback( formContentData, nfRadio.channel( 'app' ).request( 'get:formModel' ), true );
|
5189 |
-
|
5190 |
-
/*
|
5191 |
-
* Check our fieldContentViewsFilter to see if we have any defined.
|
5192 |
-
* If we do, overwrite our default with the view returned from the filter.
|
5193 |
-
*/
|
5194 |
-
var formContentViewFilters = nfRadio.channel( 'formContent' ).request( 'get:viewFilters' );
|
5195 |
-
|
5196 |
-
/*
|
5197 |
-
* Get our first filter, this will be the one with the highest priority.
|
5198 |
-
*/
|
5199 |
-
var sortedArray = _.without( formContentViewFilters, undefined );
|
5200 |
-
var callback = _.first( sortedArray );
|
5201 |
-
formContentView = callback();
|
5202 |
-
|
5203 |
-
nfRadio.channel( 'settings' ).request( 'update:setting', 'formContentData', formContentData, true );
|
5204 |
-
return new formContentView( { collection: formContentData } );
|
5205 |
-
},
|
5206 |
-
|
5207 |
-
getSettingsTitleView: function( data ) {
|
5208 |
-
/*
|
5209 |
-
* If we are dealing with a field model, return the fields settings view, otherwise, return the default.
|
5210 |
-
*/
|
5211 |
-
if ( 'fields' == data.model.get( 'objectDomain' ) ) {
|
5212 |
-
return new fieldsSettingsTitleView( data );
|
5213 |
-
} else {
|
5214 |
-
return this.get( 'getDefaultSettingsTitleView' ).call( this, data );
|
5215 |
-
}
|
5216 |
-
|
5217 |
-
},
|
5218 |
-
|
5219 |
-
getGutterLeftView: function( data ) {
|
5220 |
-
/*
|
5221 |
-
* Check our fieldContentViewsFilter to see if we have any defined.
|
5222 |
-
* If we do, overwrite our default with the view returned from the filter.
|
5223 |
-
*/
|
5224 |
-
var gutterFilters = nfRadio.channel( 'formContentGutters' ).request( 'get:leftFilters' );
|
5225 |
-
|
5226 |
-
/*
|
5227 |
-
* Get our first filter, this will be the one with the highest priority.
|
5228 |
-
*/
|
5229 |
-
var sortedArray = _.without( gutterFilters, undefined );
|
5230 |
-
var callback = _.first( sortedArray );
|
5231 |
-
gutterView = callback();
|
5232 |
-
|
5233 |
-
return new gutterView();
|
5234 |
-
},
|
5235 |
-
|
5236 |
-
getGutterRightView: function() {
|
5237 |
-
/*
|
5238 |
-
* Check our fieldContentViewsFilter to see if we have any defined.
|
5239 |
-
* If we do, overwrite our default with the view returned from the filter.
|
5240 |
-
*/
|
5241 |
-
var gutterFilters = nfRadio.channel( 'formContentGutters' ).request( 'get:rightFilters' );
|
5242 |
-
|
5243 |
-
/*
|
5244 |
-
* Get our first filter, this will be the one with the highest priority.
|
5245 |
-
*/
|
5246 |
-
var sortedArray = _.without( gutterFilters, undefined );
|
5247 |
-
var callback = _.first( sortedArray );
|
5248 |
-
gutterView = callback();
|
5249 |
-
|
5250 |
-
return new gutterView();
|
5251 |
-
}
|
5252 |
-
|
5253 |
-
},
|
5254 |
-
{
|
5255 |
-
id: 'actions',
|
5256 |
-
nicename: nfi18n.domainActions,
|
5257 |
-
hotkeys: {
|
5258 |
-
'Esc' : 'close:drawer',
|
5259 |
-
'Ctrl+Shift+n' : 'add:newAction',
|
5260 |
-
'Ctrl+Shift+f' : 'changeDomain:fields',
|
5261 |
-
'Ctrl+Shift+s' : 'changeDomain:settings',
|
5262 |
-
'Alt+Ctrl+t' : 'open:mergeTags',
|
5263 |
-
'up' : 'up:mergeTags',
|
5264 |
-
'down' : 'down:mergeTags',
|
5265 |
-
'Shift+return' : 'return:mergeTags'
|
5266 |
-
},
|
5267 |
-
mobileDashicon: 'dashicons-external',
|
5268 |
-
|
5269 |
-
getSubHeaderView: function() {
|
5270 |
-
return new actionsSubHeaderView();
|
5271 |
-
},
|
5272 |
-
|
5273 |
-
getMainContentView: function() {
|
5274 |
-
var collection = nfRadio.channel( 'actions' ).request( 'get:collection' );
|
5275 |
-
return new actionsMainContentView( { collection: collection } );
|
5276 |
-
}
|
5277 |
-
},
|
5278 |
-
{
|
5279 |
-
id: 'settings',
|
5280 |
-
nicename: nfi18n.domainAdvanced,
|
5281 |
-
hotkeys: {
|
5282 |
-
'Esc' : 'close:drawer',
|
5283 |
-
'Ctrl+Shift+f' : 'changeDomain:fields',
|
5284 |
-
'Ctrl+Shift+a' : 'changeDomain:actions',
|
5285 |
-
'Alt+Ctrl+t' : 'open:mergeTags',
|
5286 |
-
'up' : 'up:mergeTags',
|
5287 |
-
'down' : 'down:mergeTags',
|
5288 |
-
'Shift+return' : 'return:mergeTags'
|
5289 |
-
},
|
5290 |
-
mobileDashicon: 'dashicons-admin-generic',
|
5291 |
-
|
5292 |
-
getSubHeaderView: function() {
|
5293 |
-
return new settingsSubHeaderView();
|
5294 |
-
},
|
5295 |
-
|
5296 |
-
getMainContentView: function() {
|
5297 |
-
var collection = nfRadio.channel( 'settings' ).request( 'get:typeCollection' );
|
5298 |
-
return new settingsMainContentView( { collection: collection } );
|
5299 |
-
}
|
5300 |
-
},
|
5301 |
-
{
|
5302 |
-
id: 'preview',
|
5303 |
-
nicename: 'Preview Form',
|
5304 |
-
classes: 'preview',
|
5305 |
-
dashicons: 'dashicons-visibility',
|
5306 |
-
mobileDashicon: 'dashicons-visibility',
|
5307 |
-
url: nfAdmin.previewurl
|
5308 |
-
}
|
5309 |
-
] );
|
5310 |
-
|
5311 |
-
/*
|
5312 |
-
* Send out a radio message with our domain config collection.
|
5313 |
-
*/
|
5314 |
-
nfRadio.channel( 'app' ).trigger( 'init:domainCollection', this.collection );
|
5315 |
-
|
5316 |
-
/*
|
5317 |
-
* Respond to requests to get the app domain collection.
|
5318 |
-
*/
|
5319 |
-
nfRadio.channel( 'app' ).reply( 'get:domainCollection', this.getDomainCollection, this );
|
5320 |
-
nfRadio.channel( 'app' ).reply( 'get:domainModel', this.getDomainModel, this );
|
5321 |
-
},
|
5322 |
-
|
5323 |
-
getDomainCollection: function() {
|
5324 |
-
return this.collection;
|
5325 |
-
},
|
5326 |
-
|
5327 |
-
getDomainModel: function( id ) {
|
5328 |
-
return this.collection.get( id );
|
5329 |
-
},
|
5330 |
-
|
5331 |
-
defaultFormContentView: function( formContentData ) {
|
5332 |
-
return FieldsMainContentFieldCollectionView;
|
5333 |
-
},
|
5334 |
-
|
5335 |
-
defaultFormContentLoad: function( formContentData ) {
|
5336 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
5337 |
-
/*
|
5338 |
-
* If we only have one load filter, we can just return the field collection.
|
5339 |
-
*/
|
5340 |
-
var formContentLoadFilters = nfRadio.channel( 'formContent' ).request( 'get:loadFilters' );
|
5341 |
-
var sortedArray = _.without( formContentLoadFilters, undefined );
|
5342 |
-
|
5343 |
-
if ( 1 == sortedArray.length || 'undefined' == typeof formContentData || true === formContentData instanceof Backbone.Collection ) return fieldCollection;
|
5344 |
-
|
5345 |
-
/*
|
5346 |
-
* If another filter is registered, we are calling this from somewhere else.
|
5347 |
-
*/
|
5348 |
-
|
5349 |
-
var fieldModels = _.map( formContentData, function( key ) {
|
5350 |
-
return fieldCollection.findWhere( { key: key } );
|
5351 |
-
}, this );
|
5352 |
-
|
5353 |
-
return new FieldCollection( fieldModels );
|
5354 |
-
},
|
5355 |
-
|
5356 |
-
defaultFormContentGutterView: function( formContentData ) {
|
5357 |
-
return EmptyView;
|
5358 |
-
}
|
5359 |
-
|
5360 |
-
});
|
5361 |
-
|
5362 |
-
return controller;
|
5363 |
-
} );
|
5364 |
-
/**
|
5365 |
-
* Model for our app data.
|
5366 |
-
* Listens for changes to the 'clean' attribute and triggers a radio message when the state changes.
|
5367 |
-
*
|
5368 |
-
* @package Ninja Forms builder
|
5369 |
-
* @subpackage Fields
|
5370 |
-
* @copyright (c) 2015 WP Ninjas
|
5371 |
-
* @since 3.0
|
5372 |
-
*/
|
5373 |
-
define( 'models/app/appModel',[], function() {
|
5374 |
-
var model = Backbone.Model.extend( {
|
5375 |
-
defaults: {
|
5376 |
-
loading: false
|
5377 |
-
},
|
5378 |
-
|
5379 |
-
initialize: function() {
|
5380 |
-
// Listen to changes to our 'clean' attribute.
|
5381 |
-
this.on( 'change:clean', this.changeStatus, this );
|
5382 |
-
},
|
5383 |
-
|
5384 |
-
changeStatus: function() {
|
5385 |
-
// Send out a radio message when the 'clean' attribute changes.
|
5386 |
-
nfRadio.channel( 'app' ).trigger( 'change:clean', this.get( 'clean' ) );
|
5387 |
-
}
|
5388 |
-
} );
|
5389 |
-
|
5390 |
-
return model;
|
5391 |
-
} );
|
5392 |
-
/**
|
5393 |
-
* Creates and stores a model that represents app-wide data. i.e. current domain, current drawer, clean, etc.
|
5394 |
-
*
|
5395 |
-
* clean is a boolean that represents whether or not changes have been made.
|
5396 |
-
*
|
5397 |
-
* @package Ninja Forms builder
|
5398 |
-
* @subpackage Main App
|
5399 |
-
* @copyright (c) 2015 WP Ninjas
|
5400 |
-
* @since 3.0
|
5401 |
-
*/
|
5402 |
-
define( 'controllers/app/data',['models/app/appModel'], function( appModel ) {
|
5403 |
-
var controller = Marionette.Object.extend( {
|
5404 |
-
initialize: function() {
|
5405 |
-
// Get the collection that represents all the parts of our application.
|
5406 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
5407 |
-
// Setup our initial model.
|
5408 |
-
this.model = new appModel( {
|
5409 |
-
currentDrawer: false,
|
5410 |
-
currentDomain: appDomainCollection.get( 'fields' ),
|
5411 |
-
clean: true
|
5412 |
-
} );
|
5413 |
-
|
5414 |
-
/*
|
5415 |
-
* Set the mobile setting used to track whether or not we're on a mobile device.
|
5416 |
-
*/
|
5417 |
-
var mobile = ( 1 == nfAdmin.mobile ) ? true : false;
|
5418 |
-
this.model.set( 'mobile', mobile );
|
5419 |
-
|
5420 |
-
/*
|
5421 |
-
* Respond to requests to see if we are on mobile.
|
5422 |
-
*/
|
5423 |
-
nfRadio.channel( 'app' ).reply( 'is:mobile', this.isMobile, this );
|
5424 |
-
|
5425 |
-
/*
|
5426 |
-
* Respond to app channel requests for information about the state of our app.
|
5427 |
-
*/
|
5428 |
-
nfRadio.channel( 'app' ).reply( 'get:data', this.getData, this );
|
5429 |
-
nfRadio.channel( 'app' ).reply( 'get:setting', this.getSetting, this );
|
5430 |
-
nfRadio.channel( 'app' ).reply( 'get:currentDomain', this.getCurrentDomain, this );
|
5431 |
-
nfRadio.channel( 'app' ).reply( 'get:currentDrawer', this.getCurrentDrawer, this );
|
5432 |
-
nfRadio.channel( 'drawer' ).reply( 'get:current', this.getCurrentDrawer, this );
|
5433 |
-
|
5434 |
-
/*
|
5435 |
-
* Respond to app channel requests to update app settings.
|
5436 |
-
*/
|
5437 |
-
nfRadio.channel( 'app' ).reply( 'update:currentDomain', this.updateCurrentDomain, this );
|
5438 |
-
nfRadio.channel( 'app' ).reply( 'update:currentDrawer', this.updateCurrentDrawer, this );
|
5439 |
-
nfRadio.channel( 'app' ).reply( 'update:setting', this.updateSetting, this );
|
5440 |
-
|
5441 |
-
nfRadio.channel( 'settings' ).reply( 'check:deps', this.checkDeps, this );
|
5442 |
-
|
5443 |
-
},
|
5444 |
-
|
5445 |
-
/**
|
5446 |
-
* A more robust settings dependency system.
|
5447 |
-
* This allows you to have a setting only show when X AND Y are met or when X OR Y are met.
|
5448 |
-
*
|
5449 |
-
* @since
|
5450 |
-
* @param {object} setting Setting object
|
5451 |
-
* @param {object} context Object context for where this is being called.
|
5452 |
-
* @return {bool}/{string}
|
5453 |
-
*/
|
5454 |
-
checkDeps: function( setting, context ) {
|
5455 |
-
if ( ! setting.deps ) {
|
5456 |
-
return '';
|
5457 |
-
}
|
5458 |
-
|
5459 |
-
// If we do have a "settings" property, then this is a new dependency format.
|
5460 |
-
let deps_settings = setting.deps.settings;
|
5461 |
-
let match = setting.deps.match;
|
5462 |
-
|
5463 |
-
let hide = false;
|
5464 |
-
|
5465 |
-
for (var i = deps_settings.length - 1; i >= 0; i--) {
|
5466 |
-
let name = deps_settings[i].name;
|
5467 |
-
let value = deps_settings[i].value;
|
5468 |
-
|
5469 |
-
// Use == here instead of === in order to avoid string => int comparison.
|
5470 |
-
if ( context.dataModel.get( name ) == value ) {
|
5471 |
-
// If we're looking for "any" match, we can go ahead and return here.
|
5472 |
-
if ( 'any' == match ) {
|
5473 |
-
hide = false;
|
5474 |
-
break;
|
5475 |
-
}
|
5476 |
-
} else {
|
5477 |
-
hide = true;
|
5478 |
-
}
|
5479 |
-
}
|
5480 |
-
|
5481 |
-
if ( hide ) {
|
5482 |
-
return 'style="display:none;"';
|
5483 |
-
}
|
5484 |
-
|
5485 |
-
return '';
|
5486 |
-
},
|
5487 |
-
|
5488 |
-
updateCurrentDomain: function( model ) {
|
5489 |
-
this.updateSetting( 'currentDomain', model );
|
5490 |
-
},
|
5491 |
-
|
5492 |
-
updateSetting: function( setting, value ) {
|
5493 |
-
this.model.set( setting, value );
|
5494 |
-
return true;
|
5495 |
-
},
|
5496 |
-
|
5497 |
-
getSetting: function( setting ) {
|
5498 |
-
return this.model.get( setting );
|
5499 |
-
},
|
5500 |
-
|
5501 |
-
getData: function() {
|
5502 |
-
return this.model;
|
5503 |
-
},
|
5504 |
-
|
5505 |
-
getCurrentDomain: function() {
|
5506 |
-
return this.model.get( 'currentDomain' );
|
5507 |
-
},
|
5508 |
-
|
5509 |
-
updateCurrentDrawer: function( drawerID ) {
|
5510 |
-
this.updateSetting( 'currentDrawer', drawerID );
|
5511 |
-
return true;
|
5512 |
-
},
|
5513 |
-
|
5514 |
-
getCurrentDrawer: function() {
|
5515 |
-
var currentDrawerID = this.model.get( 'currentDrawer' );
|
5516 |
-
return nfRadio.channel( 'app' ).request( 'get:drawer', currentDrawerID );
|
5517 |
-
},
|
5518 |
-
|
5519 |
-
isMobile: function() {
|
5520 |
-
return this.model.get( 'mobile' );
|
5521 |
-
}
|
5522 |
-
|
5523 |
-
|
5524 |
-
});
|
5525 |
-
|
5526 |
-
return controller;
|
5527 |
-
} );
|
5528 |
-
/**
|
5529 |
-
* Listens for click events to expand/collapse setting groups.
|
5530 |
-
*
|
5531 |
-
* @package Ninja Forms builder
|
5532 |
-
* @subpackage Fields - New Field Drawer
|
5533 |
-
* @copyright (c) 2015 WP Ninjas
|
5534 |
-
* @since 3.0
|
5535 |
-
*/
|
5536 |
-
define( 'controllers/app/drawerToggleSettingGroup',[], function() {
|
5537 |
-
var controller = Marionette.Object.extend( {
|
5538 |
-
initialize: function() {
|
5539 |
-
// Listen for click events on our settings group.
|
5540 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'click:toggleSettingGroup', this.toggleSettingGroup );
|
5541 |
-
},
|
5542 |
-
|
5543 |
-
/**
|
5544 |
-
* Set the 'display' attribute of our group model to true or false to toggle.
|
5545 |
-
*
|
5546 |
-
* @since 3.0
|
5547 |
-
* @param Object e event
|
5548 |
-
* @param backbone.model model group setting model
|
5549 |
-
* @return void
|
5550 |
-
*/
|
5551 |
-
toggleSettingGroup: function( e, model ) {
|
5552 |
-
if ( model.get( 'display' ) ) {
|
5553 |
-
/*
|
5554 |
-
* Make sure that none of our settings have errors
|
5555 |
-
*/
|
5556 |
-
var errors = false;
|
5557 |
-
_.each( model.get( 'settings' ).models, function( setting ) {
|
5558 |
-
if ( setting.get( 'error' ) ) {
|
5559 |
-
errors = true;
|
5560 |
-
}
|
5561 |
-
} );
|
5562 |
-
if ( ! errors ) {
|
5563 |
-
model.set( 'display', false );
|
5564 |
-
}
|
5565 |
-
} else {
|
5566 |
-
model.set( 'display', true );
|
5567 |
-
}
|
5568 |
-
}
|
5569 |
-
});
|
5570 |
-
|
5571 |
-
return controller;
|
5572 |
-
} );
|
5573 |
-
/**
|
5574 |
-
* Updates our database with our form data.
|
5575 |
-
*
|
5576 |
-
* @package Ninja Forms builder
|
5577 |
-
* @subpackage Fields
|
5578 |
-
* @copyright (c) 2015 WP Ninjas
|
5579 |
-
* @since 3.0
|
5580 |
-
*/
|
5581 |
-
define( 'controllers/app/updateDB',[], function() {
|
5582 |
-
var controller = Marionette.Object.extend( {
|
5583 |
-
|
5584 |
-
initialize: function() {
|
5585 |
-
// Listen for the closing of the drawer and update when it's closed.
|
5586 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'closed', this.updateDB );
|
5587 |
-
// Respond to requests to update the database.
|
5588 |
-
nfRadio.channel( 'app' ).reply( 'update:db', this.updateDB, this );
|
5589 |
-
/*
|
5590 |
-
* Register our default formContent save filter.
|
5591 |
-
* This converts our collection into an array of keys.
|
5592 |
-
*/
|
5593 |
-
nfRadio.channel( 'formContent' ).request( 'add:saveFilter', this.defaultSaveFilter, 10, this );
|
5594 |
-
},
|
5595 |
-
|
5596 |
-
/**
|
5597 |
-
* Update our database.
|
5598 |
-
* If action isn't specified, assume we're updating the preview.
|
5599 |
-
*
|
5600 |
-
* @since 3.0
|
5601 |
-
* @param string action preview or publish
|
5602 |
-
* @return void
|
5603 |
-
*/
|
5604 |
-
updateDB: function( action ) {
|
5605 |
-
|
5606 |
-
// If our app is clean, dont' update.
|
5607 |
-
if ( nfRadio.channel( 'app' ).request( 'get:setting', 'clean' ) ) {
|
5608 |
-
return false;
|
5609 |
-
}
|
5610 |
-
|
5611 |
-
// Default action to preview.
|
5612 |
-
action = action || 'preview';
|
5613 |
-
|
5614 |
-
// Setup our ajax actions based on the action we're performing
|
5615 |
-
if ( 'preview' == action ) {
|
5616 |
-
var jsAction = 'nf_preview_update';
|
5617 |
-
} else if ( 'publish' == action ) {
|
5618 |
-
var jsAction = 'nf_save_form';
|
5619 |
-
// now using a different ajax action
|
5620 |
-
// var jsAction = 'nf_batch_process';
|
5621 |
-
}
|
5622 |
-
|
5623 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
5624 |
-
|
5625 |
-
/*
|
5626 |
-
* There are pieces of data that are only needed for the builder and not for the front-end.
|
5627 |
-
* We need to unset those.
|
5628 |
-
* TODO: Make this more dynamic/filterable.
|
5629 |
-
*/
|
5630 |
-
_.each( formModel.get( 'fields' ).models, function( fieldModel, index ) {
|
5631 |
-
fieldModel.unset( 'jBox', { silent: true } );
|
5632 |
-
} );
|
5633 |
-
|
5634 |
-
/*
|
5635 |
-
* The main content of our form is called the formContent.
|
5636 |
-
* In this next section, we check to see if any add-ons want to modify that contents before we save.
|
5637 |
-
* If there aren't any filters found, we default to the field collection.
|
5638 |
-
*
|
5639 |
-
*/
|
5640 |
-
|
5641 |
-
var formContentData = nfRadio.channel( 'settings' ).request( 'get:setting', 'formContentData' );
|
5642 |
-
/*
|
5643 |
-
* As of version 3.0, 'fieldContentsData' has deprecated in favour of 'formContentData'.
|
5644 |
-
* If we don't have this setting, then we check for this deprecated value.
|
5645 |
-
*
|
5646 |
-
* Set our fieldContentsData to our form setting 'fieldContentsData'
|
5647 |
-
*
|
5648 |
-
* TODO: Remove this backwards compatibility eventually.
|
5649 |
-
*/
|
5650 |
-
if ( ! formContentData ) {
|
5651 |
-
formContentData = nfRadio.channel( 'settings' ).request( 'get:setting', 'fieldContentsData' );
|
5652 |
-
}
|
5653 |
-
|
5654 |
-
var formContentSaveDataFilters = nfRadio.channel( 'formContent' ).request( 'get:saveFilters' );
|
5655 |
-
|
5656 |
-
/*
|
5657 |
-
* Get our first filter, this will be the one with the highest priority.
|
5658 |
-
*/
|
5659 |
-
var sortedArray = _.without( formContentSaveDataFilters, undefined );
|
5660 |
-
var callback = _.first( sortedArray );
|
5661 |
-
/*
|
5662 |
-
* Set our formContentData to the callback specified in the filter, passing our current formContentData.
|
5663 |
-
*/
|
5664 |
-
formContentData = callback( formContentData );
|
5665 |
-
|
5666 |
-
if ( 'publish' == action && formModel.get( 'show_publish_options' ) ) {
|
5667 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'newForm' );
|
5668 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
5669 |
-
jQuery( builderEl ).addClass( 'disable-main' );
|
5670 |
-
return false;
|
5671 |
-
}
|
5672 |
-
|
5673 |
-
// Get our form data
|
5674 |
-
var formData = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
5675 |
-
|
5676 |
-
// Turn our formData model into an object
|
5677 |
-
var data = JSON.parse( JSON.stringify( formData ) );
|
5678 |
-
data.settings.formContentData = formContentData;
|
5679 |
-
|
5680 |
-
/**
|
5681 |
-
* Prepare fields for submission.
|
5682 |
-
*/
|
5683 |
-
|
5684 |
-
// Get the field IDs that we've deleted.
|
5685 |
-
var removedIDs = formData.get( 'fields' ).removedIDs;
|
5686 |
-
|
5687 |
-
/*
|
5688 |
-
* data.fields is an array of objects like:
|
5689 |
-
* field.label = blah
|
5690 |
-
* field.label_pos = blah
|
5691 |
-
* etc.
|
5692 |
-
*
|
5693 |
-
* And we need that format to be:
|
5694 |
-
* field.settings.label = blah
|
5695 |
-
* field.settings.label_pos = blah
|
5696 |
-
*
|
5697 |
-
* So, we loop through our fields and create a field.settings object.
|
5698 |
-
*/
|
5699 |
-
_.each( data.fields, function( field ) {
|
5700 |
-
var id = field.id;
|
5701 |
-
// We dont' want to update id or parent_id
|
5702 |
-
delete field.id;
|
5703 |
-
delete field.parent_id;
|
5704 |
-
var settings = {};
|
5705 |
-
// Loop through all the attributes of our fields
|
5706 |
-
for (var prop in field) {
|
5707 |
-
if ( field.hasOwnProperty( prop ) ) {
|
5708 |
-
// If our field property isn't null, then...
|
5709 |
-
if ( null !== field[ prop ] ) {
|
5710 |
-
// Set our settings.prop value.
|
5711 |
-
settings[prop] = field[prop];
|
5712 |
-
}
|
5713 |
-
// Delete the property from the field.
|
5714 |
-
delete field[ prop ];
|
5715 |
-
}
|
5716 |
-
}
|
5717 |
-
|
5718 |
-
for( var setting in settings ){
|
5719 |
-
if( null === settings[ setting ] ) {
|
5720 |
-
delete settings[setting];
|
5721 |
-
}
|
5722 |
-
}
|
5723 |
-
|
5724 |
-
// Update our field object.
|
5725 |
-
field.settings = settings;
|
5726 |
-
field.id = id;
|
5727 |
-
} );
|
5728 |
-
|
5729 |
-
// Set our deleted_fields object so that we can know which fields were removed.
|
5730 |
-
data.deleted_fields = removedIDs;
|
5731 |
-
|
5732 |
-
/**
|
5733 |
-
* Prepare actions for submission.
|
5734 |
-
*/
|
5735 |
-
|
5736 |
-
// Get the action IDs that we've deleted.
|
5737 |
-
var removedIDs = formData.get( 'actions' ).removedIDs;
|
5738 |
-
|
5739 |
-
/*
|
5740 |
-
* data.actions is an array of objects like:
|
5741 |
-
* action.label = blah
|
5742 |
-
* action.label_pos = blah
|
5743 |
-
* etc.
|
5744 |
-
*
|
5745 |
-
* And we need that format to be:
|
5746 |
-
* action.settings.label = blah
|
5747 |
-
* action.settings.label_pos = blah
|
5748 |
-
*
|
5749 |
-
* So, we loop through our actions and create a field.settings object.
|
5750 |
-
*/
|
5751 |
-
_.each( data.actions, function( action ) {
|
5752 |
-
var id = action.id;
|
5753 |
-
// We dont' want to update id or parent_id
|
5754 |
-
delete action.id;
|
5755 |
-
delete action.parent_id;
|
5756 |
-
var settings = {};
|
5757 |
-
// Loop through all the attributes of our actions
|
5758 |
-
for (var prop in action) {
|
5759 |
-
if ( action.hasOwnProperty( prop ) ) {
|
5760 |
-
//Removing null values
|
5761 |
-
if( null !== action[ prop ] ) {
|
5762 |
-
// Set our settings.prop value.
|
5763 |
-
settings[ prop ] = action[ prop ];
|
5764 |
-
}
|
5765 |
-
// Delete the property from the action.
|
5766 |
-
delete action[ prop ];
|
5767 |
-
}
|
5768 |
-
}
|
5769 |
-
// Update our action object.
|
5770 |
-
action.settings = settings;
|
5771 |
-
action.id = id;
|
5772 |
-
} );
|
5773 |
-
|
5774 |
-
for ( var setting in data.settings ) {
|
5775 |
-
if ( null === data.settings[ setting ] ) {
|
5776 |
-
delete data.settings[ setting ];
|
5777 |
-
}
|
5778 |
-
}
|
5779 |
-
|
5780 |
-
// Set our deleted_actions object so that we can know which actions were removed.
|
5781 |
-
data.deleted_actions = removedIDs;
|
5782 |
-
|
5783 |
-
// Turn our object into a JSON string.
|
5784 |
-
data = JSON.stringify( data );
|
5785 |
-
|
5786 |
-
// Run anything that needs to happen before we update.
|
5787 |
-
nfRadio.channel( 'app' ).trigger( 'before:updateDB', data );
|
5788 |
-
|
5789 |
-
if ( 'publish' == action ) {
|
5790 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'loading', true );
|
5791 |
-
nfRadio.channel( 'app' ).trigger( 'change:loading' );
|
5792 |
-
|
5793 |
-
// If we're on mobile, show a notice that we're publishing
|
5794 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
5795 |
-
nfRadio.channel( 'notices' ).request( 'add', 'publishing', 'Your Changes Are Being Published', { autoClose: false } );
|
5796 |
-
}
|
5797 |
-
}
|
5798 |
-
|
5799 |
-
if ( 'nf_save_form' === jsAction ) {
|
5800 |
-
// if the form string is long than this, chunk it
|
5801 |
-
var chunk_size = 100000;
|
5802 |
-
var data_chunks = [];
|
5803 |
-
|
5804 |
-
// Let's chunk this
|
5805 |
-
if( chunk_size < data.length ) {
|
5806 |
-
data_chunks = data.match(new RegExp('.{1,' + chunk_size + '}', 'g'));
|
5807 |
-
}
|
5808 |
-
// if we have chunks send them via the step processor
|
5809 |
-
if( 1 < data_chunks.length ) {
|
5810 |
-
// this function will make the ajax call for chunks
|
5811 |
-
this.saveChunkedForm(
|
5812 |
-
data_chunks,
|
5813 |
-
0,
|
5814 |
-
'nf_batch_process',
|
5815 |
-
action,
|
5816 |
-
formModel.get('id'),
|
5817 |
-
true
|
5818 |
-
);
|
5819 |
-
} else {
|
5820 |
-
// otherwise send it the regular way.
|
5821 |
-
var context = this;
|
5822 |
-
var responseData = null;
|
5823 |
-
|
5824 |
-
jQuery.post( ajaxurl,
|
5825 |
-
{
|
5826 |
-
action: jsAction,
|
5827 |
-
form: data,
|
5828 |
-
security: nfAdmin.ajaxNonce
|
5829 |
-
},
|
5830 |
-
function( response ) {
|
5831 |
-
responseData = response;
|
5832 |
-
context.handleFinalResponse( responseData, action );
|
5833 |
-
}
|
5834 |
-
).fail( function( xhr, status, error ) {
|
5835 |
-
context.handleFinalFailure( xhr, status, error, action )
|
5836 |
-
} );
|
5837 |
-
}
|
5838 |
-
} else if ( 'nf_preview_update' === jsAction ) {
|
5839 |
-
var context = this;
|
5840 |
-
var responseData = null;
|
5841 |
-
jQuery.post( ajaxurl,
|
5842 |
-
{
|
5843 |
-
action: jsAction,
|
5844 |
-
form: data,
|
5845 |
-
security: nfAdmin.ajaxNonce
|
5846 |
-
},
|
5847 |
-
function( response ) {
|
5848 |
-
responseData = response;
|
5849 |
-
context.handleFinalResponse( responseData, action );
|
5850 |
-
}
|
5851 |
-
).fail( function( xhr, status, error ) {
|
5852 |
-
context.handleFinalFailure( xhr, status, error, action )
|
5853 |
-
} );
|
5854 |
-
}
|
5855 |
-
},
|
5856 |
-
/**
|
5857 |
-
* Function to recursively send chunks until all chunks have been sent
|
5858 |
-
*
|
5859 |
-
* @param chunks
|
5860 |
-
* @param currentIndex
|
5861 |
-
* @param currentChunk
|
5862 |
-
* @param jsAction
|
5863 |
-
* @param action
|
5864 |
-
*/
|
5865 |
-
saveChunkedForm: function( chunks, currentChunk, jsAction, action, formId, new_publish ) {
|
5866 |
-
var total_chunks = chunks.length;
|
5867 |
-
var postObj = {
|
5868 |
-
action: jsAction,
|
5869 |
-
batch_type: 'chunked_publish',
|
5870 |
-
data: {
|
5871 |
-
new_publish: new_publish,
|
5872 |
-
chunk_total: total_chunks,
|
5873 |
-
chunk_current: currentChunk,
|
5874 |
-
chunk: chunks[ currentChunk ],
|
5875 |
-
form_id: formId
|
5876 |
-
},
|
5877 |
-
security: nfAdmin.batchNonce
|
5878 |
-
};
|
5879 |
-
|
5880 |
-
var that = this;
|
5881 |
-
jQuery.post( ajaxurl, postObj )
|
5882 |
-
.then( function ( response ) {
|
5883 |
-
try {
|
5884 |
-
var res = JSON.parse(response);
|
5885 |
-
if ( 'success' === res.last_request && ! res.batch_complete) {
|
5886 |
-
console.log('Chunk ' + currentChunk + ' processed');
|
5887 |
-
|
5888 |
-
// send the next chunk
|
5889 |
-
that.saveChunkedForm(chunks, res.requesting, jsAction, action, formId, false);
|
5890 |
-
} else if ( res.batch_complete ) {
|
5891 |
-
/**
|
5892 |
-
* We need to respond with data to make the
|
5893 |
-
* publish button return to gray
|
5894 |
-
*/
|
5895 |
-
that.handleFinalResponse(response, action);
|
5896 |
-
}
|
5897 |
-
} catch ( exception ) {
|
5898 |
-
console.log( 'There was an error in parsing the' +
|
5899 |
-
' response');
|
5900 |
-
console.log( exception );
|
5901 |
-
}
|
5902 |
-
}
|
5903 |
-
).fail( function( xhr, status, error ) {
|
5904 |
-
console.log( 'There was an error sending form data' );
|
5905 |
-
console.log( error );
|
5906 |
-
that.handleFinalFailure( xhr, status, error, action );
|
5907 |
-
});
|
5908 |
-
},
|
5909 |
-
|
5910 |
-
handleFinalResponse: function( response, action ) {
|
5911 |
-
try {
|
5912 |
-
response = JSON.parse( response );
|
5913 |
-
response.action = action;
|
5914 |
-
|
5915 |
-
// Run anything that needs to happen after we update.
|
5916 |
-
nfRadio.channel( 'app' ).trigger( 'response:updateDB', response );
|
5917 |
-
if ( ! nfRadio.channel( 'app' ).request( 'is:mobile' ) && 'preview' == action ) {
|
5918 |
-
// nfRadio.channel( 'notices' ).request( 'add', 'previewUpdate', 'Preview Updated' );
|
5919 |
-
}
|
5920 |
-
} catch( exception ) {
|
5921 |
-
console.log( 'Something went wrong!' );
|
5922 |
-
console.log( exception );
|
5923 |
-
}
|
5924 |
-
},
|
5925 |
-
|
5926 |
-
handleFinalFailure: function( xhr, status, error, action ) {
|
5927 |
-
// For previews, only log to the console.
|
5928 |
-
if( 'preview' == action ) {
|
5929 |
-
console.log( error );
|
5930 |
-
return;
|
5931 |
-
}
|
5932 |
-
// @todo Convert alert to jBox Modal.
|
5933 |
-
alert(xhr.status + ' ' + error + '\r\n' + 'An error on the server caused your form not to publish.\r\nPlease contact Ninja Forms Support with your PHP Error Logs.\r\nhttps://ninjaforms.com/contact');
|
5934 |
-
},
|
5935 |
-
|
5936 |
-
defaultSaveFilter: function( formContentData ) {
|
5937 |
-
return formContentData.pluck( 'key' );
|
5938 |
-
}
|
5939 |
-
|
5940 |
-
});
|
5941 |
-
|
5942 |
-
return controller;
|
5943 |
-
} );
|
5944 |
-
|
5945 |
-
/**
|
5946 |
-
* Model that represents our form data.
|
5947 |
-
*
|
5948 |
-
* @package Ninja Forms builder
|
5949 |
-
* @subpackage Fields
|
5950 |
-
* @copyright (c) 2015 WP Ninjas
|
5951 |
-
* @since 3.0
|
5952 |
-
*/
|
5953 |
-
define( 'models/app/formModel',[], function() {
|
5954 |
-
var model = Backbone.Model.extend( {
|
5955 |
-
initialize: function() {
|
5956 |
-
if ( ! jQuery.isNumeric( this.get( 'id' ) ) ) {
|
5957 |
-
this.set( 'show_publish_options', true, { silent: true } );
|
5958 |
-
} else {
|
5959 |
-
this.set( 'show_publish_options', false, { silent: true } );
|
5960 |
-
}
|
5961 |
-
}
|
5962 |
-
} );
|
5963 |
-
|
5964 |
-
return model;
|
5965 |
-
} );
|
5966 |
-
/**
|
5967 |
-
* Stores our form data and responds to requests for it.
|
5968 |
-
* Form data stores fields, actions, and settings.
|
5969 |
-
*
|
5970 |
-
* @package Ninja Forms builder
|
5971 |
-
* @subpackage Fields
|
5972 |
-
* @copyright (c) 2015 WP Ninjas
|
5973 |
-
* @since 3.0
|
5974 |
-
*/
|
5975 |
-
define( 'controllers/app/formData',['models/app/formModel'], function( formModel) {
|
5976 |
-
var controller = Marionette.Object.extend( {
|
5977 |
-
initialize: function() {
|
5978 |
-
// Instantiate Form Model
|
5979 |
-
this.model = new formModel( { id: preloadedFormData.id } );
|
5980 |
-
// Set our field collection
|
5981 |
-
this.model.set( 'fields', nfRadio.channel( 'fields' ).request( 'get:collection' ) );
|
5982 |
-
// Set our actions collection
|
5983 |
-
this.model.set( 'actions', nfRadio.channel( 'actions' ).request( 'get:collection' ) );
|
5984 |
-
// Set our settings collection
|
5985 |
-
this.model.set( 'settings', nfRadio.channel( 'settings' ).request( 'get:settings' ) );
|
5986 |
-
// Respond to requests for form data.
|
5987 |
-
nfRadio.channel( 'app' ).reply( 'get:formModel', this.getFormModel, this );
|
5988 |
-
},
|
5989 |
-
|
5990 |
-
/**
|
5991 |
-
* Return form data model.
|
5992 |
-
*
|
5993 |
-
* @since 3.0
|
5994 |
-
* @return backbone.model
|
5995 |
-
*/
|
5996 |
-
getFormModel: function() {
|
5997 |
-
return this.model;
|
5998 |
-
}
|
5999 |
-
|
6000 |
-
});
|
6001 |
-
|
6002 |
-
return controller;
|
6003 |
-
} );
|
6004 |
-
/**
|
6005 |
-
* Handles changing our preview link when we change the 'clean' state of our app.
|
6006 |
-
*
|
6007 |
-
* @package Ninja Forms builder
|
6008 |
-
* @subpackage Fields
|
6009 |
-
* @copyright (c) 2015 WP Ninjas
|
6010 |
-
* @since 3.0
|
6011 |
-
*/
|
6012 |
-
define( 'controllers/app/previewLink',[], function() {
|
6013 |
-
var controller = Marionette.Object.extend( {
|
6014 |
-
initialize: function() {
|
6015 |
-
// Listen for events that would change our preview link
|
6016 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:sendChanges', this.disablePreview, this );
|
6017 |
-
this.listenTo( nfRadio.channel( 'app' ), 'response:sendChanges', this.enablePreview, this );
|
6018 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:clean', this.changePreviewNicename, this );
|
6019 |
-
},
|
6020 |
-
|
6021 |
-
/**
|
6022 |
-
* Disable our preview link before we send data to update our preview.
|
6023 |
-
*
|
6024 |
-
* @since 3.0
|
6025 |
-
* @return void
|
6026 |
-
*/
|
6027 |
-
disablePreview: function() {
|
6028 |
-
// Get our preview domain
|
6029 |
-
var appDomains = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6030 |
-
var preview = appDomains.get( 'preview' );
|
6031 |
-
// Set disabled to true. This will trigger the preview link view to redraw.
|
6032 |
-
preview.set( 'disabled', true );
|
6033 |
-
},
|
6034 |
-
|
6035 |
-
/**
|
6036 |
-
* Change the preview link text from "Preview Form" to "Preview Changes" or vice-versa
|
6037 |
-
*
|
6038 |
-
* @since 3.0
|
6039 |
-
* @param boolean clean app data state
|
6040 |
-
* @return void
|
6041 |
-
*/
|
6042 |
-
changePreviewNicename: function( clean ) {
|
6043 |
-
// Get our preview domain
|
6044 |
-
var appDomains = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6045 |
-
var preview = appDomains.get( 'preview' );
|
6046 |
-
|
6047 |
-
// If we have unsaved changes, set our text to 'changes' otherwise, set it to 'form'
|
6048 |
-
if ( ! clean ) {
|
6049 |
-
var nicename = 'Preview Changes';
|
6050 |
-
} else {
|
6051 |
-
var nicename = 'Preview Form';
|
6052 |
-
}
|
6053 |
-
|
6054 |
-
preview.set( 'nicename', nicename );
|
6055 |
-
},
|
6056 |
-
|
6057 |
-
/**
|
6058 |
-
* Enable our preview button.
|
6059 |
-
* This is triggered when we get a response from our preview update.
|
6060 |
-
*
|
6061 |
-
* @since 3.0
|
6062 |
-
* @return void
|
6063 |
-
*/
|
6064 |
-
enablePreview: function() {
|
6065 |
-
// Get our preview domain
|
6066 |
-
var appDomains = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6067 |
-
var preview = appDomains.get( 'preview' );
|
6068 |
-
// Set disabled to false. This will trigger the preview link view to redraw.
|
6069 |
-
preview.set( 'disabled', false );
|
6070 |
-
}
|
6071 |
-
|
6072 |
-
});
|
6073 |
-
|
6074 |
-
return controller;
|
6075 |
-
} );
|
6076 |
-
/**
|
6077 |
-
* Listens to our app channel for requests to change the current domain.
|
6078 |
-
*
|
6079 |
-
* The app menu and the main submenu both contain clickable links that change the current domain.
|
6080 |
-
*
|
6081 |
-
* @package Ninja Forms builder
|
6082 |
-
* @subpackage Main App
|
6083 |
-
* @copyright (c) 2015 WP Ninjas
|
6084 |
-
* @since 3.0
|
6085 |
-
*/
|
6086 |
-
define( 'controllers/app/menuButtons',[], function() {
|
6087 |
-
var controller = Marionette.Object.extend( {
|
6088 |
-
initialize: function() {
|
6089 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:publish', this.publish );
|
6090 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:viewChanges', this.viewChanges );
|
6091 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:publicLink', this.publicLink );
|
6092 |
-
},
|
6093 |
-
|
6094 |
-
publish: function() {
|
6095 |
-
nfRadio.channel( 'app' ).request( 'update:db', 'publish' );
|
6096 |
-
},
|
6097 |
-
|
6098 |
-
viewChanges: function() {
|
6099 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6100 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'viewChanges', { collection: changeCollection } );
|
6101 |
-
},
|
6102 |
-
|
6103 |
-
publicLink: function() {
|
6104 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'publicLink' );
|
6105 |
-
}
|
6106 |
-
|
6107 |
-
});
|
6108 |
-
|
6109 |
-
return controller;
|
6110 |
-
} );
|
6111 |
-
/**
|
6112 |
-
* Model that represents our change data.
|
6113 |
-
*
|
6114 |
-
* @package Ninja Forms builder
|
6115 |
-
* @subpackage Fields
|
6116 |
-
* @copyright (c) 2015 WP Ninjas
|
6117 |
-
* @since 3.0
|
6118 |
-
*/
|
6119 |
-
define( 'models/app/changeModel',[], function() {
|
6120 |
-
var model = Backbone.Model.extend( {
|
6121 |
-
defaults: {
|
6122 |
-
disabled: false
|
6123 |
-
}
|
6124 |
-
} );
|
6125 |
-
|
6126 |
-
return model;
|
6127 |
-
} );
|
6128 |
-
/**
|
6129 |
-
* Holds all of our change models.
|
6130 |
-
*
|
6131 |
-
* @package Ninja Forms builder
|
6132 |
-
* @subpackage Fields
|
6133 |
-
* @copyright (c) 2015 WP Ninjas
|
6134 |
-
* @since 3.0
|
6135 |
-
*/
|
6136 |
-
define( 'models/app/changeCollection',['models/app/changeModel'], function( domainModel ) {
|
6137 |
-
var collection = Backbone.Collection.extend( {
|
6138 |
-
model: domainModel,
|
6139 |
-
|
6140 |
-
comparator: function( model ) {
|
6141 |
-
var id = parseInt( model.cid.replace( 'c', '' ) );
|
6142 |
-
return -id;
|
6143 |
-
}
|
6144 |
-
} );
|
6145 |
-
return collection;
|
6146 |
-
} );
|
6147 |
-
/**
|
6148 |
-
* Track settings changes across our app.
|
6149 |
-
*
|
6150 |
-
* @package Ninja Forms builder
|
6151 |
-
* @subpackage Main App
|
6152 |
-
* @copyright (c) 2015 WP Ninjas
|
6153 |
-
* @since 3.0
|
6154 |
-
*/
|
6155 |
-
define( 'controllers/app/trackChanges',['models/app/changeCollection', 'models/app/changeModel'], function( changeCollection, ChangeModel ) {
|
6156 |
-
var controller = Marionette.Object.extend( {
|
6157 |
-
initialize: function() {
|
6158 |
-
this.collection = new changeCollection();
|
6159 |
-
// Respond to any requests to add a change directly.
|
6160 |
-
nfRadio.channel( 'changes' ).reply( 'register:change', this.registerChange, this );
|
6161 |
-
// Respond to requests for the change collection
|
6162 |
-
nfRadio.channel( 'changes' ).reply( 'get:collection', this.getCollection, this );
|
6163 |
-
// Listen for changes in our clean state. If it goes to clean, clear our collection.
|
6164 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:clean', this.maybeResetCollection );
|
6165 |
-
},
|
6166 |
-
|
6167 |
-
registerChange: function( action, model, changes, label, data ) {
|
6168 |
-
var data = typeof data !== 'undefined' ? data : {};
|
6169 |
-
if ( 'undefined' == typeof label.dashicon ) {
|
6170 |
-
label.dashicon = 'admin-generic';
|
6171 |
-
}
|
6172 |
-
var changeModel = new ChangeModel({
|
6173 |
-
action: action,
|
6174 |
-
model: model,
|
6175 |
-
changes: changes,
|
6176 |
-
label: label,
|
6177 |
-
data: data
|
6178 |
-
} );
|
6179 |
-
this.collection.add( changeModel );
|
6180 |
-
|
6181 |
-
//loop through repeater fields to reset active state if needed
|
6182 |
-
nfRadio.channel( 'fields-repeater' ).trigger( 'clearEditActive', model );
|
6183 |
-
|
6184 |
-
return changeModel;
|
6185 |
-
},
|
6186 |
-
|
6187 |
-
getCollection: function() {
|
6188 |
-
return this.collection;
|
6189 |
-
},
|
6190 |
-
|
6191 |
-
maybeResetCollection: function( clean ) {
|
6192 |
-
if ( clean ) {
|
6193 |
-
this.collection.reset();
|
6194 |
-
}
|
6195 |
-
}
|
6196 |
-
|
6197 |
-
});
|
6198 |
-
|
6199 |
-
return controller;
|
6200 |
-
} );
|
6201 |
-
define( 'controllers/app/undoChanges',[], function() {
|
6202 |
-
var controller = Marionette.Object.extend( {
|
6203 |
-
initialize: function() {
|
6204 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'click:undoChanges', this.undoChanges, this );
|
6205 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'click:undoSingle', this.undoSingle, this );
|
6206 |
-
},
|
6207 |
-
|
6208 |
-
undoChanges: function() {
|
6209 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6210 |
-
changeCollection.sort();
|
6211 |
-
var that = this;
|
6212 |
-
_.each( changeCollection.models, function( change ) {
|
6213 |
-
that.undoSingle( change, true );
|
6214 |
-
} );
|
6215 |
-
changeCollection.reset();
|
6216 |
-
// Update preview.
|
6217 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
6218 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', true );
|
6219 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6220 |
-
this.dispatchClick();
|
6221 |
-
},
|
6222 |
-
|
6223 |
-
undoSingle: function( change, undoAll ) {
|
6224 |
-
nfRadio.channel( 'changes' ).request( 'undo:' + change.get( 'action' ), change, undoAll );
|
6225 |
-
this.dispatchClick();
|
6226 |
-
},
|
6227 |
-
|
6228 |
-
dispatchClick: function() {
|
6229 |
-
// If we already have a cookie, exit.
|
6230 |
-
if ( document.cookie.includes( 'nf_undo' ) ) return;
|
6231 |
-
// Otherwise, prepare our cookie.
|
6232 |
-
var cname = "nf_undo";
|
6233 |
-
var d = new Date();
|
6234 |
-
// Set expiration at 1 week.
|
6235 |
-
d.setTime( d.getTime() + ( 7*24*60*60*1000 ) );
|
6236 |
-
var expires = "expires="+ d.toUTCString();
|
6237 |
-
// Bake the cookie.
|
6238 |
-
document.cookie = cname + "=1;" + expires + ";path=/";
|
6239 |
-
var data = {
|
6240 |
-
action: 'nf_undo_click',
|
6241 |
-
security: nfAdmin.ajaxNonce
|
6242 |
-
}
|
6243 |
-
// Make our AJAX call.
|
6244 |
-
jQuery.post( ajaxurl, data );
|
6245 |
-
}
|
6246 |
-
|
6247 |
-
});
|
6248 |
-
|
6249 |
-
return controller;
|
6250 |
-
} );
|
6251 |
-
/**
|
6252 |
-
* Listens for our update:db response and replaces tmp ids with new ids if we were performing the publish action.
|
6253 |
-
*
|
6254 |
-
* @package Ninja Forms builder
|
6255 |
-
* @subpackage Main App
|
6256 |
-
* @copyright (c) 2015 WP Ninjas
|
6257 |
-
* @since 3.0
|
6258 |
-
*/
|
6259 |
-
define( 'controllers/app/publishResponse',[], function() {
|
6260 |
-
var controller = Marionette.Object.extend( {
|
6261 |
-
initialize: function() {
|
6262 |
-
// Listen to our app channel for the updateDB response.
|
6263 |
-
this.listenTo( nfRadio.channel( 'app' ), 'response:updateDB', this.publishResponse );
|
6264 |
-
},
|
6265 |
-
|
6266 |
-
publishResponse: function( response ) {
|
6267 |
-
// If we aren't performing a publish action, bail.
|
6268 |
-
if ( 'publish' !== response.action ) {
|
6269 |
-
return false;
|
6270 |
-
}
|
6271 |
-
|
6272 |
-
// Check to see if we have any new ids.
|
6273 |
-
if ( 'undefined' != typeof response.data.new_ids ) {
|
6274 |
-
|
6275 |
-
// If we have any new fields, update their models with the new id.
|
6276 |
-
if ( 'undefined' != typeof response.data.new_ids.fields ) {
|
6277 |
-
_.each( response.data.new_ids.fields, function( newID, oldID ) {
|
6278 |
-
var field = nfRadio.channel( 'fields' ).request( 'get:field', oldID );
|
6279 |
-
if ( field ) {
|
6280 |
-
field.set( 'id', newID );
|
6281 |
-
} else {
|
6282 |
-
field = nfRadio.channel( 'fields-repeater' ).request( 'get:childField', oldID, null, newID );
|
6283 |
-
field.set( 'id', newID );
|
6284 |
-
}
|
6285 |
-
} );
|
6286 |
-
}
|
6287 |
-
|
6288 |
-
// If we have any new actions, update their models with the new id.
|
6289 |
-
if ( 'undefined' != typeof response.data.new_ids.actions ) {
|
6290 |
-
_.each( response.data.new_ids.actions, function( newID, oldID ) {
|
6291 |
-
var action = nfRadio.channel( 'actions' ).request( 'get:action', oldID );
|
6292 |
-
if ( action ) {
|
6293 |
-
action.set( 'id', newID );
|
6294 |
-
}
|
6295 |
-
} );
|
6296 |
-
}
|
6297 |
-
|
6298 |
-
// If we have a new form id, update the model with the new id.
|
6299 |
-
if ( 'undefined' != typeof response.data.new_ids.forms ) {
|
6300 |
-
_.each( response.data.new_ids.forms, function( newID, oldID ) {
|
6301 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
6302 |
-
formModel.set( 'id', newID );
|
6303 |
-
history.replaceState( '', '', 'admin.php?page=ninja-forms&form_id=' + newID );
|
6304 |
-
} );
|
6305 |
-
}
|
6306 |
-
}
|
6307 |
-
|
6308 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'loading', false );
|
6309 |
-
nfRadio.channel( 'app' ).trigger( 'change:loading' );
|
6310 |
-
|
6311 |
-
// If we're on mobile, show a notice that we're publishing
|
6312 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
6313 |
-
nfRadio.channel( 'notices' ).request( 'close', 'publishing' );
|
6314 |
-
}
|
6315 |
-
// Add a notice that we've published.
|
6316 |
-
// nfRadio.channel( 'notices' ).request( 'add', 'published', 'Changes Published' );
|
6317 |
-
nfRadio.channel( 'app' ).trigger( 'app:published', response );
|
6318 |
-
|
6319 |
-
// Mark our app as clean. This will disable the publish button and fire anything else that cares about the state.
|
6320 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', true );
|
6321 |
-
}
|
6322 |
-
|
6323 |
-
});
|
6324 |
-
|
6325 |
-
return controller;
|
6326 |
-
} );
|
6327 |
-
/**
|
6328 |
-
* Listens to our app channel for requests to change the current domain.
|
6329 |
-
*
|
6330 |
-
* The app menu and the main submenu both contain clickable links that change the current domain.
|
6331 |
-
*
|
6332 |
-
* @package Ninja Forms builder
|
6333 |
-
* @subpackage Main App
|
6334 |
-
* @copyright (c) 2015 WP Ninjas
|
6335 |
-
* @since 3.0
|
6336 |
-
*/
|
6337 |
-
define( 'controllers/app/changeDomain',[], function() {
|
6338 |
-
var controller = Marionette.Object.extend( {
|
6339 |
-
initialize: function() {
|
6340 |
-
// Listen for both menu and submenu clicks.
|
6341 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:menu', this.changeAppDomain );
|
6342 |
-
// Reply to specific requests to change the domain
|
6343 |
-
nfRadio.channel( 'app' ).reply( 'change:currentDomain', this.changeAppDomain, this );
|
6344 |
-
|
6345 |
-
// Reply to requests to prevent our drawer from closing
|
6346 |
-
nfRadio.channel( 'app' ).reply( 'prevent:changeDomain', this.preventChange, this );
|
6347 |
-
// Reply to requests to enable drawer closing
|
6348 |
-
nfRadio.channel( 'app' ).reply( 'enable:changeDomain', this.enableChange, this );
|
6349 |
-
|
6350 |
-
/*
|
6351 |
-
* Object that holds our array of 'prevent change' values.
|
6352 |
-
* We use an array so that registered requests can unregister and not affect each other.
|
6353 |
-
*/
|
6354 |
-
this.objPreventChange = {};
|
6355 |
-
},
|
6356 |
-
|
6357 |
-
changeAppDomain: function( e, model ) {
|
6358 |
-
/*
|
6359 |
-
* If we have disabled movement between domains, return false.
|
6360 |
-
*/
|
6361 |
-
if ( this.maybePreventChange() ) {
|
6362 |
-
return false;
|
6363 |
-
}
|
6364 |
-
|
6365 |
-
/*
|
6366 |
-
* If we are passed a model, use that model.
|
6367 |
-
* Otherwise, get the domain from the event target data.
|
6368 |
-
*/
|
6369 |
-
if ( 'undefined' == typeof model ) {
|
6370 |
-
var domainID = jQuery( e.target ).data( 'domain' );
|
6371 |
-
var model = nfRadio.channel( 'app' ).request( 'get:domainModel', domainID );
|
6372 |
-
}
|
6373 |
-
// If a drawer is open, close it.
|
6374 |
-
if ( nfRadio.channel( 'app' ).request( 'get:currentDrawer' ) ) {
|
6375 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6376 |
-
}
|
6377 |
-
/*
|
6378 |
-
* If we aren't dealing with an external url (such as preview), update our app data
|
6379 |
-
* and trigger a radio message saying we've changed the domain.
|
6380 |
-
*/
|
6381 |
-
if ( 0 == model.get( 'url' ).length ) {
|
6382 |
-
var mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
|
6383 |
-
nfRadio.channel( 'app' ).request( 'update:currentDomain', model );
|
6384 |
-
jQuery( mainEl ).scrollTop( 0 );
|
6385 |
-
nfRadio.channel( 'app' ).trigger( 'change:currentDomain', model );
|
6386 |
-
}
|
6387 |
-
},
|
6388 |
-
|
6389 |
-
/**
|
6390 |
-
* Check to see if anything has registered a key to prevent changing the domain.
|
6391 |
-
*
|
6392 |
-
* @since 3.0
|
6393 |
-
* @return boolean
|
6394 |
-
*/
|
6395 |
-
maybePreventChange: function() {
|
6396 |
-
if ( 0 == Object.keys( this.objPreventChange ).length ) {
|
6397 |
-
return false;
|
6398 |
-
} else {
|
6399 |
-
return true;
|
6400 |
-
}
|
6401 |
-
},
|
6402 |
-
|
6403 |
-
/**
|
6404 |
-
* Register a key to prevent changing the domain.
|
6405 |
-
*
|
6406 |
-
* @since 3.0
|
6407 |
-
* @param string key unique id for our 'prevent change domain' setting.
|
6408 |
-
* @return void
|
6409 |
-
*/
|
6410 |
-
preventChange: function( key ) {
|
6411 |
-
this.objPreventChange[ key ] = true;
|
6412 |
-
},
|
6413 |
-
|
6414 |
-
/**
|
6415 |
-
* Remove a previously registered key that is preventing our domain from changing.
|
6416 |
-
*
|
6417 |
-
* @since 3.0
|
6418 |
-
* @param string key unique id for our 'prevent change domain' setting.
|
6419 |
-
* @return void
|
6420 |
-
*/
|
6421 |
-
enableChange: function( key ) {
|
6422 |
-
delete this.objPreventChange[ key ];
|
6423 |
-
},
|
6424 |
-
|
6425 |
-
});
|
6426 |
-
|
6427 |
-
return controller;
|
6428 |
-
} );
|
6429 |
-
/**
|
6430 |
-
* Modify the user's browser history when they click on a domain
|
6431 |
-
*
|
6432 |
-
* @package Ninja Forms builder
|
6433 |
-
* @subpackage Main App
|
6434 |
-
* @copyright (c) 2015 WP Ninjas
|
6435 |
-
* @since 3.0
|
6436 |
-
*/
|
6437 |
-
define( 'controllers/app/pushstate',[], function() {
|
6438 |
-
var controller = Marionette.Object.extend( {
|
6439 |
-
initialize: function() {
|
6440 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.changePushState );
|
6441 |
-
},
|
6442 |
-
|
6443 |
-
changePushState: function() {
|
6444 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
6445 |
-
history.pushState( null, null, window.location.href + '&domain=' + currentDomain.get( 'id' ) );
|
6446 |
-
var reExp = /domain=\\d+/;
|
6447 |
-
var url = window.location.toString();
|
6448 |
-
var newUrl = url.replace( reExp, '' );
|
6449 |
-
console.log( newUrl );
|
6450 |
-
}
|
6451 |
-
|
6452 |
-
});
|
6453 |
-
|
6454 |
-
return controller;
|
6455 |
-
} );
|
6456 |
-
/**
|
6457 |
-
* Handles our hotkey execution. Needs to be cleaned up and made more programmatic.
|
6458 |
-
*
|
6459 |
-
* Our hotkeys are defined by the domain that we're currently viewing. In each domain's model, there is a hotkey object.
|
6460 |
-
*
|
6461 |
-
* Currently too much hotkey data is hard-coded here.
|
6462 |
-
*
|
6463 |
-
* @package Ninja Forms builder
|
6464 |
-
* @subpackage Fields
|
6465 |
-
* @copyright (c) 2015 WP Ninjas
|
6466 |
-
* @since 3.0
|
6467 |
-
*/
|
6468 |
-
define( 'controllers/app/hotkeys',[], function() {
|
6469 |
-
var controller = Marionette.Object.extend( {
|
6470 |
-
initialize: function() {
|
6471 |
-
// When we change our domain, change the hotkeys to those within that object.
|
6472 |
-
this.listenTo( nfRadio.channel( 'main' ), 'render:main', this.changeHotkeys );
|
6473 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', this.changeHotkeys );
|
6474 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'render:settingGroup', this.changeHotkeys );
|
6475 |
-
// Currently, these are the functions that run when the new field or new action hotkey is pressed.
|
6476 |
-
// TODO: move these into a config module or into something more programmatic and scalable.
|
6477 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'add:newField', this.addNewField );
|
6478 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'add:newAction', this.addNewAction );
|
6479 |
-
// Same as above, these functions need to be moved into a more modular/programmatic solution.
|
6480 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'changeDomain:fields', this.changeDomainFields );
|
6481 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'changeDomain:actions', this.changeDomainActions );
|
6482 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'changeDomain:settings', this.changeDomainSettings );
|
6483 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'close:drawer', this.closeDrawer );
|
6484 |
-
},
|
6485 |
-
|
6486 |
-
changeHotkeys: function() {
|
6487 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
6488 |
-
jQuery( document ).off( '.nfDomainHotkeys' );
|
6489 |
-
jQuery( 'input' ).off( '.nfDomainHotkeys' );
|
6490 |
-
if ( currentDomain.get( 'hotkeys' ) ) {
|
6491 |
-
jQuery.each( currentDomain.get( 'hotkeys' ), function( hotkey, msg ) {
|
6492 |
-
jQuery( document ).on( 'keydown.nfDomainHotkeys', null, hotkey, function( e ) {
|
6493 |
-
nfRadio.channel( 'hotkeys' ).trigger( msg, e );
|
6494 |
-
} );
|
6495 |
-
jQuery( 'input' ).on( 'keydown.nfDomainHotkeys', null, hotkey, function( e ) {
|
6496 |
-
nfRadio.channel( 'hotkeys' ).trigger( msg, e );
|
6497 |
-
} );
|
6498 |
-
jQuery( 'textarea' ).on( 'keydown.nfDomainHotkeys', null, hotkey, function( e ) {
|
6499 |
-
nfRadio.channel( 'hotkeys' ).trigger( msg, e );
|
6500 |
-
} );
|
6501 |
-
} );
|
6502 |
-
}
|
6503 |
-
},
|
6504 |
-
|
6505 |
-
addNewField: function() {
|
6506 |
-
if ( 'addField' != nfRadio.channel( 'app' ).request( 'get:currentDrawer' ) ) {
|
6507 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'addField' );
|
6508 |
-
} else {
|
6509 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6510 |
-
}
|
6511 |
-
|
6512 |
-
},
|
6513 |
-
|
6514 |
-
addNewAction: function() {
|
6515 |
-
if ( 'addAction' != nfRadio.channel( 'app' ).request( 'get:currentDrawer' ) ) {
|
6516 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'addAction' );
|
6517 |
-
} else {
|
6518 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6519 |
-
}
|
6520 |
-
},
|
6521 |
-
|
6522 |
-
changeDomainFields: function() {
|
6523 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6524 |
-
var fieldsDomain = appDomainCollection.get( 'fields' );
|
6525 |
-
nfRadio.channel( 'app' ).request( 'change:currentDomain', {}, fieldsDomain );
|
6526 |
-
},
|
6527 |
-
|
6528 |
-
changeDomainActions: function() {
|
6529 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6530 |
-
var actionsDomain = appDomainCollection.get( 'actions' );
|
6531 |
-
nfRadio.channel( 'app' ).request( 'change:currentDomain', {}, actionsDomain );
|
6532 |
-
},
|
6533 |
-
|
6534 |
-
changeDomainSettings: function() {
|
6535 |
-
var appDomainCollection = nfRadio.channel( 'app' ).request( 'get:domainCollection' );
|
6536 |
-
var settingsDomain = appDomainCollection.get( 'settings' );
|
6537 |
-
nfRadio.channel( 'app' ).request( 'change:currentDomain', {}, settingsDomain );
|
6538 |
-
},
|
6539 |
-
|
6540 |
-
closeDrawer: function() {
|
6541 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6542 |
-
}
|
6543 |
-
|
6544 |
-
});
|
6545 |
-
|
6546 |
-
return controller;
|
6547 |
-
} );
|
6548 |
-
/**
|
6549 |
-
* Change the clean state of our app when settings are changed.
|
6550 |
-
*
|
6551 |
-
* @package Ninja Forms builder
|
6552 |
-
* @subpackage Main App
|
6553 |
-
* @copyright (c) 2015 WP Ninjas
|
6554 |
-
* @since 3.0
|
6555 |
-
*/
|
6556 |
-
define( 'controllers/app/cleanState',[], function() {
|
6557 |
-
var controller = Marionette.Object.extend( {
|
6558 |
-
initialize: function() {
|
6559 |
-
/*
|
6560 |
-
* Set an array of field model attributes to ignore.
|
6561 |
-
* This list will be filtered just before we ignore anything.
|
6562 |
-
*/
|
6563 |
-
this.ignoreAttributes = [
|
6564 |
-
'editActive'
|
6565 |
-
];
|
6566 |
-
|
6567 |
-
this.listenTo( nfRadio.channel( 'app' ), 'update:setting', this.setAppClean );
|
6568 |
-
},
|
6569 |
-
|
6570 |
-
setAppClean: function( model ) {
|
6571 |
-
for( var attr in model.changedAttributes() ) {
|
6572 |
-
var changedAttr = attr;
|
6573 |
-
var after = model.changedAttributes()[ attr ];
|
6574 |
-
}
|
6575 |
-
|
6576 |
-
var ignoreAttributes = nfRadio.channel( 'undo-' + model.get( 'type' ) ).request( 'ignore:attributes', this.ignoreAttributes ) || this.ignoreAttributes;
|
6577 |
-
|
6578 |
-
if ( -1 != this.ignoreAttributes.indexOf( attr ) ) {
|
6579 |
-
return false;
|
6580 |
-
}
|
6581 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
6582 |
-
|
6583 |
-
//loop through repeater fields to reset active state if needed
|
6584 |
-
nfRadio.channel( 'fields-repeater' ).trigger( 'clearEditActive', model );
|
6585 |
-
}
|
6586 |
-
|
6587 |
-
});
|
6588 |
-
|
6589 |
-
return controller;
|
6590 |
-
} );
|
6591 |
-
/**
|
6592 |
-
* All of the core undo functions. Listens on the 'changes' channel for an undo request.
|
6593 |
-
*
|
6594 |
-
* @package Ninja Forms builder
|
6595 |
-
* @subpackage Main App
|
6596 |
-
* @copyright (c) 2015 WP Ninjas
|
6597 |
-
* @since 3.0
|
6598 |
-
*/
|
6599 |
-
define( 'controllers/app/coreUndo',[], function() {
|
6600 |
-
var controller = Marionette.Object.extend( {
|
6601 |
-
initialize: function() {
|
6602 |
-
nfRadio.channel( 'changes' ).reply( 'undo:changeSetting', this.undoChangeSetting, this );
|
6603 |
-
nfRadio.channel( 'changes' ).reply( 'undo:addObject', this.undoAddObject, this );
|
6604 |
-
nfRadio.channel( 'changes' ).reply( 'undo:removeObject', this.undoRemoveObject, this );
|
6605 |
-
nfRadio.channel( 'changes' ).reply( 'undo:duplicateObject', this.undoDuplicateObject, this );
|
6606 |
-
|
6607 |
-
nfRadio.channel( 'changes' ).reply( 'undo:sortFields', this.undoSortFields, this );
|
6608 |
-
nfRadio.channel( 'changes' ).reply( 'undo:addListOption', this.undoAddListOption, this );
|
6609 |
-
nfRadio.channel( 'changes' ).reply( 'undo:removeListOption', this.undoRemoveListOption, this );
|
6610 |
-
nfRadio.channel( 'changes' ).reply( 'undo:sortListOptions', this.undoSortListOptions, this );
|
6611 |
-
},
|
6612 |
-
|
6613 |
-
/**
|
6614 |
-
* Undo settings that have been changed.
|
6615 |
-
*
|
6616 |
-
* @since 3.0
|
6617 |
-
* @param backbone.model change model of our change
|
6618 |
-
* @param boolean undoAll are we in the middle of an undo all action?
|
6619 |
-
* @return void
|
6620 |
-
*/
|
6621 |
-
undoChangeSetting: function( change, undoAll ) {
|
6622 |
-
var fieldModel = change.get( 'model' );
|
6623 |
-
var changes = change.get( 'changes' );
|
6624 |
-
var attr = changes.attr;
|
6625 |
-
var before = changes.before;
|
6626 |
-
fieldModel.set( attr, before );
|
6627 |
-
this.maybeRemoveChange( change, undoAll );
|
6628 |
-
},
|
6629 |
-
|
6630 |
-
/**
|
6631 |
-
* Undo adding a field or an action.
|
6632 |
-
* Loops through our change collection and removes any change models based upon the one we're removing.
|
6633 |
-
*
|
6634 |
-
* @since 3.0
|
6635 |
-
* @param backbone.model change model of our change
|
6636 |
-
* @param boolean undoAll are we in the middle of an undo all action?
|
6637 |
-
* @return void
|
6638 |
-
*/
|
6639 |
-
undoAddObject: function( change, undoAll ) {
|
6640 |
-
var objectModel = change.get( 'model' );
|
6641 |
-
var collection = change.get( 'data' ).collection;
|
6642 |
-
|
6643 |
-
if ( 'undefined' != typeof collection.newIDs ) {
|
6644 |
-
delete collection.newIDs[ objectModel.get( 'id' ) ];
|
6645 |
-
}
|
6646 |
-
|
6647 |
-
if ( ! undoAll ) {
|
6648 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6649 |
-
var results = changeCollection.where( { model: objectModel } );
|
6650 |
-
|
6651 |
-
_.each( results, function( model ) {
|
6652 |
-
if ( model !== change ) {
|
6653 |
-
changeCollection.remove( model );
|
6654 |
-
}
|
6655 |
-
} );
|
6656 |
-
}
|
6657 |
-
|
6658 |
-
collection.remove( objectModel );
|
6659 |
-
this.maybeRemoveChange( change, undoAll );
|
6660 |
-
},
|
6661 |
-
|
6662 |
-
/**
|
6663 |
-
* Undo adding a field or an action.
|
6664 |
-
* Loops through our change collection and removes any change models based upon the one we're removing.
|
6665 |
-
*
|
6666 |
-
* @since 3.0
|
6667 |
-
* @param backbone.model change model of our change
|
6668 |
-
* @param boolean undoAll are we in the middle of an undo all action?
|
6669 |
-
* @return void
|
6670 |
-
*/
|
6671 |
-
undoDuplicateObject: function( change, undoAll ) {
|
6672 |
-
var objectModel = change.get( 'model' );
|
6673 |
-
var objectCollection = change.get( 'data' ).collection;
|
6674 |
-
|
6675 |
-
if ( ! undoAll ) {
|
6676 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6677 |
-
var results = changeCollection.where( { model: objectModel } );
|
6678 |
-
|
6679 |
-
_.each( results, function( model ) {
|
6680 |
-
if ( model !== change ) {
|
6681 |
-
changeCollection.remove( model );
|
6682 |
-
}
|
6683 |
-
} );
|
6684 |
-
}
|
6685 |
-
|
6686 |
-
objectCollection.remove( objectModel );
|
6687 |
-
this.maybeRemoveChange( change, undoAll );
|
6688 |
-
},
|
6689 |
-
|
6690 |
-
/**
|
6691 |
-
* Undo removing a field or an action.
|
6692 |
-
*
|
6693 |
-
* @since 3.0
|
6694 |
-
* @param backbone.model change model of our change
|
6695 |
-
* @param boolean undoAll are we in the middle of an undo all action?
|
6696 |
-
* @return void
|
6697 |
-
*/
|
6698 |
-
undoRemoveObject: function( change, undoAll ) {
|
6699 |
-
var dataModel = change.get( 'model' );
|
6700 |
-
var collection = change.get( 'data' ).collection;
|
6701 |
-
|
6702 |
-
nfRadio.channel( dataModel.get( 'objectDomain' ) ).request( 'add', dataModel );
|
6703 |
-
|
6704 |
-
delete collection.removedIDs[ dataModel.get( 'id' ) ];
|
6705 |
-
|
6706 |
-
if ( ! undoAll ) {
|
6707 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6708 |
-
var results = changeCollection.where( { model: dataModel } );
|
6709 |
-
|
6710 |
-
_.each( results, function( model ) {
|
6711 |
-
if ( model !== change ) {
|
6712 |
-
model.set( 'disabled', false );
|
6713 |
-
}
|
6714 |
-
} );
|
6715 |
-
}
|
6716 |
-
|
6717 |
-
// Trigger a reset on our field collection so that our view re-renders
|
6718 |
-
collection.trigger( 'reset', collection );
|
6719 |
-
|
6720 |
-
this.maybeRemoveChange( change, undoAll );
|
6721 |
-
},
|
6722 |
-
|
6723 |
-
/**
|
6724 |
-
* Undo field sorting.
|
6725 |
-
*
|
6726 |
-
* @since 3.0
|
6727 |
-
* @param backbone.model change model of our change
|
6728 |
-
* @param boolean undoAll are we in the middle of an undo all action?
|
6729 |
-
* @return void
|
6730 |
-
*/
|
6731 |
-
undoSortFields: function( change, undoAll ) {
|
6732 |
-
var data = change.get( 'data' );
|
6733 |
-
var fields = data.fields;
|
6734 |
-
|
6735 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
6736 |
-
_.each( fields, function( changeModel ) {
|
6737 |
-
var before = changeModel.before;
|
6738 |
-
var fieldModel = changeModel.model;
|
6739 |
-
fieldModel.set( 'order', before );
|
6740 |
-
// console.log( 'set ' + fieldModel.get( 'label' ) + ' to ' + before );
|
6741 |
-
} );
|
6742 |
-
// console.log( fieldCollection.where( { label: 'Name' } ) );
|
6743 |
-
// console.log( fieldCollection.where( { label: 'Email' } ) );
|
6744 |
-
|
6745 |
-
|
6746 |
-
fieldCollection.sort();
|
6747 |
-
this.maybeRemoveChange( change, undoAll );
|
6748 |
-
},
|
6749 |
-
|
6750 |
-
undoAddListOption: function( change, undoAll ) {
|
6751 |
-
var model = change.get( 'model' );
|
6752 |
-
|
6753 |
-
if ( ! undoAll ) {
|
6754 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6755 |
-
var results = changeCollection.where( { model: model } );
|
6756 |
-
|
6757 |
-
_.each( results, function( changeModel ) {
|
6758 |
-
if ( changeModel !== change ) {
|
6759 |
-
changeCollection.remove( changeModel );
|
6760 |
-
}
|
6761 |
-
} );
|
6762 |
-
}
|
6763 |
-
|
6764 |
-
model.collection.remove( model );
|
6765 |
-
this.maybeRemoveChange( change, undoAll );
|
6766 |
-
},
|
6767 |
-
|
6768 |
-
undoRemoveListOption: function( change, undoAll ) {
|
6769 |
-
var model = change.get( 'model' );
|
6770 |
-
var collection = change.get( 'data' ).collection;
|
6771 |
-
collection.add( model );
|
6772 |
-
|
6773 |
-
if ( ! undoAll ) {
|
6774 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6775 |
-
var results = changeCollection.where( { model: model } );
|
6776 |
-
|
6777 |
-
_.each( results, function( model ) {
|
6778 |
-
if ( model !== change ) {
|
6779 |
-
model.set( 'disabled', false );
|
6780 |
-
}
|
6781 |
-
} );
|
6782 |
-
}
|
6783 |
-
|
6784 |
-
this.maybeRemoveChange( change, undoAll );
|
6785 |
-
},
|
6786 |
-
|
6787 |
-
undoSortListOptions: function( change, undoAll ) {
|
6788 |
-
var data = change.get( 'data' );
|
6789 |
-
var collection = data.collection;
|
6790 |
-
|
6791 |
-
var objModels = data.objModels;
|
6792 |
-
|
6793 |
-
_.each( objModels, function( changeModel ) {
|
6794 |
-
var before = changeModel.before;
|
6795 |
-
var optionModel = changeModel.model;
|
6796 |
-
optionModel.set( 'order', before );
|
6797 |
-
} );
|
6798 |
-
|
6799 |
-
|
6800 |
-
collection.sort();
|
6801 |
-
this.maybeRemoveChange( change, undoAll );
|
6802 |
-
},
|
6803 |
-
|
6804 |
-
/**
|
6805 |
-
* If our undo action was requested to 'remove' the change from the collection, remove it.
|
6806 |
-
*
|
6807 |
-
* @since 3.0
|
6808 |
-
* @param backbone.model change model of our change
|
6809 |
-
* @param boolean remove should we remove this item from our change collection
|
6810 |
-
* @return void
|
6811 |
-
*/
|
6812 |
-
maybeRemoveChange: function( change, undoAll ) {
|
6813 |
-
var undoAll = typeof undoAll !== 'undefined' ? undoAll : false;
|
6814 |
-
if ( ! undoAll ) {
|
6815 |
-
// Update preview.
|
6816 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
6817 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
6818 |
-
changeCollection.remove( change );
|
6819 |
-
if ( 0 == changeCollection.length ) {
|
6820 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', true );
|
6821 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
6822 |
-
}
|
6823 |
-
}
|
6824 |
-
}
|
6825 |
-
|
6826 |
-
});
|
6827 |
-
|
6828 |
-
return controller;
|
6829 |
-
} );
|
6830 |
-
/**
|
6831 |
-
* Returns a clone of a backbone model with all the attributes looped through so that collections contained within are propely cloned.
|
6832 |
-
*
|
6833 |
-
* @package Ninja Forms builder
|
6834 |
-
* @subpackage Main App
|
6835 |
-
* @copyright (c) 2015 WP Ninjas
|
6836 |
-
* @since 3.0
|
6837 |
-
*/
|
6838 |
-
define( 'controllers/app/cloneModelDeep',[], function() {
|
6839 |
-
var controller = Marionette.Object.extend( {
|
6840 |
-
initialize: function() {
|
6841 |
-
nfRadio.channel( 'app' ).reply( 'clone:modelDeep', this.cloneModelDeep, this );
|
6842 |
-
},
|
6843 |
-
|
6844 |
-
cloneModelDeep: function( model ) {
|
6845 |
-
// Temporary value used to store any new collections.
|
6846 |
-
var replace = {};
|
6847 |
-
// Loop over every model attribute and if we find a collection, clone each model and instantiate a new collection.
|
6848 |
-
_.each( model.attributes, function( val, key ) {
|
6849 |
-
if( val instanceof Backbone.Collection ) { // Is this a backbone collection?
|
6850 |
-
var clonedCollection = nfRadio.channel( 'app' ).request( 'clone:collectionDeep', val );
|
6851 |
-
replace[ key ] = clonedCollection;
|
6852 |
-
} else if ( val instanceof Backbone.Model ) { // Is this a backbone model?
|
6853 |
-
replace[ key ] = this.cloneModelDeep( val );
|
6854 |
-
}
|
6855 |
-
}, this );
|
6856 |
-
|
6857 |
-
// Clone our original model
|
6858 |
-
var newModel = model.clone();
|
6859 |
-
// Overwrite any collections we created above.
|
6860 |
-
_.each( replace, function( val, key ) {
|
6861 |
-
newModel.set( key, val );
|
6862 |
-
} );
|
6863 |
-
|
6864 |
-
return newModel;
|
6865 |
-
}
|
6866 |
-
});
|
6867 |
-
|
6868 |
-
return controller;
|
6869 |
-
} );
|
6870 |
-
/**
|
6871 |
-
* Returns the appropriate child view for our settings drawer.
|
6872 |
-
*
|
6873 |
-
* This enables settings types to register custom childviews for their settings.
|
6874 |
-
* The option-repeater setting for the list field is an example.
|
6875 |
-
*
|
6876 |
-
* @package Ninja Forms builder
|
6877 |
-
* @subpackage App - Edit Settings Drawer
|
6878 |
-
* @copyright (c) 2015 WP Ninjas
|
6879 |
-
* @since 3.0
|
6880 |
-
*/
|
6881 |
-
define( 'controllers/app/getSettingChildView',['views/app/drawer/itemSetting'], function( itemSettingView ) {
|
6882 |
-
var controller = Marionette.Object.extend( {
|
6883 |
-
initialize: function() {
|
6884 |
-
// Respond to requests for field settings child views.
|
6885 |
-
nfRadio.channel( 'app' ).reply( 'get:settingChildView', this.getSettingChildView, this );
|
6886 |
-
},
|
6887 |
-
|
6888 |
-
/**
|
6889 |
-
* Return the appropriate child setting view.
|
6890 |
-
*
|
6891 |
-
* @since 3.0
|
6892 |
-
* @param backbone.model model Field setting
|
6893 |
-
* @return backbone.view
|
6894 |
-
*/
|
6895 |
-
getSettingChildView: function( model ) {
|
6896 |
-
// Get our setting type.
|
6897 |
-
var type = model.get( 'type' );
|
6898 |
-
// Request a setting childview from our setting type channel. (Setting type, not field type)
|
6899 |
-
var settingChildView = nfRadio.channel( type ).request( 'get:settingChildView', model ) || itemSettingView;
|
6900 |
-
|
6901 |
-
return settingChildView
|
6902 |
-
}
|
6903 |
-
|
6904 |
-
});
|
6905 |
-
|
6906 |
-
return controller;
|
6907 |
-
} );
|
6908 |
-
/**
|
6909 |
-
* Updates our model when the user changes a setting.
|
6910 |
-
*
|
6911 |
-
* @package Ninja Forms builder
|
6912 |
-
* @subpackage Main App
|
6913 |
-
* @copyright (c) 2015 WP Ninjas
|
6914 |
-
* @since 3.0
|
6915 |
-
*/
|
6916 |
-
define( 'controllers/app/changeSettingDefault',[], function() {
|
6917 |
-
var controller = Marionette.Object.extend( {
|
6918 |
-
initialize: function() {
|
6919 |
-
// Respond to requests to update settings.
|
6920 |
-
nfRadio.channel( 'app' ).reply( 'change:setting', this.changeSetting, this );
|
6921 |
-
|
6922 |
-
// Listen on our app channel for the change setting event. Fired by the setting view.
|
6923 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:setting', this.changeSetting, this );
|
6924 |
-
},
|
6925 |
-
|
6926 |
-
/**
|
6927 |
-
* When we change our setting, update the model.
|
6928 |
-
*
|
6929 |
-
* @since 3.0
|
6930 |
-
* @param Object e event
|
6931 |
-
* @param backbone.model settingModel model that holds our field type settings info
|
6932 |
-
* @param backbone.model dataModel model that holds our field settings
|
6933 |
-
* @return void
|
6934 |
-
*/
|
6935 |
-
changeSetting: function( e, settingModel, dataModel, value ) {
|
6936 |
-
var name = settingModel.get( 'name' );
|
6937 |
-
var before = dataModel.get( name );
|
6938 |
-
var value = value || null;
|
6939 |
-
if ( ! value ) {
|
6940 |
-
// Sends out a request on the fields-type (fields-text, fields-checkbox, etc) channel to see if that field type needs to return a special value for saving.
|
6941 |
-
value = nfRadio.channel( settingModel.get( 'type' ) ).request( 'before:updateSetting', e, dataModel, name, settingModel );
|
6942 |
-
}
|
6943 |
-
|
6944 |
-
if( 'undefined' == typeof value ){
|
6945 |
-
value = jQuery( e.target ).val();
|
6946 |
-
}
|
6947 |
-
|
6948 |
-
// Update our field model with the new setting value.
|
6949 |
-
dataModel.set( name, value, { settingModel: settingModel } );
|
6950 |
-
nfRadio.channel( 'setting-' + name ).trigger( 'after:updateSetting', dataModel, settingModel );
|
6951 |
-
// Register our setting change with our change tracker
|
6952 |
-
var after = value;
|
6953 |
-
|
6954 |
-
var changes = {
|
6955 |
-
attr: name,
|
6956 |
-
before: before,
|
6957 |
-
after: after
|
6958 |
-
}
|
6959 |
-
|
6960 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
6961 |
-
var currentDomainID = currentDomain.get( 'id' );
|
6962 |
-
|
6963 |
-
var label = {
|
6964 |
-
object: dataModel.get( 'objectType' ),
|
6965 |
-
label: dataModel.get( 'label' ),
|
6966 |
-
change: 'Changed ' + settingModel.get( 'label' ) + ' from ' + before + ' to ' + after
|
6967 |
-
};
|
6968 |
-
|
6969 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'changeSetting', dataModel, changes, label );
|
6970 |
-
}
|
6971 |
-
|
6972 |
-
});
|
6973 |
-
|
6974 |
-
return controller;
|
6975 |
-
} );
|
6976 |
-
define( 'views/app/drawer/typeSettingFieldset',['views/app/drawer/itemSetting'], function( itemSettingView ) {
|
6977 |
-
var view = Marionette.CompositeView.extend( {
|
6978 |
-
template: '#tmpl-nf-edit-setting-wrap',
|
6979 |
-
childView: itemSettingView,
|
6980 |
-
|
6981 |
-
initialize: function( data ) {
|
6982 |
-
this.collection = this.model.get( 'settings' );
|
6983 |
-
this.childViewOptions = { dataModel: data.dataModel };
|
6984 |
-
this.dataModel = data.dataModel;
|
6985 |
-
var deps = this.model.get( 'deps' );
|
6986 |
-
if ( deps ) {
|
6987 |
-
// If we don't have a 'settings' property, this is a legacy depdency setup.
|
6988 |
-
if ( 'undefined' == typeof deps.settings ) {
|
6989 |
-
deps.settings = [];
|
6990 |
-
_.each(deps, function(dep, name){
|
6991 |
-
if( 'settings' !== name ) {
|
6992 |
-
deps.settings.push( { name: name, value: dep } );
|
6993 |
-
}
|
6994 |
-
});
|
6995 |
-
deps.match = 'all';
|
6996 |
-
}
|
6997 |
-
|
6998 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
6999 |
-
let name = deps.settings[i].name;
|
7000 |
-
this.dataModel.on( 'change:' + name, this.render, this );
|
7001 |
-
}
|
7002 |
-
}
|
7003 |
-
this.model.on( 'rerender', this.render, this );
|
7004 |
-
},
|
7005 |
-
|
7006 |
-
onBeforeDestroy: function() {
|
7007 |
-
var deps = this.model.get( 'deps' );
|
7008 |
-
if ( deps ) {
|
7009 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
7010 |
-
name = deps.settings[i].name;
|
7011 |
-
this.dataModel.off( 'change:' + name, this.render );
|
7012 |
-
}
|
7013 |
-
}
|
7014 |
-
},
|
7015 |
-
|
7016 |
-
onBeforeRender: function() {
|
7017 |
-
nfRadio.channel( 'app' ).trigger( 'before:renderSetting', this.model, this.dataModel );
|
7018 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'before:renderSetting', this.model, this.dataModel, this );
|
7019 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'before:renderSetting', this.model, this.dataModel, this );
|
7020 |
-
},
|
7021 |
-
|
7022 |
-
onRender: function() {
|
7023 |
-
/*
|
7024 |
-
* Send out a radio message.
|
7025 |
-
*/
|
7026 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
7027 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
7028 |
-
},
|
7029 |
-
|
7030 |
-
templateHelpers: function () {
|
7031 |
-
var that = this;
|
7032 |
-
return {
|
7033 |
-
renderVisible: function() {
|
7034 |
-
|
7035 |
-
if(!nfAdmin.devMode){
|
7036 |
-
if('help' == this.name) return 'style="display:none;"';
|
7037 |
-
if('classes' == this.name) return 'style="display:none;"';
|
7038 |
-
if('input_limit_set' == this.name) return 'style="display:none;"';
|
7039 |
-
|
7040 |
-
if('checkbox' == that.dataModel.get('type')){
|
7041 |
-
if('checkbox_values' == this.name) return 'style="display:none;"';
|
7042 |
-
}
|
7043 |
-
|
7044 |
-
if('date' == that.dataModel.get('type')){
|
7045 |
-
if('year_range' == this.name) return 'style="display:none;"';
|
7046 |
-
}
|
7047 |
-
}
|
7048 |
-
|
7049 |
-
return nfRadio.channel( 'settings' ).request( 'check:deps', this, that );
|
7050 |
-
},
|
7051 |
-
renderSetting: function(){
|
7052 |
-
var setting = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-edit-setting-' + this.type );
|
7053 |
-
return setting( this );
|
7054 |
-
},
|
7055 |
-
|
7056 |
-
renderClasses: function() {
|
7057 |
-
var classes = '';
|
7058 |
-
if ( 'undefined' != typeof this.width ) {
|
7059 |
-
classes += this.width;
|
7060 |
-
} else {
|
7061 |
-
classes += ' one-half';
|
7062 |
-
}
|
7063 |
-
|
7064 |
-
if ( this.error ) {
|
7065 |
-
classes += ' nf-error';
|
7066 |
-
}
|
7067 |
-
|
7068 |
-
return classes;
|
7069 |
-
},
|
7070 |
-
|
7071 |
-
renderError: function() {
|
7072 |
-
if ( this.error ) {
|
7073 |
-
return this.error;
|
7074 |
-
}
|
7075 |
-
return '';
|
7076 |
-
}
|
7077 |
-
}
|
7078 |
-
},
|
7079 |
-
|
7080 |
-
attachHtml: function( collectionView, childView ) {
|
7081 |
-
jQuery( collectionView.el ).find( '.nf-field-sub-settings' ).append( childView.el );
|
7082 |
-
}
|
7083 |
-
} );
|
7084 |
-
|
7085 |
-
return view;
|
7086 |
-
} );
|
7087 |
-
/**
|
7088 |
-
* Handles actions related to field settings that use a fieldset
|
7089 |
-
*
|
7090 |
-
* @package Ninja Forms builder
|
7091 |
-
* @subpackage Fields - Edit Field Drawer
|
7092 |
-
* @copyright (c) 2015 WP Ninjas
|
7093 |
-
* @since 3.0
|
7094 |
-
*/
|
7095 |
-
define( 'controllers/app/fieldset',['views/app/drawer/typeSettingFieldset','models/app/settingCollection'], function( fieldsetView, settingCollection ) {
|
7096 |
-
var controller = Marionette.Object.extend( {
|
7097 |
-
initialize: function() {
|
7098 |
-
nfRadio.channel( 'fieldset' ).reply( 'get:settingChildView', this.getSettingChildView, this );
|
7099 |
-
// When a list type field is initialized, create an option collection.
|
7100 |
-
this.listenTo( nfRadio.channel( 'fieldset' ), 'init:settingModel', this.createSettingsCollection );
|
7101 |
-
},
|
7102 |
-
|
7103 |
-
getSettingChildView: function( model ) {
|
7104 |
-
return fieldsetView;
|
7105 |
-
},
|
7106 |
-
|
7107 |
-
/**
|
7108 |
-
* Instantiate settings collection when a fieldset type is initialized.
|
7109 |
-
*
|
7110 |
-
* @since 3.0
|
7111 |
-
* @param backbone.model model field model being initialized
|
7112 |
-
* @return void
|
7113 |
-
*/
|
7114 |
-
createSettingsCollection: function( model ) {
|
7115 |
-
model.set( 'settings', new settingCollection( model.get( 'settings' ) ) );
|
7116 |
-
},
|
7117 |
-
|
7118 |
-
});
|
7119 |
-
|
7120 |
-
return controller;
|
7121 |
-
} );
|
7122 |
-
/**
|
7123 |
-
* Handles actions related to our toggle field.
|
7124 |
-
* When we change the toggle, the setting value will be 'on' or ''.
|
7125 |
-
* We need to change this to 1 or 0.
|
7126 |
-
*
|
7127 |
-
* @package Ninja Forms builder
|
7128 |
-
* @subpackage Fields - Edit Field Drawer
|
7129 |
-
* @copyright (c) 2015 WP Ninjas
|
7130 |
-
* @since 3.0
|
7131 |
-
*/
|
7132 |
-
define( 'controllers/app/toggleSetting',[], function() {
|
7133 |
-
var controller = Marionette.Object.extend( {
|
7134 |
-
initialize: function() {
|
7135 |
-
// We don't want the RTE setting to re-render when the value changes.
|
7136 |
-
nfRadio.channel( 'setting-type-toggle' ).reply( 'renderOnChange', function(){ return false } );
|
7137 |
-
|
7138 |
-
// Respond to requests for field setting filtering.
|
7139 |
-
nfRadio.channel( 'toggle' ).reply( 'before:updateSetting', this.updateSetting, this );
|
7140 |
-
},
|
7141 |
-
|
7142 |
-
/**
|
7143 |
-
* Return either 1 or 0, depending upon the toggle position.
|
7144 |
-
*
|
7145 |
-
* @since 3.0
|
7146 |
-
* @param Object e event
|
7147 |
-
* @param backbone.model fieldModel field model
|
7148 |
-
* @param string name setting name
|
7149 |
-
* @param backbone.model settingTypeModel field type model
|
7150 |
-
* @return int 1 or 0
|
7151 |
-
*/
|
7152 |
-
updateSetting: function( e, fieldModel, name, settingTypeModel ) {
|
7153 |
-
if ( jQuery( e.target ).prop( 'checked' ) ) {
|
7154 |
-
var value = 1;
|
7155 |
-
} else {
|
7156 |
-
var value = 0;
|
7157 |
-
}
|
7158 |
-
|
7159 |
-
return value;
|
7160 |
-
}
|
7161 |
-
|
7162 |
-
});
|
7163 |
-
|
7164 |
-
return controller;
|
7165 |
-
} );
|
7166 |
-
/**
|
7167 |
-
* Handles actions related to our toggle field.
|
7168 |
-
* When we change the toggle, the setting value will be 'on' or ''.
|
7169 |
-
* We need to change this to 1 or 0.
|
7170 |
-
*
|
7171 |
-
* @package Ninja Forms builder
|
7172 |
-
* @subpackage Fields - Edit Field Drawer
|
7173 |
-
* @copyright (c) 2015 WP Ninjas
|
7174 |
-
* @since 3.0
|
7175 |
-
*/
|
7176 |
-
define( 'controllers/app/buttonToggleSetting',[], function() {
|
7177 |
-
var controller = Marionette.Object.extend( {
|
7178 |
-
initialize: function() {
|
7179 |
-
// We don't want the RTE setting to re-render when the value changes.
|
7180 |
-
nfRadio.channel( 'setting-type-button-toggle' ).reply( 'renderOnChange', function(){ return false; } );
|
7181 |
-
|
7182 |
-
// Respond to requests for field setting filtering.
|
7183 |
-
nfRadio.channel( 'button-toggle' ).reply( 'before:updateSetting', this.updateSetting, this );
|
7184 |
-
},
|
7185 |
-
|
7186 |
-
/**
|
7187 |
-
* Return either 1 or 0, depending upon the toggle position.
|
7188 |
-
*
|
7189 |
-
* @since 3.0
|
7190 |
-
* @param Object e event
|
7191 |
-
* @param backbone.model fieldModel field model
|
7192 |
-
* @param string name setting name
|
7193 |
-
* @param backbone.model settingTypeModel field type model
|
7194 |
-
* @return int 1 or 0
|
7195 |
-
*/
|
7196 |
-
updateSetting: function( e, fieldModel, name, settingTypeModel ) {
|
7197 |
-
return e.target.value;
|
7198 |
-
}
|
7199 |
-
|
7200 |
-
});
|
7201 |
-
|
7202 |
-
return controller;
|
7203 |
-
} );
|
7204 |
-
/**
|
7205 |
-
* Handles actions related to number field settings.
|
7206 |
-
*
|
7207 |
-
* @package Ninja Forms builder
|
7208 |
-
* @subpackage Fields - Edit Field Drawer
|
7209 |
-
* @copyright (c) 2015 WP Ninjas
|
7210 |
-
* @since 3.0
|
7211 |
-
*/
|
7212 |
-
define( 'controllers/app/numberSetting',[], function() {
|
7213 |
-
var controller = Marionette.Object.extend( {
|
7214 |
-
initialize: function() {
|
7215 |
-
// Respond to requests for field setting filtering.
|
7216 |
-
nfRadio.channel( 'number' ).reply( 'before:updateSetting', this.updateSetting, this );
|
7217 |
-
},
|
7218 |
-
|
7219 |
-
/**
|
7220 |
-
* Resets value if user enters value below min value or above max value
|
7221 |
-
*
|
7222 |
-
* @since 3.0
|
7223 |
-
* @param Object e event
|
7224 |
-
* @param backbone.model fieldModel field model
|
7225 |
-
* @param string name setting name
|
7226 |
-
* @param backbone.model settingTypeModel field type model
|
7227 |
-
* @return int 1 or 0
|
7228 |
-
*/
|
7229 |
-
updateSetting: function( e, fieldModel, name, settingTypeModel ) {
|
7230 |
-
var minVal = settingTypeModel.get( 'min_val' );
|
7231 |
-
var maxVal = settingTypeModel.get( 'max_val' );
|
7232 |
-
|
7233 |
-
/*
|
7234 |
-
* if we gave a min value set, revert to that if the user enters
|
7235 |
-
* a lower number
|
7236 |
-
*/
|
7237 |
-
if( 'undefined' != typeof minVal && null !== minVal ){
|
7238 |
-
if ( e.target.value < minVal ) {
|
7239 |
-
fieldModel.set('value', minVal);
|
7240 |
-
e.target.value = minVal;
|
7241 |
-
}
|
7242 |
-
}
|
7243 |
-
/*
|
7244 |
-
* if we gave a max value set, revert to that if the user enters
|
7245 |
-
* a higher number
|
7246 |
-
*/
|
7247 |
-
if( 'undefined' != typeof maxVal && null !== maxVal ){
|
7248 |
-
if ( e.target.value > maxVal ) {
|
7249 |
-
fieldModel.set('value', maxVal);
|
7250 |
-
e.target.value = maxVal;
|
7251 |
-
}
|
7252 |
-
}
|
7253 |
-
|
7254 |
-
return e.target.value;
|
7255 |
-
}
|
7256 |
-
|
7257 |
-
});
|
7258 |
-
|
7259 |
-
return controller;
|
7260 |
-
} );
|
7261 |
-
|
7262 |
-
define( 'controllers/app/radioSetting',[], function() {
|
7263 |
-
var controller = Marionette.Object.extend({
|
7264 |
-
initialize: function () {
|
7265 |
-
// Respond to requests for field setting filtering.
|
7266 |
-
|
7267 |
-
console.log( nfRadio.channel( 'radio' ) );
|
7268 |
-
nfRadio.channel('radio').reply( 'before:updateSetting', this.updateSetting, this);
|
7269 |
-
},
|
7270 |
-
|
7271 |
-
|
7272 |
-
updateSetting: function( e, fieldModel, name, settingTypeModel ) {
|
7273 |
-
console.log( 'test' );
|
7274 |
-
}
|
7275 |
-
});
|
7276 |
-
return controller;
|
7277 |
-
} );
|
7278 |
-
/**
|
7279 |
-
* Listens for clicks on our action item action buttons.
|
7280 |
-
*
|
7281 |
-
* @package Ninja Forms builder
|
7282 |
-
* @subpackage Fields - Main Sortable
|
7283 |
-
* @copyright (c) 2015 WP Ninjas
|
7284 |
-
* @since 3.0
|
7285 |
-
*/
|
7286 |
-
define( 'controllers/app/itemControls',[], function() {
|
7287 |
-
var controller = Marionette.Object.extend( {
|
7288 |
-
|
7289 |
-
deleting: false, // block edit functionality while deleting field
|
7290 |
-
|
7291 |
-
initialize: function() {
|
7292 |
-
// Listen for clicks to edit, delete, duplicate actions.
|
7293 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:edit', this.clickEdit );
|
7294 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:delete', this.maybeDelete );
|
7295 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:duplicate', this.clickDuplicate );
|
7296 |
-
|
7297 |
-
// Listen for our drawer close and remove our active edit state
|
7298 |
-
},
|
7299 |
-
|
7300 |
-
/**
|
7301 |
-
* Open a drawer with our action model for editing settings.
|
7302 |
-
*
|
7303 |
-
* @since 3.0
|
7304 |
-
* @param Object e event
|
7305 |
-
* @param backbone.model model action model
|
7306 |
-
* @return void
|
7307 |
-
*/
|
7308 |
-
clickEdit: function( e, model ) {
|
7309 |
-
// if we are deleting a field, we don't want to the edit drawer to open
|
7310 |
-
if( ! this.deleting ) {
|
7311 |
-
var currentDomain = nfRadio.channel('app').request('get:currentDomain');
|
7312 |
-
var currentDomainID = currentDomain.get('id');
|
7313 |
-
var type = nfRadio.channel(currentDomainID).request('get:type', model.get('type'));
|
7314 |
-
nfRadio.channel('app').request('open:drawer', 'editSettings', {
|
7315 |
-
model: model,
|
7316 |
-
groupCollection: type.get('settingGroups')
|
7317 |
-
});
|
7318 |
-
//loop through repeater fields to reset active state if needed
|
7319 |
-
nfRadio.channel( 'fields-repeater' ).trigger( 'clearEditActive', model );
|
7320 |
-
}
|
7321 |
-
},
|
7322 |
-
|
7323 |
-
/**
|
7324 |
-
* Let user know that all data will be lost before actually deleting
|
7325 |
-
*
|
7326 |
-
* @since 3.0
|
7327 |
-
* @param Object e event
|
7328 |
-
* @param backbone.model model action model
|
7329 |
-
* @return void
|
7330 |
-
*/
|
7331 |
-
maybeDelete: function( e, dataModel ) {
|
7332 |
-
// we set deleting to true, so the edit event doesn't open drawer
|
7333 |
-
this.deleting = true;
|
7334 |
-
var modelID = dataModel.get( 'id' );
|
7335 |
-
var modelType = dataModel.get( 'objectType' );
|
7336 |
-
|
7337 |
-
// Build a lookup table for fields that we don't save
|
7338 |
-
var nonSaveFields = [ 'html', 'submit', 'hr',
|
7339 |
-
'recaptcha', 'spam', 'creditcard', 'creditcardcvc',
|
7340 |
-
'creditcardexpiration', 'creditcardfullname',
|
7341 |
-
'creditcardnumber', 'creditcardzip' ];
|
7342 |
-
|
7343 |
-
/*
|
7344 |
-
* If this is a new field that hasn't been saved, then we don't
|
7345 |
-
* need to check for data
|
7346 |
-
*/
|
7347 |
-
if( 'field' != modelType.toLowerCase() ) {
|
7348 |
-
this.clickDelete( e, dataModel );
|
7349 |
-
} else {
|
7350 |
-
/*
|
7351 |
-
* If the field has been saved, then we need to check for
|
7352 |
-
* submission data for this field
|
7353 |
-
*/
|
7354 |
-
if( 'tmp' === modelID.toString().substring( 0, 3 )
|
7355 |
-
|| -1 != jQuery.inArray( dataModel.get( 'type' ), nonSaveFields ) ) {
|
7356 |
-
// not a saved field so proceed as normal
|
7357 |
-
this.clickDelete( e, dataModel );
|
7358 |
-
} else {
|
7359 |
-
// need the form id
|
7360 |
-
var formModel = Backbone.Radio.channel('app').request('get:formModel');
|
7361 |
-
var data = {
|
7362 |
-
'action': 'nf_maybe_delete_field',
|
7363 |
-
'security': nfAdmin.ajaxNonce,
|
7364 |
-
'formID': formModel.get('id'),
|
7365 |
-
'fieldKey': dataModel.get('key'),
|
7366 |
-
'fieldID': modelID
|
7367 |
-
};
|
7368 |
-
var that = this;
|
7369 |
-
|
7370 |
-
// make call to see if field has submission data
|
7371 |
-
jQuery.post(ajaxurl, data)
|
7372 |
-
.done(function (response) {
|
7373 |
-
var res = JSON.parse(response);
|
7374 |
-
|
7375 |
-
if (res.data.hasOwnProperty('errors')) {
|
7376 |
-
var errors = res.data.errors;
|
7377 |
-
var errorMsg = '';
|
7378 |
-
|
7379 |
-
if (Array.isArray(errors)) {
|
7380 |
-
errors.forEach(function(error) {
|
7381 |
-
errors += error + "\n";
|
7382 |
-
})
|
7383 |
-
} else {
|
7384 |
-
errors = errors;
|
7385 |
-
}
|
7386 |
-
console.log('Maybe Delete Field Errors: ', errors);
|
7387 |
-
alert(errors);
|
7388 |
-
return null;
|
7389 |
-
}
|
7390 |
-
|
7391 |
-
if (res.data.field_has_data) {
|
7392 |
-
// if it does, show warning modal
|
7393 |
-
that.doDeleteFieldModal(e, dataModel);
|
7394 |
-
return false;
|
7395 |
-
} else {
|
7396 |
-
// if not, proceed like normal
|
7397 |
-
that.clickDelete(e, dataModel);
|
7398 |
-
return false;
|
7399 |
-
}
|
7400 |
-
});
|
7401 |
-
}
|
7402 |
-
}
|
7403 |
-
},
|
7404 |
-
|
7405 |
-
/**
|
7406 |
-
* Create the field delete warning modal
|
7407 |
-
*
|
7408 |
-
* @param e
|
7409 |
-
* @param dataModel
|
7410 |
-
*/
|
7411 |
-
doDeleteFieldModal: function( e, dataModel ) {
|
7412 |
-
// Build warning modal to warn user a losing all data related to field
|
7413 |
-
var that = this;
|
7414 |
-
var modalData = {
|
7415 |
-
width: 400,
|
7416 |
-
closeOnClick: false,
|
7417 |
-
closeOnEsc: true,
|
7418 |
-
content: nfi18n.fieldDataDeleteMsg,
|
7419 |
-
btnPrimary: {
|
7420 |
-
text: nfi18n.delete,
|
7421 |
-
callback: function() {
|
7422 |
-
// close and destory modal.
|
7423 |
-
deleteModal.toggleModal( false );
|
7424 |
-
deleteModal.destroy();
|
7425 |
-
// proceed as normal, data will be deleted in backend on publish
|
7426 |
-
that.clickDelete( e, dataModel );
|
7427 |
-
}
|
7428 |
-
},
|
7429 |
-
btnSecondary: {
|
7430 |
-
text: nfi18n.cancel,
|
7431 |
-
callback: function() {
|
7432 |
-
// close and destory modal
|
7433 |
-
deleteModal.toggleModal( false );
|
7434 |
-
deleteModal.destroy();
|
7435 |
-
// set deleting to false so edit can work as normal
|
7436 |
-
that.deleting = false;
|
7437 |
-
}
|
7438 |
-
}
|
7439 |
-
};
|
7440 |
-
var deleteModal = new NinjaModal( modalData );
|
7441 |
-
},
|
7442 |
-
|
7443 |
-
/**
|
7444 |
-
* Delete a action model from our collection
|
7445 |
-
*
|
7446 |
-
* @since 3.0
|
7447 |
-
* @param Object e event
|
7448 |
-
* @param backbone.model model action model
|
7449 |
-
* @return void
|
7450 |
-
*/
|
7451 |
-
clickDelete: function( e, dataModel ) {
|
7452 |
-
var newModel = nfRadio.channel( 'app' ).request( 'clone:modelDeep', dataModel );
|
7453 |
-
|
7454 |
-
// Add our action deletion to our change log.
|
7455 |
-
var label = {
|
7456 |
-
object: dataModel.get( 'objectType' ),
|
7457 |
-
label: dataModel.get( 'label' ),
|
7458 |
-
change: 'Removed',
|
7459 |
-
dashicon: 'dismiss'
|
7460 |
-
};
|
7461 |
-
|
7462 |
-
var data = {
|
7463 |
-
collection: dataModel.collection
|
7464 |
-
};
|
7465 |
-
|
7466 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
7467 |
-
var results = changeCollection.where( { model: dataModel } );
|
7468 |
-
|
7469 |
-
_.each( results, function( changeModel ) {
|
7470 |
-
var data = changeModel.get( 'data' );
|
7471 |
-
if ( 'undefined' != typeof data.fields ) {
|
7472 |
-
_.each( data.fields, function( field, index ) {
|
7473 |
-
if ( field.model == dataModel ) {
|
7474 |
-
data.fields[ index ].model = newModel;
|
7475 |
-
}
|
7476 |
-
} );
|
7477 |
-
}
|
7478 |
-
changeModel.set( 'data', data );
|
7479 |
-
changeModel.set( 'model', newModel );
|
7480 |
-
changeModel.set( 'disabled', true );
|
7481 |
-
} );
|
7482 |
-
|
7483 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'removeObject', newModel, null, label, data );
|
7484 |
-
|
7485 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
7486 |
-
var currentDomainID = currentDomain.get( 'id' );
|
7487 |
-
nfRadio.channel( currentDomainID ).request( 'delete', dataModel );
|
7488 |
-
this.deleting = false;
|
7489 |
-
},
|
7490 |
-
|
7491 |
-
/**
|
7492 |
-
* Duplicate a action within our collection, adding the word "copy" to the label.
|
7493 |
-
*
|
7494 |
-
* @since 3.0
|
7495 |
-
* @param Object e event
|
7496 |
-
* @param backbone.model model action model
|
7497 |
-
* @return void
|
7498 |
-
*/
|
7499 |
-
clickDuplicate: function( e, model ) {
|
7500 |
-
var newModel = nfRadio.channel( 'app' ).request( 'clone:modelDeep', model );
|
7501 |
-
var currentDomain = nfRadio.channel( 'app' ).request( 'get:currentDomain' );
|
7502 |
-
var currentDomainID = currentDomain.get( 'id' );
|
7503 |
-
|
7504 |
-
// Change our label.
|
7505 |
-
// Make sure this update is silent to avoid triggering key change events down the waterfall.
|
7506 |
-
newModel.set( 'label', newModel.get( 'label' ) + ' Copy', {silent: true} );
|
7507 |
-
// Update our ID to the new tmp id.
|
7508 |
-
var tmpID = nfRadio.channel( currentDomainID ).request( 'get:tmpID' );
|
7509 |
-
newModel.set( 'id', tmpID );
|
7510 |
-
// Add new model.
|
7511 |
-
// Params are: model, silent, renderTrigger, action
|
7512 |
-
nfRadio.channel( currentDomainID ).request( 'add', newModel, false, false, 'duplicate' );
|
7513 |
-
|
7514 |
-
// Add our action addition to our change log.
|
7515 |
-
var label = {
|
7516 |
-
object: model.get( 'objectType' ),
|
7517 |
-
label: model.get( 'label' ),
|
7518 |
-
change: 'Duplicated',
|
7519 |
-
dashicon: 'admin-page'
|
7520 |
-
};
|
7521 |
-
|
7522 |
-
var data = {
|
7523 |
-
collection: nfRadio.channel( currentDomainID ).request( 'get:collection' )
|
7524 |
-
}
|
7525 |
-
|
7526 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'duplicateObject', newModel, null, label, data );
|
7527 |
-
|
7528 |
-
model.trigger( 'change:label', model );
|
7529 |
-
|
7530 |
-
// Update preview.
|
7531 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
7532 |
-
}
|
7533 |
-
|
7534 |
-
});
|
7535 |
-
|
7536 |
-
return controller;
|
7537 |
-
} );
|
7538 |
-
/**
|
7539 |
-
* Config file for our merge tags.
|
7540 |
-
*
|
7541 |
-
* this.collection represents all of our registered merge tags.
|
7542 |
-
*
|
7543 |
-
* @package Ninja Forms builder
|
7544 |
-
* @subpackage Main App
|
7545 |
-
* @copyright (c) 2015 WP Ninjas
|
7546 |
-
* @since 3.0
|
7547 |
-
*/
|
7548 |
-
define( 'controllers/app/mergeTags',[
|
7549 |
-
'models/app/mergeTagCollection'
|
7550 |
-
], function(
|
7551 |
-
mergeTagCollection
|
7552 |
-
) {
|
7553 |
-
var controller = Marionette.Object.extend( {
|
7554 |
-
initialize: function() {
|
7555 |
-
this.tagSectionCollection = new mergeTagCollection();
|
7556 |
-
var that = this;
|
7557 |
-
_.each( mergeTags, function( tagSection ) {
|
7558 |
-
if ( tagSection.tags ) {
|
7559 |
-
var tags = new mergeTagCollection( tagSection.tags );
|
7560 |
-
} else {
|
7561 |
-
var tags = '';
|
7562 |
-
}
|
7563 |
-
|
7564 |
-
that.tagSectionCollection.add( {
|
7565 |
-
id: tagSection.id,
|
7566 |
-
label: tagSection.label,
|
7567 |
-
tags: tags,
|
7568 |
-
default_group: tagSection.default_group
|
7569 |
-
} );
|
7570 |
-
} );
|
7571 |
-
|
7572 |
-
var fieldTags = this.tagSectionCollection.get( 'fields').get( 'tags' );
|
7573 |
-
|
7574 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
7575 |
-
_.each( fieldCollection.models, function( field ) {
|
7576 |
-
// TODO: Make this dynamic
|
7577 |
-
if ( 'submit' !== field.get( 'type' ) ) {
|
7578 |
-
fieldTags.add( {
|
7579 |
-
id: field.get( 'id' ),
|
7580 |
-
label: field.get( 'label' ),
|
7581 |
-
tag: that.getFieldKeyFormat( field.get( 'key' ) )
|
7582 |
-
} );
|
7583 |
-
}
|
7584 |
-
} );
|
7585 |
-
|
7586 |
-
var calcTags = new mergeTagCollection();
|
7587 |
-
|
7588 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
7589 |
-
var calcCollection = formModel.get( 'settings' ).get( 'calculations' );
|
7590 |
-
_.each( calcCollection.models, function( calcModel ) {
|
7591 |
-
calcTags.add( {
|
7592 |
-
label: calcModel.get( 'name' ),
|
7593 |
-
tag: '{calc:' + calcModel.get( 'name' ) + '}'
|
7594 |
-
} );
|
7595 |
-
} );
|
7596 |
-
|
7597 |
-
this.tagSectionCollection.get( 'calcs' ).set( 'tags', calcTags );
|
7598 |
-
|
7599 |
-
this.currentElement = {};
|
7600 |
-
this.settingModel = {};
|
7601 |
-
this.open = false;
|
7602 |
-
|
7603 |
-
// Unhook jBox Merge Tag stuff.
|
7604 |
-
// nfRadio.channel( 'mergeTags' ).reply( 'init', this.initMergeTags, this );
|
7605 |
-
|
7606 |
-
this.listenTo( nfRadio.channel( 'mergeTags' ), 'click:mergeTag', this.clickMergeTag );
|
7607 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'add:field', this.addFieldTags );
|
7608 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'delete:field', this.deleteFieldTags );
|
7609 |
-
this.listenTo( nfRadio.channel( 'option-repeater-calculations' ), 'update:option', this.updateCalcTags );
|
7610 |
-
this.listenTo( nfRadio.channel( 'option-repeater-calculations' ), 'remove:option', this.updateCalcTags );
|
7611 |
-
|
7612 |
-
|
7613 |
-
nfRadio.channel( 'mergeTags' ).reply( 'update:currentElement', this.updateCurrentElement, this );
|
7614 |
-
nfRadio.channel( 'mergeTags' ).reply( 'update:currentSetting', this.updateCurrentSetting, this );
|
7615 |
-
|
7616 |
-
// Listen for requests for our mergeTag collection.
|
7617 |
-
nfRadio.channel( 'mergeTags' ).reply( 'get:collection', this.getCollection, this );
|
7618 |
-
nfRadio.channel( 'mergeTags' ).reply( 'get:mergeTag', this.getSectionModel, this );
|
7619 |
-
|
7620 |
-
// When a field's ID is changed (ie from a tmpID), update the merge tag.
|
7621 |
-
this.listenTo( nfRadio.channel( 'fieldSetting-id' ), 'update:setting', this.updateID );
|
7622 |
-
|
7623 |
-
// When we edit a key, check for places that key might be used.
|
7624 |
-
this.listenTo( nfRadio.channel( 'fieldSetting-key' ), 'update:setting', this.updateKey );
|
7625 |
-
|
7626 |
-
// Reply to requests to check a data model for a field key when one is updated.
|
7627 |
-
this.listenTo( nfRadio.channel( 'app' ), 'replace:fieldKey', this.replaceFieldKey );
|
7628 |
-
|
7629 |
-
// Reply to requests to check a data model for a field key when one is updated.
|
7630 |
-
nfRadio.channel( 'app' ).reply( 'get:fieldKeyFormat', this.getFieldKeyFormat, this );
|
7631 |
-
|
7632 |
-
/*
|
7633 |
-
* TODO: Hotkey support for adding tags.
|
7634 |
-
*
|
7635 |
-
|
7636 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'open:mergeTags', this.openMergeTags );
|
7637 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'up:mergeTags', this.upMergeTags );
|
7638 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'down:mergeTags', this.downMergeTags );
|
7639 |
-
this.listenTo( nfRadio.channel( 'hotkeys' ), 'return:mergeTags', this.returnMergeTags );
|
7640 |
-
nfRadio.channel( 'mergeTags' ).reply( 'update:open', this.updateOpen, this );
|
7641 |
-
*/
|
7642 |
-
},
|
7643 |
-
|
7644 |
-
/**
|
7645 |
-
* Init merge tags within the passed view.
|
7646 |
-
* @since 3.0
|
7647 |
-
* @param backbone.view view to be searched for merge tags.
|
7648 |
-
* @return void
|
7649 |
-
*/
|
7650 |
-
initMergeTags: function( view ) {
|
7651 |
-
var mergeTagsView = nfRadio.channel( 'mergeTags' ).request( 'get:view' );
|
7652 |
-
var that = this;
|
7653 |
-
/*
|
7654 |
-
* Apply merge tags jQuery plugin.
|
7655 |
-
*
|
7656 |
-
* Prevent jBox from being called multiple times on the same element
|
7657 |
-
*/
|
7658 |
-
this.jBoxes = {};
|
7659 |
-
var that = this;
|
7660 |
-
|
7661 |
-
jQuery( view.el ).find( '.merge-tags' ).each(function() {
|
7662 |
-
if ( 'undefined' == typeof jQuery( this ).data( 'jBox-id' ) ) {
|
7663 |
-
var jBox = jQuery( this ).jBox( 'Tooltip', {
|
7664 |
-
title: 'Insert Merge Tag',
|
7665 |
-
trigger: 'click',
|
7666 |
-
position: {
|
7667 |
-
x: 'center',
|
7668 |
-
y: 'bottom'
|
7669 |
-
},
|
7670 |
-
closeOnClick: 'body',
|
7671 |
-
closeOnEsc: true,
|
7672 |
-
theme: 'TooltipBorder',
|
7673 |
-
maxHeight: 200,
|
7674 |
-
|
7675 |
-
onOpen: function() {
|
7676 |
-
mergeTagsView.reRender( view.model );
|
7677 |
-
this.setContent( jQuery( '.merge-tags-content' ) );
|
7678 |
-
var currentElement = jQuery( this.target ).prev( '.setting' );
|
7679 |
-
if ( 0 == currentElement.length ) {
|
7680 |
-
currentElement = jQuery( view.el ).find( '.setting' );
|
7681 |
-
}
|
7682 |
-
|
7683 |
-
that.updateCurrentSetting( view.model );
|
7684 |
-
that.updateCurrentElement( currentElement );
|
7685 |
-
// nfRadio.channel( 'drawer' ).request( 'prevent:close', 'merge-tags' );
|
7686 |
-
},
|
7687 |
-
onClose: function() {
|
7688 |
-
// nfRadio.channel( 'drawer' ).request( 'enable:close', 'merge-tags' );
|
7689 |
-
}
|
7690 |
-
});
|
7691 |
-
|
7692 |
-
jQuery( this ).data( 'jBox-id', jBox.id );
|
7693 |
-
}
|
7694 |
-
});
|
7695 |
-
},
|
7696 |
-
|
7697 |
-
clickMergeTag: function( e, tagModel ) {
|
7698 |
-
/*
|
7699 |
-
* TODO: Make this more dynamic.
|
7700 |
-
* Currently, the RTE is the only section that modifies how merge tags work,
|
7701 |
-
* but another type of setting might need to do this in the future.
|
7702 |
-
*/
|
7703 |
-
|
7704 |
-
if( 'undefined' != typeof this.settingModel.get( 'settingModel' ) && 'calculations' == this.settingModel.get( 'settingModel' ).get( 'name' ) ) {
|
7705 |
-
|
7706 |
-
console.log( tagModel );
|
7707 |
-
|
7708 |
-
var currentValue = jQuery( this.currentElement ).val();
|
7709 |
-
var currentPos = jQuery( this.currentElement ).caret();
|
7710 |
-
var newPos = currentPos + tagModel.get( 'tag' ).length;
|
7711 |
-
|
7712 |
-
var tag = ( 'undefined' != typeof tagModel.get( 'calcTag' ) ) ? tagModel.get( 'calcTag' ) : tagModel.get( 'tag' );
|
7713 |
-
|
7714 |
-
currentValue = currentValue.substr( 0, currentPos ) + tag + currentValue.substr( currentPos );
|
7715 |
-
jQuery( this.currentElement ).val( currentValue ).caret( newPos ).trigger( 'change' );
|
7716 |
-
} else if( 'rte' == this.settingModel.get( 'type' ) ) {
|
7717 |
-
jQuery( this.currentElement ).summernote( 'insertText', tagModel.get( 'tag' ) );
|
7718 |
-
} else {
|
7719 |
-
var currentValue = jQuery( this.currentElement ).val();
|
7720 |
-
var currentPos = jQuery( this.currentElement ).caret();
|
7721 |
-
var newPos = currentPos + tagModel.get( 'tag' ).length;
|
7722 |
-
currentValue = currentValue.substr( 0, currentPos ) + tagModel.get( 'tag' ) + currentValue.substr( currentPos );
|
7723 |
-
jQuery( this.currentElement ).val( currentValue ).caret( newPos ).trigger( 'change' );
|
7724 |
-
}
|
7725 |
-
},
|
7726 |
-
|
7727 |
-
addFieldTags: function( fieldModel ) {
|
7728 |
-
// TODO: Make this dynamic
|
7729 |
-
if ( 'submit' !== fieldModel.get( 'type' ) ) {
|
7730 |
-
this.tagSectionCollection.get( 'fields' ).get( 'tags' ).add( {
|
7731 |
-
id: fieldModel.get( 'id' ),
|
7732 |
-
label: fieldModel.get( 'label' ),
|
7733 |
-
tag: this.getFieldKeyFormat( fieldModel.get( 'key' ) ),
|
7734 |
-
calcTag: this.getFieldKeyFormatCalc( fieldModel.get( 'key' ) )
|
7735 |
-
} );
|
7736 |
-
}
|
7737 |
-
},
|
7738 |
-
|
7739 |
-
deleteFieldTags: function( fieldModel ) {
|
7740 |
-
var fieldID = fieldModel.get( 'id' );
|
7741 |
-
var tagModel = this.tagSectionCollection.get( 'fields' ).get( 'tags' ).get( fieldID );
|
7742 |
-
this.tagSectionCollection.get( 'fields' ).get( 'tags' ).remove( tagModel );
|
7743 |
-
},
|
7744 |
-
|
7745 |
-
updateCalcTags: function( optionModel ) {
|
7746 |
-
var calcTags = new mergeTagCollection();
|
7747 |
-
|
7748 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
7749 |
-
var calcCollection = formModel.get( 'settings' ).get( 'calculations' );
|
7750 |
-
|
7751 |
-
_.each( calcCollection.models, function( calc ) {
|
7752 |
-
calcTags.add( {
|
7753 |
-
label: calc.get( 'name' ),
|
7754 |
-
tag: '{calc:' + calc.get( 'name' ) + '}'
|
7755 |
-
} );
|
7756 |
-
} );
|
7757 |
-
|
7758 |
-
this.tagSectionCollection.get( 'calcs' ).set( 'tags', calcTags );
|
7759 |
-
},
|
7760 |
-
|
7761 |
-
openMergeTags: function( e ) {
|
7762 |
-
if ( 'TEXTAREA' == jQuery( e.target )[0].tagName || 'INPUT' == jQuery( e.target )[0].tagName ) {
|
7763 |
-
jQuery( e.target ).parent().find( '.merge-tags' ).click();
|
7764 |
-
}
|
7765 |
-
},
|
7766 |
-
|
7767 |
-
returnMergeTags: function( e ) {
|
7768 |
-
if ( this.open ) {
|
7769 |
-
e.preventDefault();
|
7770 |
-
var currentModel = this.fields.where( { 'active': true } )[0];
|
7771 |
-
if ( currentModel ) {
|
7772 |
-
this.clickMergeTag( e, currentModel );
|
7773 |
-
}
|
7774 |
-
}
|
7775 |
-
},
|
7776 |
-
|
7777 |
-
upMergeTags: function( e ) {
|
7778 |
-
if ( this.open ) {
|
7779 |
-
e.preventDefault();
|
7780 |
-
this.changeActiveTag( 'up' );
|
7781 |
-
}
|
7782 |
-
},
|
7783 |
-
|
7784 |
-
downMergeTags: function( e ) {
|
7785 |
-
if ( this.open ) {
|
7786 |
-
e.preventDefault();
|
7787 |
-
this.changeActiveTag( 'down' );
|
7788 |
-
}
|
7789 |
-
},
|
7790 |
-
|
7791 |
-
changeActiveTag: function( dir ) {
|
7792 |
-
if ( 'down' == dir ) {
|
7793 |
-
var inc = 1;
|
7794 |
-
} else {
|
7795 |
-
var inc = -1
|
7796 |
-
}
|
7797 |
-
// First, check to see if a field is currently active.
|
7798 |
-
if( 0 < this.fields.where( { 'active': true } ).length ) {
|
7799 |
-
var currentModel = this.fields.where( { 'active': true } )[0];
|
7800 |
-
var currentIndex = this.fields.indexOf( currentModel );
|
7801 |
-
currentModel.set( 'active', false );
|
7802 |
-
|
7803 |
-
var nextModel = this.fields.models[ currentIndex + inc ];
|
7804 |
-
if ( nextModel ) {
|
7805 |
-
nextModel.set( 'active', true );
|
7806 |
-
} else {
|
7807 |
-
|
7808 |
-
}
|
7809 |
-
|
7810 |
-
} else if ( 0 < this.fields.where( { 'active': true } ) ) { // There aren't any active fields. Check for active system tags.
|
7811 |
-
console.log( 'system' );
|
7812 |
-
} else if ( 0 < this.userInfo.where( { 'active': true } ) ) { // No active user info LIs.
|
7813 |
-
console.log( 'userinfo' );
|
7814 |
-
} else { // No active LIs. We haven't made any active yet, or we've gotten to the bottom of the list.
|
7815 |
-
// Make sure that we have fields
|
7816 |
-
if ( 0 < this.fields.models.length ) {
|
7817 |
-
// Set our first field to active.
|
7818 |
-
this.fields.models[0].set( 'active', true );
|
7819 |
-
} else {
|
7820 |
-
// Set our first system model to active.
|
7821 |
-
this.system.models[0].set( 'active', true );
|
7822 |
-
}
|
7823 |
-
}
|
7824 |
-
},
|
7825 |
-
|
7826 |
-
updateCurrentElement: function( element ) {
|
7827 |
-
this.currentElement = element;
|
7828 |
-
},
|
7829 |
-
|
7830 |
-
updateCurrentSetting: function( settingModel ) {
|
7831 |
-
this.settingModel = settingModel;
|
7832 |
-
},
|
7833 |
-
|
7834 |
-
getCollection: function() {
|
7835 |
-
return this.tagSectionCollection;
|
7836 |
-
},
|
7837 |
-
|
7838 |
-
getSectionModel: function( id ) {
|
7839 |
-
return this.tagSectionCollection.get( id );
|
7840 |
-
},
|
7841 |
-
|
7842 |
-
updateOpen: function( open ) {
|
7843 |
-
this.open = open;
|
7844 |
-
_.each( this.tagSectionCollection.get( 'fields' ).models, function( model ) {
|
7845 |
-
model.set( 'active', false );
|
7846 |
-
} );
|
7847 |
-
},
|
7848 |
-
|
7849 |
-
// When a field is published, update the merge tag with the newly assigned ID (as opposed to the tmpID).
|
7850 |
-
updateID: function( fieldModel ) {
|
7851 |
-
|
7852 |
-
// Get the formatted merge tag for comparison.
|
7853 |
-
var targetTag = this.getFieldKeyFormat( fieldModel.get( 'key' ) );
|
7854 |
-
|
7855 |
-
// Search the field tags for the matching merge tag to be updated.
|
7856 |
-
var oldTag = this.tagSectionCollection.get( 'fields' ).get( 'tags' ).find( function( fieldMergeTag ){
|
7857 |
-
return targetTag == fieldMergeTag.get( 'tag' );
|
7858 |
-
});
|
7859 |
-
|
7860 |
-
// If no matching tag is found, return early.
|
7861 |
-
if( 'undefined' == typeof oldTag ) return;
|
7862 |
-
|
7863 |
-
// Update the merge tag with the "published" field ID.
|
7864 |
-
oldTag.set( 'id', fieldModel.get( 'id' ) );
|
7865 |
-
},
|
7866 |
-
|
7867 |
-
updateKey: function( fieldModel ) {
|
7868 |
-
var newKey = fieldModel.get( 'key' );
|
7869 |
-
var oldTag = this.tagSectionCollection.get( 'fields' ).get( 'tags' ).get( fieldModel.get( 'id' ) );
|
7870 |
-
if ( 'undefined' != typeof oldTag ) {
|
7871 |
-
oldTag.set( 'tag', this.getFieldKeyFormat( newKey ) );
|
7872 |
-
}
|
7873 |
-
|
7874 |
-
},
|
7875 |
-
|
7876 |
-
getFieldKeyFormat: function( key ) {
|
7877 |
-
return '{field:' + key + '}';
|
7878 |
-
},
|
7879 |
-
|
7880 |
-
getFieldKeyFormatCalc: function( key ) {
|
7881 |
-
return '{field:' + key + ':calc}';
|
7882 |
-
},
|
7883 |
-
|
7884 |
-
replaceFieldKey: function( dataModel, keyModel, settingModel ) {
|
7885 |
-
var oldKey = this.getFieldKeyFormat( keyModel._previousAttributes[ 'key' ] );
|
7886 |
-
var newKey = this.getFieldKeyFormat( keyModel.get( 'key' ) );
|
7887 |
-
var settingName = settingModel.get( 'name' );
|
7888 |
-
var oldVal = dataModel.get( settingName );
|
7889 |
-
if(settingName == 'calculations' && 'undefined' != typeof(dataModel.get('calculations'))) {
|
7890 |
-
var calcModel = dataModel.get( 'calculations' );
|
7891 |
-
calcModel.each( function( model ) {
|
7892 |
-
var oldCalcKey = oldKey.slice( 0, (oldKey.length - 1) ) + ':calc}';
|
7893 |
-
var newCalcKey = newKey.slice( 0, (newKey.length - 1 ) ) + ':calc}';
|
7894 |
-
oldVal = model.get( 'eq' );
|
7895 |
-
if ( 'string' == typeof( oldVal ) ) {
|
7896 |
-
var re = new RegExp( oldCalcKey, 'g' );
|
7897 |
-
var newVal = oldVal.replace( re, newCalcKey );
|
7898 |
-
re = new RegExp( oldKey, 'g' );
|
7899 |
-
// TODO: We won't need this second replace when we no longer
|
7900 |
-
// have to append :calc to merge tags.
|
7901 |
-
newVal = newVal.replace( re, newKey );
|
7902 |
-
model.set( 'eq', newVal );
|
7903 |
-
}
|
7904 |
-
} );
|
7905 |
-
return false;
|
7906 |
-
}
|
7907 |
-
if ( 'string' == typeof oldVal ) {
|
7908 |
-
var re = new RegExp( oldKey, 'g' );
|
7909 |
-
newVal = oldVal.replace( re, newKey );
|
7910 |
-
dataModel.set( settingName, newVal );
|
7911 |
-
}
|
7912 |
-
}
|
7913 |
-
|
7914 |
-
});
|
7915 |
-
|
7916 |
-
return controller;
|
7917 |
-
} );
|
7918 |
-
|
7919 |
-
/**
|
7920 |
-
* @package Ninja Forms builder
|
7921 |
-
* @subpackage App
|
7922 |
-
* @copyright (c) 2015 WP Ninjas
|
7923 |
-
* @since 3.0
|
7924 |
-
*/
|
7925 |
-
define( 'models/app/mergeTagLookupCollection',['models/app/mergeTagModel'], function( mergeTagModel ) {
|
7926 |
-
var collection = Backbone.Collection.extend( {
|
7927 |
-
model: mergeTagModel
|
7928 |
-
} );
|
7929 |
-
return collection;
|
7930 |
-
} );
|
7931 |
-
/**
|
7932 |
-
* @package Ninja Forms builder
|
7933 |
-
* @subpackage App
|
7934 |
-
* @copyright (c) 2015 WP Ninjas
|
7935 |
-
* @since 3.0
|
7936 |
-
*/
|
7937 |
-
define( 'views/app/drawer/mergeTag',[], function() {
|
7938 |
-
var view = Marionette.ItemView.extend({
|
7939 |
-
tagName: 'li',
|
7940 |
-
template: '#tmpl-nf-merge-tag-box-tag',
|
7941 |
-
|
7942 |
-
events: {
|
7943 |
-
"click": "insertTag"
|
7944 |
-
},
|
7945 |
-
|
7946 |
-
insertTag: function() {
|
7947 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', this.model.get( 'tag' ) );
|
7948 |
-
}
|
7949 |
-
});
|
7950 |
-
|
7951 |
-
return view;
|
7952 |
-
} );
|
7953 |
-
/**
|
7954 |
-
* @package Ninja Forms builder
|
7955 |
-
* @subpackage App
|
7956 |
-
* @copyright (c) 2015 WP Ninjas
|
7957 |
-
* @since 3.0
|
7958 |
-
*/
|
7959 |
-
define( 'views/app/drawer/mergeTagList',[ 'views/app/drawer/mergeTag' ], function( mergeTagView ) {
|
7960 |
-
var view = Marionette.CollectionView.extend({
|
7961 |
-
tagName: 'ul',
|
7962 |
-
childView: mergeTagView,
|
7963 |
-
calc: false,
|
7964 |
-
|
7965 |
-
initialize: function() {
|
7966 |
-
nfRadio.channel( 'merge-tags' ).reply( 'update:taglist', this.sectionFilter, this );
|
7967 |
-
nfRadio.channel( 'merge-tags' ).reply( 'filtersearch', this.searchFilter, this );
|
7968 |
-
},
|
7969 |
-
|
7970 |
-
filter: function( child, index, collection ){
|
7971 |
-
return 'fields' == child.get( 'section' );
|
7972 |
-
},
|
7973 |
-
|
7974 |
-
sectionFilter: function( section, calc ){
|
7975 |
-
this.filter = function( child, index, collection ){
|
7976 |
-
return section == child.get( 'section' );
|
7977 |
-
}
|
7978 |
-
|
7979 |
-
if ( calc ) {
|
7980 |
-
this.calc = true;
|
7981 |
-
}
|
7982 |
-
|
7983 |
-
if ( this.calc ) {
|
7984 |
-
var fieldsToRemove = this.excludeFromCalcs();
|
7985 |
-
|
7986 |
-
/**
|
7987 |
-
* Filters our merge tags.
|
7988 |
-
* Make sure that we're in the right section, and then check to see if the merge tag is in our remove tracker.
|
7989 |
-
*/
|
7990 |
-
this.filter = function( child, index, collection ) {
|
7991 |
-
return section == child.get( 'section' ) && -1 == fieldsToRemove.indexOf( child.get( 'tag' ) );
|
7992 |
-
}
|
7993 |
-
}
|
7994 |
-
|
7995 |
-
this.render();
|
7996 |
-
nfRadio.channel( 'merge-tags' ).trigger( 'after:filtersearch', section );
|
7997 |
-
},
|
7998 |
-
|
7999 |
-
searchFilter: function( term ){
|
8000 |
-
if ( this.calc ) {
|
8001 |
-
var fieldsToRemove = this.excludeFromCalcs();
|
8002 |
-
}
|
8003 |
-
|
8004 |
-
this.filter = function( child, index, collection ){
|
8005 |
-
var label = child.get( 'label' ).toLowerCase().indexOf( term.toLowerCase().replace( ':', '' ) ) >= 0;
|
8006 |
-
var tag = child.get( 'tag' ).toLowerCase().indexOf( term.toLowerCase() ) >= 0;
|
8007 |
-
// If we are in a calculation setting and this tag is in our remove tracker, early return false.
|
8008 |
-
if ( this.calc && -1 != fieldsToRemove.indexOf( child.get( 'tag' ) ) ) {
|
8009 |
-
return false;
|
8010 |
-
}
|
8011 |
-
return label || tag;
|
8012 |
-
}
|
8013 |
-
|
8014 |
-
this.render();
|
8015 |
-
nfRadio.channel( 'merge-tags' ).trigger( 'after:filtersearch' );
|
8016 |
-
|
8017 |
-
},
|
8018 |
-
|
8019 |
-
/**
|
8020 |
-
* TODO: This is a wonky fix for removing Product and Quantity fields from calcuation merge tags.
|
8021 |
-
* Merge tags don't respect the "exclude" merge tag settings.
|
8022 |
-
* Ultimately, the fix might include updating merge tags to respect those settings.
|
8023 |
-
*/
|
8024 |
-
excludeFromCalcs: function(){
|
8025 |
-
/**
|
8026 |
-
* Remove any unwanted fields if we are in a calculation.
|
8027 |
-
* Get a list of all fields, then filter out unwanted fields.
|
8028 |
-
*/
|
8029 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
8030 |
-
// Stores the keys of unwanted fields.
|
8031 |
-
var fieldsToRemove = [];
|
8032 |
-
// Declare blacklisted field types.
|
8033 |
-
var blacklist = ['product', 'quantity', 'total', 'shipping', 'date'];
|
8034 |
-
// Remove them from the merge tag selection box.
|
8035 |
-
_.each( fieldCollection.models, function( model ) {
|
8036 |
-
if ( -1 != blacklist.indexOf( model.get('type') ) ) {
|
8037 |
-
fieldsToRemove.push( '{field:' + model.get( 'key' ) + '}' );
|
8038 |
-
}
|
8039 |
-
});
|
8040 |
-
return fieldsToRemove;
|
8041 |
-
}
|
8042 |
-
});
|
8043 |
-
|
8044 |
-
return view;
|
8045 |
-
} );
|
8046 |
-
/**
|
8047 |
-
* @package Ninja Forms builder
|
8048 |
-
* @subpackage App
|
8049 |
-
* @copyright (c) 2015 WP Ninjas
|
8050 |
-
* @since 3.0
|
8051 |
-
*/
|
8052 |
-
define( 'views/app/drawer/mergeTagGroup',[], function() {
|
8053 |
-
var view = Marionette.ItemView.extend({
|
8054 |
-
tagName: 'li',
|
8055 |
-
template: '#tmpl-nf-merge-tag-box-section',
|
8056 |
-
events: {
|
8057 |
-
"click": "onClick"
|
8058 |
-
},
|
8059 |
-
|
8060 |
-
initialize: function () {
|
8061 |
-
this.listenTo( nfRadio.channel( 'merge-tags' ), 'after:filtersearch', this.updateActive );
|
8062 |
-
},
|
8063 |
-
|
8064 |
-
onClick: function(){
|
8065 |
-
this.updateTags();
|
8066 |
-
},
|
8067 |
-
|
8068 |
-
updateTags: function() {
|
8069 |
-
nfRadio.channel( 'merge-tags' ).request( 'update:taglist', this.model.get( 'id' ) );
|
8070 |
-
},
|
8071 |
-
|
8072 |
-
updateActive: function( section ) {
|
8073 |
-
this.$el.removeClass( 'active' );
|
8074 |
-
|
8075 |
-
if ( section == this.model.get( 'id' ) ) {
|
8076 |
-
this.$el.addClass( 'active' );
|
8077 |
-
}
|
8078 |
-
},
|
8079 |
-
|
8080 |
-
setActive: function(){
|
8081 |
-
this.$el.addClass( 'active' );
|
8082 |
-
this.$el.siblings().removeClass( 'active' );
|
8083 |
-
},
|
8084 |
-
|
8085 |
-
});
|
8086 |
-
|
8087 |
-
return view;
|
8088 |
-
} );
|
8089 |
-
/**
|
8090 |
-
* @package Ninja Forms builder
|
8091 |
-
* @subpackage App
|
8092 |
-
* @copyright (c) 2015 WP Ninjas
|
8093 |
-
* @since 3.0
|
8094 |
-
*/
|
8095 |
-
define( 'views/app/drawer/mergeTagGroupList',[ 'views/app/drawer/mergeTagGroup' ], function( mergeTagGroupView ) {
|
8096 |
-
var view = Marionette.CollectionView.extend({
|
8097 |
-
tagName: 'ul',
|
8098 |
-
childView: mergeTagGroupView,
|
8099 |
-
|
8100 |
-
initialize: function(){
|
8101 |
-
this.listenTo( nfRadio.channel( 'merge-tags' ), 'open', this.render, this );
|
8102 |
-
},
|
8103 |
-
|
8104 |
-
// TODO: Update filter when a new tag is added. ie Calculations.
|
8105 |
-
filter: function( child, index, collection ){
|
8106 |
-
return 0 < child.get( 'tags' ).length;
|
8107 |
-
},
|
8108 |
-
});
|
8109 |
-
|
8110 |
-
return view;
|
8111 |
-
} );
|
8112 |
-
/**
|
8113 |
-
* @package Ninja Forms builder
|
8114 |
-
* @subpackage App
|
8115 |
-
* @copyright (c) 2015 WP Ninjas
|
8116 |
-
* @since 3.0
|
8117 |
-
*/
|
8118 |
-
define( 'views/app/drawer/mergeTagFilter',[], function() {
|
8119 |
-
var view = Marionette.ItemView.extend({
|
8120 |
-
template: '#tmpl-nf-merge-tag-box-filter',
|
8121 |
-
events: {
|
8122 |
-
"keyup input": "updateFilter",
|
8123 |
-
},
|
8124 |
-
updateFilter: function( event ) {
|
8125 |
-
|
8126 |
-
if( /* ENTER */ 13 == event.keyCode ){ // Copied from Keyup Callback.
|
8127 |
-
// Get top listed merge tag.
|
8128 |
-
var firstFilteredTag = jQuery( '#merge-tags-box .merge-tag-list ul li span' ).first().data( 'tag' );
|
8129 |
-
|
8130 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', firstFilteredTag );
|
8131 |
-
|
8132 |
-
// COPIED FROM BELOW
|
8133 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8134 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8135 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8136 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8137 |
-
return;
|
8138 |
-
}
|
8139 |
-
var value = this.$el.find( 'input' ).val();
|
8140 |
-
nfRadio.channel( 'merge-tags' ).request( 'filtersearch', value );
|
8141 |
-
}
|
8142 |
-
});
|
8143 |
-
|
8144 |
-
return view;
|
8145 |
-
} );
|
8146 |
-
/**
|
8147 |
-
* @package Ninja Forms builder
|
8148 |
-
* @subpackage App
|
8149 |
-
* @copyright (c) 2015 WP Ninjas
|
8150 |
-
* @since 3.0
|
8151 |
-
*/
|
8152 |
-
define( 'views/app/drawer/mergeTagBox',[], function() {
|
8153 |
-
var view = Marionette.LayoutView.extend({
|
8154 |
-
el: '#merge-tags-box',
|
8155 |
-
template: "#tmpl-nf-merge-tag-box",
|
8156 |
-
|
8157 |
-
regions: {
|
8158 |
-
filter: '.merge-tag-filter',
|
8159 |
-
sections: '.merge-tag-sections',
|
8160 |
-
tags: '.merge-tag-list'
|
8161 |
-
},
|
8162 |
-
});
|
8163 |
-
|
8164 |
-
return view;
|
8165 |
-
} );
|
8166 |
-
/**
|
8167 |
-
* @package Ninja Forms builder
|
8168 |
-
* @subpackage Merge Tag Box
|
8169 |
-
* @copyright (c) 2017 WP Ninjas
|
8170 |
-
* @since 3.1
|
8171 |
-
*/
|
8172 |
-
|
8173 |
-
define( 'controllers/app/mergeTagBox',[
|
8174 |
-
'models/app/mergeTagModel',
|
8175 |
-
'models/app/mergeTagLookupCollection',
|
8176 |
-
'views/app/drawer/mergeTag',
|
8177 |
-
'views/app/drawer/mergeTagList',
|
8178 |
-
'views/app/drawer/mergeTagGroup',
|
8179 |
-
'views/app/drawer/mergeTagGroupList',
|
8180 |
-
'views/app/drawer/mergeTagFilter',
|
8181 |
-
'views/app/drawer/mergeTagBox'
|
8182 |
-
], function(
|
8183 |
-
MergeTagModel,
|
8184 |
-
MergeTagLookupCollection,
|
8185 |
-
MergeTagView,
|
8186 |
-
MergeTagListView,
|
8187 |
-
MergeTagGroupView,
|
8188 |
-
MergeTagGroupListView,
|
8189 |
-
MergeTagFilterView,
|
8190 |
-
MergeTagBoxLayout
|
8191 |
-
) {
|
8192 |
-
var controller = Marionette.Object.extend( {
|
8193 |
-
|
8194 |
-
caret: 0, // Track the caret position of the current setting's input.
|
8195 |
-
old: '', // THe old merge tag that will be replaced.
|
8196 |
-
|
8197 |
-
initialize: function(){
|
8198 |
-
|
8199 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'render:settingGroup', function(){
|
8200 |
-
jQuery( '.merge-tags' ).off( 'click' );
|
8201 |
-
jQuery( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8202 |
-
});
|
8203 |
-
|
8204 |
-
this.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.afterAppStart );
|
8205 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
8206 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'before:close', this.beforeDrawerClose );
|
8207 |
-
|
8208 |
-
var that = this;
|
8209 |
-
nfRadio.channel( 'mergeTags' ).reply( 'set:caret', function( position ){
|
8210 |
-
that.caret = position;
|
8211 |
-
});
|
8212 |
-
nfRadio.channel( 'mergeTags' ).reply( 'get:caret', function(){
|
8213 |
-
return that.caret;
|
8214 |
-
});
|
8215 |
-
|
8216 |
-
var that = this;
|
8217 |
-
nfRadio.channel( 'mergeTags' ).reply( 'set:old', function( value ){
|
8218 |
-
that.old = value;
|
8219 |
-
});
|
8220 |
-
nfRadio.channel( 'mergeTags' ).reply( 'get:old', function(){
|
8221 |
-
return that.old;
|
8222 |
-
});
|
8223 |
-
|
8224 |
-
nfRadio.channel( 'mergeTags' ).reply( 'insert:tag', this.insertTag.bind( this ) );
|
8225 |
-
|
8226 |
-
/** OPTION REPEATER */
|
8227 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'add:option', function( model ){
|
8228 |
-
var selector = '#' + model.cid + ' .has-merge-tags input.setting';
|
8229 |
-
jQuery( selector ).on( 'focus', function( event ){
|
8230 |
-
that.focusCallback( event, selector, 'option-repeater' );
|
8231 |
-
});
|
8232 |
-
jQuery( selector ).on( 'keyup', function( event ){
|
8233 |
-
that.keyupCallback( event, selector, 'option-repeater' );
|
8234 |
-
});
|
8235 |
-
jQuery( selector ).siblings( '.nf-list-options .merge-tags' ).off( 'click' );
|
8236 |
-
jQuery( selector ).siblings( '.nf-list-options .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8237 |
-
} );
|
8238 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
|
8239 |
-
jQuery( '.nf-list-options .merge-tags' ).off( 'click' );
|
8240 |
-
jQuery( '.nf-list-options .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8241 |
-
} );
|
8242 |
-
|
8243 |
-
/* CALCULATIONS */
|
8244 |
-
this.listenTo( nfRadio.channel( 'setting-calculations-option' ), 'render:setting', this.renderSetting );
|
8245 |
-
// this.listenTo( nfRadio.channel( 'setting-calculations-option' ), 'render:setting', function( settingModel, dataModel, view ){
|
8246 |
-
// view.$el.find( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8247 |
-
// } );
|
8248 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
|
8249 |
-
jQuery( '.nf-list-options.calculations .merge-tags' ).off( 'click' );
|
8250 |
-
jQuery( '.nf-list-options.calculations .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8251 |
-
} );
|
8252 |
-
|
8253 |
-
/* SUMMERNOTE */
|
8254 |
-
this.listenTo( nfRadio.channel( 'summernote' ), 'focus', function( e, selector ) {
|
8255 |
-
that.focusCallback( false, selector, 'rte' );
|
8256 |
-
} );
|
8257 |
-
this.listenTo( nfRadio.channel( 'summernote' ), 'keydown', function( e, selector ){
|
8258 |
-
jQuery( selector ).closest( '.nf-setting' ).find( '.setting' ).summernote( 'saveRange' );
|
8259 |
-
} );
|
8260 |
-
this.listenTo( nfRadio.channel( 'summernote' ), 'keyup', function( e, selector ){
|
8261 |
-
that.keyupCallback( e, selector, 'rte' );
|
8262 |
-
} );
|
8263 |
-
|
8264 |
-
// When an RTE setting is shown, make sure merge tags are hooked up.
|
8265 |
-
this.listenTo( nfRadio.channel( 'setting-type-rte' ), 'render:setting', function(){
|
8266 |
-
jQuery( '.note-editor .merge-tags' ).off( 'click' );
|
8267 |
-
jQuery( '.note-editor .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8268 |
-
} );
|
8269 |
-
|
8270 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', function(){
|
8271 |
-
jQuery( '.note-editor .merge-tags' ).off( 'click' );
|
8272 |
-
jQuery( '.note-editor .merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8273 |
-
} );
|
8274 |
-
|
8275 |
-
jQuery( document ).on( 'keyup', function( event ){
|
8276 |
-
if( 27 == event.keyCode ){
|
8277 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
|
8278 |
-
// Copied from KeyupCallback.
|
8279 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8280 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8281 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8282 |
-
jQuery( '.merge-tag-focus' ).blur();
|
8283 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8284 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8285 |
-
}
|
8286 |
-
});
|
8287 |
-
|
8288 |
-
/**
|
8289 |
-
* Listen to the Field Changes (add, delete, update) and update the Merge Tags.
|
8290 |
-
*/
|
8291 |
-
this.listenTo( Backbone.Radio.channel( 'fields' ), 'add:field', this.afterAppStart );
|
8292 |
-
this.listenTo( Backbone.Radio.channel( 'fields' ), 'delete:field', this.afterAppStart );
|
8293 |
-
this.listenTo( Backbone.Radio.channel( 'fieldSetting-key' ), 'update:setting', this.afterAppStart );
|
8294 |
-
|
8295 |
-
/** ... and Calc updates. */
|
8296 |
-
this.listenTo( Backbone.Radio.channel( 'calcs' ), 'update:calc', this.afterAppStart );
|
8297 |
-
|
8298 |
-
this.listenTo( Backbone.Radio.channel( 'app' ), 'change:currentDomain', this.afterAppStart );
|
8299 |
-
},
|
8300 |
-
|
8301 |
-
afterAppStart: function() {
|
8302 |
-
|
8303 |
-
var currentDomain = Backbone.Radio.channel( 'app' ).request( 'get:currentDomain' );
|
8304 |
-
|
8305 |
-
var mergeTagCollection = nfRadio.channel( 'mergeTags' ).request( 'get:collection' );
|
8306 |
-
var mergeTags = [];
|
8307 |
-
mergeTagCollection.each( function( section ){
|
8308 |
-
|
8309 |
-
section.get( 'tags' ).each( function( tag ){
|
8310 |
-
|
8311 |
-
if( 'fields' == currentDomain.get( 'id' ) && '{submission:sequence}' == tag.get( 'tag' ) ) return;
|
8312 |
-
|
8313 |
-
mergeTags.push({
|
8314 |
-
label: tag.get( 'label' ),
|
8315 |
-
tag: tag.get( 'tag' ),
|
8316 |
-
section: section.get( 'id' )
|
8317 |
-
});
|
8318 |
-
});
|
8319 |
-
});
|
8320 |
-
var layout = new MergeTagBoxLayout();
|
8321 |
-
layout.render();
|
8322 |
-
var tagCollection = new MergeTagLookupCollection( mergeTags );
|
8323 |
-
var mergeTagListView = new MergeTagListView({
|
8324 |
-
collection: tagCollection
|
8325 |
-
});
|
8326 |
-
var mergeTagGroupListView = new MergeTagGroupListView({
|
8327 |
-
collection: mergeTagCollection
|
8328 |
-
});
|
8329 |
-
|
8330 |
-
layout.getRegion('tags').show(mergeTagListView);
|
8331 |
-
layout.getRegion('sections').show(mergeTagGroupListView);
|
8332 |
-
layout.getRegion('filter').show(new MergeTagFilterView);
|
8333 |
-
},
|
8334 |
-
|
8335 |
-
beforeRenderSetting: function( settingModel, dataModel ){
|
8336 |
-
if( 'undefined' == typeof settingModel.get( 'use_merge_tags' ) ) return;
|
8337 |
-
if( ! settingModel.get( 'use_merge_tags' ) ) return;
|
8338 |
-
var name = settingModel.get( 'name' );
|
8339 |
-
this.listenTo( nfRadio.channel( 'setting-' + name ), 'render:setting', this.renderSetting );
|
8340 |
-
},
|
8341 |
-
|
8342 |
-
renderSetting: function( settingModel, dataModel, view ){
|
8343 |
-
|
8344 |
-
view.$el.find( '.merge-tags' ).off( 'click' );
|
8345 |
-
view.$el.find( '.merge-tags' ).on( 'click', this.mergeTagsButtonClick );
|
8346 |
-
|
8347 |
-
if( 0 == jQuery( '#merge-tags-box' ).length ) this.afterAppStart();
|
8348 |
-
|
8349 |
-
// Track Scrolling.
|
8350 |
-
jQuery( '#nf-drawer' ).on( 'scroll', function(){
|
8351 |
-
// COPIED AND MODIFIED FROM FOCUS
|
8352 |
-
if( 0 == jQuery( '.merge-tag-focus' ).length ) return;
|
8353 |
-
|
8354 |
-
var rteEditor = jQuery( '.merge-tag-focus' ).closest( '.nf-setting' ).find( '.note-editor' );
|
8355 |
-
if( 0 != rteEditor.length ){
|
8356 |
-
var posY = rteEditor.offset().top - jQuery(window).scrollTop();
|
8357 |
-
var height = rteEditor.outerHeight();
|
8358 |
-
} else {
|
8359 |
-
var posY = jQuery('.merge-tag-focus').offset().top - jQuery(window).scrollTop();
|
8360 |
-
var height = jQuery('.merge-tag-focus').outerHeight();
|
8361 |
-
}
|
8362 |
-
|
8363 |
-
// Find out if merge tag box will go below bottom of the page.
|
8364 |
-
var tagBoxY = posY + height;
|
8365 |
-
var windowHeight = window.innerHeight;
|
8366 |
-
var tagBoxHeight = jQuery( '#merge-tags-box' ).outerHeight();
|
8367 |
-
|
8368 |
-
// If merge tag box will render below the bottom of the page,
|
8369 |
-
// change it to render above the field
|
8370 |
-
|
8371 |
-
if ( ( tagBoxY + tagBoxHeight ) > windowHeight ) {
|
8372 |
-
tagBoxY = posY - tagBoxHeight;
|
8373 |
-
}
|
8374 |
-
|
8375 |
-
if ( 0 > tagBoxY ) {
|
8376 |
-
tagBoxY = posY;
|
8377 |
-
}
|
8378 |
-
|
8379 |
-
jQuery( '#merge-tags-box' ).css( 'top', tagBoxY );
|
8380 |
-
|
8381 |
-
var boxHeight = jQuery( '#merge-tags-box' ).outerHeight();
|
8382 |
-
jQuery( '#nf-drawer' ).css( 'padding-bottom', boxHeight + 'px' );
|
8383 |
-
|
8384 |
-
var repeaterRow = jQuery( '.merge-tag-focus' ).closest( '.nf-list-options-tbody' );
|
8385 |
-
if( 0 != repeaterRow.length ){
|
8386 |
-
var left = repeaterRow.offset().left - jQuery(window).scrollLeft();
|
8387 |
-
jQuery( '#merge-tags-box' ).css( 'left', left );
|
8388 |
-
} else {
|
8389 |
-
var posX = jQuery( '.merge-tag-focus' ).closest( '.nf-settings' ).offset().left - jQuery(window).scrollLeft();
|
8390 |
-
jQuery( '#merge-tags-box' ).css( 'left', posX );
|
8391 |
-
jQuery( '#merge-tags-box' ).css( 'width', jQuery( '.merge-tag-focus' ).closest( '.nf-settings' ).width() );
|
8392 |
-
}
|
8393 |
-
});
|
8394 |
-
|
8395 |
-
// On input focus, move the Merge Tag Box into position.
|
8396 |
-
jQuery( view.el ).find( '.setting' ).on( 'focus', this.focusCallback );
|
8397 |
-
|
8398 |
-
// TODO: Maybe move to view events.
|
8399 |
-
// On input keyup, maybe show Merge Tag Box.
|
8400 |
-
jQuery( view.el ).find( '.setting' ).on( 'keyup', this.keyupCallback );
|
8401 |
-
},
|
8402 |
-
|
8403 |
-
// TODO: Maybe move to view class.
|
8404 |
-
beforeDrawerClose: function(){
|
8405 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8406 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8407 |
-
// jQuery( 'body' ).append( jQuery( '#merge-tags-box' ) );
|
8408 |
-
},
|
8409 |
-
|
8410 |
-
insertTag: function( tag ) {
|
8411 |
-
|
8412 |
-
var $input = jQuery( '.merge-tag-focus' );
|
8413 |
-
|
8414 |
-
if( 0 != $input.closest( '.nf-setting' ).first().find( '.note-editable' ).length ){
|
8415 |
-
$input = $input.closest( '.nf-setting' ).first().find( '.note-editable' );
|
8416 |
-
}
|
8417 |
-
|
8418 |
-
if( 1 < $input.length ){ $input = $input.first(); }
|
8419 |
-
|
8420 |
-
if( $input.hasClass( 'note-editable' ) ){
|
8421 |
-
var str = $input.closest( '.nf-setting' ).find( '.setting' ).summernote( 'code' );
|
8422 |
-
} else {
|
8423 |
-
var str = $input.val();
|
8424 |
-
}
|
8425 |
-
|
8426 |
-
var find = nfRadio.channel( 'mergeTags' ).request( 'get:old' );
|
8427 |
-
var replace = tag;
|
8428 |
-
var caretPos = nfRadio.channel( 'mergeTags' ).request( 'get:caret' );
|
8429 |
-
|
8430 |
-
var patt = /{([a-zA-Z0-9]|:|_||-})*/g;
|
8431 |
-
|
8432 |
-
// Loop through matches to find insert/replace index range.
|
8433 |
-
// Reference: http://codepen.io/kjohnson/pen/36c3a782644dfff40fe3c1f05f8739d9?editors=0012
|
8434 |
-
while (match = patt.exec(str)) {
|
8435 |
-
if (find != match[0]) continue; // This isn't the match you are looking for...
|
8436 |
-
var string = str.slice(0, match.index) + replace + str.slice(patt.lastIndex); // Fancy replace for the specifc match, using the index/position.
|
8437 |
-
|
8438 |
-
if( $input.hasClass( 'note-editable' ) ){
|
8439 |
-
$input.closest( '.nf-setting' ).find( '.setting' ).summernote( 'code', string );
|
8440 |
-
|
8441 |
-
// Reposition the caret. http://stackoverflow.com/a/6249440 TODO: Determine the appropriate childNode.
|
8442 |
-
var el = $input;
|
8443 |
-
var childNode = null; // Default to first childNode.
|
8444 |
-
_.each( el[0].childNodes, function( node, index ){
|
8445 |
-
if( childNode ) return;
|
8446 |
-
if( ! node.nodeValue && ! node.innerHTML ) return;
|
8447 |
-
if( node.nodeValue ) {
|
8448 |
-
var value = node.nodeValue;
|
8449 |
-
} else if( node.innerHTML ){
|
8450 |
-
var value = node.innerHTML;
|
8451 |
-
}
|
8452 |
-
|
8453 |
-
if( -1 == value.indexOf(replace) ) return; // Replace not found in this node.
|
8454 |
-
|
8455 |
-
value = value.replace( / /g, ' ' );
|
8456 |
-
var position = value.indexOf(replace) + find.length;
|
8457 |
-
|
8458 |
-
/*
|
8459 |
-
* If no caretPos, determine based on the node. ie Merge Tag Button context.
|
8460 |
-
* Note: We can't just check for '{', because they could just be inserting the first tag.
|
8461 |
-
*/
|
8462 |
-
if( -1 == caretPos ){
|
8463 |
-
caretPos = value.indexOf( replace ) + 1;
|
8464 |
-
}
|
8465 |
-
|
8466 |
-
if (caretPos == position) childNode = el[0].childNodes[index];
|
8467 |
-
});
|
8468 |
-
if( ! childNode ) childNode = el[0].childNodes[0];
|
8469 |
-
var offset = caretPos - find.length + replace.length;
|
8470 |
-
var range = document.createRange();
|
8471 |
-
var sel = window.getSelection();
|
8472 |
-
if( 0 != childNode.childNodes.length ) {
|
8473 |
-
try{
|
8474 |
-
range.setStart(childNode.childNodes[0], offset);
|
8475 |
-
} catch( err ) {
|
8476 |
-
console.log( childNode );
|
8477 |
-
console.log( 'error' );
|
8478 |
-
}
|
8479 |
-
|
8480 |
-
} else {
|
8481 |
-
try {
|
8482 |
-
range.setStart(childNode, offset);
|
8483 |
-
} catch( err ) {
|
8484 |
-
console.log( 'error' );
|
8485 |
-
}
|
8486 |
-
|
8487 |
-
}
|
8488 |
-
range.collapse(true);
|
8489 |
-
sel.removeAllRanges();
|
8490 |
-
sel.addRange(range);
|
8491 |
-
|
8492 |
-
|
8493 |
-
} else {
|
8494 |
-
$input.val(string); // Update input value with parsed string.
|
8495 |
-
$input.change(); // Trigger a change event after inserting the merge tag so that it saves to the model.
|
8496 |
-
$input.caret(caretPos - find.length + replace.length); // Update Carept Position.
|
8497 |
-
}
|
8498 |
-
|
8499 |
-
}
|
8500 |
-
|
8501 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8502 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8503 |
-
$input.removeClass( 'merge-tag-focus' );
|
8504 |
-
$input.closest( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8505 |
-
},
|
8506 |
-
|
8507 |
-
mergeTagsButtonClick: function( e ){
|
8508 |
-
var $this = jQuery( this );
|
8509 |
-
|
8510 |
-
if ($this.hasClass('open-media-manager')) {
|
8511 |
-
return;
|
8512 |
-
}
|
8513 |
-
|
8514 |
-
if( $this.siblings().hasClass( 'merge-tag-focus' ) ){
|
8515 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
|
8516 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8517 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8518 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8519 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8520 |
-
return;
|
8521 |
-
}
|
8522 |
-
|
8523 |
-
if( 0 !== $this.closest( '.nf-setting, .nf-table-row' ).find( '.note-tools' ).length ){
|
8524 |
-
var $inputSetting = $this.closest( '.note-editor' ).siblings( '.setting' ).first();
|
8525 |
-
$this.closest( '.nf-setting' ).find( '.setting' ).summernote( 'insertText', '{' );
|
8526 |
-
// Since we haven't determined the caretPos, set to -1 as a flag to determine later.
|
8527 |
-
nfRadio.channel('mergeTags').request( 'set:caret', -1 );
|
8528 |
-
} else {
|
8529 |
-
var $inputSetting = $this.siblings( '.setting' ).first();
|
8530 |
-
var text = $inputSetting.val() || '';
|
8531 |
-
$inputSetting.val( text + '{' ).change();
|
8532 |
-
nfRadio.channel('mergeTags').request('set:caret', text.length + 1 );
|
8533 |
-
}
|
8534 |
-
|
8535 |
-
if( $this.parent().hasClass( 'note-tools' ) ){
|
8536 |
-
// $this.closest( '.nf-setting' ).find( '.setting' ).summernote( 'insertText', '{' );
|
8537 |
-
}
|
8538 |
-
|
8539 |
-
nfRadio.channel('mergeTags').request('set:old', '{' );
|
8540 |
-
|
8541 |
-
$inputSetting.addClass( 'merge-tag-focus' );
|
8542 |
-
|
8543 |
-
// Disable browser autocomplete.
|
8544 |
-
var autocomplete = $this.attr( 'autocomplete' );
|
8545 |
-
$this.attr( 'autocomplete', 'off' );
|
8546 |
-
$this.data( 'autocomplete', autocomplete );
|
8547 |
-
|
8548 |
-
var $overlayElement = $this.closest( '.nf-setting, .nf-table-row' );
|
8549 |
-
if( 0 != $overlayElement.find( '.note-editor' ).length ){
|
8550 |
-
$overlayElement.find('.note-editor' ).addClass('merge-tag-focus-overlay');
|
8551 |
-
} else {
|
8552 |
-
$overlayElement.addClass('merge-tag-focus-overlay');
|
8553 |
-
}
|
8554 |
-
|
8555 |
-
/**
|
8556 |
-
* TODO: This is a wonky work around for removing Product and Quantity fields from calculation merge tags.
|
8557 |
-
* The merge tag system doesn't currently respect "exclude" merge tag settings.
|
8558 |
-
*
|
8559 |
-
* If 'eq' is the textarea next to the merge tag icon, then we're in a calculation setting.
|
8560 |
-
*/
|
8561 |
-
if ( 'eq' == jQuery( e.target ).prev( 'textarea' ).data( 'id' ) ) {
|
8562 |
-
var calc = true;
|
8563 |
-
} else {
|
8564 |
-
var calc = false;
|
8565 |
-
}
|
8566 |
-
|
8567 |
-
// Request that our merge tag box update its tag list, passing whether or not we're in a calculation setting.
|
8568 |
-
nfRadio.channel( 'merge-tags' ).request( 'update:taglist', 'fields', calc );
|
8569 |
-
|
8570 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'block' );
|
8571 |
-
nfRadio.channel( 'drawer' ).request( 'prevent:close' );
|
8572 |
-
|
8573 |
-
jQuery( '.merge-tag-focus-overlay' ).off( 'click' );
|
8574 |
-
jQuery( '.merge-tag-focus-overlay' ).on( 'click', function( e ) {
|
8575 |
-
if ( jQuery( e.target ).hasClass( 'note-editor' ) ) {
|
8576 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
|
8577 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8578 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8579 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8580 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8581 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8582 |
-
}
|
8583 |
-
} );
|
8584 |
-
|
8585 |
-
setTimeout(function(){
|
8586 |
-
jQuery( '#merge-tags-box' ).find( '.merge-tag-filter' ).find( 'input' ).focus();
|
8587 |
-
}, 500 );
|
8588 |
-
},
|
8589 |
-
|
8590 |
-
focusCallback: function( e, target, type ){
|
8591 |
-
|
8592 |
-
var type = type || 'setting';
|
8593 |
-
var $this = ( 'undefined' == typeof target ) ? jQuery( this ) : jQuery( target );
|
8594 |
-
|
8595 |
-
jQuery( '.merge-tag-focus' ).each(function(index, el){
|
8596 |
-
if( this == el ) return;
|
8597 |
-
el.removeClass( 'merge-tag-focus' );
|
8598 |
-
});
|
8599 |
-
|
8600 |
-
if( 'rte' == type ) {
|
8601 |
-
var posY = $this.closest( '.nf-setting' ).find( '.note-editor' ).offset().top - jQuery(window).scrollTop();
|
8602 |
-
var height = $this.closest( '.nf-setting' ).find( '.note-editor' ).outerHeight();
|
8603 |
-
} else {
|
8604 |
-
var posY = $this.offset().top - jQuery(window).scrollTop();
|
8605 |
-
var height = $this.outerHeight();
|
8606 |
-
}
|
8607 |
-
|
8608 |
-
// Find out if merge tag box will go below bottom of the page.
|
8609 |
-
var tagBoxY = posY + height;
|
8610 |
-
var windowHeight = window.innerHeight;
|
8611 |
-
var tagBoxHeight = jQuery( '#merge-tags-box' ).outerHeight();
|
8612 |
-
|
8613 |
-
// If merge tag box will render below the bottom of the page,
|
8614 |
-
// change it to render above the field
|
8615 |
-
|
8616 |
-
if ( ( tagBoxY + tagBoxHeight ) > windowHeight ) {
|
8617 |
-
tagBoxY = posY - tagBoxHeight;
|
8618 |
-
}
|
8619 |
-
|
8620 |
-
if ( 0 > tagBoxY ) {
|
8621 |
-
tagBoxY = posY;
|
8622 |
-
}
|
8623 |
-
|
8624 |
-
jQuery( '#merge-tags-box' ).css( 'top', tagBoxY );
|
8625 |
-
|
8626 |
-
var repeaterRow = $this.closest( '.nf-list-options-tbody' );
|
8627 |
-
if( 0 != repeaterRow.length ) {
|
8628 |
-
var left = repeaterRow.offset().left - jQuery(window).scrollLeft();
|
8629 |
-
jQuery( '#merge-tags-box' ).css( 'left', left );
|
8630 |
-
} else if( 'rte' == type ) {
|
8631 |
-
var posX = $this.closest( '.nf-setting' ).find( '.note-editor' ).offset().left - jQuery(window).scrollLeft();
|
8632 |
-
jQuery( '#merge-tags-box' ).css( 'left', posX );
|
8633 |
-
jQuery( '#merge-tags-box' ).css( 'width', $this.closest( '.nf-setting' ).find( '.note-editor' ).width() );
|
8634 |
-
}
|
8635 |
-
else
|
8636 |
-
{
|
8637 |
-
var posX = jQuery( this ).closest( '.nf-settings' ).offset().left - jQuery(window).scrollLeft();
|
8638 |
-
jQuery( '#merge-tags-box' ).css( 'left', posX );
|
8639 |
-
jQuery( '#merge-tags-box' ).css( 'width', $this.closest( '.nf-settings' ).width() );
|
8640 |
-
}
|
8641 |
-
|
8642 |
-
var dataID = jQuery( this ).data( 'id' );
|
8643 |
-
if( dataID && 'eq' != dataID ) return;
|
8644 |
-
|
8645 |
-
// var offset = jQuery( view.el ).find( '.setting' ).parent().outerHeight();
|
8646 |
-
// jQuery( view.el ).find( '.setting' ).parent().append( jQuery( '#merge-tags-box' ) );
|
8647 |
-
// jQuery( '#merge-tags-box' ).css( 'top', offset );
|
8648 |
-
},
|
8649 |
-
|
8650 |
-
keyupCallback: function( event, target, type ){
|
8651 |
-
var type = type || 'setting';
|
8652 |
-
|
8653 |
-
if( /* ENTER */ 13 == event.keyCode ){
|
8654 |
-
|
8655 |
-
// Get top listed merge tag.
|
8656 |
-
var firstFilteredTag = jQuery( '#merge-tags-box .merge-tag-list ul li span' ).first().data( 'tag' );
|
8657 |
-
|
8658 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', firstFilteredTag );
|
8659 |
-
|
8660 |
-
// COPIED FROM BELOW
|
8661 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8662 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8663 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8664 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8665 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8666 |
-
|
8667 |
-
return;
|
8668 |
-
}
|
8669 |
-
|
8670 |
-
// Get the value.
|
8671 |
-
// var value = jQuery( summernote ).summernote( 'code' );
|
8672 |
-
// Update the value.
|
8673 |
-
// jQuery( summernote ).closest( '.nf-setting' ).find( '.note-editable' ).html( value );
|
8674 |
-
|
8675 |
-
if( 'undefined' != typeof target ) {
|
8676 |
-
var $this = jQuery(target);
|
8677 |
-
} else {
|
8678 |
-
var $this = jQuery( this );
|
8679 |
-
}
|
8680 |
-
|
8681 |
-
// TODO: Disable Browser Autocomplete
|
8682 |
-
// $this.attr()
|
8683 |
-
|
8684 |
-
|
8685 |
-
var dataID = jQuery( this ).data( 'id' );
|
8686 |
-
if( dataID && 'eq' == dataID ) return;
|
8687 |
-
|
8688 |
-
// Store the current caret position.
|
8689 |
-
if( 'rte' == type ){
|
8690 |
-
var range = $this.summernote('createRange');
|
8691 |
-
if( range ) {
|
8692 |
-
var caretPos = range.so; // or .eo?
|
8693 |
-
} else {
|
8694 |
-
var caretPos = 0;
|
8695 |
-
}
|
8696 |
-
$this.closest( '.nf-setting' ).find( '.setting' ).summernote( 'saveRange' );
|
8697 |
-
} else {
|
8698 |
-
var caretPos = $this.caret();
|
8699 |
-
}
|
8700 |
-
nfRadio.channel( 'mergeTags' ).request( 'set:caret', caretPos );
|
8701 |
-
|
8702 |
-
// Find merge tags.
|
8703 |
-
if( 'rte' == type ) {
|
8704 |
-
var mergetags = $this.summernote( 'code' ).match(new RegExp(/{([a-zA-Z0-9]|:|_|-|})*/g));
|
8705 |
-
} else {
|
8706 |
-
var mergetags = $this.val().match(new RegExp(/{([a-zA-Z0-9]|:|_|-|})*/g));
|
8707 |
-
}
|
8708 |
-
|
8709 |
-
// Filter out closed merge tags.
|
8710 |
-
mergetags = _.filter(mergetags, function(mergetag) {
|
8711 |
-
return -1 == mergetag.indexOf( '}' ); // Filter out "closed" merge tags.
|
8712 |
-
});
|
8713 |
-
|
8714 |
-
// If an open merge tag is found, show the Merge Tag Box, else hide.
|
8715 |
-
if( 0 !== mergetags.length ) {
|
8716 |
-
|
8717 |
-
nfRadio.channel( 'mergeTags' ).request( 'set:old', mergetags[0] );
|
8718 |
-
|
8719 |
-
jQuery('#merge-tags-box').css( 'display', 'block' );
|
8720 |
-
nfRadio.channel( 'drawer' ).request( 'prevent:close' );
|
8721 |
-
$this.addClass('merge-tag-focus');
|
8722 |
-
|
8723 |
-
var boxHeight = jQuery( '#merge-tags-box' ).outerHeight();
|
8724 |
-
jQuery( '#nf-drawer' ).css( 'padding-bottom', boxHeight + 'px' );
|
8725 |
-
|
8726 |
-
// Disable browser autocomplete.
|
8727 |
-
var autocomplete = $this.attr( 'autocomplete' );
|
8728 |
-
$this.attr( 'autocomplete', 'off' );
|
8729 |
-
$this.data( 'autocomplete', autocomplete );
|
8730 |
-
|
8731 |
-
var $overlayElement = $this.closest( '.nf-setting, .nf-table-row' );
|
8732 |
-
if( 0 != $overlayElement.find( '.note-editor' ).length ){
|
8733 |
-
$overlayElement.find('.note-editor' ).addClass('merge-tag-focus-overlay');
|
8734 |
-
} else {
|
8735 |
-
$overlayElement.addClass('merge-tag-focus-overlay');
|
8736 |
-
}
|
8737 |
-
|
8738 |
-
$overlayElement.off( 'click' );
|
8739 |
-
$overlayElement.on( 'click', function( event ){
|
8740 |
-
var elementClasses = jQuery( event.target ).attr( 'class' ) || [];
|
8741 |
-
if( -1 !== elementClasses.indexOf( 'merge-tag-focus-overlay' ) ){
|
8742 |
-
nfRadio.channel( 'mergeTags' ).request( 'insert:tag', '' );
|
8743 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8744 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8745 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8746 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8747 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8748 |
-
}
|
8749 |
-
});
|
8750 |
-
|
8751 |
-
var value = mergetags[0].replace( '{', '' );
|
8752 |
-
} else {
|
8753 |
-
jQuery( '#merge-tags-box' ).css( 'display', 'none' );
|
8754 |
-
nfRadio.channel( 'drawer' ).request( 'enable:close' );
|
8755 |
-
jQuery( '#merge-tags-box' ).removeClass();
|
8756 |
-
jQuery( '.merge-tag-focus' ).removeClass( 'merge-tag-focus' );
|
8757 |
-
jQuery( '.merge-tag-focus-overlay' ).removeClass( 'merge-tag-focus-overlay' );
|
8758 |
-
}
|
8759 |
-
}
|
8760 |
-
|
8761 |
-
} );
|
8762 |
-
|
8763 |
-
return controller;
|
8764 |
-
} );
|
8765 |
-
|
8766 |
-
/**
|
8767 |
-
* Listens to our app channel for settings views being rendered.
|
8768 |
-
*
|
8769 |
-
* If we're about to render a setting model that's a select and has 'fields' as the 'fill' setting, add all our field models to its options.
|
8770 |
-
*
|
8771 |
-
* @package Ninja Forms builder
|
8772 |
-
* @subpackage Main App
|
8773 |
-
* @copyright (c) 2015 WP Ninjas
|
8774 |
-
* @since 3.0
|
8775 |
-
*/
|
8776 |
-
define( 'controllers/app/itemSettingFill',[], function() {
|
8777 |
-
var controller = Marionette.Object.extend( {
|
8778 |
-
initialize: function() {
|
8779 |
-
// Listen for messages that are fired before a setting view is rendered.
|
8780 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
8781 |
-
},
|
8782 |
-
|
8783 |
-
beforeRenderSetting: function( settingModel, dataModel ) {
|
8784 |
-
if ( 'fields' == settingModel.get( 'fill' ) ) {
|
8785 |
-
|
8786 |
-
}
|
8787 |
-
}
|
8788 |
-
|
8789 |
-
});
|
8790 |
-
|
8791 |
-
return controller;
|
8792 |
-
} );
|
8793 |
-
/**
|
8794 |
-
* Modify the user's browser history when they click on a domain
|
8795 |
-
*
|
8796 |
-
* @package Ninja Forms builder
|
8797 |
-
* @subpackage Main App
|
8798 |
-
* @copyright (c) 2015 WP Ninjas
|
8799 |
-
* @since 3.0
|
8800 |
-
*/
|
8801 |
-
define( 'controllers/app/confirmPublish',[], function() {
|
8802 |
-
var controller = Marionette.Object.extend( {
|
8803 |
-
initialize: function() {
|
8804 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:confirmPublish', this.confirmPublish );
|
8805 |
-
},
|
8806 |
-
|
8807 |
-
confirmPublish: function() {
|
8808 |
-
var formModel = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
8809 |
-
// Check to see if we need to add a submit button.
|
8810 |
-
if ( 1 == formModel.get( 'settings' ).get( 'add_submit' ) ) {
|
8811 |
-
nfRadio.channel( 'fields' ).request( 'add', { type: 'submit', label: 'Submit', order: 9999 } );
|
8812 |
-
}
|
8813 |
-
formModel.set( 'show_publish_options', false );
|
8814 |
-
nfRadio.channel( 'app' ).request( 'update:db', 'publish' );
|
8815 |
-
}
|
8816 |
-
|
8817 |
-
});
|
8818 |
-
|
8819 |
-
return controller;
|
8820 |
-
} );
|
8821 |
-
/**
|
8822 |
-
* Handles actions related to settings that utilise the Rich Text Editor
|
8823 |
-
*
|
8824 |
-
* @package Ninja Forms builder
|
8825 |
-
* @subpackage App - Settings Drawer
|
8826 |
-
* @copyright (c) 2015 WP Ninjas
|
8827 |
-
* @since 3.0
|
8828 |
-
*/
|
8829 |
-
define( 'controllers/app/rte',[], function() {
|
8830 |
-
var controller = Marionette.Object.extend( {
|
8831 |
-
initialize: function() {
|
8832 |
-
// We don't want the RTE setting to re-render when the value changes.
|
8833 |
-
nfRadio.channel( 'setting-type-rte' ).reply( 'renderOnChange', function(){ return false } );
|
8834 |
-
|
8835 |
-
this.listenTo( nfRadio.channel( 'rte' ), 'init:settingModel', this.initSettingModel );
|
8836 |
-
|
8837 |
-
// When an RTE setting is shown, re-render RTE.
|
8838 |
-
this.listenTo( nfRadio.channel( 'setting-type-rte' ), 'render:setting', this.renderSetting );
|
8839 |
-
|
8840 |
-
// When an RTE setting view is destroyed, remove our RTE.
|
8841 |
-
this.listenTo( nfRadio.channel( 'setting-type-rte' ), 'destroy:setting', this.destroySetting );
|
8842 |
-
|
8843 |
-
// When an element within the RTE is clicked, check to see if we should insert a link.
|
8844 |
-
this.listenTo( nfRadio.channel( 'setting-type-rte' ), 'click:extra', this.clickExtra );
|
8845 |
-
|
8846 |
-
// Instantiates the variable that holds the media library frame.
|
8847 |
-
this.meta_image_frame;
|
8848 |
-
|
8849 |
-
jQuery.summernote.options.icons = {
|
8850 |
-
'align': 'dashicons dashicons-editor-alignleft',
|
8851 |
-
'alignCenter': 'dashicons dashicons-editor-aligncenter',
|
8852 |
-
'alignJustify': 'dashicons dashicons-editor-justify',
|
8853 |
-
'alignLeft': 'dashicons dashicons-editor-alignleft',
|
8854 |
-
'alignRight': 'dashicons dashicons-editor-alignright',
|
8855 |
-
'indent': 'dashicons dashicons-editor-indent',
|
8856 |
-
'outdent': 'dashicons dashicons-editor-outdent',
|
8857 |
-
// 'arrowsAlt': 'dashicons fa-arrows-alt',
|
8858 |
-
'bold': 'dashicons dashicons-editor-bold',
|
8859 |
-
'caret': 'dashicons dashicons-arrow-down',
|
8860 |
-
// 'circle': 'dashicons fa-circle',
|
8861 |
-
'close': 'dashicons dashicons-dismiss',
|
8862 |
-
'code': 'dashicons dashicons-editor-code',
|
8863 |
-
'eraser': 'dashicons dashicons-editor-removeformatting',
|
8864 |
-
// 'font': 'dashicons fa-font',
|
8865 |
-
// 'frame': 'dashicons fa-frame',
|
8866 |
-
'italic': 'dashicons dashicons-editor-italic',
|
8867 |
-
'link': 'dashicons dashicons-admin-links',
|
8868 |
-
'unlink': 'dashicons dashicons-editor-unlink',
|
8869 |
-
'magic': 'dashicons dashicons-editor-paragraph',
|
8870 |
-
// 'menuCheck': 'dashicons fa-check',
|
8871 |
-
'minus': 'dashicons dashicons-minus',
|
8872 |
-
'orderedlist': 'dashicons dashicons-editor-ol',
|
8873 |
-
// 'pencil': 'dashicons fa-pencil',
|
8874 |
-
// 'picture': 'dashicons fa-picture-o',
|
8875 |
-
// 'question': 'dashicons fa-question',
|
8876 |
-
'redo': 'dashicons dashicons-redo',
|
8877 |
-
'square': 'dashicons fa-square',
|
8878 |
-
// 'strikethrough': 'dashicons fa-strikethrough',
|
8879 |
-
// 'subscript': 'dashicons fa-subscript',
|
8880 |
-
// 'superscript': 'dashicons fa-superscript',
|
8881 |
-
'table': 'dashicons dashicons-editor-table',
|
8882 |
-
// 'textHeight': 'dashicons fa-text-height',
|
8883 |
-
// 'trash': 'dashicons fa-trash',
|
8884 |
-
'underline': 'dashicons dashicons-editor-underline',
|
8885 |
-
'undo': 'dashicons dashicons-undo',
|
8886 |
-
'unorderedlist': 'dashicons dashicons-editor-ul',
|
8887 |
-
// 'video': 'dashicons fa-youtube-play'
|
8888 |
-
}
|
8889 |
-
|
8890 |
-
this.currentContext = {};
|
8891 |
-
},
|
8892 |
-
|
8893 |
-
initSettingModel: function( settingModel ) {
|
8894 |
-
settingModel.set( 'hide_merge_tags', true );
|
8895 |
-
},
|
8896 |
-
|
8897 |
-
initRTE: function( settingModel, dataModel, settingView ) {
|
8898 |
-
/*
|
8899 |
-
* Custom Button for links
|
8900 |
-
*/
|
8901 |
-
var that = this;
|
8902 |
-
// var linkButton = this.linkButton();
|
8903 |
-
var linkButton = function( context ) {
|
8904 |
-
return that.linkButton( context );
|
8905 |
-
}
|
8906 |
-
var mediaButton = function( context ) {
|
8907 |
-
return that.mediaButton( context );
|
8908 |
-
}
|
8909 |
-
var mergeTags = this.mergeTags();
|
8910 |
-
|
8911 |
-
var toolbar = [
|
8912 |
-
[ 'paragraphStyle', ['style'] ],
|
8913 |
-
[ 'fontStyle', [ 'bold', 'italic', 'underline','clear' ] ],
|
8914 |
-
[ 'lists', [ 'ul', 'ol' ] ],
|
8915 |
-
[ 'paragraph', [ 'paragraph' ] ],
|
8916 |
-
[ 'customGroup', [ 'linkButton', 'unlink' ] ],
|
8917 |
-
[ 'table', [ 'table' ] ],
|
8918 |
-
[ 'actions', [ 'undo', 'redo' ] ],
|
8919 |
-
[ 'tools', [ 'mediaButton', 'mergeTags', 'codeview' ] ]
|
8920 |
-
];
|
8921 |
-
|
8922 |
-
jQuery( settingView.el ).find( 'div.setting' ).summernote( {
|
8923 |
-
toolbar: toolbar,
|
8924 |
-
buttons: {
|
8925 |
-
linkButton: linkButton,
|
8926 |
-
mergeTags: mergeTags,
|
8927 |
-
mediaButton: mediaButton
|
8928 |
-
},
|
8929 |
-
height: 150, //set editable area's height
|
8930 |
-
codemirror: { // codemirror options
|
8931 |
-
theme: 'monokai',
|
8932 |
-
lineNumbers: true,
|
8933 |
-
lineWrapping: true,
|
8934 |
-
callbacks: {
|
8935 |
-
onBlur: function( editor ) {
|
8936 |
-
var value = editor.getValue();
|
8937 |
-
that.updateDataModel( settingModel, dataModel, value );
|
8938 |
-
}
|
8939 |
-
}
|
8940 |
-
},
|
8941 |
-
prettifyHtml: true,
|
8942 |
-
callbacks: {
|
8943 |
-
onBlur: function( e, context ) {
|
8944 |
-
var value = jQuery( this ).summernote( 'code' );
|
8945 |
-
that.updateDataModel( settingModel, dataModel, value );
|
8946 |
-
nfRadio.channel( 'summernote' ).trigger( 'blur', settingModel, dataModel, value );
|
8947 |
-
},
|
8948 |
-
onFocus: function( e, context ) {
|
8949 |
-
nfRadio.channel( 'summernote' ).trigger( 'focus', e, this, context );
|
8950 |
-
},
|
8951 |
-
onKeydown: function( e, context ) {
|
8952 |
-
nfRadio.channel( 'summernote' ).trigger( 'keydown', e, this, context );
|
8953 |
-
},
|
8954 |
-
onKeyup: function( e, context ) {
|
8955 |
-
nfRadio.channel( 'summernote' ).trigger( 'keyup', e, this, context );
|
8956 |
-
}
|
8957 |
-
}
|
8958 |
-
} );
|
8959 |
-
},
|
8960 |
-
|
8961 |
-
updateDataModel: function( settingModel, dataModel, value ) {
|
8962 |
-
var name = settingModel.get( 'name' );
|
8963 |
-
var before = dataModel.get( name );
|
8964 |
-
var after = value;
|
8965 |
-
|
8966 |
-
var changes = {
|
8967 |
-
attr: name,
|
8968 |
-
before: before,
|
8969 |
-
after: after
|
8970 |
-
}
|
8971 |
-
|
8972 |
-
var label = {
|
8973 |
-
object: dataModel.get( 'objectType' ),
|
8974 |
-
label: dataModel.get( 'label' ),
|
8975 |
-
change: 'Changed ' + settingModel.get( 'label' ) + ' from ' + before + ' to ' + after
|
8976 |
-
};
|
8977 |
-
|
8978 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'changeSetting', dataModel, changes, label );
|
8979 |
-
|
8980 |
-
dataModel.set( settingModel.get( 'name' ), after );
|
8981 |
-
},
|
8982 |
-
|
8983 |
-
renderSetting: function( settingModel, dataModel, settingView ) {
|
8984 |
-
this.initRTE( settingModel, dataModel,settingView );
|
8985 |
-
var linkMenu = jQuery( settingView.el ).find( '.link-button' ).next( '.dropdown-menu' ).find( 'button' );
|
8986 |
-
linkMenu.replaceWith(function () {
|
8987 |
-
return jQuery( '<div/>', {
|
8988 |
-
class: jQuery( linkMenu ).attr( 'class' ),
|
8989 |
-
html: this.innerHTML
|
8990 |
-
} );
|
8991 |
-
} );
|
8992 |
-
},
|
8993 |
-
|
8994 |
-
destroySetting: function( settingModel, dataModel, settingView ) {
|
8995 |
-
this.removeRTE( settingModel, dataModel, settingView );
|
8996 |
-
},
|
8997 |
-
|
8998 |
-
removeRTE: function( settingModel, dataModel, settingView ) {
|
8999 |
-
jQuery( settingView.el ).find( 'div.setting' ).summernote( 'destroy' );
|
9000 |
-
},
|
9001 |
-
|
9002 |
-
drawerOpened: function( settingModel, dataModel, settingView ) {
|
9003 |
-
this.initRTE( settingModel, dataModel, settingView );
|
9004 |
-
},
|
9005 |
-
|
9006 |
-
linkButton: function( context ) {
|
9007 |
-
var that = this;
|
9008 |
-
var ui = jQuery.summernote.ui;
|
9009 |
-
var linkButton = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-rte-link-button' );
|
9010 |
-
var linkDropdown = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-rte-link-dropdown' );
|
9011 |
-
return ui.buttonGroup([
|
9012 |
-
ui.button({
|
9013 |
-
className: 'dropdown-toggle link-button',
|
9014 |
-
contents: linkButton({}),
|
9015 |
-
tooltip: 'Insert Link',
|
9016 |
-
click: function( e ) {
|
9017 |
-
that.clickLinkButton( e, context );
|
9018 |
-
},
|
9019 |
-
data: {
|
9020 |
-
toggle: 'dropdown'
|
9021 |
-
}
|
9022 |
-
}),
|
9023 |
-
ui.dropdown([
|
9024 |
-
ui.buttonGroup({
|
9025 |
-
children: [
|
9026 |
-
ui.button({
|
9027 |
-
contents: linkDropdown({}),
|
9028 |
-
tooltip: ''
|
9029 |
-
}),
|
9030 |
-
]
|
9031 |
-
})
|
9032 |
-
])
|
9033 |
-
]).render();
|
9034 |
-
},
|
9035 |
-
|
9036 |
-
mergeTags: function( context ) {
|
9037 |
-
var ui = jQuery.summernote.ui;
|
9038 |
-
var mergeTagsButton = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-rte-merge-tags-button' );
|
9039 |
-
return ui.button({
|
9040 |
-
className: 'dropdown-toggle merge-tags',
|
9041 |
-
contents: mergeTagsButton({}),
|
9042 |
-
tooltip: 'Merge Tags'
|
9043 |
-
}).render();
|
9044 |
-
},
|
9045 |
-
|
9046 |
-
mediaButton: function( context ) {
|
9047 |
-
var that = this;
|
9048 |
-
var ui = jQuery.summernote.ui;
|
9049 |
-
var mediaButton = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-rte-media-button' );
|
9050 |
-
return ui.button({
|
9051 |
-
className: 'dropdown-toggle',
|
9052 |
-
contents: mediaButton({}),
|
9053 |
-
tooltip: 'Insert Media',
|
9054 |
-
click: function( e ) {
|
9055 |
-
that.openMediaManager( e, context );
|
9056 |
-
}
|
9057 |
-
}).render();
|
9058 |
-
},
|
9059 |
-
|
9060 |
-
openMediaManager: function( e, context ) {
|
9061 |
-
context.invoke( 'editor.createRange' );
|
9062 |
-
context.invoke( 'editor.saveRange' );
|
9063 |
-
this.currentContext = context;
|
9064 |
-
|
9065 |
-
// If the frame already exists, re-open it.
|
9066 |
-
if ( this.meta_image_frame ) {
|
9067 |
-
this.meta_image_frame.open();
|
9068 |
-
return;
|
9069 |
-
}
|
9070 |
-
|
9071 |
-
// Sets up the media library frame
|
9072 |
-
this.meta_image_frame = wp.media.frames.meta_image_frame = wp.media({
|
9073 |
-
title: 'Select a file',
|
9074 |
-
button: { text: 'insert' }
|
9075 |
-
});
|
9076 |
-
|
9077 |
-
var that = this;
|
9078 |
-
|
9079 |
-
// Runs when an image is selected.
|
9080 |
-
this.meta_image_frame.on('select', function(){
|
9081 |
-
|
9082 |
-
// Grabs the attachment selection and creates a JSON representation of the model.
|
9083 |
-
var media_attachment = that.meta_image_frame.state().get('selection').first().toJSON();
|
9084 |
-
that.insertMedia( media_attachment, context );
|
9085 |
-
});
|
9086 |
-
|
9087 |
-
// Opens the media library frame.
|
9088 |
-
this.meta_image_frame.open();
|
9089 |
-
},
|
9090 |
-
|
9091 |
-
clickLinkButton: function ( e, context ) {
|
9092 |
-
var range = context.invoke( 'editor.createRange' );
|
9093 |
-
context.invoke( 'editor.saveRange' );
|
9094 |
-
var text = range.toString()
|
9095 |
-
this.currentContext = context;
|
9096 |
-
|
9097 |
-
jQuery( e.target ).closest( '.note-customGroup > .note-btn-group' ).on ('hide.bs.dropdown', function ( e ) {
|
9098 |
-
return false;
|
9099 |
-
});
|
9100 |
-
|
9101 |
-
jQuery( e.target ).closest( '.note-customGroup > .note-btn-group' ).on ('shown.bs.dropdown', function ( e ) {
|
9102 |
-
jQuery( e.target ).parent().parent().find( '.link-text' ).val( text );
|
9103 |
-
jQuery( e.target ).parent().parent().find( '.link-url' ).focus();
|
9104 |
-
});
|
9105 |
-
},
|
9106 |
-
|
9107 |
-
clickExtra: function( e, settingModel, dataModel, settingView ) {
|
9108 |
-
var textEl = jQuery( e.target ).parent().find( '.link-text' );
|
9109 |
-
var urlEl = jQuery( e.target ).parent().find( '.link-url' );
|
9110 |
-
var isNewWindowEl = jQuery( e.target ).parent().find( '.link-new-window' );
|
9111 |
-
this.currentContext.invoke( 'editor.restoreRange' );
|
9112 |
-
if ( jQuery( e.target ).hasClass( 'insert-link' ) ) {
|
9113 |
-
var text = textEl.val();
|
9114 |
-
var url = urlEl.val();
|
9115 |
-
var isNewWindow = ( isNewWindowEl.prop( 'checked' ) ) ? true: false;
|
9116 |
-
if ( 0 != text.length && 0 != url.length ) {
|
9117 |
-
this.currentContext.invoke( 'editor.createLink', { text:text, url: url, isNewWindow: isNewWindow } );
|
9118 |
-
}
|
9119 |
-
}
|
9120 |
-
textEl.val( '' );
|
9121 |
-
urlEl.val( '' );
|
9122 |
-
isNewWindowEl.prop( 'checked', false );
|
9123 |
-
jQuery( e.target ).closest( 'div.note-btn-group.open' ).removeClass( 'open' );
|
9124 |
-
},
|
9125 |
-
|
9126 |
-
insertMedia: function( media, context ) {
|
9127 |
-
this.currentContext.invoke( 'editor.restoreRange' );
|
9128 |
-
if ( 'image' == media.type ) {
|
9129 |
-
this.currentContext.invoke( 'editor.insertImage', media.url );
|
9130 |
-
} else {
|
9131 |
-
this.currentContext.invoke( 'editor.createLink', {
|
9132 |
-
text: media.title || media.filename,
|
9133 |
-
url: media.url
|
9134 |
-
} );
|
9135 |
-
}
|
9136 |
-
|
9137 |
-
}
|
9138 |
-
});
|
9139 |
-
|
9140 |
-
return controller;
|
9141 |
-
} );
|
9142 |
-
|
9143 |
-
/**
|
9144 |
-
* Listens to our app channel for settings views being rendered.
|
9145 |
-
*
|
9146 |
-
* @package Ninja Forms builder
|
9147 |
-
* @subpackage Main App
|
9148 |
-
* @copyright (c) 2015 WP Ninjas
|
9149 |
-
* @since 3.0
|
9150 |
-
*/
|
9151 |
-
define( 'controllers/app/settingFieldSelect',[], function() {
|
9152 |
-
var controller = Marionette.Object.extend( {
|
9153 |
-
|
9154 |
-
initialize: function() {
|
9155 |
-
|
9156 |
-
// Bind field key listener to field-select setting type.
|
9157 |
-
this.listenTo( nfRadio.channel( 'field-select' ), 'init:settingModel', this.trackKeyChanges );
|
9158 |
-
|
9159 |
-
// The first time settingModel and the dataModel meet.
|
9160 |
-
this.listenTo( nfRadio.channel( 'setting-type-field-select' ), 'before:renderSetting', this.beforeRender );
|
9161 |
-
|
9162 |
-
// Add setting change listener only in drawers with a field-select setting.
|
9163 |
-
this.listenTo( nfRadio.channel( 'field-select' ), 'init:settingModel', function() {
|
9164 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:setting', this.maybeSwitchToFieldsDomain );
|
9165 |
-
});
|
9166 |
-
|
9167 |
-
this.listenTo( nfRadio.channel( 'app' ), 'change:currentDomain', this.autoOpenDrawer );
|
9168 |
-
|
9169 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', this.filterDrawerContents );
|
9170 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'closed', this.SwitchToFieldsDomain );
|
9171 |
-
},
|
9172 |
-
|
9173 |
-
trackKeyChanges: function( settingModel ) {
|
9174 |
-
settingModel.listenTo( nfRadio.channel( 'app' ), 'update:fieldKey', settingModel.updateKey );
|
9175 |
-
|
9176 |
-
// Update selected field if the selected field's key changes.
|
9177 |
-
this.listenTo( nfRadio.channel( 'app' ), 'replace:fieldKey', this.updateFieldMap );
|
9178 |
-
},
|
9179 |
-
|
9180 |
-
updateFieldMap: function( dataModel, keyModel, settingModel ) {
|
9181 |
-
|
9182 |
-
var oldKey = keyModel._previousAttributes[ 'key' ];
|
9183 |
-
var newKey = keyModel.get( 'key' );
|
9184 |
-
|
9185 |
-
if( 'field-select' == settingModel.get( 'type' ) && dataModel.get( settingModel.get( 'name' ) ) == oldKey ) {
|
9186 |
-
|
9187 |
-
dataModel.set( settingModel.get( 'name' ), newKey );
|
9188 |
-
}
|
9189 |
-
},
|
9190 |
-
|
9191 |
-
beforeRender: function( settingModel, dataModel ) {
|
9192 |
-
|
9193 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
9194 |
-
|
9195 |
-
var fieldTypes = settingModel.get( 'field_types' );
|
9196 |
-
|
9197 |
-
var options = [
|
9198 |
-
{
|
9199 |
-
label: '--',
|
9200 |
-
value: 0
|
9201 |
-
}
|
9202 |
-
];
|
9203 |
-
_.each( fieldCollection.models, function( field ){
|
9204 |
-
|
9205 |
-
if( dataModel.cid == field.cid ) return;
|
9206 |
-
|
9207 |
-
if( 'undefined' != typeof fieldTypes && 0 != fieldTypes.length && ! _.contains( fieldTypes, field.get( 'type' ) ) ) return;
|
9208 |
-
|
9209 |
-
var fieldFilter = settingModel.get( 'field_filter' );
|
9210 |
-
if( fieldFilter && 'undefined' != typeof fieldFilter[ field.get( 'type' ) ] ) {
|
9211 |
-
var bail = false;
|
9212 |
-
_.each( fieldFilter[ field.get( 'type' ) ], function( value, setting ){
|
9213 |
-
console.log( value + ":" + field.get( setting ) );
|
9214 |
-
if( value != field.get( setting ) ) bail = true;
|
9215 |
-
} );
|
9216 |
-
if( bail ) return;
|
9217 |
-
}
|
9218 |
-
|
9219 |
-
var value = field.get( 'key' );
|
9220 |
-
switch ( settingModel.get( 'field_value_format' ) ) {
|
9221 |
-
case 'key':
|
9222 |
-
value = field.get( 'key' );
|
9223 |
-
break;
|
9224 |
-
case 'merge_tag':
|
9225 |
-
default:
|
9226 |
-
value = '{field:' + field.get( 'key' ) + '}';
|
9227 |
-
}
|
9228 |
-
|
9229 |
-
options.push({
|
9230 |
-
label: field.get( 'label' ),
|
9231 |
-
value: value
|
9232 |
-
});
|
9233 |
-
});
|
9234 |
-
|
9235 |
-
if( 'undefined' != typeof fieldTypes && 0 != fieldTypes.length ) {
|
9236 |
-
_.each( fieldTypes, function( fieldType ){
|
9237 |
-
|
9238 |
-
var fieldTypeModel = nfRadio.channel( 'fields' ).request( 'get:type', fieldType );
|
9239 |
-
|
9240 |
-
options.push({
|
9241 |
-
label: '-- Add ' + fieldTypeModel.get( 'nicename' ) + ' Field',
|
9242 |
-
value: 'addField:' + fieldType,
|
9243 |
-
});
|
9244 |
-
} );
|
9245 |
-
}
|
9246 |
-
|
9247 |
-
settingModel.set( 'options', options );
|
9248 |
-
},
|
9249 |
-
|
9250 |
-
maybeSwitchToFieldsDomain: function( e, model, dataModel ) {
|
9251 |
-
|
9252 |
-
if( 'field-select' != model.get( 'type' ) ) return;
|
9253 |
-
|
9254 |
-
var name = model.get( 'name' );
|
9255 |
-
var value = dataModel.get( name );
|
9256 |
-
|
9257 |
-
if( ! value ) return;
|
9258 |
-
|
9259 |
-
var rubble = value.split( ':' );
|
9260 |
-
|
9261 |
-
if( 'addField' != rubble[0] ) return;
|
9262 |
-
|
9263 |
-
this.openDrawer = 'addField';
|
9264 |
-
this.filterDrawer = rubble[1];
|
9265 |
-
|
9266 |
-
dataModel.set( name, '' );
|
9267 |
-
|
9268 |
-
this.switchDomain = true;
|
9269 |
-
nfRadio.channel( 'app' ).request( 'close:drawer' );
|
9270 |
-
},
|
9271 |
-
|
9272 |
-
SwitchToFieldsDomain: function() {
|
9273 |
-
if( this.switchDomain ) {
|
9274 |
-
var fieldDomainModel = nfRadio.channel( 'app' ).request( 'get:domainModel', 'fields' );
|
9275 |
-
nfRadio.channel('app').request('change:currentDomain', null, fieldDomainModel);
|
9276 |
-
this.switchDomain = null;
|
9277 |
-
}
|
9278 |
-
},
|
9279 |
-
|
9280 |
-
autoOpenDrawer: function() {
|
9281 |
-
if( this.openDrawer ) {
|
9282 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', this.openDrawer );
|
9283 |
-
this.openDrawer = null;
|
9284 |
-
}
|
9285 |
-
},
|
9286 |
-
|
9287 |
-
filterDrawerContents: function() {
|
9288 |
-
if( this.filterDrawer ) {
|
9289 |
-
nfRadio.channel('drawer-addField').trigger('change:filter', this.filterDrawer);
|
9290 |
-
this.filterDrawer = null;
|
9291 |
-
}
|
9292 |
-
}
|
9293 |
-
});
|
9294 |
-
|
9295 |
-
return controller;
|
9296 |
-
} );
|
9297 |
-
/**
|
9298 |
-
* The Field List setting is a container of settings (like the Fieldset setting), in which its children are instantiated.
|
9299 |
-
* Unlike the Fieldset setting, Field List settings are dynamically created based on the list of form fields.
|
9300 |
-
*
|
9301 |
-
* Note: Field references in the dynamic setting names are based on field keys, which may change.
|
9302 |
-
* Unlike regular field key tracking, a new setting needs to be created with the same value as the previous.
|
9303 |
-
*
|
9304 |
-
* @package Ninja Forms builder
|
9305 |
-
* @subpackage Action Settings
|
9306 |
-
* @copyright (c) 2016 WP Ninjas
|
9307 |
-
* @author Kyle B. Johnson
|
9308 |
-
* @since 3.0
|
9309 |
-
*/
|
9310 |
-
define( 'controllers/app/settingFieldList',['views/app/drawer/typeSettingFieldset','models/app/settingCollection'], function( fieldsetView, settingCollection ) {
|
9311 |
-
return Marionette.Object.extend( {
|
9312 |
-
|
9313 |
-
/**
|
9314 |
-
* A reference list of Field List setting models.
|
9315 |
-
*/
|
9316 |
-
fieldListSettings: [],
|
9317 |
-
|
9318 |
-
initialize: function() {
|
9319 |
-
this.listenTo( nfRadio.channel( 'field-list' ), 'init:settingModel', this.registerFieldListSettings );
|
9320 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'update:setting', this.updateFieldListSettingKeys );
|
9321 |
-
nfRadio.channel( 'field-list' ).reply( 'get:settingChildView', this.getSettingChildView, this );
|
9322 |
-
},
|
9323 |
-
|
9324 |
-
/**
|
9325 |
-
* Build a reference list of Field List setting models for later reference.
|
9326 |
-
*
|
9327 |
-
* @param settingModel
|
9328 |
-
*/
|
9329 |
-
registerFieldListSettings: function( settingModel ){
|
9330 |
-
this.fieldListSettings.push( settingModel.get( 'name' ) );
|
9331 |
-
},
|
9332 |
-
|
9333 |
-
/**
|
9334 |
-
* Field List settings contain field keys in the setting names.
|
9335 |
-
* When a field key changes, so too must the Field List setting name.
|
9336 |
-
*
|
9337 |
-
* @param fieldModel
|
9338 |
-
*/
|
9339 |
-
updateFieldListSettingKeys: function( fieldModel ){
|
9340 |
-
|
9341 |
-
// We are only interested in field key changes.
|
9342 |
-
if( 'undefined' == typeof fieldModel.changed.key ) return;
|
9343 |
-
|
9344 |
-
var oldKey = fieldModel._previousAttributes.key;
|
9345 |
-
var newKey = fieldModel.changed.key;
|
9346 |
-
|
9347 |
-
/*
|
9348 |
-
* This is an absolute (functional) mess of nesting. I apologize to my future self, or Kenny.
|
9349 |
-
*
|
9350 |
-
* Each setting of each action model must be checked against each registered Field List setting.
|
9351 |
-
*/
|
9352 |
-
var that = this;
|
9353 |
-
_.each( Backbone.Radio.channel( 'actions' ).request( 'get:collection' ).models, function( actionModel ) {
|
9354 |
-
_.each( actionModel.attributes, function( value, setting ) {
|
9355 |
-
var lastChanged = ''; // Used to avoid resetting the change with a duplicate call.
|
9356 |
-
_.each( that.fieldListSettings, function( prefix ) {
|
9357 |
-
if( setting != prefix + '-' + oldKey || lastChanged == oldKey ) return;
|
9358 |
-
var oldValue = actionModel.get( prefix + '-' + oldKey );
|
9359 |
-
actionModel.set( prefix + '-' + newKey, oldValue );
|
9360 |
-
actionModel.set( prefix + '-' + oldKey, 0 );
|
9361 |
-
lastChanged = oldKey;
|
9362 |
-
});
|
9363 |
-
});
|
9364 |
-
});
|
9365 |
-
},
|
9366 |
-
|
9367 |
-
/**
|
9368 |
-
* Set the view for Field List sub-settings, just like the Fieldset setting.
|
9369 |
-
*
|
9370 |
-
* @param settingModel
|
9371 |
-
* @returns {*}
|
9372 |
-
*/
|
9373 |
-
getSettingChildView: function( settingModel ) {
|
9374 |
-
|
9375 |
-
/**
|
9376 |
-
* Dynamically build field-list settings as needed for the view.
|
9377 |
-
*/
|
9378 |
-
|
9379 |
-
// Filter fields based on the field_types setting property.
|
9380 |
-
var fields = _.filter( nfRadio.channel( 'fields' ).request( 'get:collection' ).models, function( field ) {
|
9381 |
-
return _.contains( settingModel.get( 'field_types' ), field.get( 'type' ) );
|
9382 |
-
});
|
9383 |
-
|
9384 |
-
// Map fields into setting definitions.
|
9385 |
-
var settings = _.map( fields, function( field ) {
|
9386 |
-
return {
|
9387 |
-
name: settingModel.get( 'name' ) + '-' + field.get( 'key' ),
|
9388 |
-
type: 'toggle',
|
9389 |
-
label: field.get( 'label' ),
|
9390 |
-
width: 'full'
|
9391 |
-
};
|
9392 |
-
});
|
9393 |
-
|
9394 |
-
settingModel.set( 'settings', new settingCollection( settings ) );
|
9395 |
-
|
9396 |
-
// return the child view.
|
9397 |
-
return fieldsetView;
|
9398 |
-
},
|
9399 |
-
|
9400 |
-
});
|
9401 |
-
} );
|
9402 |
-
|
9403 |
-
/**
|
9404 |
-
* Listens to our app channel for settings views being rendered.
|
9405 |
-
*
|
9406 |
-
*
|
9407 |
-
*
|
9408 |
-
* @package Ninja Forms builder
|
9409 |
-
* @subpackage Main App
|
9410 |
-
* @copyright (c) 2015 WP Ninjas
|
9411 |
-
* @since 3.0
|
9412 |
-
*/
|
9413 |
-
define( 'controllers/app/settingHTML',[], function() {
|
9414 |
-
var controller = Marionette.Object.extend( {
|
9415 |
-
initialize: function() {
|
9416 |
-
|
9417 |
-
// The first time settingModel and the dataModel meet.
|
9418 |
-
this.listenTo( nfRadio.channel( 'setting-type-html' ), 'before:renderSetting', this.init );
|
9419 |
-
},
|
9420 |
-
|
9421 |
-
init: function( settingModel, dataModel ) {
|
9422 |
-
|
9423 |
-
if( 'undefined' == settingModel.get( 'mirror' ) ) return;
|
9424 |
-
|
9425 |
-
// Listen to a setting change inside of the dataModel.
|
9426 |
-
dataModel.on( 'change:' + settingModel.get( 'mirror' ), this.update, settingModel );
|
9427 |
-
},
|
9428 |
-
|
9429 |
-
update: function( dataModel, changedSettingValue ) {
|
9430 |
-
|
9431 |
-
// Mirror the default value setting value.
|
9432 |
-
dataModel.set( this.get( 'name' ), changedSettingValue );
|
9433 |
-
}
|
9434 |
-
});
|
9435 |
-
|
9436 |
-
return controller;
|
9437 |
-
} );
|
9438 |
-
/**
|
9439 |
-
* Listens to our app channel for settings views being rendered.
|
9440 |
-
*
|
9441 |
-
* @package Ninja Forms builder
|
9442 |
-
* @subpackage Main App
|
9443 |
-
* @copyright (c) 2015 WP Ninjas
|
9444 |
-
* @since 3.0
|
9445 |
-
*/
|
9446 |
-
define( 'controllers/app/settingColor',[], function() {
|
9447 |
-
var controller = Marionette.Object.extend( {
|
9448 |
-
initialize: function() {
|
9449 |
-
// We don't want to re-render this setting type when the data changes.
|
9450 |
-
nfRadio.channel( 'setting-type-color' ).reply( 'renderOnChange', this.setRenderFalse );
|
9451 |
-
// We want to close any color pickers before we close our styling tab or drawer.
|
9452 |
-
this.listenTo( nfRadio.channel( 'setting-type-color' ), 'destroy:setting', this.closeColorPickers );
|
9453 |
-
|
9454 |
-
// The first time settingModel and the dataModel meet.
|
9455 |
-
this.listenTo( nfRadio.channel( 'setting-type-color' ), 'render:setting', this.initColorPicker );
|
9456 |
-
},
|
9457 |
-
|
9458 |
-
initColorPicker: function( settingModel, dataModel, view ) {
|
9459 |
-
|
9460 |
-
var name = settingModel.get( 'name' );
|
9461 |
-
var el = jQuery( view.el ).find( 'input' );
|
9462 |
-
|
9463 |
-
jQuery( el ).wpColorPicker( {
|
9464 |
-
change: function( event, ui ){
|
9465 |
-
nfRadio.channel( 'app' ).request( 'change:setting', event, settingModel, dataModel, ui.color.toString() );
|
9466 |
-
}
|
9467 |
-
} );
|
9468 |
-
},
|
9469 |
-
|
9470 |
-
setRenderFalse: function() {
|
9471 |
-
return false;
|
9472 |
-
},
|
9473 |
-
|
9474 |
-
closeColorPickers: function( settingModel, dataModel, view ) {
|
9475 |
-
jQuery( view.el ).find( '.wp-color-picker' ).wpColorPicker( 'close' );
|
9476 |
-
}
|
9477 |
-
});
|
9478 |
-
|
9479 |
-
return controller;
|
9480 |
-
} );
|
9481 |
-
/**
|
9482 |
-
* Listens to our app channel for the app to start.
|
9483 |
-
*
|
9484 |
-
* If the form is a new form, then highlight the Add New submenu item.
|
9485 |
-
* Otherwise, append an Edit Form submenu for context.
|
9486 |
-
*
|
9487 |
-
* @package Ninja Forms builder
|
9488 |
-
* @subpackage Main App
|
9489 |
-
* @copyright (c) 2016 WP Ninjas
|
9490 |
-
* @since 3.0
|
9491 |
-
*/
|
9492 |
-
define( 'controllers/app/changeMenu',[], function() {
|
9493 |
-
var controller = Marionette.Object.extend({
|
9494 |
-
|
9495 |
-
editFormText: '',
|
9496 |
-
|
9497 |
-
initialize: function () {
|
9498 |
-
this.editFormText = nfAdmin.editFormText || 'Edit Form';
|
9499 |
-
this.listenTo(nfRadio.channel('app'), 'after:appStart', this.changeMenu);
|
9500 |
-
this.listenTo( nfRadio.channel( 'app' ), 'response:updateDB', this.formPublish );
|
9501 |
-
},
|
9502 |
-
|
9503 |
-
changeMenu: function () {
|
9504 |
-
var form = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
9505 |
-
|
9506 |
-
if ( this.isNewForm( form.id ) ) {
|
9507 |
-
this.highlightAddNew();
|
9508 |
-
} else {
|
9509 |
-
this.appendEditForm();
|
9510 |
-
}
|
9511 |
-
},
|
9512 |
-
|
9513 |
-
isNewForm: function( form_id ) {
|
9514 |
-
return isNaN( form_id );
|
9515 |
-
},
|
9516 |
-
|
9517 |
-
highlightAddNew: function() {
|
9518 |
-
jQuery( '.wp-submenu li' ).removeClass( 'current' );
|
9519 |
-
jQuery( 'a[href="admin.php?page=ninja-forms&form_id=new"]' ).parent().addClass( 'current' );
|
9520 |
-
},
|
9521 |
-
|
9522 |
-
/**
|
9523 |
-
* Append 'Edit Form'
|
9524 |
-
* When editing a form, add an 'Edit Form' submenu item to
|
9525 |
-
* the WordPress Admin Dashboard menu, specifically under
|
9526 |
-
* the Ninja Forms Menu Item and after the 'Add New' item.
|
9527 |
-
*/
|
9528 |
-
appendEditForm: function() {
|
9529 |
-
// Singleton check. Only add this menu item one time.
|
9530 |
-
if ( jQuery( 'li a:contains("' + this.editFormText + '")' ).length > 0 ) return;
|
9531 |
-
|
9532 |
-
var editFormLinkText, editFormLink, editFormListItem;
|
9533 |
-
|
9534 |
-
// Create the 'Edit Form' submenu item.
|
9535 |
-
editFormLinkText = document.createTextNode(this.editFormText);
|
9536 |
-
editFormLink = document.createElement("a");
|
9537 |
-
editFormLink.appendChild(editFormLinkText);
|
9538 |
-
|
9539 |
-
editFormListItem = document.createElement("li");
|
9540 |
-
editFormListItem.appendChild(editFormLink);
|
9541 |
-
editFormListItem.classList.add("current");
|
9542 |
-
|
9543 |
-
// Remove the `current` class from any existing list items.
|
9544 |
-
jQuery( '.wp-submenu li' ).removeClass( 'current' );
|
9545 |
-
|
9546 |
-
// Insert the 'Edit Form' item after the 'Add New' item;
|
9547 |
-
jQuery( 'a[href="admin.php?page=ninja-forms#new-form"]' ).parent().after( editFormListItem );
|
9548 |
-
},
|
9549 |
-
|
9550 |
-
formPublish: function( response ) {
|
9551 |
-
if ( 'publish' !== response.action ) return false;
|
9552 |
-
this.changeMenu();
|
9553 |
-
}
|
9554 |
-
});
|
9555 |
-
|
9556 |
-
return controller;
|
9557 |
-
});
|
9558 |
-
|
9559 |
-
/**
|
9560 |
-
* When we click on a domain link, close the mobile menu.
|
9561 |
-
*
|
9562 |
-
* @package Ninja Forms builder
|
9563 |
-
* @subpackage Main App
|
9564 |
-
* @copyright (c) 2015 WP Ninjas
|
9565 |
-
* @since 3.0
|
9566 |
-
*/
|
9567 |
-
define( 'controllers/app/mobile',[], function() {
|
9568 |
-
var controller = Marionette.Object.extend( {
|
9569 |
-
initialize: function() {
|
9570 |
-
// Listen for clicks on our app menu.
|
9571 |
-
this.listenTo( nfRadio.channel( 'app' ), 'click:menu', this.closeMobileMenu );
|
9572 |
-
},
|
9573 |
-
|
9574 |
-
closeMobileMenu: function() {
|
9575 |
-
var builderEl = nfRadio.channel( 'app' ).request( 'get:builderEl' );
|
9576 |
-
jQuery( builderEl ).removeClass( 'nf-menu-expand' );
|
9577 |
-
}
|
9578 |
-
|
9579 |
-
});
|
9580 |
-
|
9581 |
-
return controller;
|
9582 |
-
} );
|
9583 |
-
/**
|
9584 |
-
* Add a jBox notice to the screen.
|
9585 |
-
*
|
9586 |
-
* @package Ninja Forms builder
|
9587 |
-
* @subpackage Main App
|
9588 |
-
* @copyright (c) 2015 WP Ninjas
|
9589 |
-
* @since 3.0
|
9590 |
-
*/
|
9591 |
-
define( 'controllers/app/notices',[], function() {
|
9592 |
-
var controller = Marionette.Object.extend( {
|
9593 |
-
initialize: function() {
|
9594 |
-
nfRadio.channel( 'notices' ).reply( 'add', this.addNotice, this );
|
9595 |
-
nfRadio.channel( 'notices' ).reply( 'close', this.closeNotice, this );
|
9596 |
-
this.notices = {};
|
9597 |
-
},
|
9598 |
-
|
9599 |
-
addNotice: function( key, msg, options ) {
|
9600 |
-
|
9601 |
-
var appDefaults = {
|
9602 |
-
content: msg,
|
9603 |
-
color: 'green',
|
9604 |
-
zIndex:10000000,
|
9605 |
-
constructOnInit: true,
|
9606 |
-
stack: true,
|
9607 |
-
animation: {
|
9608 |
-
open: 'flip',
|
9609 |
-
close: 'flip'
|
9610 |
-
}
|
9611 |
-
};
|
9612 |
-
|
9613 |
-
var mobileDefaults = {
|
9614 |
-
position: {
|
9615 |
-
x: 'center',
|
9616 |
-
y: 'top'
|
9617 |
-
},
|
9618 |
-
animation: {
|
9619 |
-
open:'slide:top',
|
9620 |
-
close:'slide:left'
|
9621 |
-
},
|
9622 |
-
autoClose: 2000,
|
9623 |
-
offset: {
|
9624 |
-
x: 0,
|
9625 |
-
y: 55
|
9626 |
-
}
|
9627 |
-
};
|
9628 |
-
|
9629 |
-
var desktopDefaults = {
|
9630 |
-
attributes: {
|
9631 |
-
x: 'left',
|
9632 |
-
y: 'bottom'
|
9633 |
-
},
|
9634 |
-
autoClose: 4000
|
9635 |
-
};
|
9636 |
-
|
9637 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
9638 |
-
var defaults = mobileDefaults;
|
9639 |
-
} else {
|
9640 |
-
var defaults = desktopDefaults;
|
9641 |
-
}
|
9642 |
-
defaults = jQuery.extend( defaults, appDefaults );
|
9643 |
-
|
9644 |
-
var options = jQuery.extend( defaults, options );
|
9645 |
-
// console.log( options );
|
9646 |
-
this.notices[ key ] = new jBox( 'Notice', options );
|
9647 |
-
},
|
9648 |
-
|
9649 |
-
closeNotice: function( key ) {
|
9650 |
-
if ( 'undefined' != typeof this.notices[ key ] ) {
|
9651 |
-
this.notices[ key ].close();
|
9652 |
-
}
|
9653 |
-
},
|
9654 |
-
|
9655 |
-
openNotice: function( key ) {
|
9656 |
-
if ( 'undefined' != typeof this.notices[ key ] ) {
|
9657 |
-
this.notices[ key ].open();
|
9658 |
-
}
|
9659 |
-
}
|
9660 |
-
|
9661 |
-
});
|
9662 |
-
|
9663 |
-
return controller;
|
9664 |
-
} );
|
9665 |
-
/**
|
9666 |
-
* Prompt the user to save if they attempt to leave the page with unsaved changes.
|
9667 |
-
*
|
9668 |
-
* @package Ninja Forms builder
|
9669 |
-
* @subpackage Main App
|
9670 |
-
* @copyright (c) 2016 WP Ninjas
|
9671 |
-
* @since 3.0
|
9672 |
-
*/
|
9673 |
-
define( 'controllers/app/unloadCheck',[], function() {
|
9674 |
-
var controller = Marionette.Object.extend( {
|
9675 |
-
initialize: function() {
|
9676 |
-
jQuery( window ).bind( 'beforeunload', this.maybePrompt );
|
9677 |
-
},
|
9678 |
-
|
9679 |
-
maybePrompt: function( model ) {
|
9680 |
-
// If our app is clean, don't show a warning.
|
9681 |
-
if ( ! nfRadio.channel( 'app' ).request( 'get:setting', 'clean' ) ) {
|
9682 |
-
return 'You have unsaved changes.';
|
9683 |
-
}
|
9684 |
-
}
|
9685 |
-
|
9686 |
-
});
|
9687 |
-
|
9688 |
-
return controller;
|
9689 |
-
} );
|
9690 |
-
/**
|
9691 |
-
* Before we save data to the database (on preview update or publish), we check to see if we have anyone
|
9692 |
-
* that wants to update the 'formContent' form setting. This setting is used on the front-end to allow
|
9693 |
-
* for custom display of form fields. i.e. layout rows.
|
9694 |
-
*
|
9695 |
-
* @package Ninja Forms builder
|
9696 |
-
* @subpackage Main App
|
9697 |
-
* @copyright (c) 2015 WP Ninjas
|
9698 |
-
* @since 3.0
|
9699 |
-
*/
|
9700 |
-
define( 'controllers/app/formContentFilters',[], function() {
|
9701 |
-
var controller = Marionette.Object.extend( {
|
9702 |
-
initialize: function() {
|
9703 |
-
/*
|
9704 |
-
* Init our formContent view filter array.
|
9705 |
-
*/
|
9706 |
-
this.viewFilters = [];
|
9707 |
-
this.saveFilters = [];
|
9708 |
-
this.loadFilters = [];
|
9709 |
-
|
9710 |
-
/*
|
9711 |
-
* Listen for requests to add formContent filters.
|
9712 |
-
*/
|
9713 |
-
|
9714 |
-
nfRadio.channel( 'formContent' ).reply( 'add:viewFilter', this.addViewFilter, this );
|
9715 |
-
nfRadio.channel( 'formContent' ).reply( 'add:saveFilter', this.addSaveFilter, this );
|
9716 |
-
nfRadio.channel( 'formContent' ).reply( 'add:loadFilter', this.addLoadFilter, this );
|
9717 |
-
|
9718 |
-
/*
|
9719 |
-
* Listen for requests to get our formContent filters.
|
9720 |
-
*/
|
9721 |
-
nfRadio.channel( 'formContent' ).reply( 'get:viewFilters', this.getViewFilters, this );
|
9722 |
-
nfRadio.channel( 'formContent' ).reply( 'get:saveFilters', this.getSaveFilters, this );
|
9723 |
-
nfRadio.channel( 'formContent' ).reply( 'get:loadFilters', this.getLoadFilters, this );
|
9724 |
-
|
9725 |
-
/*
|
9726 |
-
* -- DEPRECATED RADIO REPLIES --
|
9727 |
-
*
|
9728 |
-
* The 'fieldContents' channel has been deprecated as of 3.0 (it was present in the RC) in favour of 'formContent'.
|
9729 |
-
* Listen for requests to add new fieldContent filters.
|
9730 |
-
*
|
9731 |
-
* TODO: These radio listeners on the 'fieldContents' channels are here for backwards compatibility and should be removed eventually.
|
9732 |
-
*/
|
9733 |
-
|
9734 |
-
nfRadio.channel( 'fieldContents' ).reply( 'add:viewFilter', this.addViewFilter, this );
|
9735 |
-
nfRadio.channel( 'fieldContents' ).reply( 'add:saveFilter', this.addSaveFilter, this );
|
9736 |
-
nfRadio.channel( 'fieldContents' ).reply( 'add:loadFilter', this.addLoadFilter, this );
|
9737 |
-
|
9738 |
-
/*
|
9739 |
-
* Listen for requests to get our fieldContent filters.
|
9740 |
-
*/
|
9741 |
-
nfRadio.channel( 'fieldContents' ).reply( 'get:viewFilters', this.getViewFilters, this );
|
9742 |
-
nfRadio.channel( 'fieldContents' ).reply( 'get:saveFilters', this.getSaveFilters, this );
|
9743 |
-
nfRadio.channel( 'fieldContents' ).reply( 'get:loadFilters', this.getLoadFilters, this );
|
9744 |
-
|
9745 |
-
/*
|
9746 |
-
* -- END DEPRECATED --
|
9747 |
-
*/
|
9748 |
-
},
|
9749 |
-
|
9750 |
-
addViewFilter: function( callback, priority ) {
|
9751 |
-
this.viewFilters[ priority ] = callback;
|
9752 |
-
},
|
9753 |
-
|
9754 |
-
getViewFilters: function() {
|
9755 |
-
return this.viewFilters;
|
9756 |
-
},
|
9757 |
-
|
9758 |
-
addSaveFilter: function( callback, priority ) {
|
9759 |
-
this.saveFilters[ priority ] = callback;
|
9760 |
-
},
|
9761 |
-
|
9762 |
-
getSaveFilters: function() {
|
9763 |
-
return this.saveFilters;
|
9764 |
-
},
|
9765 |
-
|
9766 |
-
addLoadFilter: function( callback, priority ) {
|
9767 |
-
this.loadFilters[ priority ] = callback;
|
9768 |
-
},
|
9769 |
-
|
9770 |
-
getLoadFilters: function() {
|
9771 |
-
return this.loadFilters;
|
9772 |
-
}
|
9773 |
-
|
9774 |
-
});
|
9775 |
-
|
9776 |
-
return controller;
|
9777 |
-
} );
|
9778 |
-
/**
|
9779 |
-
* Handles filters for our main content gutter views.
|
9780 |
-
*
|
9781 |
-
* @package Ninja Forms builder
|
9782 |
-
* @subpackage Main App
|
9783 |
-
* @copyright (c) 2015 WP Ninjas
|
9784 |
-
* @since 3.0
|
9785 |
-
*/
|
9786 |
-
define( 'controllers/app/formContentGutterFilters',[], function() {
|
9787 |
-
var controller = Marionette.Object.extend( {
|
9788 |
-
initialize: function() {
|
9789 |
-
/*
|
9790 |
-
* Init our gutter view filter array.
|
9791 |
-
*/
|
9792 |
-
this.leftFilters = [];
|
9793 |
-
this.rightFilters = [];
|
9794 |
-
/*
|
9795 |
-
* Listen for requests to add gutter filters.
|
9796 |
-
*/
|
9797 |
-
nfRadio.channel( 'formContentGutters' ).reply( 'add:leftFilter', this.addLeftFilter, this );
|
9798 |
-
nfRadio.channel( 'formContentGutters' ).reply( 'add:rightFilter', this.addRightFilter, this );
|
9799 |
-
|
9800 |
-
/*
|
9801 |
-
* Listen for requests to get our content gutter filters.
|
9802 |
-
*/
|
9803 |
-
nfRadio.channel( 'formContentGutters' ).reply( 'get:leftFilters', this.getLeftFilters, this );
|
9804 |
-
nfRadio.channel( 'formContentGutters' ).reply( 'get:rightFilters', this.getRightFilters, this );
|
9805 |
-
},
|
9806 |
-
|
9807 |
-
addLeftFilter: function( callback, priority ) {
|
9808 |
-
this.leftFilters[ priority ] = callback;
|
9809 |
-
},
|
9810 |
-
|
9811 |
-
addRightFilter: function( callback, priority ) {
|
9812 |
-
this.rightFilters[ priority ] = callback;
|
9813 |
-
},
|
9814 |
-
|
9815 |
-
getLeftFilters: function() {
|
9816 |
-
return this.leftFilters;
|
9817 |
-
},
|
9818 |
-
|
9819 |
-
getRightFilters: function() {
|
9820 |
-
return this.rightFilters;
|
9821 |
-
}
|
9822 |
-
|
9823 |
-
});
|
9824 |
-
|
9825 |
-
return controller;
|
9826 |
-
} );
|
9827 |
-
/**
|
9828 |
-
* Returns a clone of a backbone collection with all the models' attributes looped through so that collections contained within are propely cloned.
|
9829 |
-
*
|
9830 |
-
* @package Ninja Forms builder
|
9831 |
-
* @subpackage Main App
|
9832 |
-
* @copyright (c) 2015 WP Ninjas
|
9833 |
-
* @since 3.0
|
9834 |
-
*/
|
9835 |
-
define( 'controllers/app/cloneCollectionDeep',[], function() {
|
9836 |
-
var controller = Marionette.Object.extend( {
|
9837 |
-
initialize: function() {
|
9838 |
-
nfRadio.channel( 'app' ).reply( 'clone:collectionDeep', this.cloneCollectionDeep, this );
|
9839 |
-
},
|
9840 |
-
|
9841 |
-
cloneCollectionDeep: function( collection ) {
|
9842 |
-
var models = [];
|
9843 |
-
// Loop through every model in our collection, clone it, and add it to our model array
|
9844 |
-
_.each( collection.models, function( model ) {
|
9845 |
-
var newModel = nfRadio.channel( 'app' ).request( 'clone:modelDeep', model );
|
9846 |
-
models.push( newModel );
|
9847 |
-
} );
|
9848 |
-
// Create a new instance of our collection
|
9849 |
-
return new collection.constructor( models, collection.options );
|
9850 |
-
}
|
9851 |
-
});
|
9852 |
-
|
9853 |
-
return controller;
|
9854 |
-
} );
|
9855 |
-
/**
|
9856 |
-
* Tracks which keys have been pressed.
|
9857 |
-
* Currently only used by fields to see if they should duplicate or delete on click.
|
9858 |
-
* (Shift + D + click = delete) (Shift + C + click = duplicate)
|
9859 |
-
*
|
9860 |
-
* @package Ninja Forms builder
|
9861 |
-
* @subpackage Fields - Edit Field Drawer
|
9862 |
-
* @copyright (c) 2015 WP Ninjas
|
9863 |
-
* @since 3.0
|
9864 |
-
*/
|
9865 |
-
define( 'controllers/app/trackKeyDown',[], function() {
|
9866 |
-
var controller = Marionette.Object.extend( {
|
9867 |
-
keys: [],
|
9868 |
-
|
9869 |
-
initialize: function() {
|
9870 |
-
var that = this;
|
9871 |
-
/*
|
9872 |
-
* Track keydowns and store the keys pressed.
|
9873 |
-
*/
|
9874 |
-
|
9875 |
-
jQuery( document ).on( 'keydown', function( e ) {
|
9876 |
-
that.keyDown( e, that );
|
9877 |
-
} );
|
9878 |
-
|
9879 |
-
jQuery( document ).on( 'keyup', function( e ) {
|
9880 |
-
that.keyUp( e, that );
|
9881 |
-
} );
|
9882 |
-
|
9883 |
-
/*
|
9884 |
-
* Get the keys currently being pressed, if any
|
9885 |
-
*/
|
9886 |
-
nfRadio.channel( 'app' ).reply( 'get:keydown', this.getKeyDown, this );
|
9887 |
-
},
|
9888 |
-
|
9889 |
-
keyDown: function( e, context ) {
|
9890 |
-
/*
|
9891 |
-
* Add our keycode to our keys array.
|
9892 |
-
*/
|
9893 |
-
context.keys[ e.keyCode ] = e.keyCode;
|
9894 |
-
},
|
9895 |
-
|
9896 |
-
keyUp: function( e, context ) {
|
9897 |
-
/*
|
9898 |
-
* Remove our keycode from our keys array.
|
9899 |
-
*/
|
9900 |
-
if ( -1 != context.keys.indexOf( e.keyCode ) ) {
|
9901 |
-
delete context.keys[ e.keyCode ];
|
9902 |
-
}
|
9903 |
-
},
|
9904 |
-
|
9905 |
-
getKeyDown: function() {
|
9906 |
-
return this.keys;
|
9907 |
-
}
|
9908 |
-
});
|
9909 |
-
|
9910 |
-
return controller;
|
9911 |
-
} );
|
9912 |
-
/**
|
9913 |
-
* Initialize the perfectscroll jQuery plugin
|
9914 |
-
*
|
9915 |
-
* @package Ninja Forms builder
|
9916 |
-
* @subpackage Main App
|
9917 |
-
* @copyright (c) 2015 WP Ninjas
|
9918 |
-
* @since 3.0
|
9919 |
-
*/
|
9920 |
-
define( 'controllers/app/perfectScroll',[], function() {
|
9921 |
-
var controller = Marionette.Object.extend( {
|
9922 |
-
movedPos: false,
|
9923 |
-
|
9924 |
-
initialize: function() {
|
9925 |
-
/*
|
9926 |
-
* When we init the main view, init our perfectscroll
|
9927 |
-
*/
|
9928 |
-
this.listenTo( nfRadio.channel( 'main' ), 'show:main', this.initPerfectScroll );
|
9929 |
-
|
9930 |
-
/*
|
9931 |
-
* When our drawer opens and closes, change the position of our scroll rail.
|
9932 |
-
*/
|
9933 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'opened', this.moveRail );
|
9934 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'before:closeDrawer', this.resetRail );
|
9935 |
-
},
|
9936 |
-
|
9937 |
-
initPerfectScroll: function( view ) {
|
9938 |
-
if ( ! nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
9939 |
-
jQuery( view.el ).parent().perfectScrollbar( {
|
9940 |
-
suppressScrollX: true
|
9941 |
-
} );
|
9942 |
-
}
|
9943 |
-
|
9944 |
-
jQuery( 'head' ).append( '<style id="ps-scrollbar-css" type="text/css"></style>' );
|
9945 |
-
},
|
9946 |
-
|
9947 |
-
moveRail: function() {
|
9948 |
-
var drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
9949 |
-
var movedPos = jQuery( drawerEl ).outerWidth();
|
9950 |
-
|
9951 |
-
jQuery( '#ps-scrollbar-css' ).text( '.ps-scrollbar-moved { right: ' + movedPos + 'px !important; } ' );
|
9952 |
-
jQuery( '#nf-main .ps-scrollbar-y-rail' ).addClass( 'ps-scrollbar-moved ' );
|
9953 |
-
|
9954 |
-
},
|
9955 |
-
|
9956 |
-
resetRail: function() {
|
9957 |
-
jQuery( '.ps-scrollbar-y-rail' ).removeClass( 'ps-scrollbar-moved ' );
|
9958 |
-
}
|
9959 |
-
|
9960 |
-
});
|
9961 |
-
|
9962 |
-
return controller;
|
9963 |
-
} );
|
9964 |
-
/**
|
9965 |
-
* Returns a new setting group collection.
|
9966 |
-
* Used to settings drawers for custom data models (i.e. not fields, actions, or advanced)
|
9967 |
-
*
|
9968 |
-
* @package Ninja Forms builder
|
9969 |
-
* @subpackage App - Edit Settings Drawer
|
9970 |
-
* @copyright (c) 2016 WP Ninjas
|
9971 |
-
* @since 3.0
|
9972 |
-
*/
|
9973 |
-
define( 'controllers/app/getNewSettingGroupCollection',[ 'models/app/settingGroupCollection' ], function( SettingGroupCollection ) {
|
9974 |
-
var controller = Marionette.Object.extend( {
|
9975 |
-
initialize: function() {
|
9976 |
-
// Respond to requests for a new setting group collection
|
9977 |
-
nfRadio.channel( 'app' ).reply( 'get:settingGroupCollectionDefinition', this.getNewSettingGroupCollection, this );
|
9978 |
-
},
|
9979 |
-
|
9980 |
-
/**
|
9981 |
-
* Return a new instance of the setting group collection.
|
9982 |
-
*
|
9983 |
-
* @since 3.0
|
9984 |
-
* @return backbone.collection
|
9985 |
-
*/
|
9986 |
-
getNewSettingGroupCollection: function() {
|
9987 |
-
return SettingGroupCollection;
|
9988 |
-
}
|
9989 |
-
|
9990 |
-
});
|
9991 |
-
|
9992 |
-
return controller;
|
9993 |
-
} );
|
9994 |
-
/**
|
9995 |
-
*
|
9996 |
-
* @package Ninja Forms builder
|
9997 |
-
* @subpackage Main App
|
9998 |
-
* @copyright (c) 2017 WP Ninjas
|
9999 |
-
* @since 3.0.30
|
10000 |
-
*/
|
10001 |
-
define( 'controllers/app/settingMedia',[], function() {
|
10002 |
-
var controller = Marionette.Object.extend( {
|
10003 |
-
initialize: function() {
|
10004 |
-
// When the media button is clicked, open the media manager.
|
10005 |
-
this.listenTo( nfRadio.channel( 'setting-type-media' ), 'click:extra', this.clickExtra );
|
10006 |
-
},
|
10007 |
-
|
10008 |
-
clickExtra: function( e, settingModel, dataModel, settingView ) {
|
10009 |
-
var textEl = jQuery( e.target ).parent().find( '.setting' );
|
10010 |
-
|
10011 |
-
if ( jQuery( e.target ).hasClass( 'open-media-manager' ) ) {
|
10012 |
-
// If the frame already exists, re-open it.
|
10013 |
-
if ( this.meta_image_frame ) {
|
10014 |
-
this.meta_image_frame.open();
|
10015 |
-
return;
|
10016 |
-
}
|
10017 |
-
|
10018 |
-
// Sets up the media library frame
|
10019 |
-
this.meta_image_frame = wp.media.frames.meta_image_frame = wp.media({
|
10020 |
-
title: 'Select a file',
|
10021 |
-
button: { text: 'insert' }
|
10022 |
-
});
|
10023 |
-
|
10024 |
-
var that = this;
|
10025 |
-
|
10026 |
-
// Runs when an image is selected.
|
10027 |
-
this.meta_image_frame.on('select', function(){
|
10028 |
-
// Grabs the attachment selection and creates a JSON representation of the model.
|
10029 |
-
var media_attachment = that.meta_image_frame.state().get('selection').first().toJSON();
|
10030 |
-
textEl.val( media_attachment.url ).change();
|
10031 |
-
});
|
10032 |
-
|
10033 |
-
// Opens the media library frame.
|
10034 |
-
this.meta_image_frame.open();
|
10035 |
-
}
|
10036 |
-
},
|
10037 |
-
});
|
10038 |
-
|
10039 |
-
return controller;
|
10040 |
-
} );
|
10041 |
-
/**
|
10042 |
-
* Handles changing our public link when we request a new one or when it's set improperly.
|
10043 |
-
*
|
10044 |
-
* @package Ninja Forms builder
|
10045 |
-
* @subpackage Fields
|
10046 |
-
* @copyright (c) 2019 WP Ninjas
|
10047 |
-
* @since UPDATE_VERSION_ON_MERGE
|
10048 |
-
*/
|
10049 |
-
define( 'controllers/app/publicLink',[], function() {
|
10050 |
-
var controller = Marionette.Object.extend( {
|
10051 |
-
initialize: function() {
|
10052 |
-
this.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.validatePublicLink, this );
|
10053 |
-
nfRadio.channel( 'app' ).reply( 'generate:publicLinkKey', this.newPublicLinkKey, this );
|
10054 |
-
},
|
10055 |
-
|
10056 |
-
newPublicLinkKey: function() {
|
10057 |
-
var formSettingsDataModel = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
10058 |
-
var public_link_key = nfRadio.channel('app').request('get:formModel').get('id');
|
10059 |
-
for (var i = 0; i < 4; i++) {
|
10060 |
-
var char = Math.random().toString(36).slice(-1);
|
10061 |
-
public_link_key += char;
|
10062 |
-
};
|
10063 |
-
// Apply the public link key to form settings
|
10064 |
-
formSettingsDataModel.set('public_link_key', public_link_key);
|
10065 |
-
return public_link_key;
|
10066 |
-
},
|
10067 |
-
|
10068 |
-
validatePublicLink: function() {
|
10069 |
-
var formID = nfRadio.channel('app').request('get:formModel').get('id');
|
10070 |
-
var formSettingsDataModel = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
10071 |
-
if ( 'undefined' === typeof formSettingsDataModel.get('public_link_key') ) return false;
|
10072 |
-
if ( 0 === formSettingsDataModel.get( 'public_link_key' ).indexOf( formID ) ) return false;
|
10073 |
-
var public_link_key = this.newPublicLinkKey();
|
10074 |
-
var publicLink = nfAdmin.publicLinkStructure.replace('[FORM_ID]', public_link_key);
|
10075 |
-
formSettingsDataModel.set('public_link', publicLink);
|
10076 |
-
}
|
10077 |
-
|
10078 |
-
});
|
10079 |
-
|
10080 |
-
return controller;
|
10081 |
-
} );
|
10082 |
-
/**
|
10083 |
-
* Model that represents our field type section on the add new field drawer.
|
10084 |
-
*
|
10085 |
-
* @package Ninja Forms builder
|
10086 |
-
* @subpackage Fields
|
10087 |
-
* @copyright (c) 2015 WP Ninjas
|
10088 |
-
* @since 3.0
|
10089 |
-
*/
|
10090 |
-
define( 'models/fields/typeSectionModel',[], function() {
|
10091 |
-
var model = Backbone.Model.extend( {
|
10092 |
-
defaults: {
|
10093 |
-
classes: ''
|
10094 |
-
}
|
10095 |
-
} );
|
10096 |
-
|
10097 |
-
return model;
|
10098 |
-
} );
|
10099 |
-
/**
|
10100 |
-
* Collection that holds our field models.
|
10101 |
-
*
|
10102 |
-
* @package Ninja Forms builder
|
10103 |
-
* @subpackage Fields
|
10104 |
-
* @copyright (c) 2015 WP Ninjas
|
10105 |
-
* @since 3.0
|
10106 |
-
*/
|
10107 |
-
define( 'models/fields/typeSectionCollection',['models/fields/typeSectionModel'], function( typeSectionModel ) {
|
10108 |
-
var collection = Backbone.Collection.extend( {
|
10109 |
-
model: typeSectionModel
|
10110 |
-
} );
|
10111 |
-
return collection;
|
10112 |
-
} );
|
10113 |
-
/**
|
10114 |
-
* Creates and stores a collection of field types. This includes all of the settings shown when editing a field.
|
10115 |
-
*
|
10116 |
-
* 1) Create our settings sections config
|
10117 |
-
* 2) Loops over our preloaded data and adds that to our field type collection
|
10118 |
-
*
|
10119 |
-
* Also responds to requests for data about field types
|
10120 |
-
*
|
10121 |
-
* @package Ninja Forms builder
|
10122 |
-
* @subpackage Fields
|
10123 |
-
* @copyright (c) 2015 WP Ninjas
|
10124 |
-
* @since 3.0
|
10125 |
-
*/
|
10126 |
-
define( 'controllers/fields/types',[
|
10127 |
-
'models/app/typeCollection',
|
10128 |
-
'models/fields/typeSectionCollection'
|
10129 |
-
],
|
10130 |
-
function(
|
10131 |
-
TypeCollection,
|
10132 |
-
SectionCollection
|
10133 |
-
) {
|
10134 |
-
var controller = Marionette.Object.extend( {
|
10135 |
-
initialize: function() {
|
10136 |
-
// Config for our settings sections
|
10137 |
-
this.sections = new SectionCollection( fieldTypeSections );
|
10138 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'init:typeModel', this.registerSection );
|
10139 |
-
|
10140 |
-
// Create our field type collection
|
10141 |
-
this.collection = new TypeCollection( fieldTypeData, { type: 'fields' } );
|
10142 |
-
|
10143 |
-
// Respond to requests to get field type, collection, settings, and sections
|
10144 |
-
nfRadio.channel( 'fields' ).reply( 'get:type', this.getFieldType, this );
|
10145 |
-
nfRadio.channel( 'fields' ).reply( 'get:typeCollection', this.getTypeCollection, this );
|
10146 |
-
nfRadio.channel( 'fields' ).reply( 'get:typeSections', this.getTypeSections, this );
|
10147 |
-
nfRadio.channel( 'fields' ).reply( 'get:savedFields', this.getSavedFields, this );
|
10148 |
-
|
10149 |
-
// Listen to clicks on field types
|
10150 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'click:fieldType', this.addField );
|
10151 |
-
},
|
10152 |
-
|
10153 |
-
registerSection: function( typeModel ) {
|
10154 |
-
if ( 'fields' != typeModel.collection.type || ! typeModel.get( 'section' ) ) return;
|
10155 |
-
|
10156 |
-
this.sections.get( typeModel.get( 'section' ) ).get( 'fieldTypes' ).push( typeModel.get( 'id' ) );
|
10157 |
-
},
|
10158 |
-
|
10159 |
-
/**
|
10160 |
-
* Return a field type by id
|
10161 |
-
*
|
10162 |
-
* @since 3.0
|
10163 |
-
* @param string id field type
|
10164 |
-
* @return backbone.model field type model
|
10165 |
-
*/
|
10166 |
-
getFieldType: function( id ) {
|
10167 |
-
return this.collection.get( id );
|
10168 |
-
},
|
10169 |
-
|
10170 |
-
/**
|
10171 |
-
* Return the entire field type collection
|
10172 |
-
*
|
10173 |
-
* @since 3.0
|
10174 |
-
* @param string id [description]
|
10175 |
-
* @return backbone.collection field type collection
|
10176 |
-
*/
|
10177 |
-
getTypeCollection: function( id ) {
|
10178 |
-
return this.collection;
|
10179 |
-
},
|
10180 |
-
|
10181 |
-
/**
|
10182 |
-
* Add a field type to our fields sortable when the field type button is clicked.
|
10183 |
-
*
|
10184 |
-
* @since 3.0
|
10185 |
-
* @param Object e event
|
10186 |
-
* @return void
|
10187 |
-
*/
|
10188 |
-
addField: function( e ) {
|
10189 |
-
var type = jQuery( e.target ).data( 'id' );
|
10190 |
-
|
10191 |
-
if( e.shiftKey ){
|
10192 |
-
nfRadio.channel( 'fields' ).request( 'add:stagedField', type );
|
10193 |
-
return;
|
10194 |
-
}
|
10195 |
-
|
10196 |
-
var fieldModel = nfRadio.channel( 'fields' ).request( 'add', {
|
10197 |
-
type: type,
|
10198 |
-
|
10199 |
-
label: nfRadio.channel( 'fields' ).request( 'get:type', type ).get( 'nicename' )
|
10200 |
-
});
|
10201 |
-
|
10202 |
-
console.log( fieldModel );
|
10203 |
-
|
10204 |
-
var label = {
|
10205 |
-
object: 'Field',
|
10206 |
-
label: fieldModel.get( 'label' ),
|
10207 |
-
change: 'Added',
|
10208 |
-
dashicon: 'plus-alt'
|
10209 |
-
};
|
10210 |
-
|
10211 |
-
var data = {
|
10212 |
-
collection: nfRadio.channel( 'fields' ).request( 'get:collection' )
|
10213 |
-
}
|
10214 |
-
|
10215 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addObject', fieldModel, null, label, data );
|
10216 |
-
|
10217 |
-
// Re-Draw the Field Collection
|
10218 |
-
nfRadio.channel( 'fields' ).request( 'redraw:collection' );
|
10219 |
-
},
|
10220 |
-
|
10221 |
-
/**
|
10222 |
-
* Return our field type settings sections
|
10223 |
-
*
|
10224 |
-
* @since 3.0
|
10225 |
-
* @return backbone.collection field type settings sections
|
10226 |
-
*/
|
10227 |
-
getTypeSections: function() {
|
10228 |
-
return this.sections;
|
10229 |
-
},
|
10230 |
-
|
10231 |
-
/**
|
10232 |
-
* Return our saved fields
|
10233 |
-
*
|
10234 |
-
* @since 3.0
|
10235 |
-
* @return backbone.collection
|
10236 |
-
*/
|
10237 |
-
getSavedFields: function() {
|
10238 |
-
this.sections.get( 'saved' );
|
10239 |
-
}
|
10240 |
-
});
|
10241 |
-
|
10242 |
-
return controller;
|
10243 |
-
} );
|
10244 |
-
|
10245 |
-
/**
|
10246 |
-
* Handles the logic for our field type draggables.
|
10247 |
-
*
|
10248 |
-
* @package Ninja Forms builder
|
10249 |
-
* @subpackage Fields - New Field Drawer
|
10250 |
-
* @copyright (c) 2015 WP Ninjas
|
10251 |
-
* @since 3.0
|
10252 |
-
*/
|
10253 |
-
define( 'controllers/fields/fieldTypeDrag',[], function( ) {
|
10254 |
-
var controller = Marionette.Object.extend( {
|
10255 |
-
initialize: function() {
|
10256 |
-
// Listen to our field type draggables and run the appropriate function.
|
10257 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:type', this.startDrag );
|
10258 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:type', this.stopDrag );
|
10259 |
-
/*
|
10260 |
-
* Respond to requests for our helper clone.
|
10261 |
-
* This is used by other parts of the application to modify what the user is dragging in real-time.
|
10262 |
-
*/
|
10263 |
-
nfRadio.channel( 'drawer-addField' ).reply( 'get:typeHelperClone', this.getCurrentDraggableHelperClone, this );
|
10264 |
-
},
|
10265 |
-
|
10266 |
-
/**
|
10267 |
-
* When we start dragging:
|
10268 |
-
* get our drawer element
|
10269 |
-
* set its overflow property to visible !important -> forces the type drag element to be on at the top of the z-index.
|
10270 |
-
* get our main element
|
10271 |
-
* est its overflow propery to visible !important -> forces the type drag element to be on top of the z-index.
|
10272 |
-
* set our dragging helper clone
|
10273 |
-
*
|
10274 |
-
* @since 3.0
|
10275 |
-
* @param object context This function is going to be called from a draggable. Context is the "this" reference to the draggable.
|
10276 |
-
* @param object ui Object sent by jQuery UI draggable.
|
10277 |
-
* @return void
|
10278 |
-
*/
|
10279 |
-
startDrag: function( context, ui ) {
|
10280 |
-
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
10281 |
-
this.mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
|
10282 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
|
10283 |
-
|
10284 |
-
this.draggableHelperClone = jQuery( ui.helper ).clone();
|
10285 |
-
|
10286 |
-
},
|
10287 |
-
|
10288 |
-
/**
|
10289 |
-
* When we stop dragging, reset our overflow property to hidden !important.
|
10290 |
-
*
|
10291 |
-
* @since 3.0
|
10292 |
-
* @param object context This function is going to be called from a draggable. Context is the "this" reference to the draggable.
|
10293 |
-
* @param object ui Object sent by jQuery UI draggable.
|
10294 |
-
* @return {[type]} [description]
|
10295 |
-
*/
|
10296 |
-
stopDrag: function( context, ui ) {
|
10297 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
|
10298 |
-
},
|
10299 |
-
|
10300 |
-
getCurrentDraggableHelperClone: function() {
|
10301 |
-
return this.draggableHelperClone;
|
10302 |
-
}
|
10303 |
-
});
|
10304 |
-
|
10305 |
-
return controller;
|
10306 |
-
} );
|
10307 |
-
/**
|
10308 |
-
* Handles the dragging of our field staging area
|
10309 |
-
*
|
10310 |
-
* @package Ninja Forms builder
|
10311 |
-
* @subpackage Fields - New Field Drawer
|
10312 |
-
* @copyright (c) 2015 WP Ninjas
|
10313 |
-
* @since 3.0
|
10314 |
-
*/
|
10315 |
-
define( 'controllers/fields/stagingDrag',[], function( ) {
|
10316 |
-
var controller = Marionette.Object.extend( {
|
10317 |
-
initialize: function() {
|
10318 |
-
// Listen for the start and stop of our field staging dragging
|
10319 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:fieldStaging', this.startDrag );
|
10320 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:fieldStaging', this.stopDrag );
|
10321 |
-
},
|
10322 |
-
|
10323 |
-
/**
|
10324 |
-
* When the user starts dragging the staging area, we have to:
|
10325 |
-
* set the overflow property of the drawer to visible !important. If we don't, the button goes underneath the main section.
|
10326 |
-
* set the overflow proerty of the main to visible !important. If we don't, the dragged element goes underneath the drawer.
|
10327 |
-
* replace our helper with the stacked "x fields" template.
|
10328 |
-
*
|
10329 |
-
* @since 3.0
|
10330 |
-
* @param Object context jQuery UI Draggable
|
10331 |
-
* @param Object ui jQuery UI element
|
10332 |
-
* @return void
|
10333 |
-
*/
|
10334 |
-
startDrag: function( context, ui ) {
|
10335 |
-
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
10336 |
-
this.mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
|
10337 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
|
10338 |
-
// jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
|
10339 |
-
|
10340 |
-
var stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );
|
10341 |
-
var html = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-staged-fields-drag' );
|
10342 |
-
jQuery( ui.helper ).html( html( { num: stagedFields.models.length } ) );
|
10343 |
-
jQuery( ui.helper ).prop( 'id', 'nf-staged-fields-drag' );
|
10344 |
-
jQuery( ui.item ).css( 'opacity', '0.7' );
|
10345 |
-
},
|
10346 |
-
|
10347 |
-
/**
|
10348 |
-
* When we stop dragging the staging area, we have to set the overflow property to hidden !important
|
10349 |
-
*
|
10350 |
-
* @since 3.0
|
10351 |
-
* @param Object context jQuery UI Draggable
|
10352 |
-
* @param Object ui jQuery UI element
|
10353 |
-
* @return void
|
10354 |
-
*/
|
10355 |
-
stopDrag: function( context, ui ) {
|
10356 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
|
10357 |
-
// jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
|
10358 |
-
}
|
10359 |
-
});
|
10360 |
-
|
10361 |
-
return controller;
|
10362 |
-
} );
|
10363 |
-
/**
|
10364 |
-
* Handles most things related to our staging area:
|
10365 |
-
* 1) Creates a collection
|
10366 |
-
* 2) Listens for requests to CRUD items from the collection
|
10367 |
-
* 3) Adds our staged fields to the fields sortable when the drawer is closed
|
10368 |
-
*
|
10369 |
-
* @package Ninja Forms builder
|
10370 |
-
* @subpackage Fields - New Field Drawer
|
10371 |
-
* @copyright (c) 2015 WP Ninjas
|
10372 |
-
* @since 3.0
|
10373 |
-
*/
|
10374 |
-
define( 'controllers/fields/staging',['models/fields/stagingCollection'], function( stagingCollection ) {
|
10375 |
-
var controller = Marionette.Object.extend( {
|
10376 |
-
initialize: function() {
|
10377 |
-
// Create our staged fields collection
|
10378 |
-
this.collection = new stagingCollection();
|
10379 |
-
// Respond to requests related to our staging area.
|
10380 |
-
nfRadio.channel( 'fields' ).reply( 'add:stagedField', this.addStagedField, this );
|
10381 |
-
nfRadio.channel( 'fields' ).reply( 'remove:stagedField', this.removeStagedField, this );
|
10382 |
-
nfRadio.channel( 'fields' ).reply( 'get:staging', this.getStagingCollection, this );
|
10383 |
-
nfRadio.channel( 'fields' ).reply( 'sort:staging', this.sortStagedFields, this );
|
10384 |
-
nfRadio.channel( 'fields' ).reply( 'clear:staging', this.clearStagedFields, this );
|
10385 |
-
// Listen to our remove staged field click event.
|
10386 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'click:removeStagedField', this.removeStagedField );
|
10387 |
-
// Listen to our event that fires just before a drawer is closed.
|
10388 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'before:closeDrawer', this.beforeCloseDrawer );
|
10389 |
-
},
|
10390 |
-
|
10391 |
-
getStagingCollection: function() {
|
10392 |
-
return this.collection;
|
10393 |
-
},
|
10394 |
-
|
10395 |
-
/**
|
10396 |
-
* Add a field to our staging area
|
10397 |
-
*
|
10398 |
-
* @since 3.0
|
10399 |
-
* @param string type Type of field we're adding
|
10400 |
-
* @return tmpID
|
10401 |
-
*/
|
10402 |
-
addStagedField: function( type, silent ) {
|
10403 |
-
var silent = silent || false;
|
10404 |
-
// Get our type model from the string.
|
10405 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
10406 |
-
// Our tmp ID is a string with the time appended to make it unique.
|
10407 |
-
var tmpID = 'nf-staged-field-' + jQuery.now();
|
10408 |
-
// Object that will be added to our staging collection.
|
10409 |
-
var data = {
|
10410 |
-
id: tmpID,
|
10411 |
-
// i.e. firstname, textbox, etc.
|
10412 |
-
slug: fieldType.get( 'type' ),
|
10413 |
-
// i.e. First Name, Textbox, etc.
|
10414 |
-
nicename: fieldType.get( 'nicename' ),
|
10415 |
-
// i.e. calendar, envelope, etc.
|
10416 |
-
icon: fieldType.get( 'icon' )
|
10417 |
-
}
|
10418 |
-
//
|
10419 |
-
var model = this.collection.add( data );
|
10420 |
-
|
10421 |
-
if( ! silent ) nfRadio.channel( 'fields').trigger( 'add:stagedField', model );
|
10422 |
-
|
10423 |
-
return tmpID;
|
10424 |
-
},
|
10425 |
-
|
10426 |
-
/**
|
10427 |
-
* Remove a field from staging
|
10428 |
-
*
|
10429 |
-
* @since 3.0
|
10430 |
-
* @param Object e Event
|
10431 |
-
* @param Backbone.model model staged field model to remove
|
10432 |
-
* @return void
|
10433 |
-
*/
|
10434 |
-
removeStagedField: function( e, model ) {
|
10435 |
-
this.collection.remove( model );
|
10436 |
-
nfRadio.channel( 'fields' ).trigger( 'remove:stagedField', model );
|
10437 |
-
},
|
10438 |
-
|
10439 |
-
/**
|
10440 |
-
* Adds our staged fields to the main fields sortable before the drawer is closed.
|
10441 |
-
*
|
10442 |
-
* @since 3.0
|
10443 |
-
* @return void
|
10444 |
-
*/
|
10445 |
-
beforeCloseDrawer: function() {
|
10446 |
-
if ( 0 != this.collection.models.length ) { // Make sure that we have models
|
10447 |
-
// Get our field collection.
|
10448 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
10449 |
-
|
10450 |
-
var fields = [];
|
10451 |
-
// Loop through our staging collection
|
10452 |
-
_.each( this.collection.models, function( model ) {
|
10453 |
-
// Get a tmp ID for our new field.
|
10454 |
-
var tmpID = nfRadio.channel( 'fields' ).request( 'get:tmpID' );
|
10455 |
-
// Create an object that can be added as a model.
|
10456 |
-
var tmpField = { id: tmpID, label: model.get( 'nicename' ), type: model.get( 'slug' ) };
|
10457 |
-
// Add our new field.
|
10458 |
-
var newModel = nfRadio.channel( 'fields' ).request( 'add', tmpField, false );
|
10459 |
-
// Add our field addition to our change log.
|
10460 |
-
var label = {
|
10461 |
-
object: 'Field',
|
10462 |
-
label: newModel.get( 'label' ),
|
10463 |
-
change: 'Added',
|
10464 |
-
dashicon: 'plus-alt'
|
10465 |
-
};
|
10466 |
-
var data = {
|
10467 |
-
collection: fieldCollection
|
10468 |
-
}
|
10469 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addObject', newModel, null, label, data );
|
10470 |
-
|
10471 |
-
} );
|
10472 |
-
// Trigger a reset on our field collection so that our view re-renders
|
10473 |
-
fieldCollection.trigger( 'reset', fieldCollection );
|
10474 |
-
// Empty the staging collection
|
10475 |
-
this.collection.reset();
|
10476 |
-
}
|
10477 |
-
// Sort our fields.
|
10478 |
-
nfRadio.channel( 'fields' ).request( 'sort:fields', null, null, false );
|
10479 |
-
},
|
10480 |
-
|
10481 |
-
/**
|
10482 |
-
* Sort our staging area by the 'order' attribute.
|
10483 |
-
*
|
10484 |
-
* @since 3.0
|
10485 |
-
* @return void
|
10486 |
-
*/
|
10487 |
-
sortStagedFields: function() {
|
10488 |
-
// Get our staged fields sortable.
|
10489 |
-
var sortableEl = nfRadio.channel( 'app' ).request( 'get:stagedFieldsEl' );
|
10490 |
-
// Get the current order using jQuery sortable. Will be an array of IDs: [tmp-blah, tmp-blah]
|
10491 |
-
var order = jQuery( sortableEl ).sortable( 'toArray' );
|
10492 |
-
// Loop through our models
|
10493 |
-
_.each( this.collection.models, function( field ) {
|
10494 |
-
// Search our order array for this field.
|
10495 |
-
var search = field.get( 'id' );
|
10496 |
-
var pos = order.indexOf( search );
|
10497 |
-
// Update our staged field model with the new order.
|
10498 |
-
field.set( 'order', pos );
|
10499 |
-
} );
|
10500 |
-
// Sort our staging collection.
|
10501 |
-
this.collection.sort();
|
10502 |
-
},
|
10503 |
-
|
10504 |
-
clearStagedFields: function() {
|
10505 |
-
this.collection.reset();
|
10506 |
-
}
|
10507 |
-
|
10508 |
-
});
|
10509 |
-
|
10510 |
-
return controller;
|
10511 |
-
} );
|
10512 |
-
/**
|
10513 |
-
* Handles actions related to our staged fields sortable.
|
10514 |
-
*
|
10515 |
-
* @package Ninja Forms builder
|
10516 |
-
* @subpackage Fields - New Field Drawer
|
10517 |
-
* @copyright (c) 2015 WP Ninjas
|
10518 |
-
* @since 3.0
|
10519 |
-
*/
|
10520 |
-
define( 'controllers/fields/stagingSortable',['models/fields/stagingCollection'], function( stagingCollection ) {
|
10521 |
-
var controller = Marionette.Object.extend( {
|
10522 |
-
initialize: function() {
|
10523 |
-
// Listen to our field type draggables
|
10524 |
-
// this.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:type', this.addActiveClass );
|
10525 |
-
// this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:type', this.removeActiveClass );
|
10526 |
-
// Listen to our sortable events
|
10527 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'receive:stagedFields', this.receiveStagedFields );
|
10528 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'over:stagedFields', this.overStagedFields );
|
10529 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'out:stagedFields', this.outStagedFields );
|
10530 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'start:stagedFields', this.startStagedFields );
|
10531 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stop:stagedFields', this.stopStagedFields );
|
10532 |
-
},
|
10533 |
-
|
10534 |
-
/**
|
10535 |
-
* Change our dropped field type helper so that it matches the other items in our sortable.
|
10536 |
-
*
|
10537 |
-
* @since 3.0
|
10538 |
-
* @param Object ui jQuery UI item
|
10539 |
-
* @return void
|
10540 |
-
*/
|
10541 |
-
receiveStagedFields: function( ui ) {
|
10542 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) {
|
10543 |
-
var type = jQuery( ui.item ).data( 'id' );
|
10544 |
-
var tmpID = nfRadio.channel( 'fields' ).request( 'add:stagedField', type );
|
10545 |
-
jQuery( ui.helper ).prop( 'id', tmpID );
|
10546 |
-
nfRadio.channel( 'fields' ).request( 'sort:staging' );
|
10547 |
-
jQuery( ui.helper ).remove();
|
10548 |
-
nfRadio.channel( 'drawer-addField' ).trigger( 'drop:fieldType', type );
|
10549 |
-
}
|
10550 |
-
},
|
10551 |
-
|
10552 |
-
/**
|
10553 |
-
* Add an active class to our sortable when a field type item is dragged
|
10554 |
-
*
|
10555 |
-
* @since 3.0
|
10556 |
-
*/
|
10557 |
-
addActiveClass: function() {
|
10558 |
-
var stagedFieldsEl = nfRadio.channel( 'app' ).request( 'get:stagedFieldsEl' );
|
10559 |
-
jQuery( stagedFieldsEl ).addClass( 'nf-droppable-active' );
|
10560 |
-
},
|
10561 |
-
|
10562 |
-
/**
|
10563 |
-
* Remove the active class from our sortable when the field type item is dropped.
|
10564 |
-
*
|
10565 |
-
* @since 3.0
|
10566 |
-
* @return void
|
10567 |
-
*/
|
10568 |
-
removeActiveClass: function() {
|
10569 |
-
var stagedFieldsEl = nfRadio.channel( 'app' ).request( 'get:stagedFieldsEl' );
|
10570 |
-
jQuery( stagedFieldsEl ).removeClass( 'nf-droppable-active' );
|
10571 |
-
},
|
10572 |
-
|
10573 |
-
/**
|
10574 |
-
* When the field type item is dragged over our sortable, we change the helper to match the sortable items.
|
10575 |
-
*
|
10576 |
-
* @since 3.0
|
10577 |
-
* @param Object e event
|
10578 |
-
* @param Object ui jQuery UI Element
|
10579 |
-
* @return void
|
10580 |
-
*/
|
10581 |
-
overStagedFields: function( e, ui ) {
|
10582 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) {
|
10583 |
-
var type = jQuery( ui.item ).data( 'id' );
|
10584 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
10585 |
-
var nicename = fieldType.get( 'nicename' );
|
10586 |
-
this.currentHelper = ui.helper
|
10587 |
-
jQuery( ui.helper ).html( nicename + '<span class="dashicons dashicons-dismiss"></span>' );
|
10588 |
-
jQuery( ui.helper ).removeClass( 'nf-field-type-button' ).addClass( 'nf-item-dock' ).css( { 'opacity': '0.8', 'width': '', 'height': '' } );
|
10589 |
-
var sortableEl = nfRadio.channel( 'app' ).request( 'get:stagedFieldsEl' );
|
10590 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
10591 |
-
jQuery( sortableEl ).addClass( 'nf-droppable-hover' );
|
10592 |
-
}
|
10593 |
-
}
|
10594 |
-
|
10595 |
-
},
|
10596 |
-
|
10597 |
-
/**
|
10598 |
-
* When a field type item is moved away from our sortable, we change the helper to its previous appearance
|
10599 |
-
*
|
10600 |
-
* @since 3.0
|
10601 |
-
* @param Object ui jQuery UI element
|
10602 |
-
* @return void
|
10603 |
-
*/
|
10604 |
-
outStagedFields: function( ui ) {
|
10605 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) {
|
10606 |
-
var helperClone = nfRadio.channel( 'drawer-addField' ).request( 'get:typeHelperClone' );
|
10607 |
-
jQuery( this.currentHelper ).html( jQuery( helperClone ).html() );
|
10608 |
-
jQuery( this.currentHelper ).removeClass( 'nf-item-dock' ).addClass( 'nf-field-type-button' );
|
10609 |
-
var sortableEl = nfRadio.channel( 'app' ).request( 'get:stagedFieldsEl' );
|
10610 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
10611 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-hover' );
|
10612 |
-
}
|
10613 |
-
}
|
10614 |
-
},
|
10615 |
-
|
10616 |
-
/**
|
10617 |
-
* When a user starts to drag a sortable item, we need to set a few properties on the item and the helper.
|
10618 |
-
* These keep the original item in place while dragging and changes the opacity of the helper.
|
10619 |
-
*
|
10620 |
-
* @since 3.0
|
10621 |
-
* @param Object ui jQuery UI element
|
10622 |
-
* @return void
|
10623 |
-
*/
|
10624 |
-
startStagedFields: function( ui ) {
|
10625 |
-
jQuery( ui.item ).show();
|
10626 |
-
jQuery( ui.item ).css( { 'display': 'inline', 'opacity': '0.7' } );
|
10627 |
-
jQuery( ui.helper ).css( 'opacity', '0.5' );
|
10628 |
-
},
|
10629 |
-
|
10630 |
-
/**
|
10631 |
-
* When we stop dragging a sortable item, remove our opacity setting and remove the helper item.
|
10632 |
-
*
|
10633 |
-
* @since 3.0
|
10634 |
-
* @param Object ui jQuery UI element
|
10635 |
-
* @return void
|
10636 |
-
*/
|
10637 |
-
stopStagedFields: function( ui ) {
|
10638 |
-
jQuery( ui.item ).css( 'opacity', '' );
|
10639 |
-
jQuery( ui.helper ).remove();
|
10640 |
-
}
|
10641 |
-
|
10642 |
-
});
|
10643 |
-
|
10644 |
-
return controller;
|
10645 |
-
} );
|
10646 |
-
/**
|
10647 |
-
* Filters our field type collection.
|
10648 |
-
*
|
10649 |
-
* @package Ninja Forms builder
|
10650 |
-
* @subpackage Fields - New Field Drawer
|
10651 |
-
* @copyright (c) 2015 WP Ninjas
|
10652 |
-
* @since 3.0
|
10653 |
-
*/
|
10654 |
-
define( 'controllers/fields/filterTypes',['models/fields/typeSectionCollection'], function( fieldTypeSectionCollection ) {
|
10655 |
-
var controller = Marionette.Object.extend( {
|
10656 |
-
initialize: function() {
|
10657 |
-
// Listen to our change filter event.
|
10658 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'change:filter', this.filterFieldTypes );
|
10659 |
-
},
|
10660 |
-
|
10661 |
-
/**
|
10662 |
-
* Filter our field types in the add new field drawer
|
10663 |
-
*
|
10664 |
-
* Takes a search string and finds any field types that match either the name or alias.
|
10665 |
-
*
|
10666 |
-
* @since 3.0
|
10667 |
-
* @param string search string being searched for
|
10668 |
-
* @param object e Keyup event
|
10669 |
-
* @return void
|
10670 |
-
*/
|
10671 |
-
filterFieldTypes: function( search, e ) {
|
10672 |
-
// Make sure that we aren't dealing with an empty string.
|
10673 |
-
if ( '' != jQuery.trim( search ) ) {
|
10674 |
-
var filtered = [];
|
10675 |
-
/**
|
10676 |
-
* Call the function that actually filters our collection,
|
10677 |
-
* and then loop through our collection, adding each model to our filtered array.
|
10678 |
-
*/
|
10679 |
-
_.each( this.filterCollection( search ), function( model ) {
|
10680 |
-
filtered.push( model.get( 'id' ) );
|
10681 |
-
} );
|
10682 |
-
|
10683 |
-
// Create a new Field Type Section collection with the filtered array.
|
10684 |
-
var filteredSectionCollection = new fieldTypeSectionCollection( [
|
10685 |
-
{
|
10686 |
-
id: 'filtered',
|
10687 |
-
nicename: 'Filtered Fields',
|
10688 |
-
fieldTypes: filtered
|
10689 |
-
}
|
10690 |
-
] );
|
10691 |
-
|
10692 |
-
// Declare array of fields to hide.
|
10693 |
-
var hiddenFields = nfRadio.channel( 'app' ).request( 'update:hiddenFields' ) || [];
|
10694 |
-
hiddenFields = hiddenFields.concat([
|
10695 |
-
'product',
|
10696 |
-
'quantity',
|
10697 |
-
'shipping',
|
10698 |
-
'total',
|
10699 |
-
'button'
|
10700 |
-
]);
|
10701 |
-
|
10702 |
-
// Search our results of hidden fields.
|
10703 |
-
for ( var i = filteredSectionCollection.models[ 0 ].get( 'fieldTypes' ).length -1; i >= 0; i-- ) {
|
10704 |
-
var target = hiddenFields.indexOf( filteredSectionCollection.models[ 0 ].get( 'fieldTypes' )[ i ] );
|
10705 |
-
// If we find any...
|
10706 |
-
if ( -1 < target ) {
|
10707 |
-
// Remove them from the collection.
|
10708 |
-
filteredSectionCollection.models[ 0 ].get( 'fieldTypes' ).splice( i, 1 );
|
10709 |
-
}
|
10710 |
-
}
|
10711 |
-
|
10712 |
-
// Request that our field types filter be applied, passing the collection we created above.
|
10713 |
-
nfRadio.channel( 'drawer' ).trigger( 'filter:fieldTypes', filteredSectionCollection );
|
10714 |
-
// If we've pressed the 'enter' key, add the field to staging and clear the filter.
|
10715 |
-
if ( 'undefined' != typeof e && e.addObject ) {
|
10716 |
-
if ( 0 < filtered.length ) {
|
10717 |
-
nfRadio.channel( 'fields' ).request( 'add:stagedField', filtered[0] );
|
10718 |
-
nfRadio.channel( 'drawer' ).request( 'clear:filter' );
|
10719 |
-
}
|
10720 |
-
}
|
10721 |
-
} else {
|
10722 |
-
// Clear our filter if the search text is empty.
|
10723 |
-
nfRadio.channel( 'drawer' ).trigger( 'clear:filter' );
|
10724 |
-
}
|
10725 |
-
},
|
10726 |
-
|
10727 |
-
/**
|
10728 |
-
* Search our field type collection for the search string.
|
10729 |
-
*
|
10730 |
-
* @since 3.0
|
10731 |
-
* @param string search string being searched for
|
10732 |
-
* @return backbone.collection
|
10733 |
-
*/
|
10734 |
-
filterCollection: function( search ) {
|
10735 |
-
search = search.toLowerCase();
|
10736 |
-
// Get our list of field types
|
10737 |
-
var collection = nfRadio.channel( 'fields' ).request( 'get:typeCollection' );
|
10738 |
-
/*
|
10739 |
-
* Backbone collections have a 'filter' method that loops through every model,
|
10740 |
-
* waiting for you to return true or false. If you return true, the model is kept.
|
10741 |
-
* If you return false, it's removed from the filtered result.
|
10742 |
-
*/
|
10743 |
-
var filtered = collection.filter( function( model ) {
|
10744 |
-
var found = false;
|
10745 |
-
|
10746 |
-
// If we match either the ID or nicename, return true.
|
10747 |
-
if ( model.get( 'type' ).toLowerCase().indexOf( search ) != -1 ) {
|
10748 |
-
found = true;
|
10749 |
-
} else if ( model.get( 'nicename' ).toLowerCase().indexOf( search ) != -1 ) {
|
10750 |
-
found = true;
|
10751 |
-
}
|
10752 |
-
|
10753 |
-
/*
|
10754 |
-
* TODO: Hashtag searching. Doesn't really do anything atm.
|
10755 |
-
*/
|
10756 |
-
if ( model.get( 'tags' ) && 0 == search.indexOf( '#' ) ) {
|
10757 |
-
_.each( model.get( 'tags' ), function( tag ) {
|
10758 |
-
if ( search.replace( '#', '' ).length > 1 ) {
|
10759 |
-
if ( tag.toLowerCase().indexOf( search.replace( '#', '' ) ) != -1 ) {
|
10760 |
-
found = true;
|
10761 |
-
}
|
10762 |
-
}
|
10763 |
-
} );
|
10764 |
-
}
|
10765 |
-
|
10766 |
-
// If we match any of the aliases, return true.
|
10767 |
-
if ( model.get( 'alias' ) ) {
|
10768 |
-
_.each( model.get( 'alias' ), function( alias ) {
|
10769 |
-
if ( alias.toLowerCase().indexOf( search ) != -1 ) {
|
10770 |
-
found = true;
|
10771 |
-
}
|
10772 |
-
} );
|
10773 |
-
}
|
10774 |
-
|
10775 |
-
return found;
|
10776 |
-
} );
|
10777 |
-
// Return our filtered collection.
|
10778 |
-
return filtered;
|
10779 |
-
}
|
10780 |
-
});
|
10781 |
-
|
10782 |
-
return controller;
|
10783 |
-
} );
|
10784 |
-
define( 'views/fields/preview/element',[], function() {
|
10785 |
-
var view = Marionette.ItemView.extend({
|
10786 |
-
tagName: 'div',
|
10787 |
-
template: '#tmpl-nf-field-input',
|
10788 |
-
|
10789 |
-
initialize: function() {
|
10790 |
-
|
10791 |
-
var type = this.model.get('type');
|
10792 |
-
|
10793 |
-
this.model.set('value', this.model.get('default'));
|
10794 |
-
|
10795 |
-
if('date' == type && this.model.get('date_default')){
|
10796 |
-
var format = this.model.get('date_format');
|
10797 |
-
if('default' == format || '' == format) format = this.convertDateFormat(nfAdmin.dateFormat);
|
10798 |
-
this.model.set('value', moment().format(format) );
|
10799 |
-
}
|
10800 |
-
|
10801 |
-
if('phone' == type) type = 'tel';
|
10802 |
-
if('spam' == type) type = 'input';
|
10803 |
-
// if('date' == type) type = 'input';
|
10804 |
-
if('confirm' == type) type = 'input';
|
10805 |
-
if('password' == type) type = 'input';
|
10806 |
-
if('passwordconfirm' == type) type = 'input';
|
10807 |
-
if('quantity' == type) type = 'number';
|
10808 |
-
if('terms' == type) type = 'listcheckbox';
|
10809 |
-
if('liststate' == type) type = 'listselect';
|
10810 |
-
if('listcountry' == type) type = 'listselect';
|
10811 |
-
if('listmultiselect' == type) type = 'listselect';
|
10812 |
-
if('save' == type) type = 'submit';
|
10813 |
-
|
10814 |
-
// If a builder-specific template exists for this type, use that.
|
10815 |
-
if ( 1 == jQuery( '#tmpl-nf-builder-field-' + type ).length ) {
|
10816 |
-
this.template = '#tmpl-nf-builder-field-' + type;
|
10817 |
-
} else {
|
10818 |
-
this.template = '#tmpl-nf-field-' + type;
|
10819 |
-
}
|
10820 |
-
},
|
10821 |
-
|
10822 |
-
onRender: function() {
|
10823 |
-
if(this.model.get('container_class').includes('two-col-list')) {
|
10824 |
-
jQuery(this.el).find('> ul').css('display', 'grid');
|
10825 |
-
jQuery(this.el).find('> ul').css('grid-template-columns', 'repeat(2, 1fr)');
|
10826 |
-
}
|
10827 |
-
if(this.model.get('container_class').includes('three-col-list')) {
|
10828 |
-
jQuery(this.el).find('> ul').css('display', 'grid');
|
10829 |
-
jQuery(this.el).find('> ul').css('grid-template-columns', 'repeat(3, 1fr)');
|
10830 |
-
}
|
10831 |
-
if(this.model.get('container_class').includes('four-col-list')) {
|
10832 |
-
jQuery(this.el).find('> ul').css('display', 'grid');
|
10833 |
-
jQuery(this.el).find('> ul').css('grid-template-columns', 'repeat(4, 1fr)');
|
10834 |
-
}
|
10835 |
-
},
|
10836 |
-
|
10837 |
-
templateHelpers: function () {
|
10838 |
-
return {
|
10839 |
-
renderClasses: function() {
|
10840 |
-
// ...
|
10841 |
-
},
|
10842 |
-
renderPlaceholder: function() {
|
10843 |
-
if('undefined' == typeof this.placeholder) return;
|
10844 |
-
return 'placeholder="' + jQuery.trim( this.placeholder ) + '"';
|
10845 |
-
},
|
10846 |
-
maybeDisabled: function() {
|
10847 |
-
if('undefined' == typeof this.disable_input) return;
|
10848 |
-
if(!this.disable_input) return;
|
10849 |
-
return 'disabled="disabled"';
|
10850 |
-
},
|
10851 |
-
maybeRequired: function() {
|
10852 |
-
// ...
|
10853 |
-
},
|
10854 |
-
maybeInputLimit: function() {
|
10855 |
-
// ...
|
10856 |
-
},
|
10857 |
-
maybeDisableAutocomplete: function() {
|
10858 |
-
// ..
|
10859 |
-
},
|
10860 |
-
maybeChecked: function() {
|
10861 |
-
if('checked' == this.default_value) return ' checked="checked"';
|
10862 |
-
},
|
10863 |
-
renderOptions: function() {
|
10864 |
-
switch(this.type) {
|
10865 |
-
case 'terms':
|
10866 |
-
|
10867 |
-
if( ! this.taxonomy ){
|
10868 |
-
return '(No taxonomy selected)';
|
10869 |
-
}
|
10870 |
-
|
10871 |
-
var taxonomyTerms = fieldTypeData.find(function(typeData){
|
10872 |
-
return 'terms' == typeData.id;
|
10873 |
-
}).settingGroups.find(function(settingGroup){
|
10874 |
-
return 'primary' == settingGroup.id;
|
10875 |
-
}).settings.find(function(setting){
|
10876 |
-
return 'taxonomy_terms' == setting.name;
|
10877 |
-
}).settings;
|
10878 |
-
|
10879 |
-
var attributes = Object.keys(this);
|
10880 |
-
var enabledTaxonomyTerms = attributes.filter(function(attribute){
|
10881 |
-
return 0 == attribute.indexOf('taxonomy_term_') && this[attribute];
|
10882 |
-
}.bind(this));
|
10883 |
-
|
10884 |
-
if(0 == enabledTaxonomyTerms.length) {
|
10885 |
-
return '(No available terms selected)';
|
10886 |
-
}
|
10887 |
-
|
10888 |
-
return enabledTaxonomyTerms.reduce(function(html, enabledTaxonomyTerm) {
|
10889 |
-
var term = taxonomyTerms.find(function(terms){
|
10890 |
-
return enabledTaxonomyTerm == terms.name;
|
10891 |
-
});
|
10892 |
-
if( 'undefined' == typeof term ) return html;
|
10893 |
-
return html += '<li><input type="checkbox"><div>' + term.label + '</div></li>';
|
10894 |
-
}.bind(this), '');
|
10895 |
-
case 'liststate':
|
10896 |
-
case 'listselect':
|
10897 |
-
|
10898 |
-
// Check if there are any options.
|
10899 |
-
if(0 == this.options.models.length) return '';
|
10900 |
-
|
10901 |
-
// Filter by :selected" options.
|
10902 |
-
var options = this.options.models.filter(function(option){
|
10903 |
-
return option.get('selected');
|
10904 |
-
});
|
10905 |
-
|
10906 |
-
// If no option set as "selected", then reset the previous filter.
|
10907 |
-
if(0 == options.length) options = this.options.models;
|
10908 |
-
|
10909 |
-
// Set the first option to display in the field preview.
|
10910 |
-
return '<option>' + options[0].get('label') + '</option>';
|
10911 |
-
case 'listmultiselect':
|
10912 |
-
return this.options.models.reduce(function(html, option) {
|
10913 |
-
var selected = (option.get('selected')) ? ' selected="selected"' : '';
|
10914 |
-
return html += '<option' + selected + '>' + option.get('label') + '</option>';
|
10915 |
-
}, '');
|
10916 |
-
case 'listcheckbox':
|
10917 |
-
return this.options.models.reduce(function(html, option) {
|
10918 |
-
var checked = (option.get('selected')) ? ' checked="checked"' : '';
|
10919 |
-
return html += '<li><input type="checkbox"' + checked + '><div>' + option.get('label') + '</div></li>';
|
10920 |
-
}, '');
|
10921 |
-
case 'listradio':
|
10922 |
-
var checked = false; // External flag to only select one radio item.
|
10923 |
-
return this.options.models.reduce(function(html, option) {
|
10924 |
-
checked = (option.get('selected') && !checked) ? ' checked="checked"' : '';
|
10925 |
-
return html += '<li><input type="radio"' + checked + '><div>' + option.get('label') + '</div></li>';
|
10926 |
-
}, '');
|
10927 |
-
case 'listcountry':
|
10928 |
-
var defaultValue = this.default;
|
10929 |
-
var defaultOption = window.fieldTypeData.find(function(data) {
|
10930 |
-
return 'listcountry' == data.id;
|
10931 |
-
}).settingGroups.find(function(group){
|
10932 |
-
return 'primary' == group.id;
|
10933 |
-
}).settings.find(function(setting){
|
10934 |
-
return 'default' == setting.name;
|
10935 |
-
}).options.find(function(option) {
|
10936 |
-
return defaultValue == option.value;
|
10937 |
-
});
|
10938 |
-
var optionLabel = ('undefined' !== typeof defaultOption ) ? defaultOption.label : '--';
|
10939 |
-
return '<option>' + optionLabel + '</option>';
|
10940 |
-
default:
|
10941 |
-
return '';
|
10942 |
-
}
|
10943 |
-
},
|
10944 |
-
renderOtherAttributes: function() {
|
10945 |
-
var attributes = [];
|
10946 |
-
if('listmultiselect' == this.type) {
|
10947 |
-
attributes.push('multiple');
|
10948 |
-
|
10949 |
-
var multi_size = this.multi_size || '5';
|
10950 |
-
attributes.push('size="' + multi_size + '"');
|
10951 |
-
}
|
10952 |
-
|
10953 |
-
return attributes.join(' ');
|
10954 |
-
},
|
10955 |
-
renderProduct: function() {
|
10956 |
-
// ...
|
10957 |
-
},
|
10958 |
-
renderNumberDefault: function() {
|
10959 |
-
return this.value;
|
10960 |
-
},
|
10961 |
-
renderCurrencyFormatting: function() {
|
10962 |
-
// ...
|
10963 |
-
},
|
10964 |
-
renderRatings: function() {
|
10965 |
-
var ratingOutput = '';
|
10966 |
-
for (var i = 0; i < this.number_of_stars; i++) {
|
10967 |
-
ratingOutput += '<i class="fa fa-star" aria-hidden="true"></i> ';
|
10968 |
-
}
|
10969 |
-
return ratingOutput;
|
10970 |
-
},
|
10971 |
-
renderHourOptions: function() {
|
10972 |
-
html = '';
|
10973 |
-
let hours = 12;
|
10974 |
-
|
10975 |
-
if ( 'undefined' != typeof this.hours_24 && 1 == this.hours_24 ) {
|
10976 |
-
hours = 24;
|
10977 |
-
}
|
10978 |
-
|
10979 |
-
for (var i = 0; i < hours; i++) {
|
10980 |
-
let value = label = i;
|
10981 |
-
|
10982 |
-
if ( i < 10 ) {
|
10983 |
-
value = label = '0' + i;
|
10984 |
-
}
|
10985 |
-
html += '<option value="' + value + '">' + label + '</option>';
|
10986 |
-
i = i++;
|
10987 |
-
}
|
10988 |
-
|
10989 |
-
return html;
|
10990 |
-
},
|
10991 |
-
|
10992 |
-
renderMinuteOptions: function() {
|
10993 |
-
var html = '';
|
10994 |
-
let minute_increment = 5;
|
10995 |
-
|
10996 |
-
if ( 'undefined' != typeof this.minute_increment ) {
|
10997 |
-
minute_increment = this.minute_increment;
|
10998 |
-
}
|
10999 |
-
|
11000 |
-
let i = 0;
|
11001 |
-
|
11002 |
-
while( i < 60 ) {
|
11003 |
-
let value = label = i;
|
11004 |
-
|
11005 |
-
if ( i < 10 ) {
|
11006 |
-
value = label = '0' + i;
|
11007 |
-
}
|
11008 |
-
html += '<option value="' + value + '">' + label + '</option>';
|
11009 |
-
i = i + minute_increment;
|
11010 |
-
}
|
11011 |
-
|
11012 |
-
return html;
|
11013 |
-
},
|
11014 |
-
|
11015 |
-
maybeRenderAMPM: function() {
|
11016 |
-
if ( 'undefined' == typeof this.hours_24 || 1 == this.hours_24 ) {
|
11017 |
-
return;
|
11018 |
-
}
|
11019 |
-
|
11020 |
-
return '<div style="float:left;"><select class="ampm" style="float:left;"><option value="am">AM</option><option value="pm">PM</option></select></div>'
|
11021 |
-
},
|
11022 |
-
maybeRenderTime: function() {
|
11023 |
-
if ( 'time_only' == this.date_mode || 'date_and_time' == this.date_mode ) {
|
11024 |
-
return true;
|
11025 |
-
}
|
11026 |
-
return false;
|
11027 |
-
},
|
11028 |
-
|
11029 |
-
}
|
11030 |
-
},
|
11031 |
-
|
11032 |
-
convertDateFormat: function( dateFormat ) {
|
11033 |
-
// http://php.net/manual/en/function.date.php
|
11034 |
-
// https://github.com/dbushell/Pikaday/blob/master/README.md#formatting
|
11035 |
-
// Note: Be careful not to add overriding replacements. Order is important here.
|
11036 |
-
|
11037 |
-
/** Day */
|
11038 |
-
dateFormat = dateFormat.replace( 'D', 'ddd' ); // @todo Ordering issue?
|
11039 |
-
dateFormat = dateFormat.replace( 'd', 'DD' );
|
11040 |
-
dateFormat = dateFormat.replace( 'l', 'dddd' );
|
11041 |
-
dateFormat = dateFormat.replace( 'j', 'D' );
|
11042 |
-
dateFormat = dateFormat.replace( 'N', '' ); // Not Supported
|
11043 |
-
dateFormat = dateFormat.replace( 'S', '' ); // Not Supported
|
11044 |
-
dateFormat = dateFormat.replace( 'w', 'd' );
|
11045 |
-
dateFormat = dateFormat.replace( 'z', '' ); // Not Supported
|
11046 |
-
|
11047 |
-
/** Week */
|
11048 |
-
dateFormat = dateFormat.replace( 'W', 'W' );
|
11049 |
-
|
11050 |
-
/** Month */
|
11051 |
-
dateFormat = dateFormat.replace( 'M', 'MMM' ); // "M" before "F" or "m" to avoid overriding.
|
11052 |
-
dateFormat = dateFormat.replace( 'F', 'MMMM' );
|
11053 |
-
dateFormat = dateFormat.replace( 'm', 'MM' );
|
11054 |
-
dateFormat = dateFormat.replace( 'n', 'M' );
|
11055 |
-
dateFormat = dateFormat.replace( 't', '' ); // Not Supported
|
11056 |
-
|
11057 |
-
// Year
|
11058 |
-
dateFormat = dateFormat.replace( 'L', '' ); // Not Supported
|
11059 |
-
dateFormat = dateFormat.replace( 'o', 'YYYY' );
|
11060 |
-
dateFormat = dateFormat.replace( 'Y', 'YYYY' );
|
11061 |
-
dateFormat = dateFormat.replace( 'y', 'YY' );
|
11062 |
-
|
11063 |
-
// Time - Not supported
|
11064 |
-
dateFormat = dateFormat.replace( 'a', '' );
|
11065 |
-
dateFormat = dateFormat.replace( 'A', '' );
|
11066 |
-
dateFormat = dateFormat.replace( 'B', '' );
|
11067 |
-
dateFormat = dateFormat.replace( 'g', '' );
|
11068 |
-
dateFormat = dateFormat.replace( 'G', '' );
|
11069 |
-
dateFormat = dateFormat.replace( 'h', '' );
|
11070 |
-
dateFormat = dateFormat.replace( 'H', '' );
|
11071 |
-
dateFormat = dateFormat.replace( 'i', '' );
|
11072 |
-
dateFormat = dateFormat.replace( 's', '' );
|
11073 |
-
dateFormat = dateFormat.replace( 'u', '' );
|
11074 |
-
dateFormat = dateFormat.replace( 'v', '' );
|
11075 |
-
|
11076 |
-
// Timezone - Not supported
|
11077 |
-
dateFormat = dateFormat.replace( 'e', '' );
|
11078 |
-
dateFormat = dateFormat.replace( 'I', '' );
|
11079 |
-
dateFormat = dateFormat.replace( 'O', '' );
|
11080 |
-
dateFormat = dateFormat.replace( 'P', '' );
|
11081 |
-
dateFormat = dateFormat.replace( 'T', '' );
|
11082 |
-
dateFormat = dateFormat.replace( 'Z', '' );
|
11083 |
-
|
11084 |
-
// Full Date/Time - Not Supported
|
11085 |
-
dateFormat = dateFormat.replace( 'c', '' );
|
11086 |
-
dateFormat = dateFormat.replace( 'r', '' );
|
11087 |
-
dateFormat = dateFormat.replace( 'u', '' );
|
11088 |
-
|
11089 |
-
return dateFormat;
|
11090 |
-
}
|
11091 |
-
|
11092 |
-
});
|
11093 |
-
|
11094 |
-
return view;
|
11095 |
-
} );
|
11096 |
-
/**
|
11097 |
-
* This is a copy of the 'views/fields/mainContentEmpty.js' file.
|
11098 |
-
* It is also the file that handles dropping new field types on our repeater field.
|
11099 |
-
*
|
11100 |
-
*/
|
11101 |
-
|
11102 |
-
define( 'views/fields/preview/repeaterElementEmpty',[], function() {
|
11103 |
-
var view = Marionette.ItemView.extend({
|
11104 |
-
tagName: 'div',
|
11105 |
-
template: '#tmpl-nf-repeater-content-fields-empty',
|
11106 |
-
|
11107 |
-
initialize: function( data ) {
|
11108 |
-
this.repeaterFieldModel = data.repeaterFieldModel;
|
11109 |
-
},
|
11110 |
-
|
11111 |
-
onBeforeDestroy: function() {
|
11112 |
-
jQuery( this.el ).parent().removeClass( 'nf-fields-empty-droppable' ).droppable( 'destroy' );
|
11113 |
-
},
|
11114 |
-
|
11115 |
-
onRender: function() {
|
11116 |
-
this.$el = this.$el.children();
|
11117 |
-
this.$el.unwrap();
|
11118 |
-
this.setElement( this.$el );
|
11119 |
-
},
|
11120 |
-
|
11121 |
-
onShow: function() {
|
11122 |
-
if ( jQuery( this.el ).parent().hasClass( 'ui-sortable' ) ) {
|
11123 |
-
jQuery( this.el ).parent().sortable( 'destroy' );
|
11124 |
-
}
|
11125 |
-
jQuery( this.el ).parent().addClass( 'nf-fields-empty-droppable' );
|
11126 |
-
let that = this;
|
11127 |
-
jQuery( this.el ).parent().droppable( {
|
11128 |
-
accept: function( draggable ) {
|
11129 |
-
if ( jQuery( draggable ).hasClass( 'nf-stage' ) || jQuery( draggable ).hasClass( 'nf-field-type-button' ) ) {
|
11130 |
-
return true;
|
11131 |
-
}
|
11132 |
-
},
|
11133 |
-
activeClass: 'nf-droppable-active',
|
11134 |
-
hoverClass: 'nf-droppable-hover',
|
11135 |
-
tolerance: 'pointer',
|
11136 |
-
|
11137 |
-
over: function( e, ui ) {
|
11138 |
-
|
11139 |
-
ui.item = ui.draggable;
|
11140 |
-
jQuery(ui.item).addClass("nf-over-repeater");
|
11141 |
-
nfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );
|
11142 |
-
},
|
11143 |
-
out: function( e, ui ) {
|
11144 |
-
|
11145 |
-
ui.item = ui.draggable;
|
11146 |
-
jQuery(ui.item).removeClass("nf-over-repeater");
|
11147 |
-
nfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );
|
11148 |
-
},
|
11149 |
-
/**
|
11150 |
-
* Handles the dropping of items into our EMPTY repeater field.
|
11151 |
-
*
|
11152 |
-
*/
|
11153 |
-
drop: function( e, ui ) {
|
11154 |
-
ui.item = null != ui.item ? ui.item : ui.draggable;
|
11155 |
-
nfRadio.channel( 'fields-repeater' ).request( 'add:childField', ui, that, e );
|
11156 |
-
},
|
11157 |
-
} );
|
11158 |
-
}
|
11159 |
-
});
|
11160 |
-
|
11161 |
-
return view;
|
11162 |
-
} );
|
11163 |
-
/**
|
11164 |
-
* Collection View that outputs our repeater field collection to the screen.
|
11165 |
-
*/
|
11166 |
-
define( 'views/fields/preview/repeaterElementCollection',[ 'views/fields/preview/repeaterElementEmpty' ], function( emptyView ) {
|
11167 |
-
var view = Marionette.CollectionView.extend( {
|
11168 |
-
tagName: 'div',
|
11169 |
-
emptyView: emptyView,
|
11170 |
-
|
11171 |
-
getChildView: function() {
|
11172 |
-
let view = nfRadio.channel( 'views' ).request( 'get:fieldItem' );
|
11173 |
-
return view;
|
11174 |
-
},
|
11175 |
-
|
11176 |
-
initialize: function( data ) {
|
11177 |
-
this.emptyViewOptions = {
|
11178 |
-
repeaterFieldModel: data.repeaterFieldModel,
|
11179 |
-
};
|
11180 |
-
this.repeaterFieldModel = data.repeaterFieldModel;
|
11181 |
-
|
11182 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'init:sortable', this.initSortable, this );
|
11183 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'get:sortableEl', this.getSortableEl, this );
|
11184 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'get:repeaterFieldsCollection', this.getRepeaterFieldsCollection, this );
|
11185 |
-
},
|
11186 |
-
|
11187 |
-
onRender: function() {
|
11188 |
-
if ( this.collection.models.length > 0 ) {
|
11189 |
-
jQuery( this.el ).addClass( 'nf-field-type-droppable' );
|
11190 |
-
var that = this;
|
11191 |
-
this.initSortable();
|
11192 |
-
}
|
11193 |
-
},
|
11194 |
-
|
11195 |
-
/**
|
11196 |
-
* This sortable is a copy with modifications of the main field list sortable.
|
11197 |
-
*
|
11198 |
-
* @since version
|
11199 |
-
* @return {[type]} [description]
|
11200 |
-
*/
|
11201 |
-
initSortable: function() {
|
11202 |
-
// If the sortable has already been instantiated, return early.
|
11203 |
-
if ( 'undefined' != typeof jQuery( this.el ).sortable( 'instance' ) ) return false;
|
11204 |
-
|
11205 |
-
jQuery( this.el ).addClass( 'nf-field-type-droppable' ).addClass( 'nf-fields-sortable' );
|
11206 |
-
|
11207 |
-
let that = this;
|
11208 |
-
jQuery( this.el ).sortable( {
|
11209 |
-
containment: 'parent',
|
11210 |
-
helper: 'clone',
|
11211 |
-
cancel: '.nf-item-controls',
|
11212 |
-
placeholder: 'nf-fields-sortable-placeholder',
|
11213 |
-
opacity: 0.95,
|
11214 |
-
grid: [ 5, 5 ],
|
11215 |
-
appendTo: '#nf-main',
|
11216 |
-
scrollSensitivity: 10,
|
11217 |
-
//connectWith would allow drag and drop between fields already in the builder and the repeatable fieldset ( this is currently an issue until we deal with existing data stored)
|
11218 |
-
//connectWith: '.nf-fields-sortable',
|
11219 |
-
|
11220 |
-
receive: function( e, ui ) {
|
11221 |
-
nfRadio.channel( 'fields-repeater' ).request( 'receive:fields', ui, that, e );
|
11222 |
-
},
|
11223 |
-
|
11224 |
-
over: function( e, ui ) {
|
11225 |
-
jQuery(ui.item).addClass("nf-over-repeater");
|
11226 |
-
if ( ui.item.dropping ) return;
|
11227 |
-
nfRadio.channel( 'fields-repeater' ).request( 'over:repeaterField', ui, that, e );
|
11228 |
-
},
|
11229 |
-
|
11230 |
-
out: function( e, ui ) {
|
11231 |
-
jQuery(ui.item).removeClass("nf-over-repeater");
|
11232 |
-
if ( ui.item.dropping ) return;
|
11233 |
-
nfRadio.channel( 'fields-repeater' ).request( 'out:repeaterField', ui, that, e );
|
11234 |
-
},
|
11235 |
-
|
11236 |
-
start: function( e, ui ) {
|
11237 |
-
if ( ui.item.dropping ) return;
|
11238 |
-
nfRadio.channel( 'fields-repeater' ).request( 'start:repeaterField', ui, that, e );
|
11239 |
-
},
|
11240 |
-
|
11241 |
-
remove: function( e, ui ) {
|
11242 |
-
// The field is removed from repeater Fields collection and a new one is created for main Fields collection from controllers/fields/sortable/js
|
11243 |
-
let droppedFieldID = jQuery( ui.item ).data( 'id' );
|
11244 |
-
let collection = that.repeaterFieldModel.get( 'fields' );
|
11245 |
-
let droppedFieldModel = collection.get( droppedFieldID );
|
11246 |
-
|
11247 |
-
// Remove the field from the repeater field collection making sure we alert the user the field data is being deleted
|
11248 |
-
nfRadio.channel( 'app' ).trigger( 'click:delete', e, droppedFieldModel );
|
11249 |
-
},
|
11250 |
-
|
11251 |
-
// When we update the sort order of our repeater field children, run our sort function.
|
11252 |
-
update: function( e, ui ) {
|
11253 |
-
nfRadio.channel( 'fields-repeater' ).request( 'update:repeaterField', ui, that, e );
|
11254 |
-
},
|
11255 |
-
|
11256 |
-
stop: function( e, ui ) {
|
11257 |
-
if ( ui.item.dropping ) return;
|
11258 |
-
nfRadio.channel( 'fields-repeater' ).request( 'stop:repeaterField', ui, that, e );
|
11259 |
-
}
|
11260 |
-
} );
|
11261 |
-
},
|
11262 |
-
|
11263 |
-
destroySortable: function() {
|
11264 |
-
jQuery( this.el ).sortable( 'destroy' );
|
11265 |
-
},
|
11266 |
-
|
11267 |
-
/**
|
11268 |
-
* When we add our first child, we need to init the sortable.
|
11269 |
-
*
|
11270 |
-
* @since version
|
11271 |
-
* @param {[type]} childView [description]
|
11272 |
-
* @return {[type]} [description]
|
11273 |
-
*/
|
11274 |
-
onAddChild: function( childView ) {
|
11275 |
-
if ( nfRadio.channel( 'fields' ).request( 'get:adding' ) ) {
|
11276 |
-
childView.$el.hide().show( 'clip' );
|
11277 |
-
nfRadio.channel( 'fields' ).request( 'set:adding', false);
|
11278 |
-
}
|
11279 |
-
},
|
11280 |
-
|
11281 |
-
/**
|
11282 |
-
* Get Element holding child fields
|
11283 |
-
*/
|
11284 |
-
getSortableEl: function() {
|
11285 |
-
return this.el;
|
11286 |
-
},
|
11287 |
-
|
11288 |
-
/**
|
11289 |
-
* Getter for the repeater Fields collection
|
11290 |
-
*/
|
11291 |
-
getRepeaterFieldsCollection: function() {
|
11292 |
-
return this.repeaterFieldModel.get( 'fields' );
|
11293 |
-
}
|
11294 |
-
|
11295 |
-
} );
|
11296 |
-
|
11297 |
-
return view;
|
11298 |
-
} );
|
11299 |
-
|
11300 |
-
define( 'views/fields/preview/repeaterElementLayout',[ 'views/fields/preview/repeaterElementCollection' ], function( previewRepeaterElementCollectionView ) {
|
11301 |
-
var view = Marionette.LayoutView.extend({
|
11302 |
-
tagName: 'div',
|
11303 |
-
template: '#tmpl-nf-field-repeater',
|
11304 |
-
|
11305 |
-
regions: {
|
11306 |
-
fields: '.nf-repeater-fieldsets',
|
11307 |
-
},
|
11308 |
-
|
11309 |
-
initialize: function( data ) {
|
11310 |
-
this.collection = data.collection;
|
11311 |
-
this.model = data.model;
|
11312 |
-
},
|
11313 |
-
|
11314 |
-
onRender: function() {
|
11315 |
-
// Populate the fields region with our collection view.
|
11316 |
-
this.fields.show( new previewRepeaterElementCollectionView( { collection: this.collection, repeaterFieldModel: this.model } ) );
|
11317 |
-
},
|
11318 |
-
});
|
11319 |
-
|
11320 |
-
return view;
|
11321 |
-
} );
|
11322 |
-
define( 'views/fields/preview/label',[], function() {
|
11323 |
-
var view = Marionette.ItemView.extend({
|
11324 |
-
tagName: 'div',
|
11325 |
-
template: '#tmpl-nf-field-label',
|
11326 |
-
|
11327 |
-
initialize: function( data ) {
|
11328 |
-
// this.$el = jQuery( data.itemView.el ).find( '.nf-realistic-field--label' );
|
11329 |
-
},
|
11330 |
-
|
11331 |
-
onRender: function() {
|
11332 |
-
// ...
|
11333 |
-
// console.log( jQuery( this.$el ) );
|
11334 |
-
},
|
11335 |
-
|
11336 |
-
templateHelpers: function () {
|
11337 |
-
return {
|
11338 |
-
renderLabelClasses: function() {
|
11339 |
-
// ...
|
11340 |
-
},
|
11341 |
-
maybeRenderHelp: function() {
|
11342 |
-
// ...
|
11343 |
-
}
|
11344 |
-
}
|
11345 |
-
}
|
11346 |
-
|
11347 |
-
});
|
11348 |
-
|
11349 |
-
return view;
|
11350 |
-
} );
|
11351 |
-
define( 'views/fields/fieldItem',['views/app/itemControls', 'views/fields/preview/element', 'views/fields/preview/repeaterElementLayout', 'views/fields/preview/label'], function( itemControlsView, previewElementView, previewRepeaterElementView, previewLabelView ) {
|
11352 |
-
var view = Marionette.LayoutView.extend({
|
11353 |
-
tagName: 'div',
|
11354 |
-
template: '#tmpl-nf-main-content-field',
|
11355 |
-
doingShortcut: false,
|
11356 |
-
|
11357 |
-
regions: {
|
11358 |
-
itemControls: '.nf-item-controls',
|
11359 |
-
previewLabel: '.nf-realistic-field--label',
|
11360 |
-
previewElement: '.nf-realistic-field--element',
|
11361 |
-
},
|
11362 |
-
|
11363 |
-
initialize: function() {
|
11364 |
-
this.model.on( 'change:editActive', this.render, this );
|
11365 |
-
this.model.on( 'change:label', this.render, this );
|
11366 |
-
this.model.on( 'change:required', this.render, this );
|
11367 |
-
this.model.on( 'change:id', this.render, this );
|
11368 |
-
},
|
11369 |
-
|
11370 |
-
onBeforeDestroy: function() {
|
11371 |
-
this.model.off( 'change:editActive', this.render );
|
11372 |
-
this.model.off( 'change:label', this.render );
|
11373 |
-
this.model.off( 'change:required', this.render );
|
11374 |
-
this.model.off( 'change:id', this.render );
|
11375 |
-
},
|
11376 |
-
|
11377 |
-
onRender: function() {
|
11378 |
-
this.$el = this.$el.children();
|
11379 |
-
this.$el.unwrap();
|
11380 |
-
this.setElement( this.$el );
|
11381 |
-
|
11382 |
-
this.itemControls.show( new itemControlsView( { model: this.model } ) );
|
11383 |
-
jQuery( this.el ).disableSelection();
|
11384 |
-
|
11385 |
-
var type = this.model.get('type');
|
11386 |
-
if('phone' == type) type = 'tel';
|
11387 |
-
if('spam' == type) type = 'input';
|
11388 |
-
// if('date' == type) type = 'input';
|
11389 |
-
if('confirm' == type) type = 'input';
|
11390 |
-
if('password' == type) type = 'input';
|
11391 |
-
if('passwordconfirm' == type) type = 'input';
|
11392 |
-
if('quantity' == type) type = 'number';
|
11393 |
-
if('terms' == type) type = 'listcheckbox';
|
11394 |
-
if('liststate' == type) type = 'listselect';
|
11395 |
-
if('listcountry' == type) type = 'listselect';
|
11396 |
-
if('listmultiselect' == type) type = 'listselect';
|
11397 |
-
if('save' == type) type = 'submit';
|
11398 |
-
|
11399 |
-
// Only show preview / realisitic fields when not `html`, `hidden`, `note`, or `recaptcha`.
|
11400 |
-
var previewFieldTypeBlacklist = ['html', 'hidden', 'note', 'recaptcha'];
|
11401 |
-
var isFieldTypeTemplateAvailable = jQuery('#tmpl-nf-field-' + type).length;
|
11402 |
-
if(-1 == previewFieldTypeBlacklist.indexOf(this.model.get('type')) && isFieldTypeTemplateAvailable) {
|
11403 |
-
|
11404 |
-
// If we have a repeater field, then we have to load a specific collection view.
|
11405 |
-
if ( 'repeater' == type ) {
|
11406 |
-
this.previewElement.show( new previewRepeaterElementView( { collection: this.model.get( 'fields' ), model: this.model } ) );
|
11407 |
-
} else {
|
11408 |
-
this.previewElement.show( new previewElementView( { model: this.model } ) );
|
11409 |
-
}
|
11410 |
-
|
11411 |
-
// Only show the preview label when not `submit`, or `hr`.
|
11412 |
-
var showLabelFieldTypeBlacklist = ['submit', 'save', 'hr'];
|
11413 |
-
if(-1 == showLabelFieldTypeBlacklist.indexOf(this.model.get('type'))) {
|
11414 |
-
this.previewLabel.show( new previewLabelView( { model: this.model, itemView: this } ) );
|
11415 |
-
}
|
11416 |
-
|
11417 |
-
jQuery( this.el ).find('.nf-placeholder-label').hide();
|
11418 |
-
}
|
11419 |
-
|
11420 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
11421 |
-
jQuery( this.el ).on( 'taphold', function( e, touch ) {
|
11422 |
-
if ( ! jQuery( e.target ).hasClass( 'nf-edit-settings' ) ) {
|
11423 |
-
jQuery( this ).addClass( 'ui-sortable-helper drag-selected' );
|
11424 |
-
jQuery( this ).ClassyWiggle( 'start', { degrees: ['.65', '1', '.65', '0', '-.65', '-1', '-.65', '0'], delay: 50 } );
|
11425 |
-
}
|
11426 |
-
} );
|
11427 |
-
}
|
11428 |
-
|
11429 |
-
nfRadio.channel( 'fields-' + type ).trigger( 'render:itemView', this );
|
11430 |
-
},
|
11431 |
-
|
11432 |
-
templateHelpers: function () {
|
11433 |
-
return {
|
11434 |
-
renderClasses: function() {
|
11435 |
-
var classes = 'nf-field-wrap ' + this.type;
|
11436 |
-
if ( this.editActive ) {
|
11437 |
-
classes += ' active';
|
11438 |
-
}
|
11439 |
-
return classes;
|
11440 |
-
},
|
11441 |
-
renderRequired: function() {
|
11442 |
-
if ( 1 == this.required ) {
|
11443 |
-
return '<span class="required">*</span>';
|
11444 |
-
} else {
|
11445 |
-
return '';
|
11446 |
-
}
|
11447 |
-
},
|
11448 |
-
getFieldID: function() {
|
11449 |
-
if ( jQuery.isNumeric( this.id ) ) {
|
11450 |
-
return 'field-' + this.id;
|
11451 |
-
} else {
|
11452 |
-
return this.id;
|
11453 |
-
}
|
11454 |
-
},
|
11455 |
-
renderIcon: function() {
|
11456 |
-
var type, icon;
|
11457 |
-
|
11458 |
-
type = nfRadio.channel( 'fields' ).request( 'get:type', this.type );
|
11459 |
-
|
11460 |
-
icon = document.createElement( 'span' );
|
11461 |
-
icon.classList.add( 'fa', 'fa-' + type.get( 'icon' ) );
|
11462 |
-
|
11463 |
-
return icon.outerHTML;
|
11464 |
-
},
|
11465 |
-
labelPosition: function() {
|
11466 |
-
return this.label_pos;
|
11467 |
-
},
|
11468 |
-
renderDescriptionText: function() {
|
11469 |
-
return jQuery.trim(this.desc_text);
|
11470 |
-
}
|
11471 |
-
};
|
11472 |
-
},
|
11473 |
-
|
11474 |
-
events: {
|
11475 |
-
'mouseover .nf-item-control': 'mouseoverItemControl',
|
11476 |
-
'mousedown': 'maybeShortcut',
|
11477 |
-
'click': 'maybeClickEdit',
|
11478 |
-
'singletap': 'maybeTapEdit',
|
11479 |
-
'swipeleft': 'swipeLeft',
|
11480 |
-
'swiperight': 'swipeRight',
|
11481 |
-
'tapend': 'tapend'
|
11482 |
-
},
|
11483 |
-
|
11484 |
-
maybeClickEdit: function( e ) {
|
11485 |
-
if ( this.doingShortcut ) {
|
11486 |
-
this.doingShortcut = false;
|
11487 |
-
return false;
|
11488 |
-
}
|
11489 |
-
|
11490 |
-
if ( ( jQuery( e.target ).parent().hasClass( 'nf-fields-sortable' ) || jQuery( e.target ).parent().hasClass( 'nf-field-wrap' ) || jQuery( e.target ).hasClass( 'nf-field-wrap' ) ) && ! nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
11491 |
-
jQuery( ':focus' ).blur();
|
11492 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', e, this.model );
|
11493 |
-
}
|
11494 |
-
},
|
11495 |
-
|
11496 |
-
maybeShortcut: function( e ) {
|
11497 |
-
var keys = nfRadio.channel( 'app' ).request( 'get:keydown' );
|
11498 |
-
/*
|
11499 |
-
* If the shift key isn't held down, return.
|
11500 |
-
*/
|
11501 |
-
if ( -1 == keys.indexOf( 16 ) ) {
|
11502 |
-
return true;
|
11503 |
-
}
|
11504 |
-
/*
|
11505 |
-
* If we are pressing D, delete this field.
|
11506 |
-
*/
|
11507 |
-
if ( -1 != keys.indexOf( 68 ) ) {
|
11508 |
-
nfRadio.channel( 'app' ).trigger( 'click:delete', e, this.model );
|
11509 |
-
this.doingShortcut = true;
|
11510 |
-
return false;
|
11511 |
-
} else if ( -1 != keys.indexOf( 67 ) ) {
|
11512 |
-
this.doingShortcut = true;
|
11513 |
-
nfRadio.channel( 'app' ).trigger( 'click:duplicate', e, this.model );
|
11514 |
-
return false;
|
11515 |
-
}
|
11516 |
-
},
|
11517 |
-
|
11518 |
-
maybeTapEdit: function( e ) {
|
11519 |
-
if ( jQuery( e.target ).parent().hasClass( 'nf-fields-sortable' ) ) {
|
11520 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', e, this.model );
|
11521 |
-
}
|
11522 |
-
},
|
11523 |
-
|
11524 |
-
swipeLeft: function( e, touch ) {
|
11525 |
-
jQuery( touch.startEvnt.target ).closest( 'div' ).find( '.nf-item-duplicate' ).show();
|
11526 |
-
jQuery( touch.startEvnt.target ).closest( 'div' ).find( '.nf-item-delete' ).show();
|
11527 |
-
},
|
11528 |
-
|
11529 |
-
swipeRight: function( e, touch ) {
|
11530 |
-
jQuery( touch.startEvnt.target ).closest( 'div' ).find( '.nf-item-duplicate' ).hide();
|
11531 |
-
jQuery( touch.startEvnt.target ).closest( 'div' ).find( '.nf-item-delete' ).hide();
|
11532 |
-
},
|
11533 |
-
|
11534 |
-
tapend: function( e, touch ) {
|
11535 |
-
jQuery( this.el ).ClassyWiggle( 'stop' );
|
11536 |
-
jQuery( this.el ).removeClass( 'ui-sortable-helper drag-selected' );
|
11537 |
-
},
|
11538 |
-
|
11539 |
-
remove: function(){
|
11540 |
-
if ( nfRadio.channel( 'fields' ).request( 'get:removing' ) ) {
|
11541 |
-
this.$el.hide( 'clip', function(){
|
11542 |
-
jQuery( this ).remove();
|
11543 |
-
});
|
11544 |
-
} else {
|
11545 |
-
this.$el.remove();
|
11546 |
-
}
|
11547 |
-
|
11548 |
-
nfRadio.channel( 'fields' ).request( 'set:removing', false );
|
11549 |
-
},
|
11550 |
-
|
11551 |
-
mouseoverItemControl: function( e ) {
|
11552 |
-
jQuery( this.el ).find( '.nf-item-control' ).css( 'display', '' );
|
11553 |
-
}
|
11554 |
-
|
11555 |
-
});
|
11556 |
-
|
11557 |
-
return view;
|
11558 |
-
} );
|
11559 |
-
/**
|
11560 |
-
* Handles all the actions/functions related to our main field sortable.
|
11561 |
-
* All of the actual logic for our sortable is held here; the view just calls it using nfRadio.
|
11562 |
-
*
|
11563 |
-
* @package Ninja Forms builder
|
11564 |
-
* @subpackage Fields
|
11565 |
-
* @copyright (c) 2015 WP Ninjas
|
11566 |
-
* @since 3.0
|
11567 |
-
*/
|
11568 |
-
define( 'controllers/fields/sortable',['models/fields/fieldModel', 'views/fields/fieldItem'], function(FieldModel, FieldItemView) {
|
11569 |
-
var controller = Marionette.Object.extend( {
|
11570 |
-
initialize: function() {
|
11571 |
-
// When our field type buttons are dragged, we need to add or remove the active (blue) class.
|
11572 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:type', this.addActiveClass );
|
11573 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:type', this.removeActiveClass );
|
11574 |
-
// When our field staging is dragged, we need to add or remove the active (blue) class.
|
11575 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'startDrag:fieldStaging', this.addActiveClass );
|
11576 |
-
this.listenTo( nfRadio.channel( 'drawer-addField' ), 'stopDrag:fieldStaging', this.removeActiveClass );
|
11577 |
-
|
11578 |
-
/*
|
11579 |
-
* Handles all the events fired by our sortable:
|
11580 |
-
* receive - dropped from type button or staging
|
11581 |
-
* over - dragging within or over the sortable
|
11582 |
-
* out - leaving the sortable
|
11583 |
-
* stop - stopped sorting/dragging
|
11584 |
-
* start - started sorting/dragging
|
11585 |
-
* update - stopped sorting/dragging and order has changed
|
11586 |
-
*/
|
11587 |
-
nfRadio.channel( 'app' ).reply( 'receive:fieldsSortable', this.receiveFieldsSortable, this );
|
11588 |
-
nfRadio.channel( 'app' ).reply( 'over:fieldsSortable', this.overfieldsSortable, this );
|
11589 |
-
nfRadio.channel( 'app' ).reply( 'out:fieldsSortable', this.outFieldsSortable, this );
|
11590 |
-
nfRadio.channel( 'app' ).reply( 'stop:fieldsSortable', this.stopFieldsSortable, this );
|
11591 |
-
nfRadio.channel( 'app' ).reply( 'start:fieldsSortable', this.startFieldsSortable, this );
|
11592 |
-
nfRadio.channel( 'app' ).reply( 'update:fieldsSortable', this.updateFieldsSortable, this );
|
11593 |
-
nfRadio.channel( 'app' ).reply( 'receive:repeaterField', this.receiveRepeaterField, this );
|
11594 |
-
},
|
11595 |
-
|
11596 |
-
/**
|
11597 |
-
* Add the active class to our sortable so that its border is blue.
|
11598 |
-
*
|
11599 |
-
* @since 3.0
|
11600 |
-
* @return void
|
11601 |
-
*/
|
11602 |
-
addActiveClass: function() {
|
11603 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11604 |
-
jQuery( sortableEl ).addClass( 'nf-droppable-active' );
|
11605 |
-
},
|
11606 |
-
|
11607 |
-
/**
|
11608 |
-
* Remove the active class from our sortable
|
11609 |
-
*
|
11610 |
-
* @since 3.0
|
11611 |
-
* @return void
|
11612 |
-
*/
|
11613 |
-
removeActiveClass: function() {
|
11614 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11615 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-active' );
|
11616 |
-
},
|
11617 |
-
|
11618 |
-
/**
|
11619 |
-
* Fires when we drop a field type button or staging onto our sortable
|
11620 |
-
*
|
11621 |
-
* @since 3.0
|
11622 |
-
* @param Object ui jQuery UI element
|
11623 |
-
* @return void
|
11624 |
-
*/
|
11625 |
-
receiveFieldsSortable: function( ui ) {
|
11626 |
-
//Check for fields coming from a repeater field
|
11627 |
-
ui = this.receiveRepeaterField(ui);
|
11628 |
-
/*
|
11629 |
-
* We have to do different things if we're dealing with a field type button or staging area.
|
11630 |
-
*/
|
11631 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // Field Type Button
|
11632 |
-
// Get our type string
|
11633 |
-
var type = jQuery( ui.item ).data( 'id' );
|
11634 |
-
// Add a field (returns the tmp ID )
|
11635 |
-
var tmpID = this.addField( type, false );
|
11636 |
-
/*
|
11637 |
-
* Update our helper id to the tmpID.
|
11638 |
-
* We do this so that when we sort, we have the proper ID.
|
11639 |
-
*/
|
11640 |
-
jQuery( ui.helper ).prop( 'id', tmpID );
|
11641 |
-
nfRadio.channel( 'fields' ).request( 'sort:fields' );
|
11642 |
-
// Remove the helper. Gets rid of a weird type artifact.
|
11643 |
-
jQuery( ui.helper ).remove();
|
11644 |
-
// Trigger a drop field type event.
|
11645 |
-
nfRadio.channel( 'fields' ).trigger( 'drop:fieldType', type, tmpID );
|
11646 |
-
|
11647 |
-
} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging
|
11648 |
-
// Later, we want to reference 'this' context, so we define it here.
|
11649 |
-
var that = this;
|
11650 |
-
// Make sure that our staged fields are sorted properly.
|
11651 |
-
nfRadio.channel( 'fields' ).request( 'sort:staging' );
|
11652 |
-
// Grab our staged fields.
|
11653 |
-
var stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );
|
11654 |
-
// Get our current field order.
|
11655 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11656 |
-
|
11657 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) { // Sortable isn't empty
|
11658 |
-
// If we're dealing with a sortable that isn't empty, get the order.
|
11659 |
-
var order = jQuery( sortableEl ).sortable( 'toArray' );
|
11660 |
-
} else { // Sortable is empty
|
11661 |
-
// Sortable is empty, all we care about is our staged field draggable.
|
11662 |
-
var order = ['nf-staged-fields-drag'];
|
11663 |
-
}
|
11664 |
-
|
11665 |
-
// Get the index of our droped element.
|
11666 |
-
var insertedAt = order.indexOf( 'nf-staged-fields-drag' );
|
11667 |
-
|
11668 |
-
// Loop through each staged fields model and insert a field.
|
11669 |
-
var tmpIDs = [];
|
11670 |
-
_.each( stagedFields.models, function( field, index ) {
|
11671 |
-
// Add our field.
|
11672 |
-
var tmpID = that.addField( field.get( 'slug' ) );
|
11673 |
-
// Add this newly created field to our order array.
|
11674 |
-
order.splice( insertedAt + index, 0, tmpID );
|
11675 |
-
} );
|
11676 |
-
|
11677 |
-
// Remove our dropped element from our order array.
|
11678 |
-
var insertedAt = order.indexOf( 'nf-staged-fields-drag' );
|
11679 |
-
order.splice( insertedAt, 1 );
|
11680 |
-
// Sort our fields
|
11681 |
-
nfRadio.channel( 'fields' ).request( 'sort:fields', order );
|
11682 |
-
// Clear our staging
|
11683 |
-
nfRadio.channel( 'fields' ).request( 'clear:staging' );
|
11684 |
-
// Remove our helper. Fixes a weird artifact.
|
11685 |
-
jQuery( ui.helper ).remove();
|
11686 |
-
}
|
11687 |
-
},
|
11688 |
-
|
11689 |
-
/**
|
11690 |
-
* Add a field.
|
11691 |
-
* Builds the object necessary to add a field to the field model collection.
|
11692 |
-
*
|
11693 |
-
* @since 3.0
|
11694 |
-
* @param string type field type
|
11695 |
-
* @param boolean silent add silently
|
11696 |
-
* @return string tmpID
|
11697 |
-
*/
|
11698 |
-
addField: function( type, silent ) {
|
11699 |
-
// Default to false
|
11700 |
-
silent = silent || false;
|
11701 |
-
// Get our field type model
|
11702 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
11703 |
-
// Get our tmp ID
|
11704 |
-
var tmpID = nfRadio.channel( 'fields' ).request( 'get:tmpID' );
|
11705 |
-
// Add our field
|
11706 |
-
var newModel = nfRadio.channel( 'fields' ).request( 'add', { id: tmpID, label: fieldType.get( 'nicename' ), type: type }, silent );
|
11707 |
-
// Add our field addition to our change log.
|
11708 |
-
var label = {
|
11709 |
-
object: 'Field',
|
11710 |
-
label: newModel.get( 'label' ),
|
11711 |
-
change: 'Added',
|
11712 |
-
dashicon: 'plus-alt'
|
11713 |
-
};
|
11714 |
-
|
11715 |
-
var data = {
|
11716 |
-
collection: nfRadio.channel( 'fields' ).request( 'get:collection' )
|
11717 |
-
}
|
11718 |
-
|
11719 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addObject', newModel, null, label, data );
|
11720 |
-
|
11721 |
-
return tmpID;
|
11722 |
-
},
|
11723 |
-
|
11724 |
-
/**
|
11725 |
-
* When the user drags a field type or staging over our sortable, we need to modify the helper.
|
11726 |
-
*
|
11727 |
-
* @since 3.0
|
11728 |
-
* @param Object ui jQuery UI element
|
11729 |
-
* @return void
|
11730 |
-
*/
|
11731 |
-
overfieldsSortable: function( ui ) {
|
11732 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // Field Type
|
11733 |
-
// String type
|
11734 |
-
var type = jQuery( ui.helper ).data( 'id' );
|
11735 |
-
// Get our field type model.
|
11736 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
11737 |
-
// Get our field type nicename.
|
11738 |
-
var label = fieldType.get( 'nicename' );
|
11739 |
-
// Get our sortable element.
|
11740 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11741 |
-
// Get our fieldwidth.
|
11742 |
-
var fieldWidth = jQuery( sortableEl ).width();
|
11743 |
-
// Set our currentHelper to an object var so that we can access it later.
|
11744 |
-
this.currentHelper = ui.helper;
|
11745 |
-
|
11746 |
-
// Render a fieldItemView using a mock fieldModel.
|
11747 |
-
var fieldModel = new FieldModel({ label: fieldType.get( 'nicename' ), type: type });
|
11748 |
-
var fieldItemView = new FieldItemView({model:fieldModel});
|
11749 |
-
var renderedFieldItemView = fieldItemView.render();
|
11750 |
-
var fieldTypeEl = renderedFieldItemView.$el[0];
|
11751 |
-
jQuery( ui.helper ).html( fieldTypeEl.outerHTML );
|
11752 |
-
|
11753 |
-
} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging
|
11754 |
-
// Get our sortable, and if it's initialized add our hover class.
|
11755 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11756 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
11757 |
-
jQuery( sortableEl ).addClass( 'nf-droppable-hover' );
|
11758 |
-
}
|
11759 |
-
}
|
11760 |
-
},
|
11761 |
-
|
11762 |
-
/**
|
11763 |
-
* When the user moves a draggable outside of the sortable, we need to change the helper.
|
11764 |
-
* This returns the item to its pre-over state.
|
11765 |
-
*
|
11766 |
-
* @since 3.0
|
11767 |
-
* @param Object ui jQuery UI element
|
11768 |
-
* @return void
|
11769 |
-
*/
|
11770 |
-
outFieldsSortable: function( ui ) {
|
11771 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // Field Type
|
11772 |
-
/*
|
11773 |
-
* Get our helper clone.
|
11774 |
-
* This will let us access the previous label and classes of our helper.
|
11775 |
-
*/
|
11776 |
-
var helperClone = nfRadio.channel( 'drawer-addField' ).request( 'get:typeHelperClone' );
|
11777 |
-
// Set our helper label, remove our sortable class, and add the type class back to the type draggable.
|
11778 |
-
jQuery( this.currentHelper ).html( jQuery( helperClone ).html() );
|
11779 |
-
jQuery( this.currentHelper ).removeClass( 'nf-field-wrap' ).addClass( 'nf-field-type-button' ).css( { 'width': '', 'height': '' } );
|
11780 |
-
// Get our sortable and if it has been intialized, remove the droppable hover class.
|
11781 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11782 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
11783 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-hover' );
|
11784 |
-
}
|
11785 |
-
} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging
|
11786 |
-
// If we've initialized our sortable, remove the droppable hover class.
|
11787 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
11788 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
11789 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-hover' );
|
11790 |
-
}
|
11791 |
-
}
|
11792 |
-
},
|
11793 |
-
|
11794 |
-
/**
|
11795 |
-
* When we stop dragging in the sortable:
|
11796 |
-
* remove our opacity setting
|
11797 |
-
* remove our ui helper
|
11798 |
-
*
|
11799 |
-
* @since 3.0
|
11800 |
-
* @param Object ui jQuery UI element
|
11801 |
-
* @return void
|
11802 |
-
*/
|
11803 |
-
stopFieldsSortable: function( ui ) {
|
11804 |
-
jQuery( ui.item ).css( 'opacity', '' );
|
11805 |
-
jQuery( ui.helper ).remove();
|
11806 |
-
nfRadio.channel( 'fields' ).trigger( 'sortable:stop', ui );
|
11807 |
-
},
|
11808 |
-
|
11809 |
-
/**
|
11810 |
-
* When we start dragging in the sortable:
|
11811 |
-
* add an opacity setting of 0.5
|
11812 |
-
* show our item (jQuery hides the original item by default)
|
11813 |
-
*
|
11814 |
-
* @since 3.0
|
11815 |
-
* @param Object ui jQuery UI element
|
11816 |
-
* @return void
|
11817 |
-
*/
|
11818 |
-
startFieldsSortable: function( ui ) {
|
11819 |
-
// If we aren't dragging an item in from types or staging, update our change log.
|
11820 |
-
if( ! jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) && ! jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
|
11821 |
-
|
11822 |
-
// Maintain origional visibility during drag/sort.
|
11823 |
-
jQuery( ui.item ).show();
|
11824 |
-
|
11825 |
-
// Determine helper based on builder/layout type.
|
11826 |
-
if(jQuery(ui.item).hasClass('nf-field-wrap')){
|
11827 |
-
var newHelper = jQuery(ui.item).clone();
|
11828 |
-
} else if(jQuery(ui.item).parent().hasClass('layouts-cell')) {
|
11829 |
-
var newHelper = $parentHelper.clone();
|
11830 |
-
} else {
|
11831 |
-
var newHelper = jQuery(ui.item).clone();
|
11832 |
-
}
|
11833 |
-
|
11834 |
-
// Remove unecessary item controls from helper.
|
11835 |
-
newHelper.find('.nf-item-controls').remove();
|
11836 |
-
|
11837 |
-
// Update helper with clone's content.
|
11838 |
-
jQuery( ui.helper ).html( newHelper.html() );
|
11839 |
-
|
11840 |
-
jQuery( ui.helper ).css( 'opacity', '0.5' );
|
11841 |
-
|
11842 |
-
// Add de-emphasize origional.
|
11843 |
-
jQuery( ui.item ).css( 'opacity', '0.25' );
|
11844 |
-
}
|
11845 |
-
nfRadio.channel( 'fields' ).trigger( 'sortable:start', ui );
|
11846 |
-
},
|
11847 |
-
|
11848 |
-
/**
|
11849 |
-
* Sort our fields when we change the order.
|
11850 |
-
*
|
11851 |
-
* @since 3.0
|
11852 |
-
* @param Object ui jQuery UI element
|
11853 |
-
* @return void
|
11854 |
-
*/
|
11855 |
-
updateFieldsSortable: function( ui, sortable ) {
|
11856 |
-
|
11857 |
-
nfRadio.channel( 'fields' ).request( 'sort:fields' );
|
11858 |
-
|
11859 |
-
// If we aren't dragging an item in from types or staging, update our change log.
|
11860 |
-
if( ! jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) && ! jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
|
11861 |
-
|
11862 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
11863 |
-
var dragFieldID = jQuery( ui.item ).prop( 'id' ).replace( 'field-', '' );
|
11864 |
-
var dragModel = fieldCollection.get( dragFieldID );
|
11865 |
-
|
11866 |
-
// Add our change event to the change tracker.
|
11867 |
-
var data = { fields: [] };
|
11868 |
-
_.each( fieldCollection.models, function( field ) {
|
11869 |
-
var oldPos = field._previousAttributes.order;
|
11870 |
-
var newPos = field.get( 'order' );
|
11871 |
-
|
11872 |
-
data.fields.push( {
|
11873 |
-
model: field,
|
11874 |
-
attr: 'order',
|
11875 |
-
before: oldPos,
|
11876 |
-
after: newPos
|
11877 |
-
} );
|
11878 |
-
|
11879 |
-
} );
|
11880 |
-
|
11881 |
-
var label = {
|
11882 |
-
object: 'Field',
|
11883 |
-
label: dragModel.get( 'label' ),
|
11884 |
-
change: 'Re-ordered from ' + dragModel._previousAttributes.order + ' to ' + dragModel.get( 'order' ),
|
11885 |
-
dashicon: 'sort'
|
11886 |
-
};
|
11887 |
-
|
11888 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'sortFields', dragModel, null, label, data );
|
11889 |
-
}
|
11890 |
-
|
11891 |
-
},
|
11892 |
-
|
11893 |
-
receiveRepeaterField: function( ui ){
|
11894 |
-
//If the field was already saved as a Repeater child field we'll delete it and create a new one for the main collection
|
11895 |
-
if( String( jQuery( ui.item ).data('id') ).indexOf('.') !== -1){
|
11896 |
-
jQuery( ui.item ).removeClass('nf-field-wrap');
|
11897 |
-
let type = jQuery( ui.item ).attr('class');
|
11898 |
-
jQuery( ui.item ).data('id', type);
|
11899 |
-
jQuery( ui.item ).addClass('nf-field-type-draggable');
|
11900 |
-
}
|
11901 |
-
|
11902 |
-
return ui;
|
11903 |
-
|
11904 |
-
}
|
11905 |
-
});
|
11906 |
-
|
11907 |
-
return controller;
|
11908 |
-
} );
|
11909 |
-
/**
|
11910 |
-
* Handles interactions with our field collection.
|
11911 |
-
*
|
11912 |
-
* @package Ninja Forms builder
|
11913 |
-
* @subpackage Fields
|
11914 |
-
* @copyright (c) 2015 WP Ninjas
|
11915 |
-
* @since 3.0
|
11916 |
-
*/
|
11917 |
-
define( 'controllers/fields/data',['models/fields/fieldCollection', 'models/fields/fieldModel'], function( fieldCollection, fieldModel ) {
|
11918 |
-
var controller = Marionette.Object.extend( {
|
11919 |
-
adding: false,
|
11920 |
-
removing: false,
|
11921 |
-
|
11922 |
-
initialize: function() {
|
11923 |
-
// Load our field collection from our localized form data
|
11924 |
-
this.collection = new fieldCollection( preloadedFormData.fields );
|
11925 |
-
// Set our removedIDs to an empty object. This will be populated when a field is removed so that we can add it to our 'deleted_fields' object.
|
11926 |
-
this.collection.removedIDs = {};
|
11927 |
-
|
11928 |
-
// Respond to requests for data about fields and to update/change/delete fields from our collection.
|
11929 |
-
nfRadio.channel( 'fields' ).reply( 'get:collection', this.getFieldCollection, this );
|
11930 |
-
nfRadio.channel( 'fields' ).reply( 'get:field', this.getField, this );
|
11931 |
-
nfRadio.channel( 'fields' ).reply( 'redraw:collection', this.redrawFieldCollection, this );
|
11932 |
-
nfRadio.channel( 'fields' ).reply( 'get:tmpID', this.getTmpFieldID, this );
|
11933 |
-
|
11934 |
-
nfRadio.channel( 'fields' ).reply( 'add', this.addField, this );
|
11935 |
-
nfRadio.channel( 'fields' ).reply( 'delete', this.deleteField, this );
|
11936 |
-
nfRadio.channel( 'fields' ).reply( 'sort:fields', this.sortFields, this );
|
11937 |
-
|
11938 |
-
/*
|
11939 |
-
* Respond to requests to set our 'adding' and 'removing' state. This state is used to track whether or not
|
11940 |
-
* we should run animations in our fields collection.
|
11941 |
-
*/
|
11942 |
-
nfRadio.channel( 'fields' ).reply( 'get:adding', this.getAdding, this );
|
11943 |
-
nfRadio.channel( 'fields' ).reply( 'set:adding', this.setAdding, this );
|
11944 |
-
nfRadio.channel( 'fields' ).reply( 'get:removing', this.getRemoving, this );
|
11945 |
-
nfRadio.channel( 'fields' ).reply( 'set:removing', this.setRemoving, this );
|
11946 |
-
},
|
11947 |
-
|
11948 |
-
getFieldCollection: function() {
|
11949 |
-
return this.collection;
|
11950 |
-
},
|
11951 |
-
|
11952 |
-
redrawFieldCollection: function() {
|
11953 |
-
this.collection.trigger( 'reset', this.collection );
|
11954 |
-
},
|
11955 |
-
|
11956 |
-
getField: function( id ) {
|
11957 |
-
if ( this.collection.findWhere( { key: id } ) ) {
|
11958 |
-
/*
|
11959 |
-
* First we check to see if a key matches what we were sent.
|
11960 |
-
*/
|
11961 |
-
return this.collection.findWhere( { key: id } );
|
11962 |
-
} else {
|
11963 |
-
/*
|
11964 |
-
* If it doesn't, we try to return an ID that matches.
|
11965 |
-
*/
|
11966 |
-
return this.collection.get( id );
|
11967 |
-
}
|
11968 |
-
},
|
11969 |
-
|
11970 |
-
/**
|
11971 |
-
* Add a field to our collection. If silent is passed as true, no events will trigger.
|
11972 |
-
*
|
11973 |
-
* @since 3.0
|
11974 |
-
* @param Object data field data to insert
|
11975 |
-
* @param bool silent prevent events from firing as a result of adding
|
11976 |
-
* @param bool renderTrigger should this cause the view to re-render?
|
11977 |
-
* @param string action action context - are we performing a higher level action? i.e. duplicate
|
11978 |
-
*/
|
11979 |
-
addField: function( data, silent, renderTrigger, action ) {
|
11980 |
-
|
11981 |
-
/*
|
11982 |
-
* Set our fields 'adding' value to true. This enables our add field animation.
|
11983 |
-
*/
|
11984 |
-
nfRadio.channel( 'fields' ).request( 'set:adding', true );
|
11985 |
-
|
11986 |
-
silent = silent || false;
|
11987 |
-
action = action || '';
|
11988 |
-
renderTrigger = ( 'undefined' == typeof renderTrigger ) ? true : renderTrigger;
|
11989 |
-
|
11990 |
-
if ( false === data instanceof Backbone.Model ) {
|
11991 |
-
if ( 'undefined' == typeof ( data.id ) ) {
|
11992 |
-
data.id = this.getTmpFieldID();
|
11993 |
-
}
|
11994 |
-
var model = new fieldModel( data );
|
11995 |
-
} else {
|
11996 |
-
var model = data;
|
11997 |
-
}
|
11998 |
-
|
11999 |
-
/*
|
12000 |
-
* TODO: Add an nfRadio message filter for the model variable.
|
12001 |
-
* Currently, we manually replace for saved fields; this should be moved to a separate controller.
|
12002 |
-
*
|
12003 |
-
* If we're adding a saved field, make sure that we set the type to the parentType.
|
12004 |
-
*/
|
12005 |
-
|
12006 |
-
if ( jQuery.isNumeric( model.get( 'type' ) ) ) {
|
12007 |
-
var savedType = nfRadio.channel( 'fields' ).request( 'get:type', model.get( 'type' ) );
|
12008 |
-
model.set( 'type', savedType.get( 'parentType' ) );
|
12009 |
-
}
|
12010 |
-
|
12011 |
-
var newModel = this.collection.add( model, { silent: silent } );
|
12012 |
-
|
12013 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
12014 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
12015 |
-
nfRadio.channel( 'fields' ).trigger( 'add:field', model );
|
12016 |
-
if ( renderTrigger ) {
|
12017 |
-
nfRadio.channel( 'fields' ).trigger( 'render:newField', newModel, action );
|
12018 |
-
}
|
12019 |
-
if( 'duplicate' == action ){
|
12020 |
-
nfRadio.channel( 'fields' ).trigger( 'render:duplicateField', newModel, action );
|
12021 |
-
}
|
12022 |
-
nfRadio.channel( 'fields' ).trigger( 'after:addField', model );
|
12023 |
-
|
12024 |
-
return model;
|
12025 |
-
},
|
12026 |
-
|
12027 |
-
/**
|
12028 |
-
* Update a field setting by ID
|
12029 |
-
*
|
12030 |
-
* @since 3.0
|
12031 |
-
* @param int id field id
|
12032 |
-
* @param string name setting name
|
12033 |
-
* @param mixed value setting value
|
12034 |
-
* @return void
|
12035 |
-
*/
|
12036 |
-
updateFieldSetting: function( id, name, value ) {
|
12037 |
-
var fieldModel = this.collection.get( id );
|
12038 |
-
fieldModel.set( name, value );
|
12039 |
-
},
|
12040 |
-
|
12041 |
-
/**
|
12042 |
-
* Get our fields sortable EL
|
12043 |
-
*
|
12044 |
-
* @since 3.0
|
12045 |
-
* @param Array order optional order array like: [field-1, field-4, field-2]
|
12046 |
-
* @return void
|
12047 |
-
*/
|
12048 |
-
sortFields: function( order, ui, updateDB ) {
|
12049 |
-
if ( null == updateDB ) {
|
12050 |
-
updateDB = true;
|
12051 |
-
}
|
12052 |
-
// Get our sortable element
|
12053 |
-
var sortableEl = nfRadio.channel( 'fields' ).request( 'get:sortableEl' );
|
12054 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) { // Make sure that sortable is enabled
|
12055 |
-
// JS ternerary for setting our order
|
12056 |
-
var order = order || jQuery( sortableEl ).sortable( 'toArray' );
|
12057 |
-
|
12058 |
-
// Loop through all of our fields and update their order value
|
12059 |
-
_.each( this.collection.models, function( field ) {
|
12060 |
-
// Get our current position.
|
12061 |
-
var oldPos = field.get( 'order' );
|
12062 |
-
var id = field.get( 'id' );
|
12063 |
-
if ( jQuery.isNumeric( id ) ) {
|
12064 |
-
var search = 'field-' + id;
|
12065 |
-
} else {
|
12066 |
-
var search = id;
|
12067 |
-
}
|
12068 |
-
|
12069 |
-
// Get the index of our field inside our order array
|
12070 |
-
var newPos = order.indexOf( search ) + 1;
|
12071 |
-
field.set( 'order', newPos );
|
12072 |
-
} );
|
12073 |
-
this.collection.sort();
|
12074 |
-
|
12075 |
-
if ( updateDB ) {
|
12076 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
12077 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
12078 |
-
// Update our preview
|
12079 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
12080 |
-
}
|
12081 |
-
}
|
12082 |
-
},
|
12083 |
-
|
12084 |
-
/**
|
12085 |
-
* Delete a field from our collection.
|
12086 |
-
*
|
12087 |
-
* @since 3.0
|
12088 |
-
* @param backbone.model model field model to be deleted
|
12089 |
-
* @return void
|
12090 |
-
*/
|
12091 |
-
deleteField: function( model ) {
|
12092 |
-
nfRadio.channel( 'fields' ).trigger( 'delete:field', model );
|
12093 |
-
this.removing = true;
|
12094 |
-
this.collection.remove( model );
|
12095 |
-
|
12096 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
12097 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
12098 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
12099 |
-
|
12100 |
-
},
|
12101 |
-
|
12102 |
-
/**
|
12103 |
-
* Return a new tmp id for our fields.
|
12104 |
-
* Gets the field collection length, adds 1, then returns that prepended with 'tmp-'.
|
12105 |
-
*
|
12106 |
-
* @since 3.0
|
12107 |
-
* @return string
|
12108 |
-
*/
|
12109 |
-
getTmpFieldID: function() {
|
12110 |
-
var tmpNum = this.collection.tmpNum;
|
12111 |
-
this.collection.tmpNum++;
|
12112 |
-
return 'tmp-' + tmpNum;
|
12113 |
-
},
|
12114 |
-
|
12115 |
-
getAdding: function() {
|
12116 |
-
return this.adding;
|
12117 |
-
},
|
12118 |
-
|
12119 |
-
setAdding: function( val ) {
|
12120 |
-
this.adding = val;
|
12121 |
-
},
|
12122 |
-
|
12123 |
-
getRemoving: function() {
|
12124 |
-
return this.removing;
|
12125 |
-
},
|
12126 |
-
|
12127 |
-
setRemoving: function( val ) {
|
12128 |
-
this.removing = val;
|
12129 |
-
}
|
12130 |
-
});
|
12131 |
-
|
12132 |
-
return controller;
|
12133 |
-
} );
|
12134 |
-
/**
|
12135 |
-
* Model for our repeater option.
|
12136 |
-
*
|
12137 |
-
* @package Ninja App builder
|
12138 |
-
* @subpackage Fields
|
12139 |
-
* @copyright (c) 2015 WP Ninjas
|
12140 |
-
* @since 3.0
|
12141 |
-
*/
|
12142 |
-
define( 'models/app/optionRepeaterModel',[], function() {
|
12143 |
-
var model = Backbone.Model.extend( {
|
12144 |
-
defaults: {
|
12145 |
-
errors: {},
|
12146 |
-
max_options: 0,
|
12147 |
-
},
|
12148 |
-
|
12149 |
-
initialize: function() {
|
12150 |
-
// When we add errors to the option row, run a function.
|
12151 |
-
this.on( 'change:errors', this.changeErrors, this );
|
12152 |
-
},
|
12153 |
-
|
12154 |
-
/**
|
12155 |
-
* When we change the errors on our model, check to see if we should add or remove
|
12156 |
-
* the error from the setting that this option is a part of.
|
12157 |
-
*
|
12158 |
-
* Adding an error to the setting model simply disables the drawer and other
|
12159 |
-
* navigation. As long as we have one option with an error, it should be set to true.
|
12160 |
-
*
|
12161 |
-
* @since 3.0
|
12162 |
-
* @return void
|
12163 |
-
*/
|
12164 |
-
changeErrors: function( model ) {
|
12165 |
-
/*
|
12166 |
-
* The errors attribute will be an object, so if we don't have any keys, it's empty.
|
12167 |
-
* If we have an empty object, check to see if we can remove the error from our setting model.
|
12168 |
-
*/
|
12169 |
-
|
12170 |
-
if ( 0 == _.size( model.get( 'errors' ) ) ) {
|
12171 |
-
/*
|
12172 |
-
* Loop through our collection to see if we have any other errors.
|
12173 |
-
*/
|
12174 |
-
var errorsFound = false;
|
12175 |
-
_.each( model.collection.models, function( opt ) {
|
12176 |
-
if ( 0 != _.size( opt.get( 'errors' ) ) ) {
|
12177 |
-
errorsFound = true;
|
12178 |
-
}
|
12179 |
-
} );
|
12180 |
-
if ( ! errorsFound ) {
|
12181 |
-
model.collection.settingModel.set( 'error', false );
|
12182 |
-
}
|
12183 |
-
} else {
|
12184 |
-
/*
|
12185 |
-
* We have errors, so make sure that the setting model has an error set.
|
12186 |
-
*/
|
12187 |
-
model.collection.settingModel.set( 'error', true );
|
12188 |
-
}
|
12189 |
-
}
|
12190 |
-
} );
|
12191 |
-
|
12192 |
-
return model;
|
12193 |
-
} );
|
12194 |
-
/**
|
12195 |
-
* Model that represents our list options.
|
12196 |
-
*
|
12197 |
-
* @package Ninja Forms builder
|
12198 |
-
* @subpackage Fields
|
12199 |
-
* @copyright (c) 2015 WP Ninjas
|
12200 |
-
* @since 3.0
|
12201 |
-
*/
|
12202 |
-
define( 'models/app/optionRepeaterCollection',['models/app/optionRepeaterModel'], function( listOptionModel ) {
|
12203 |
-
var collection = Backbone.Collection.extend( {
|
12204 |
-
model: listOptionModel,
|
12205 |
-
comparator: function( model ){
|
12206 |
-
return parseInt( model.get( 'order' ) );
|
12207 |
-
},
|
12208 |
-
|
12209 |
-
initialize: function( models, options ) {
|
12210 |
-
// Listen to the 'sort' event
|
12211 |
-
this.on( 'sort', this.changeCollection, this );
|
12212 |
-
// Listen to the 'add' event
|
12213 |
-
this.on( 'add', this.addOption, this );
|
12214 |
-
this.settingModel = options.settingModel;
|
12215 |
-
},
|
12216 |
-
|
12217 |
-
changeCollection: function() {
|
12218 |
-
// Trigger a 'sort:options' event so that our field model can update
|
12219 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'sort:options', this );
|
12220 |
-
|
12221 |
-
if ('undefined' !== typeof this.settingModel ) {
|
12222 |
-
nfRadio.channel('option-repeater-' + this.settingModel.get('name')).trigger('sort:options', this);
|
12223 |
-
}
|
12224 |
-
},
|
12225 |
-
|
12226 |
-
addOption: function( model, collection ) {
|
12227 |
-
model.set( 'settingModel', this.settingModel );
|
12228 |
-
}
|
12229 |
-
} );
|
12230 |
-
return collection;
|
12231 |
-
} );
|
12232 |
-
define( 'views/app/drawer/optionRepeaterError',[], function() {
|
12233 |
-
var view = Marionette.ItemView.extend({
|
12234 |
-
tagName: 'div',
|
12235 |
-
className: 'nf-error',
|
12236 |
-
template: '#tmpl-nf-edit-setting-option-repeater-error',
|
12237 |
-
|
12238 |
-
templateHelpers: function() {
|
12239 |
-
var that = this;
|
12240 |
-
return {
|
12241 |
-
renderErrors: function() {
|
12242 |
-
if ( 'undefined' != typeof that.errors ) {
|
12243 |
-
return that.errors[ Object.keys( errors )[0] ];
|
12244 |
-
} else {
|
12245 |
-
return '';
|
12246 |
-
}
|
12247 |
-
}
|
12248 |
-
}
|
12249 |
-
}
|
12250 |
-
});
|
12251 |
-
|
12252 |
-
return view;
|
12253 |
-
} );
|
12254 |
-
define( 'views/app/drawer/optionRepeaterOption',['views/app/drawer/optionRepeaterError'], function( ErrorView ) {
|
12255 |
-
var view = Marionette.LayoutView.extend({
|
12256 |
-
tagName: 'div',
|
12257 |
-
className: 'nf-table-row',
|
12258 |
-
template: '#tmpl-nf-edit-setting-option-repeater-default-row',
|
12259 |
-
id: function() {
|
12260 |
-
return this.model.cid;
|
12261 |
-
},
|
12262 |
-
|
12263 |
-
regions: {
|
12264 |
-
error: '.nf-option-error'
|
12265 |
-
},
|
12266 |
-
|
12267 |
-
initialize: function( data ) {
|
12268 |
-
this.settingModel = data.settingModel;
|
12269 |
-
this.dataModel = data.dataModel;
|
12270 |
-
this.collection = data.collection;
|
12271 |
-
this.columns = data.columns;
|
12272 |
-
this.parentView = data.parentView;
|
12273 |
-
this.model.on( 'change:errors', this.renderErrors, this );
|
12274 |
-
|
12275 |
-
// Removed because the re-render was breaking tag insertion for merge tags.
|
12276 |
-
// this.model.on( 'change', this.render, this );
|
12277 |
-
|
12278 |
-
if ( 'undefined' != typeof this.settingModel.get( 'tmpl_row' ) ) {
|
12279 |
-
this.template = '#' + this.settingModel.get( 'tmpl_row' );
|
12280 |
-
}
|
12281 |
-
|
12282 |
-
this.hasErrors = false;
|
12283 |
-
},
|
12284 |
-
|
12285 |
-
onBeforeDestroy: function() {
|
12286 |
-
this.model.off( 'change', this.render );
|
12287 |
-
this.model.off( 'change:errors', this.renderErrors );
|
12288 |
-
},
|
12289 |
-
|
12290 |
-
onBeforeRender: function() {
|
12291 |
-
/*
|
12292 |
-
* We want to escape any HTML being output for our label.
|
12293 |
-
*/
|
12294 |
-
if ( this.model.get( 'label' ) ) {
|
12295 |
-
var label = this.model.get( 'label' );
|
12296 |
-
this.model.set( 'label', _.escape( label ), { silent: true } );
|
12297 |
-
}
|
12298 |
-
|
12299 |
-
},
|
12300 |
-
|
12301 |
-
onRender: function() {
|
12302 |
-
nfRadio.channel( 'mergeTags' ).request( 'init', this );
|
12303 |
-
/*
|
12304 |
-
* Send out a radio message.
|
12305 |
-
*/
|
12306 |
-
nfRadio.channel( 'setting-' + this.settingModel.get( 'name' ) + '-option' ).trigger( 'render:setting', this.model, this.dataModel, this );
|
12307 |
-
/*
|
12308 |
-
* We want to unescape any HTML being output for our label.
|
12309 |
-
*/
|
12310 |
-
if ( this.model.get( 'label' ) ) {
|
12311 |
-
var label = this.model.get( 'label' );
|
12312 |
-
this.model.set( 'label', _.unescape( label ), { silent: true } );
|
12313 |
-
}
|
12314 |
-
},
|
12315 |
-
|
12316 |
-
onShow: function() {
|
12317 |
-
if ( this.model.get( 'new' ) ) {
|
12318 |
-
jQuery( this.el ).find( 'input:first' ).focus();
|
12319 |
-
this.model.set( 'new', false );
|
12320 |
-
}
|
12321 |
-
},
|
12322 |
-
|
12323 |
-
events: {
|
12324 |
-
'change .setting': 'changeOption',
|
12325 |
-
'click .nf-delete': 'deleteOption',
|
12326 |
-
'keyup': 'keyupOption'
|
12327 |
-
},
|
12328 |
-
|
12329 |
-
changeOption: function( e ) {
|
12330 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'change:option', e, this.model, this.dataModel, this.settingModel, this );
|
12331 |
-
},
|
12332 |
-
|
12333 |
-
deleteOption: function( e ) {
|
12334 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'click:deleteOption', this.model, this.collection, this.dataModel, this );
|
12335 |
-
},
|
12336 |
-
|
12337 |
-
keyupOption: function( e ) {
|
12338 |
-
this.maybeAddOption( e );
|
12339 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
|
12340 |
-
nfRadio.channel( 'option-repeater-' + this.settingModel.get( 'name' ) ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
|
12341 |
-
},
|
12342 |
-
|
12343 |
-
maybeAddOption: function( e ) {
|
12344 |
-
if ( 13 == e.keyCode && 'calculations' != this.settingModel.get( 'name' ) ) {
|
12345 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel, this );
|
12346 |
-
jQuery( this.parentView.children.findByIndex(this.parentView.children.length - 1).el ).find( '[data-id="label"]' ).focus();
|
12347 |
-
}
|
12348 |
-
},
|
12349 |
-
|
12350 |
-
renderErrors: function() {
|
12351 |
-
|
12352 |
-
// if ( jQuery.isEmptyObject( this.model.get( 'errors' ) ) ) {
|
12353 |
-
// return false;
|
12354 |
-
// }
|
12355 |
-
|
12356 |
-
/*
|
12357 |
-
* We don't want to redraw the entire row, which would remove focus from the eq textarea,
|
12358 |
-
* so we add and remove error classes manually.
|
12359 |
-
*/
|
12360 |
-
if ( 0 == Object.keys( this.model.get( 'errors' ) ) ) {
|
12361 |
-
if ( this.hasErrors ) {
|
12362 |
-
this.error.empty();
|
12363 |
-
jQuery( this.el ).removeClass( 'nf-error' );
|
12364 |
-
}
|
12365 |
-
} else {
|
12366 |
-
this.hasErrors = true;
|
12367 |
-
this.error.show( new ErrorView( { model: this.model } ) );
|
12368 |
-
jQuery( this.el ).addClass( 'nf-error' );
|
12369 |
-
}
|
12370 |
-
},
|
12371 |
-
|
12372 |
-
templateHelpers: function() {
|
12373 |
-
var that = this;
|
12374 |
-
return {
|
12375 |
-
getColumns: function() {
|
12376 |
-
var columns = that.columns;
|
12377 |
-
if(!nfAdmin.devMode){
|
12378 |
-
delete columns.value;
|
12379 |
-
delete columns.calc;
|
12380 |
-
}
|
12381 |
-
return columns;
|
12382 |
-
},
|
12383 |
-
renderFieldSelect: function( dataID, value ){
|
12384 |
-
var initialOption, select, emptyContainer, label;
|
12385 |
-
|
12386 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
12387 |
-
|
12388 |
-
initialOption = document.createElement( 'option' );
|
12389 |
-
initialOption.value = '';
|
12390 |
-
initialOption.label = '--';
|
12391 |
-
initialOption.innerHTML = '--';
|
12392 |
-
|
12393 |
-
select = document.createElement( 'select' );
|
12394 |
-
select.classList.add( 'setting' );
|
12395 |
-
select.setAttribute( 'data-id', dataID );
|
12396 |
-
select.appendChild( initialOption );
|
12397 |
-
|
12398 |
-
fields.each( function( field ){
|
12399 |
-
var option = document.createElement( 'option' );
|
12400 |
-
if ( value == field.get( 'key' ) ) {
|
12401 |
-
option.setAttribute( 'selected', 'selected' );
|
12402 |
-
}
|
12403 |
-
option.value = field.get( 'key' );
|
12404 |
-
option.innerHTML = field.formatLabel();
|
12405 |
-
option.label = field.formatLabel();
|
12406 |
-
select.appendChild( option );
|
12407 |
-
});
|
12408 |
-
|
12409 |
-
label = document.createElement( 'label' );
|
12410 |
-
label.classList.add( 'nf-select' );
|
12411 |
-
label.appendChild( select );
|
12412 |
-
|
12413 |
-
// Select Lists need an empty '<div></div>' for styling purposes.
|
12414 |
-
emptyContainer = document.createElement( 'div' );
|
12415 |
-
emptyContainer.style.bottom = '6px';
|
12416 |
-
label.appendChild( emptyContainer );
|
12417 |
-
|
12418 |
-
// The template requires a string.
|
12419 |
-
return label.innerHTML;
|
12420 |
-
},
|
12421 |
-
renderNonSaveFieldSelect: function( dataID, value ){
|
12422 |
-
var initialOption, select, emptyContainer, label;
|
12423 |
-
|
12424 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
12425 |
-
|
12426 |
-
initialOption = document.createElement( 'option' );
|
12427 |
-
initialOption.value = '';
|
12428 |
-
initialOption.label = '--';
|
12429 |
-
initialOption.innerHTML = '--';
|
12430 |
-
|
12431 |
-
select = document.createElement( 'select' );
|
12432 |
-
select.classList.add( 'setting' );
|
12433 |
-
select.setAttribute( 'data-id', dataID );
|
12434 |
-
select.appendChild( initialOption );
|
12435 |
-
|
12436 |
-
// Build a lookup table for fields we want to remove from our fields list.
|
12437 |
-
var removeFieldsLookup = [ 'html', 'submit', 'hr',
|
12438 |
-
'recaptcha', 'spam', 'creditcard', 'creditcardcvc',
|
12439 |
-
'creditcardexpiration', 'creditcardfullname',
|
12440 |
-
'creditcardnumber', 'creditcardzip' ];
|
12441 |
-
|
12442 |
-
fields.each( function( field ){
|
12443 |
-
// Check for the field type in our lookup array and...
|
12444 |
-
if( jQuery.inArray( field.get( 'type' ), removeFieldsLookup ) !== -1 ) {
|
12445 |
-
// Return if the type is in our lookup array.
|
12446 |
-
return '';
|
12447 |
-
}
|
12448 |
-
|
12449 |
-
var option = document.createElement( 'option' );
|
12450 |
-
if ( value == field.get( 'key' ) ) {
|
12451 |
-
option.setAttribute( 'selected', 'selected' );
|
12452 |
-
}
|
12453 |
-
option.value = field.get( 'key' );
|
12454 |
-
option.innerHTML = field.formatLabel();
|
12455 |
-
option.label = field.formatLabel();
|
12456 |
-
select.appendChild( option );
|
12457 |
-
});
|
12458 |
-
|
12459 |
-
label = document.createElement( 'label' );
|
12460 |
-
label.classList.add( 'nf-select' );
|
12461 |
-
label.appendChild( select );
|
12462 |
-
|
12463 |
-
// Select Lists need an empty '<div></div>' for styling purposes.
|
12464 |
-
emptyContainer = document.createElement( 'div' );
|
12465 |
-
emptyContainer.style.bottom = '6px';
|
12466 |
-
label.appendChild( emptyContainer );
|
12467 |
-
|
12468 |
-
// The template requires a string.
|
12469 |
-
return label.innerHTML;
|
12470 |
-
},
|
12471 |
-
renderOptions: function( column, value ) {
|
12472 |
-
|
12473 |
-
if( 'undefined' == typeof that.options.columns[ column ] ) return;
|
12474 |
-
|
12475 |
-
var select = document.createElement( 'select' );
|
12476 |
-
|
12477 |
-
_.each( that.options.columns[ column ].options, function( option ){
|
12478 |
-
var optionNode = document.createElement( 'option' );
|
12479 |
-
if ( value === option.value ) {
|
12480 |
-
optionNode.setAttribute( 'selected', 'selected' );
|
12481 |
-
}
|
12482 |
-
optionNode.setAttribute( 'value', option.value );
|
12483 |
-
optionNode.setAttribute( 'label', option.label );
|
12484 |
-
optionNode.innerText = option.label;
|
12485 |
-
select.appendChild( optionNode );
|
12486 |
-
});
|
12487 |
-
|
12488 |
-
// The template only needs the options.
|
12489 |
-
return select.innerHTML;
|
12490 |
-
}
|
12491 |
-
|
12492 |
-
}
|
12493 |
-
}
|
12494 |
-
|
12495 |
-
});
|
12496 |
-
|
12497 |
-
return view;
|
12498 |
-
} );
|
12499 |
-
|
12500 |
-
define( 'views/app/drawer/optionRepeaterEmpty',[], function() {
|
12501 |
-
var view = Marionette.ItemView.extend({
|
12502 |
-
tagName: 'tr',
|
12503 |
-
template: '#tmpl-nf-edit-setting-option-repeater-empty'
|
12504 |
-
});
|
12505 |
-
|
12506 |
-
return view;
|
12507 |
-
} );
|
12508 |
-
define( 'views/app/drawer/optionRepeaterComposite',['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeaterEmpty', 'models/app/optionRepeaterCollection'], function( listOptionView, listEmptyView, listOptionCollection ) {
|
12509 |
-
var view = Marionette.CompositeView.extend( {
|
12510 |
-
template: '#tmpl-nf-edit-setting-option-repeater-wrap',
|
12511 |
-
childView: listOptionView,
|
12512 |
-
emptyView: listEmptyView,
|
12513 |
-
reorderOnSort: false,
|
12514 |
-
|
12515 |
-
initialize: function( data ) {
|
12516 |
-
|
12517 |
-
/*
|
12518 |
-
* Our options are stored in our database as objects, not collections.
|
12519 |
-
* Before we attempt to render them, we need to convert them to a collection if they aren't already one.
|
12520 |
-
*/
|
12521 |
-
var optionCollection = data.dataModel.get( this.model.get( 'name' ) );
|
12522 |
-
|
12523 |
-
if ( false == optionCollection instanceof Backbone.Collection ) {
|
12524 |
-
optionCollection = new listOptionCollection( [], { settingModel: this.model } );
|
12525 |
-
optionCollection.add( data.dataModel.get( this.model.get( 'name' ) ) );
|
12526 |
-
data.dataModel.set( this.model.get( 'name' ), optionCollection, { silent: true } );
|
12527 |
-
}
|
12528 |
-
|
12529 |
-
this.collection = optionCollection;
|
12530 |
-
this.dataModel = data.dataModel;
|
12531 |
-
this.childViewOptions = { parentView: this, settingModel: this.model, collection: this.collection, dataModel: data.dataModel, columns: this.model.get( 'columns' ) };
|
12532 |
-
|
12533 |
-
var deps = this.model.get( 'deps' );
|
12534 |
-
if ( deps ) {
|
12535 |
-
// If we don't have a 'settings' property, this is a legacy depdency setup.
|
12536 |
-
if ( 'undefined' == typeof deps.settings ) {
|
12537 |
-
deps.settings = [];
|
12538 |
-
_.each(deps, function(dep, name){
|
12539 |
-
if( 'settings' !== name ) {
|
12540 |
-
deps.settings.push( { name: name, value: dep } );
|
12541 |
-
}
|
12542 |
-
});
|
12543 |
-
deps.match = 'all';
|
12544 |
-
}
|
12545 |
-
|
12546 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
12547 |
-
let name = deps.settings[i].name;
|
12548 |
-
this.dataModel.on( 'change:' + name, this.render, this );
|
12549 |
-
}
|
12550 |
-
}
|
12551 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'added:option', this.maybeHideNew );
|
12552 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'removed:option', this.maybeHideNew );
|
12553 |
-
},
|
12554 |
-
|
12555 |
-
onBeforeDestroy: function() {
|
12556 |
-
var deps = this.model.get( 'deps' );
|
12557 |
-
if ( deps ) {
|
12558 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
12559 |
-
name = deps.settings[i].name;
|
12560 |
-
this.dataModel.off( 'change:' + name, this.render );
|
12561 |
-
}
|
12562 |
-
}
|
12563 |
-
},
|
12564 |
-
|
12565 |
-
onRender: function() {
|
12566 |
-
// this.$el = this.$el.children();
|
12567 |
-
// this.$el.unwrap();
|
12568 |
-
// this.setElement( this.$el );
|
12569 |
-
|
12570 |
-
// this.$el = this.$el.children();
|
12571 |
-
// this.$el.unwrap();
|
12572 |
-
// this.setElement( this.$el );
|
12573 |
-
|
12574 |
-
var that = this;
|
12575 |
-
jQuery( this.el ).find( '.nf-list-options-tbody' ).sortable( {
|
12576 |
-
handle: '.handle',
|
12577 |
-
helper: 'clone',
|
12578 |
-
placeholder: 'nf-list-options-sortable-placeholder',
|
12579 |
-
forcePlaceholderSize: true,
|
12580 |
-
opacity: 0.95,
|
12581 |
-
tolerance: 'pointer',
|
12582 |
-
|
12583 |
-
start: function( e, ui ) {
|
12584 |
-
nfRadio.channel( 'option-repeater' ).request( 'start:optionSortable', ui );
|
12585 |
-
},
|
12586 |
-
|
12587 |
-
stop: function( e, ui ) {
|
12588 |
-
nfRadio.channel( 'option-repeater' ).request( 'stop:optionSortable', ui );
|
12589 |
-
},
|
12590 |
-
|
12591 |
-
update: function( e, ui ) {
|
12592 |
-
nfRadio.channel( 'option-repeater' ).request( 'update:optionSortable', ui, this, that );
|
12593 |
-
}
|
12594 |
-
} );
|
12595 |
-
|
12596 |
-
that.setupTooltip();
|
12597 |
-
that.maybeHideNew( that.collection );
|
12598 |
-
|
12599 |
-
/*
|
12600 |
-
* Send out a radio message.
|
12601 |
-
*/
|
12602 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
12603 |
-
|
12604 |
-
},
|
12605 |
-
|
12606 |
-
onAttach: function() {
|
12607 |
-
|
12608 |
-
var importLink = jQuery( this.el ).find( '.nf-open-import-tooltip' );
|
12609 |
-
var jBox = jQuery( importLink ).jBox( 'Tooltip', {
|
12610 |
-
title: '<h3>Please enter your options below:</h3>',
|
12611 |
-
content: ( "1" == nfAdmin.devMode ? jQuery( this.el ).find( '.nf-dev-import-options' ) : jQuery( this.el ).find( '.nf-import-options' ) ),
|
12612 |
-
trigger: 'click',
|
12613 |
-
closeOnClick: 'body',
|
12614 |
-
closeButton: 'box',
|
12615 |
-
offset: { x: 20, y: 0 },
|
12616 |
-
addClass: 'import-options',
|
12617 |
-
|
12618 |
-
onOpen: function() {
|
12619 |
-
var that = this;
|
12620 |
-
setTimeout( function() { jQuery( that.content ).find( 'textarea' ).focus(); }, 200 );
|
12621 |
-
}
|
12622 |
-
} );
|
12623 |
-
|
12624 |
-
jQuery( this.el ).find( '.nf-import' ).on( 'click', { view: this, jBox: jBox }, this.clickImport );
|
12625 |
-
|
12626 |
-
/*
|
12627 |
-
* Send out a radio message.
|
12628 |
-
*/
|
12629 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
12630 |
-
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
12631 |
-
},
|
12632 |
-
|
12633 |
-
/**
|
12634 |
-
* Function to append jBox modals to each tooltip element in the option repeater.
|
12635 |
-
*/
|
12636 |
-
setupTooltip: function() {
|
12637 |
-
// For each .nf-help in the option repeater...
|
12638 |
-
jQuery( this.el ).find( '.nf-list-options' ).find( '.nf-help' ).each(function() {
|
12639 |
-
// Get the content.
|
12640 |
-
var content = jQuery(this).next('.nf-help-text');
|
12641 |
-
// Declare the modal.
|
12642 |
-
jQuery( this ).jBox( 'Tooltip', {
|
12643 |
-
content: content,
|
12644 |
-
maxWidth: 200,
|
12645 |
-
theme: 'TooltipBorder',
|
12646 |
-
trigger: 'click',
|
12647 |
-
closeOnClick: true
|
12648 |
-
})
|
12649 |
-
});
|
12650 |
-
},
|
12651 |
-
|
12652 |
-
templateHelpers: function () {
|
12653 |
-
var that = this;
|
12654 |
-
|
12655 |
-
return {
|
12656 |
-
renderHeaders: function() {
|
12657 |
-
// If this is a Field...
|
12658 |
-
// AND If the type includes 'list'...
|
12659 |
-
if ( 'Field' == that.dataModel.get( 'objectType' ) && -1 !== that.dataModel.get( 'type' ).indexOf( 'list' ) ) {
|
12660 |
-
// Declare help text.
|
12661 |
-
var helpText, helpTextContainer, helpIcon, helpIconLink, helpTextWrapper;
|
12662 |
-
|
12663 |
-
helpText = document.createTextNode( nfi18n.valueChars );
|
12664 |
-
helpTextContainer = document.createElement( 'div' );
|
12665 |
-
helpTextContainer.classList.add( 'nf-help-text' );
|
12666 |
-
helpTextContainer.appendChild( helpText );
|
12667 |
-
|
12668 |
-
helpIcon = document.createElement( 'span' );
|
12669 |
-
helpIcon.classList.add( 'dashicons', 'dashicons-admin-comments' );
|
12670 |
-
helpIconLink = document.createElement( 'a' );
|
12671 |
-
helpIconLink.classList.add( 'nf-help' );
|
12672 |
-
helpIconLink.setAttribute( 'href', '#' );
|
12673 |
-
helpIconLink.setAttribute( 'tabindex', '-1' );
|
12674 |
-
helpIconLink.appendChild( helpIcon );
|
12675 |
-
|
12676 |
-
helpTextWrapper = document.createElement( 'span' );
|
12677 |
-
helpTextWrapper.appendChild( helpIconLink );
|
12678 |
-
helpTextWrapper.appendChild( helpTextContainer );
|
12679 |
-
|
12680 |
-
// Append the help text to the 'value' header.
|
12681 |
-
if('undefined' !== typeof that.model.get('columns') ){
|
12682 |
-
if('undefined' !== typeof that.model.get('columns').value ){
|
12683 |
-
if ( -1 == that.model.get('columns').value.header.indexOf( helpTextWrapper.innerHTML ) ) {
|
12684 |
-
that.model.get('columns').value.header += helpTextWrapper.innerHTML;
|
12685 |
-
}
|
12686 |
-
}
|
12687 |
-
}
|
12688 |
-
}
|
12689 |
-
var columns, beforeColumns, afterColumns;
|
12690 |
-
|
12691 |
-
beforeColumns = document.createElement( 'div' );
|
12692 |
-
|
12693 |
-
columns = document.createElement( 'span' );
|
12694 |
-
columns.appendChild( beforeColumns );
|
12695 |
-
|
12696 |
-
if(!nfAdmin.devMode){
|
12697 |
-
delete this.columns.value;
|
12698 |
-
delete this.columns.calc;
|
12699 |
-
}
|
12700 |
-
|
12701 |
-
_.each( this.columns, function( col ) {
|
12702 |
-
var headerText, headerContainer;
|
12703 |
-
|
12704 |
-
// Use a fragment to support HTML in the col.header property, ie Dashicons.
|
12705 |
-
headerText = document.createRange().createContextualFragment( col.header );
|
12706 |
-
headerContainer = document.createElement( 'div' );
|
12707 |
-
headerContainer.appendChild( headerText );
|
12708 |
-
|
12709 |
-
columns.appendChild( headerContainer );
|
12710 |
-
} );
|
12711 |
-
|
12712 |
-
afterColumns = document.createElement( 'div' );
|
12713 |
-
columns.appendChild( afterColumns );
|
12714 |
-
|
12715 |
-
return columns.innerHTML;
|
12716 |
-
},
|
12717 |
-
|
12718 |
-
renderSetting: function() {
|
12719 |
-
var setting = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-edit-setting-' + this.type );
|
12720 |
-
return setting( this );
|
12721 |
-
},
|
12722 |
-
|
12723 |
-
renderClasses: function() {
|
12724 |
-
var classes = '';
|
12725 |
-
if ( 'undefined' != typeof this.width ) {
|
12726 |
-
classes += this.width;
|
12727 |
-
} else {
|
12728 |
-
classes += ' one-half';
|
12729 |
-
}
|
12730 |
-
|
12731 |
-
if ( this.error ) {
|
12732 |
-
classes += ' nf-error';
|
12733 |
-
}
|
12734 |
-
|
12735 |
-
return classes;
|
12736 |
-
},
|
12737 |
-
|
12738 |
-
renderVisible: function() {
|
12739 |
-
return nfRadio.channel( 'settings' ).request( 'check:deps', this, that );
|
12740 |
-
},
|
12741 |
-
|
12742 |
-
renderError: function() {
|
12743 |
-
if ( this.error ) {
|
12744 |
-
return this.error;
|
12745 |
-
}
|
12746 |
-
return '';
|
12747 |
-
},
|
12748 |
-
|
12749 |
-
renderFieldsetClasses: function() {
|
12750 |
-
return that.model.get( 'name' );
|
12751 |
-
},
|
12752 |
-
|
12753 |
-
currencySymbol: function() {
|
12754 |
-
return nfRadio.channel( 'settings' ).request( 'get:setting', 'currency' ) || nfi18n.currency_symbol;
|
12755 |
-
}
|
12756 |
-
};
|
12757 |
-
},
|
12758 |
-
|
12759 |
-
attachHtml: function( collectionView, childView ) {
|
12760 |
-
jQuery( collectionView.el ).find( '.nf-list-options-tbody' ).append( childView.el );
|
12761 |
-
nfRadio.channel( 'mergeTags' ).request( 'init', this );
|
12762 |
-
},
|
12763 |
-
|
12764 |
-
events: {
|
12765 |
-
'click .nf-add-new': 'clickAddOption',
|
12766 |
-
'click .extra': 'clickExtra'
|
12767 |
-
},
|
12768 |
-
|
12769 |
-
maybeHideNew: function( collection ) {
|
12770 |
-
if( 'undefined' == typeof collection.settingModel ) return false;
|
12771 |
-
var limit = collection.settingModel.get( 'max_options' );
|
12772 |
-
if( 0 !== limit && collection.models.length >= ( limit ) ) {
|
12773 |
-
jQuery(this.el).find('.nf-add-new').addClass('disabled');
|
12774 |
-
} else {
|
12775 |
-
jQuery(this.el).find('.nf-add-new').removeClass('disabled');
|
12776 |
-
}
|
12777 |
-
},
|
12778 |
-
|
12779 |
-
clickAddOption: function( e ) {
|
12780 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel );
|
12781 |
-
jQuery( this.children.findByIndex(this.children.length - 1).el ).find( '[data-id="label"]' ).focus();
|
12782 |
-
},
|
12783 |
-
|
12784 |
-
clickExtra: function( e ) {
|
12785 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'click:extra', e, this.collection, this.dataModel );
|
12786 |
-
nfRadio.channel( 'option-repeater-' + this.model.get( 'name' ) ).trigger( 'click:extra', e, this.model, this.collection, this.dataModel );
|
12787 |
-
},
|
12788 |
-
|
12789 |
-
clickImport: function( e ) {
|
12790 |
-
var textarea = jQuery( e.data.jBox.content ).find( 'textarea' );
|
12791 |
-
var value = textarea.val().trimLeft().trimRight();
|
12792 |
-
/*
|
12793 |
-
* Return early if we have no strings.
|
12794 |
-
*/
|
12795 |
-
if ( 0 == value.length ) {
|
12796 |
-
e.data.jBox.close();
|
12797 |
-
return false;
|
12798 |
-
}
|
12799 |
-
/*
|
12800 |
-
* Split our value based on new lines.
|
12801 |
-
*/
|
12802 |
-
|
12803 |
-
var lines = value.split(/\n/);
|
12804 |
-
if ( _.isArray( lines ) ) {
|
12805 |
-
/*
|
12806 |
-
* Loop over
|
12807 |
-
*/
|
12808 |
-
_.each( lines, function( line ) {
|
12809 |
-
var row = line.split( ',' );
|
12810 |
-
var label = row[0];
|
12811 |
-
var value = row[1] || jQuery.slugify( label, { separator: '-' } );
|
12812 |
-
var calc = row[2] || '';
|
12813 |
-
|
12814 |
-
label = label.trimLeft().trimRight();
|
12815 |
-
value = value.trimLeft().trimRight();
|
12816 |
-
calc = calc.trimLeft().trimRight();
|
12817 |
-
/*
|
12818 |
-
* Add our row to the collection
|
12819 |
-
*/
|
12820 |
-
var model = e.data.view.collection.add( { label: row[0], value: value, calc: calc } );
|
12821 |
-
// Add our field addition to our change log.
|
12822 |
-
var label = {
|
12823 |
-
object: 'field',
|
12824 |
-
label: row[0],
|
12825 |
-
change: 'Option Added',
|
12826 |
-
dashicon: 'plus-alt'
|
12827 |
-
};
|
12828 |
-
|
12829 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addListOption', model, null, label );
|
12830 |
-
nfRadio.channel( 'option-repeater-' + e.data.view.model.get( 'name' ) ).trigger( 'add:option', model );
|
12831 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'add:option', model );
|
12832 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', model );
|
12833 |
-
}, this );
|
12834 |
-
/*
|
12835 |
-
* Set our state to unclean so that the user can publish.
|
12836 |
-
*/
|
12837 |
-
} else {
|
12838 |
-
/*
|
12839 |
-
* TODO: Error Handling Here
|
12840 |
-
*/
|
12841 |
-
}
|
12842 |
-
textarea.val( '' );
|
12843 |
-
e.data.jBox.close();
|
12844 |
-
},
|
12845 |
-
} );
|
12846 |
-
|
12847 |
-
return view;
|
12848 |
-
} );
|
12849 |
-
|
12850 |
-
/**
|
12851 |
-
* Handles tasks associated with our option-repeater.
|
12852 |
-
*
|
12853 |
-
* Return our repeater child view.
|
12854 |
-
*
|
12855 |
-
* Also listens for changes to the options settings.
|
12856 |
-
*
|
12857 |
-
* @package Ninja Forms builder
|
12858 |
-
* @subpackage App
|
12859 |
-
* @copyright (c) 2015 WP Ninjas
|
12860 |
-
* @since 3.0
|
12861 |
-
*/
|
12862 |
-
define( 'controllers/app/optionRepeater',['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection', 'views/app/drawer/optionRepeaterComposite'], function( listOptionModel, listOptionCollection, listCompositeView ) {
|
12863 |
-
var controller = Marionette.Object.extend( {
|
12864 |
-
initialize: function() {
|
12865 |
-
// Respond to requests for the childView for list type fields.
|
12866 |
-
nfRadio.channel( 'option-repeater' ).reply( 'get:settingChildView', this.getSettingChildView, this );
|
12867 |
-
|
12868 |
-
// Listen for changes to our list options.
|
12869 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'change:option', this.changeOption );
|
12870 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'click:addOption', this.addOption );
|
12871 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'click:deleteOption', this.deleteOption );
|
12872 |
-
|
12873 |
-
// Respond to requests related to our list options sortable.
|
12874 |
-
nfRadio.channel( 'option-repeater' ).reply( 'update:optionSortable', this.updateOptionSortable, this );
|
12875 |
-
nfRadio.channel( 'option-repeater' ).reply( 'stop:optionSortable', this.stopOptionSortable, this );
|
12876 |
-
nfRadio.channel( 'option-repeater' ).reply( 'start:optionSortable', this.startOptionSortable, this );
|
12877 |
-
|
12878 |
-
/**
|
12879 |
-
* When we init our setting model, we need to convert our array/objects into collections/models
|
12880 |
-
*/
|
12881 |
-
this.listenTo( nfRadio.channel( 'option-repeater' ), 'init:dataModel', this.convertSettings );
|
12882 |
-
},
|
12883 |
-
|
12884 |
-
/**
|
12885 |
-
* Update an option value in our model.
|
12886 |
-
*
|
12887 |
-
* @since 3.0
|
12888 |
-
* @param Object e event
|
12889 |
-
* @param backbone.model model option model
|
12890 |
-
* @param backbone.model dataModel
|
12891 |
-
* @return void
|
12892 |
-
*/
|
12893 |
-
changeOption: function( e, model, dataModel, settingModel, optionView ) {
|
12894 |
-
var name = jQuery( e.target ).data( 'id' );
|
12895 |
-
if ( 'selected' == name ) {
|
12896 |
-
if ( jQuery( e.target ).prop( 'checked' ) ) {
|
12897 |
-
var value = 1;
|
12898 |
-
} else {
|
12899 |
-
var value = 0;
|
12900 |
-
}
|
12901 |
-
} else {
|
12902 |
-
var value = jQuery( e.target ).val();
|
12903 |
-
}
|
12904 |
-
|
12905 |
-
var before = model.get( name );
|
12906 |
-
|
12907 |
-
model.set( name, value );
|
12908 |
-
// Trigger an update on our dataModel
|
12909 |
-
this.triggerDataModel( model, dataModel );
|
12910 |
-
|
12911 |
-
var after = value;
|
12912 |
-
|
12913 |
-
var changes = {
|
12914 |
-
attr: name,
|
12915 |
-
before: before,
|
12916 |
-
after: after
|
12917 |
-
}
|
12918 |
-
|
12919 |
-
var label = {
|
12920 |
-
object: dataModel.get( 'objectType' ),
|
12921 |
-
label: dataModel.get( 'label' ),
|
12922 |
-
change: 'Option ' + model.get( 'label' ) + ' ' + name + ' changed from ' + before + ' to ' + after
|
12923 |
-
};
|
12924 |
-
|
12925 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'changeSetting', model, changes, label );
|
12926 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'update:option', model, dataModel, settingModel, optionView );
|
12927 |
-
nfRadio.channel( 'option-repeater-option-' + name ).trigger( 'update:option', e, model, dataModel, settingModel, optionView );
|
12928 |
-
nfRadio.channel( 'option-repeater-' + settingModel.get( 'name' ) ).trigger( 'update:option', model, dataModel, settingModel, optionView );
|
12929 |
-
},
|
12930 |
-
|
12931 |
-
/**
|
12932 |
-
* Add an option to our list
|
12933 |
-
*
|
12934 |
-
* @since 3.0
|
12935 |
-
* @param backbone.collection collection list option collection
|
12936 |
-
* @param backbone.model dataModel
|
12937 |
-
* @return void
|
12938 |
-
*/
|
12939 |
-
addOption: function( collection, dataModel ) {
|
12940 |
-
var modelData = {
|
12941 |
-
order: collection.length,
|
12942 |
-
new: true,
|
12943 |
-
options: {}
|
12944 |
-
};
|
12945 |
-
/**
|
12946 |
-
* If we don't actually have a 'settingModel' duplicated fields
|
12947 |
-
* can't add options until publish and the builder is reloaded.
|
12948 |
-
* If we ignore the code if we don't have settingsModel, then it
|
12949 |
-
* works.
|
12950 |
-
*/
|
12951 |
-
if ( 'undefined' !== typeof collection.settingModel ) {
|
12952 |
-
var limit = collection.settingModel.get( 'max_options' );
|
12953 |
-
if ( 0 !== limit && collection.models.length >= limit ) {
|
12954 |
-
return;
|
12955 |
-
}
|
12956 |
-
_.each( collection.settingModel.get( 'columns' ), function ( col, key ) {
|
12957 |
-
modelData[ key ] = col.default;
|
12958 |
-
|
12959 |
-
if ( 'undefined' != typeof col.options ) {
|
12960 |
-
modelData.options[ key ] = col.options;
|
12961 |
-
}
|
12962 |
-
});
|
12963 |
-
}
|
12964 |
-
var model = new listOptionModel( modelData );
|
12965 |
-
collection.add( model );
|
12966 |
-
|
12967 |
-
// Add our field addition to our change log.
|
12968 |
-
var label = {
|
12969 |
-
object: dataModel.get( 'objectType' ),
|
12970 |
-
label: dataModel.get( 'label' ),
|
12971 |
-
change: 'Option Added',
|
12972 |
-
dashicon: 'plus-alt'
|
12973 |
-
};
|
12974 |
-
|
12975 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addListOption', model, null, label );
|
12976 |
-
|
12977 |
-
if ( 'undefined' !== typeof collection.settingModel ) {
|
12978 |
-
nfRadio.channel('option-repeater-' + collection.settingModel.get('name')).trigger('add:option', model);
|
12979 |
-
}
|
12980 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'add:option', model );
|
12981 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'added:option', collection );
|
12982 |
-
this.triggerDataModel( model, dataModel );
|
12983 |
-
},
|
12984 |
-
|
12985 |
-
/**
|
12986 |
-
* Delete an option from our list
|
12987 |
-
*
|
12988 |
-
* @since 3.0
|
12989 |
-
* @param backbone.model model list option model
|
12990 |
-
* @param backbone.collection collection list option collection
|
12991 |
-
* @param backbone.model dataModel
|
12992 |
-
* @return void
|
12993 |
-
*/
|
12994 |
-
deleteOption: function( model, collection, dataModel ) {
|
12995 |
-
var newModel = nfRadio.channel( 'app' ).request( 'clone:modelDeep', model );
|
12996 |
-
|
12997 |
-
// Add our field deletion to our change log.
|
12998 |
-
var label = {
|
12999 |
-
object: dataModel.get( 'objectType' ),
|
13000 |
-
label: dataModel.get( 'label' ),
|
13001 |
-
change: 'Option ' + newModel.get( 'label' ) + ' Removed',
|
13002 |
-
dashicon: 'dismiss'
|
13003 |
-
};
|
13004 |
-
|
13005 |
-
var data = {
|
13006 |
-
collection: collection
|
13007 |
-
}
|
13008 |
-
|
13009 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'removeListOption', newModel, null, label, data );
|
13010 |
-
|
13011 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
13012 |
-
var results = changeCollection.where( { model: model } );
|
13013 |
-
|
13014 |
-
_.each( results, function( changeModel ) {
|
13015 |
-
if ( 'object' == typeof changeModel.get( 'data' ) ) {
|
13016 |
-
_.each( changeModel.get( 'data' ), function( dataModel ) {
|
13017 |
-
if ( dataModel.model == dataModel ) {
|
13018 |
-
dataModel.model = newModel;
|
13019 |
-
}
|
13020 |
-
} );
|
13021 |
-
}
|
13022 |
-
changeModel.set( 'model', newModel );
|
13023 |
-
changeModel.set( 'disabled', true );
|
13024 |
-
} );
|
13025 |
-
|
13026 |
-
collection.remove( model );
|
13027 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'remove:option', model );
|
13028 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'removed:option', collection );
|
13029 |
-
nfRadio.channel( 'option-repeater-' + collection.settingModel.get( 'name' ) ).trigger( 'remove:option', model );
|
13030 |
-
this.triggerDataModel( model, dataModel );
|
13031 |
-
},
|
13032 |
-
|
13033 |
-
/**
|
13034 |
-
* Creates an arbitrary value on our collection, then clones and updates that collection.
|
13035 |
-
* This forces a change event to be fired on the dataModel where the list option collection data is stored.
|
13036 |
-
*
|
13037 |
-
* @since 3.0
|
13038 |
-
* @param backbone.collection collection list option collection
|
13039 |
-
* @param backbone.model dataModel
|
13040 |
-
* @return void
|
13041 |
-
*/
|
13042 |
-
triggerDataModel: function( model, dataModel ) {
|
13043 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', model );
|
13044 |
-
},
|
13045 |
-
|
13046 |
-
/**
|
13047 |
-
* Return our list composite view to the setting collection view.
|
13048 |
-
*
|
13049 |
-
* @since 3.0
|
13050 |
-
* @param backbone.model model settings model
|
13051 |
-
* @return void
|
13052 |
-
*/
|
13053 |
-
getSettingChildView: function( model ) {
|
13054 |
-
return listCompositeView;
|
13055 |
-
},
|
13056 |
-
|
13057 |
-
/**
|
13058 |
-
* When we sort our list options, change the order in our option model and trigger a change.
|
13059 |
-
*
|
13060 |
-
* @since 3.0
|
13061 |
-
* @param Object sortable jQuery UI element
|
13062 |
-
* @param backbone.view setting Setting view
|
13063 |
-
* @return void
|
13064 |
-
*/
|
13065 |
-
updateOptionSortable: function( ui, sortable, setting ) {
|
13066 |
-
var newOrder = jQuery( sortable ).sortable( 'toArray' );
|
13067 |
-
var dragModel = setting.collection.get( { cid: jQuery( ui.item ).prop( 'id' ) } );
|
13068 |
-
var data = {
|
13069 |
-
collection: setting.collection,
|
13070 |
-
objModels: []
|
13071 |
-
};
|
13072 |
-
|
13073 |
-
_.each( newOrder, function( cid, index ) {
|
13074 |
-
var optionModel = setting.collection.get( { cid: cid } );
|
13075 |
-
var oldPos = optionModel.get( 'order' );
|
13076 |
-
optionModel.set( 'order', index );
|
13077 |
-
var newPos = index;
|
13078 |
-
|
13079 |
-
data.objModels.push( {
|
13080 |
-
model: optionModel,
|
13081 |
-
attr: 'order',
|
13082 |
-
before: oldPos,
|
13083 |
-
after: newPos
|
13084 |
-
} );
|
13085 |
-
} );
|
13086 |
-
|
13087 |
-
setting.collection.sort( { silent: true } );
|
13088 |
-
|
13089 |
-
var label = {
|
13090 |
-
object: setting.dataModel.get( 'objectType' ),
|
13091 |
-
label: setting.dataModel.get( 'label' ),
|
13092 |
-
change: 'Option ' + dragModel.get( 'label' ) + ' re-ordered from ' + dragModel._previousAttributes.order + ' to ' + dragModel.get( 'order' ),
|
13093 |
-
dashicon: 'sort'
|
13094 |
-
};
|
13095 |
-
|
13096 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'sortListOptions', dragModel, null, label, data );
|
13097 |
-
this.triggerDataModel( dragModel, setting.dataModel );
|
13098 |
-
nfRadio.channel( 'option-repeater' ).trigger( 'sort:option', dragModel, setting );
|
13099 |
-
nfRadio.channel( 'option-repeater-' + setting.model.get( 'name' ) ).trigger( 'sort:option', dragModel, setting );
|
13100 |
-
},
|
13101 |
-
|
13102 |
-
/**
|
13103 |
-
* When we stop sorting our list options, reset our item opacity.
|
13104 |
-
*
|
13105 |
-
* @since 3.0
|
13106 |
-
* @param Object ui jQuery UI element
|
13107 |
-
* @return void
|
13108 |
-
*/
|
13109 |
-
stopOptionSortable: function( ui ) {
|
13110 |
-
jQuery( ui.item ).css( 'opacity', '' );
|
13111 |
-
},
|
13112 |
-
|
13113 |
-
/**
|
13114 |
-
* When we start sorting our list options, remove containing divs and set our item opacity to 0.5
|
13115 |
-
*
|
13116 |
-
* @since 3.0
|
13117 |
-
* @param Objects ui jQuery UI element
|
13118 |
-
* @return void
|
13119 |
-
*/
|
13120 |
-
startOptionSortable: function( ui ) {
|
13121 |
-
jQuery( ui.placeholder ).find( 'div' ).remove();
|
13122 |
-
jQuery( ui.item ).css( 'opacity', '0.5' ).show();
|
13123 |
-
},
|
13124 |
-
|
13125 |
-
/**
|
13126 |
-
* Convert settings from an array/object to a collection/model
|
13127 |
-
*
|
13128 |
-
* @since 3.0
|
13129 |
-
* @param Backbone.Model dataModel
|
13130 |
-
* @param Backbone.Model settingModel
|
13131 |
-
* @return void
|
13132 |
-
*/
|
13133 |
-
convertSettings: function( dataModel, settingModel ) {
|
13134 |
-
/*
|
13135 |
-
* Our options are stored in our database as objects, not collections.
|
13136 |
-
* Before we attempt to render them, we need to convert them to a collection if they aren't already one.
|
13137 |
-
*/
|
13138 |
-
var optionCollection = dataModel.get( settingModel.get( 'name' ) );
|
13139 |
-
|
13140 |
-
if ( false == optionCollection instanceof Backbone.Collection ) {
|
13141 |
-
optionCollection = new listOptionCollection( [], { settingModel: settingModel } );
|
13142 |
-
optionCollection.add( dataModel.get( settingModel.get( 'name' ) ) );
|
13143 |
-
dataModel.set( settingModel.get( 'name' ), optionCollection, { silent: true } );
|
13144 |
-
}
|
13145 |
-
}
|
13146 |
-
|
13147 |
-
});
|
13148 |
-
|
13149 |
-
return controller;
|
13150 |
-
} );
|
13151 |
-
define( 'views/app/drawer/imageOptionRepeaterOption',['views/app/drawer/optionRepeaterError'], function( ErrorView ) {
|
13152 |
-
var view = Marionette.LayoutView.extend({
|
13153 |
-
tagName: 'div',
|
13154 |
-
className: 'nf-table-row',
|
13155 |
-
template: '#tmpl-nf-edit-setting-image-option-repeater-default-row',
|
13156 |
-
id: function() {
|
13157 |
-
return this.model.cid;
|
13158 |
-
},
|
13159 |
-
|
13160 |
-
regions: {
|
13161 |
-
error: '.nf-option-error'
|
13162 |
-
},
|
13163 |
-
|
13164 |
-
initialize: function( data ) {
|
13165 |
-
this.settingModel = data.settingModel;
|
13166 |
-
this.dataModel = data.dataModel;
|
13167 |
-
this.collection = data.collection;
|
13168 |
-
this.columns = data.columns;
|
13169 |
-
this.parentView = data.parentView;
|
13170 |
-
this.model.on( 'change:errors', this.renderErrors, this );
|
13171 |
-
|
13172 |
-
// Removed because the re-render was breaking tag insertion for merge tags.
|
13173 |
-
// this.model.on( 'change', this.render, this );
|
13174 |
-
|
13175 |
-
if ( 'undefined' != typeof this.settingModel.get( 'tmpl_row' ) ) {
|
13176 |
-
this.template = '#' + this.settingModel.get( 'tmpl_row' );
|
13177 |
-
}
|
13178 |
-
|
13179 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'click:extra', this.clickExtra );
|
13180 |
-
|
13181 |
-
this.hasErrors = false;
|
13182 |
-
},
|
13183 |
-
|
13184 |
-
onBeforeDestroy: function() {
|
13185 |
-
this.model.off( 'change', this.render );
|
13186 |
-
this.model.off( 'change:errors', this.renderErrors );
|
13187 |
-
},
|
13188 |
-
|
13189 |
-
onBeforeRender: function() {
|
13190 |
-
/*
|
13191 |
-
* We want to escape any HTML being output for our image.
|
13192 |
-
*/
|
13193 |
-
if ( this.model.get( 'image' ) ) {
|
13194 |
-
var image = this.model.get( 'image' );
|
13195 |
-
this.model.set( 'image', _.escape( image ), { silent: true } );
|
13196 |
-
}
|
13197 |
-
|
13198 |
-
},
|
13199 |
-
|
13200 |
-
onRender: function() {
|
13201 |
-
nfRadio.channel( 'mergeTags' ).request( 'init', this );
|
13202 |
-
/*
|
13203 |
-
* Send out a radio message.
|
13204 |
-
*/
|
13205 |
-
nfRadio.channel( 'setting-' + this.settingModel.get( 'name' ) + '-option' ).trigger( 'render:setting', this.model, this.dataModel, this );
|
13206 |
-
/*
|
13207 |
-
* We want to unescape any HTML being output for our image.
|
13208 |
-
*/
|
13209 |
-
if ( this.model.get( 'image' ) ) {
|
13210 |
-
var image = this.model.get( 'image' );
|
13211 |
-
this.model.set( 'image', _.unescape( image ), { silent: true } );
|
13212 |
-
}
|
13213 |
-
},
|
13214 |
-
|
13215 |
-
onShow: function() {
|
13216 |
-
if ( this.model.get( 'new' ) ) {
|
13217 |
-
jQuery( this.el ).find( 'input:first' ).focus();
|
13218 |
-
this.model.set( 'new', false );
|
13219 |
-
}
|
13220 |
-
},
|
13221 |
-
|
13222 |
-
events: {
|
13223 |
-
'change .setting': 'changeOption',
|
13224 |
-
'click .nf-delete': 'deleteOption',
|
13225 |
-
'keyup': 'keyupOption',
|
13226 |
-
// 'click .open-media-manager': 'openMediaModal'
|
13227 |
-
},
|
13228 |
-
|
13229 |
-
changeOption: function( e ) {
|
13230 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'change:option', e, this.model, this.dataModel, this.settingModel, this );
|
13231 |
-
},
|
13232 |
-
|
13233 |
-
deleteOption: function( e ) {
|
13234 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'click:deleteOption', this.model, this.collection, this.dataModel, this );
|
13235 |
-
},
|
13236 |
-
|
13237 |
-
keyupOption: function( e ) {
|
13238 |
-
this.maybeAddOption( e );
|
13239 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
|
13240 |
-
nfRadio.channel( 'image-option-repeater-' + this.settingModel.get( 'name' ) ).trigger( 'keyup:option', e, this.model, this.dataModel, this.settingModel, this )
|
13241 |
-
},
|
13242 |
-
|
13243 |
-
maybeAddOption: function( e ) {
|
13244 |
-
if ( 13 == e.keyCode && 'calculations' != this.settingModel.get( 'name' ) ) {
|
13245 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel, this );
|
13246 |
-
jQuery( this.parentView.children.findByIndex(this.parentView.children.length - 1).el ).find( '[data-id="image"]' ).focus();
|
13247 |
-
}
|
13248 |
-
},
|
13249 |
-
|
13250 |
-
clickExtra: function(e, settingModel, dataModel, settingView) {
|
13251 |
-
|
13252 |
-
var textEl = jQuery(e.target).parent().find('.setting');
|
13253 |
-
var optionContainerDiv = jQuery(e.target).parent().parent().parent();
|
13254 |
-
|
13255 |
-
var valueEl = jQuery(optionContainerDiv[0]).find('[data-id="value"]');
|
13256 |
-
|
13257 |
-
var imageIdEl = jQuery(optionContainerDiv[0]).find('[data-id="image_id"]');
|
13258 |
-
|
13259 |
-
var labelEl = jQuery(optionContainerDiv[0]).find('[data-id="label"]');
|
13260 |
-
|
13261 |
-
if ( jQuery( e.target ).hasClass( 'open-media-manager' )
|
13262 |
-
&& this.el.id === optionContainerDiv[0].id) {
|
13263 |
-
// If the frame already exists, re-open it.
|
13264 |
-
if ( this.meta_image_frame ) {
|
13265 |
-
this.meta_image_frame.open();
|
13266 |
-
return;
|
13267 |
-
}
|
13268 |
-
|
13269 |
-
// Sets up the media library frame
|
13270 |
-
this.meta_image_frame = wp.media.frames.meta_image_frame = wp.media({
|
13271 |
-
title: 'Select a file',
|
13272 |
-
button: { text: 'insert' }
|
13273 |
-
});
|
13274 |
-
|
13275 |
-
var that = this;
|
13276 |
-
|
13277 |
-
// Runs when an image is selected.
|
13278 |
-
this.meta_image_frame.on('select', function(){
|
13279 |
-
// Grabs the attachment selection and creates a JSON representation of the model.
|
13280 |
-
var media_attachment = that.meta_image_frame.state().get('selection').first().toJSON();
|
13281 |
-
|
13282 |
-
textEl.val(media_attachment.url).change();
|
13283 |
-
valueEl.val(media_attachment.filename).change();
|
13284 |
-
labelEl.val(media_attachment.title).change();
|
13285 |
-
imageIdEl.val(media_attachment.id).change();
|
13286 |
-
var img_container = optionContainerDiv.find('.option-image-container');
|
13287 |
-
|
13288 |
-
if(img_container) {
|
13289 |
-
$imgs = jQuery(img_container).find('img');
|
13290 |
-
if($imgs.length > 0) {
|
13291 |
-
jQuery($imgs[0]).attr('src', media_attachment.url);
|
13292 |
-
} else {
|
13293 |
-
var new_img = document.createElement('img');
|
13294 |
-
new_img.style="max-width:100px;display:inline-block;";
|
13295 |
-
new_img.src = media_attachment.url;
|
13296 |
-
jQuery(img_container).append(new_img);
|
13297 |
-
}
|
13298 |
-
}
|
13299 |
-
});
|
13300 |
-
|
13301 |
-
// Opens the media library frame.
|
13302 |
-
this.meta_image_frame.open();
|
13303 |
-
}
|
13304 |
-
},
|
13305 |
-
|
13306 |
-
renderErrors: function() {
|
13307 |
-
|
13308 |
-
// if ( jQuery.isEmptyObject( this.model.get( 'errors' ) ) ) {
|
13309 |
-
// return false;
|
13310 |
-
// }
|
13311 |
-
|
13312 |
-
/*
|
13313 |
-
* We don't want to redraw the entire row, which would remove focus from the eq textarea,
|
13314 |
-
* so we add and remove error classes manually.
|
13315 |
-
*/
|
13316 |
-
if ( 0 == Object.keys( this.model.get( 'errors' ) ) ) {
|
13317 |
-
if ( this.hasErrors ) {
|
13318 |
-
this.error.empty();
|
13319 |
-
jQuery( this.el ).removeClass( 'nf-error' );
|
13320 |
-
}
|
13321 |
-
} else {
|
13322 |
-
this.hasErrors = true;
|
13323 |
-
this.error.show( new ErrorView( { model: this.model } ) );
|
13324 |
-
jQuery( this.el ).addClass( 'nf-error' );
|
13325 |
-
}
|
13326 |
-
},
|
13327 |
-
|
13328 |
-
templateHelpers: function() {
|
13329 |
-
var that = this;
|
13330 |
-
return {
|
13331 |
-
getColumns: function() {
|
13332 |
-
var columns = that.columns;
|
13333 |
-
if(!nfAdmin.devMode){
|
13334 |
-
delete columns.value;
|
13335 |
-
delete columns.calc;
|
13336 |
-
}
|
13337 |
-
return columns;
|
13338 |
-
},
|
13339 |
-
renderFieldSelect: function( dataID, value ){
|
13340 |
-
var initialOption, select, emptyContainer, image;
|
13341 |
-
|
13342 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
13343 |
-
|
13344 |
-
initialOption = document.createElement( 'option' );
|
13345 |
-
initialOption.value = '';
|
13346 |
-
initialOption.image = '';
|
13347 |
-
initialOption.innerHTML = '--';
|
13348 |
-
|
13349 |
-
select = document.createElement( 'select' );
|
13350 |
-
select.classList.add( 'setting' );
|
13351 |
-
select.setAttribute( 'data-id', dataID );
|
13352 |
-
select.appendChild( initialOption );
|
13353 |
-
|
13354 |
-
fields.each( function( field ){
|
13355 |
-
var option = document.createElement( 'option' );
|
13356 |
-
if ( value == field.get( 'key' ) ) {
|
13357 |
-
option.setAttribute( 'selected', 'selected' );
|
13358 |
-
}
|
13359 |
-
option.value = field.get( 'key' );
|
13360 |
-
option.innerHTML = field.formatLabel();
|
13361 |
-
option.image = field.formatLabel();
|
13362 |
-
select.appendChild( option );
|
13363 |
-
});
|
13364 |
-
|
13365 |
-
image = document.createElement( 'image' );
|
13366 |
-
image.classList.add( 'nf-select' );
|
13367 |
-
image.appendChild( select );
|
13368 |
-
|
13369 |
-
// Select Lists need an empty '<div></div>' for styling purposes.
|
13370 |
-
emptyContainer = document.createElement( 'div' );
|
13371 |
-
emptyContainer.style.bottom = '6px';
|
13372 |
-
image.appendChild( emptyContainer );
|
13373 |
-
|
13374 |
-
// The template requires a string.
|
13375 |
-
return image.innerHTML;
|
13376 |
-
},
|
13377 |
-
renderNonSaveFieldSelect: function( dataID, value ){
|
13378 |
-
var initialOption, select, emptyContainer, image;
|
13379 |
-
|
13380 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
13381 |
-
|
13382 |
-
initialOption = document.createElement( 'option' );
|
13383 |
-
initialOption.value = '';
|
13384 |
-
initialOption.image = '';
|
13385 |
-
initialOption.innerHTML = '--';
|
13386 |
-
|
13387 |
-
select = document.createElement( 'select' );
|
13388 |
-
select.classList.add( 'setting' );
|
13389 |
-
select.setAttribute( 'data-id', dataID );
|
13390 |
-
select.appendChild( initialOption );
|
13391 |
-
|
13392 |
-
// Build a lookup table for fields we want to remove from our fields list.
|
13393 |
-
var removeFieldsLookup = [ 'html', 'submit', 'hr',
|
13394 |
-
'recaptcha', 'spam', 'creditcard', 'creditcardcvc',
|
13395 |
-
'creditcardexpiration', 'creditcardfullname',
|
13396 |
-
'creditcardnumber', 'creditcardzip' ];
|
13397 |
-
|
13398 |
-
fields.each( function( field ){
|
13399 |
-
// Check for the field type in our lookup array and...
|
13400 |
-
if( jQuery.inArray( field.get( 'type' ), removeFieldsLookup ) !== -1 ) {
|
13401 |
-
// Return if the type is in our lookup array.
|
13402 |
-
return '';
|
13403 |
-
}
|
13404 |
-
|
13405 |
-
var option = document.createElement( 'option' );
|
13406 |
-
if ( value == field.get( 'key' ) ) {
|
13407 |
-
option.setAttribute( 'selected', 'selected' );
|
13408 |
-
}
|
13409 |
-
option.value = field.get( 'key' );
|
13410 |
-
option.innerHTML = field.formatLabel();
|
13411 |
-
option.image = field.formatLabel();
|
13412 |
-
select.appendChild( option );
|
13413 |
-
});
|
13414 |
-
|
13415 |
-
image = document.createElement( 'image' );
|
13416 |
-
image.classList.add( 'nf-select' );
|
13417 |
-
image.appendChild( select );
|
13418 |
-
|
13419 |
-
// Select Lists need an empty '<div></div>' for styling purposes.
|
13420 |
-
emptyContainer = document.createElement( 'div' );
|
13421 |
-
emptyContainer.style.bottom = '6px';
|
13422 |
-
image.appendChild( emptyContainer );
|
13423 |
-
|
13424 |
-
// The template requires a string.
|
13425 |
-
return image.innerHTML;
|
13426 |
-
},
|
13427 |
-
renderOptions: function( column, value ) {
|
13428 |
-
|
13429 |
-
if( 'undefined' == typeof that.options.columns[ column ] ) return;
|
13430 |
-
|
13431 |
-
var select = document.createElement( 'select' );
|
13432 |
-
|
13433 |
-
_.each( that.options.columns[ column ].options, function( option ){
|
13434 |
-
var optionNode = document.createElement( 'option' );
|
13435 |
-
if ( value === option.value ) {
|
13436 |
-
optionNode.setAttribute( 'selected', 'selected' );
|
13437 |
-
}
|
13438 |
-
optionNode.setAttribute( 'value', option.value );
|
13439 |
-
optionNode.setAttribute( 'image_id', option.image_id);
|
13440 |
-
optionNode.setAttribute( 'image', option.image );
|
13441 |
-
optionNode.innerText = option.image;
|
13442 |
-
select.appendChild( optionNode );
|
13443 |
-
});
|
13444 |
-
|
13445 |
-
// The template only needs the options.
|
13446 |
-
return select.innerHTML;
|
13447 |
-
}
|
13448 |
-
|
13449 |
-
}
|
13450 |
-
}
|
13451 |
-
|
13452 |
-
});
|
13453 |
-
|
13454 |
-
return view;
|
13455 |
-
} );
|
13456 |
-
|
13457 |
-
define( 'views/app/drawer/imageOptionRepeaterComposite',['views/app/drawer/imageOptionRepeaterOption', 'views/app/drawer/optionRepeaterEmpty', 'models/app/optionRepeaterCollection'], function( listOptionView, listEmptyView, listOptionCollection ) {
|
13458 |
-
var view = Marionette.CompositeView.extend( {
|
13459 |
-
template: '#tmpl-nf-edit-setting-image-option-repeater-wrap',
|
13460 |
-
childView: listOptionView,
|
13461 |
-
emptyView: listEmptyView,
|
13462 |
-
reorderOnSort: false,
|
13463 |
-
|
13464 |
-
initialize: function( data ) {
|
13465 |
-
|
13466 |
-
/*
|
13467 |
-
* Our options are stored in our database as objects, not collections.
|
13468 |
-
* Before we attempt to render them, we need to convert them to a collection if they aren't already one.
|
13469 |
-
*/
|
13470 |
-
var optionCollection = data.dataModel.get( this.model.get( 'name' ) );
|
13471 |
-
|
13472 |
-
if ( false == optionCollection instanceof Backbone.Collection ) {
|
13473 |
-
optionCollection = new listOptionCollection( [], { settingModel: this.model } );
|
13474 |
-
optionCollection.add( data.dataModel.get( this.model.get( 'name' ) ) );
|
13475 |
-
data.dataModel.set( this.model.get( 'name' ), optionCollection, { silent: true } );
|
13476 |
-
}
|
13477 |
-
|
13478 |
-
this.collection = optionCollection;
|
13479 |
-
this.dataModel = data.dataModel;
|
13480 |
-
this.childViewOptions = { parentView: this, settingModel: this.model, collection: this.collection, dataModel: data.dataModel, columns: this.model.get( 'columns' ) };
|
13481 |
-
|
13482 |
-
var deps = this.model.get( 'deps' );
|
13483 |
-
if ( deps ) {
|
13484 |
-
// If we don't have a 'settings' property, this is a legacy depdency setup.
|
13485 |
-
if ( 'undefined' == typeof deps.settings ) {
|
13486 |
-
deps.settings = [];
|
13487 |
-
_.each(deps, function(dep, name){
|
13488 |
-
if( 'settings' !== name ) {
|
13489 |
-
deps.settings.push( { name: name, value: dep } );
|
13490 |
-
}
|
13491 |
-
});
|
13492 |
-
deps.match = 'all';
|
13493 |
-
}
|
13494 |
-
|
13495 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
13496 |
-
let name = deps.settings[i].name;
|
13497 |
-
this.dataModel.on( 'change:' + name, this.render, this );
|
13498 |
-
}
|
13499 |
-
}
|
13500 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'added:option', this.maybeHideNew );
|
13501 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'removed:option', this.maybeHideNew );
|
13502 |
-
},
|
13503 |
-
|
13504 |
-
onBeforeDestroy: function() {
|
13505 |
-
var deps = this.model.get( 'deps' );
|
13506 |
-
if ( deps ) {
|
13507 |
-
for (var i = deps.settings.length - 1; i >= 0; i--) {
|
13508 |
-
let name = deps.settings[i].name;
|
13509 |
-
this.dataModel.off( 'change:' + name, this.render );
|
13510 |
-
}
|
13511 |
-
}
|
13512 |
-
},
|
13513 |
-
|
13514 |
-
onRender: function() {
|
13515 |
-
// this.$el = this.$el.children();
|
13516 |
-
// this.$el.unwrap();
|
13517 |
-
// this.setElement( this.$el );
|
13518 |
-
|
13519 |
-
// this.$el = this.$el.children();
|
13520 |
-
// this.$el.unwrap();
|
13521 |
-
// this.setElement( this.$el );
|
13522 |
-
|
13523 |
-
var that = this;
|
13524 |
-
jQuery( this.el ).find( '.nf-listimage-options-tbody' ).sortable( {
|
13525 |
-
handle: '.handle',
|
13526 |
-
helper: 'clone',
|
13527 |
-
placeholder: 'nf-listimage-options-sortable-placeholder',
|
13528 |
-
forcePlaceholderSize: true,
|
13529 |
-
opacity: 0.95,
|
13530 |
-
tolerance: 'pointer',
|
13531 |
-
|
13532 |
-
start: function( e, ui ) {
|
13533 |
-
nfRadio.channel( 'image-option-repeater' ).request( 'start:optionSortable', ui );
|
13534 |
-
},
|
13535 |
-
|
13536 |
-
stop: function( e, ui ) {
|
13537 |
-
nfRadio.channel( 'image-option-repeater' ).request( 'stop:optionSortable', ui );
|
13538 |
-
},
|
13539 |
-
|
13540 |
-
update: function( e, ui ) {
|
13541 |
-
nfRadio.channel( 'image-option-repeater' ).request( 'update:optionSortable', ui, this, that );
|
13542 |
-
}
|
13543 |
-
} );
|
13544 |
-
|
13545 |
-
that.setupTooltip();
|
13546 |
-
that.maybeHideNew( that.collection );
|
13547 |
-
|
13548 |
-
/*
|
13549 |
-
* Send out a radio message.
|
13550 |
-
*/
|
13551 |
-
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
|
13552 |
-
|
13553 |
-
},
|
13554 |
-
|
13555 |
-
onAttach: function() {
|
13556 |
-
|
13557 |
-
// var importLink = jQuery( this.el ).find( '.nf-open-import-tooltip' );
|
13558 |
-
// var jBox = jQuery( importLink ).jBox( 'Tooltip', {
|
13559 |
-
// title: '<h3>Please enter your options below:</h3>',
|
13560 |
-
// content: ( "1" == nfAdmin.devMode ? jQuery( this.el ).find( '.nf-dev-import-options' ) : jQuery( this.el ).find( '.nf-import-options' ) ),
|
13561 |
-
// trigger: 'click',
|
13562 |
-
// closeOnClick: 'body',
|
13563 |
-
// closeButton: 'box',
|
13564 |
-
// offset: { x: 20, y: 0 },
|
13565 |
-
// addClass: 'import-options',
|
13566 |
-
|
13567 |
-
// onOpen: function() {
|
13568 |
-
// var that = this;
|
13569 |
-
// setTimeout( function() { jQuery( that.content ).find( 'textarea' ).focus(); }, 200 );
|
13570 |
-
// }
|
13571 |
-
// } );
|
13572 |
-
|
13573 |
-
// jQuery( this.el ).find( '.nf-import' ).on( 'click', { view: this, jBox: jBox }, this.clickImport );
|
13574 |
-
|
13575 |
-
// /*
|
13576 |
-
// * Send out a radio message.
|
13577 |
-
// */
|
13578 |
-
// nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
13579 |
-
// nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
|
13580 |
-
},
|
13581 |
-
|
13582 |
-
/**
|
13583 |
-
* Function to append jBox modals to each tooltip element in the option repeater.
|
13584 |
-
*/
|
13585 |
-
setupTooltip: function() {
|
13586 |
-
// For each .nf-help in the option repeater...
|
13587 |
-
jQuery( this.el ).find( '.nf-listimage-options' ).find( '.nf-help' ).each(function() {
|
13588 |
-
// Get the content.
|
13589 |
-
var content = jQuery(this).next('.nf-help-text');
|
13590 |
-
// Declare the modal.
|
13591 |
-
jQuery( this ).jBox( 'Tooltip', {
|
13592 |
-
content: content,
|
13593 |
-
maxWidth: 200,
|
13594 |
-
theme: 'TooltipBorder',
|
13595 |
-
trigger: 'click',
|
13596 |
-
closeOnClick: true
|
13597 |
-
})
|
13598 |
-
});
|
13599 |
-
},
|
13600 |
-
|
13601 |
-
templateHelpers: function () {
|
13602 |
-
var that = this;
|
13603 |
-
|
13604 |
-
return {
|
13605 |
-
renderHeaders: function() {
|
13606 |
-
// If this is a Field...
|
13607 |
-
// AND If the type includes 'list'...
|
13608 |
-
if ( 'Field' == that.dataModel.get( 'objectType' ) && -1 !== that.dataModel.get( 'type' ).indexOf( 'list' ) ) {
|
13609 |
-
// Declare help text.
|
13610 |
-
var helpText, helpTextContainer, helpIcon, helpIconLink, helpTextWrapper;
|
13611 |
-
|
13612 |
-
helpText = document.createTextNode( nfi18n.valueChars );
|
13613 |
-
helpTextContainer = document.createElement( 'div' );
|
13614 |
-
helpTextContainer.classList.add( 'nf-help-text' );
|
13615 |
-
helpTextContainer.appendChild( helpText );
|
13616 |
-
|
13617 |
-
helpIcon = document.createElement( 'span' );
|
13618 |
-
helpIcon.classList.add( 'dashicons', 'dashicons-admin-comments' );
|
13619 |
-
helpIconLink = document.createElement( 'a' );
|
13620 |
-
helpIconLink.classList.add( 'nf-help' );
|
13621 |
-
helpIconLink.setAttribute( 'href', '#' );
|
13622 |
-
helpIconLink.setAttribute( 'tabindex', '-1' );
|
13623 |
-
helpIconLink.appendChild( helpIcon );
|
13624 |
-
|
13625 |
-
helpTextWrapper = document.createElement( 'span' );
|
13626 |
-
helpTextWrapper.appendChild( helpIconLink );
|
13627 |
-
helpTextWrapper.appendChild( helpTextContainer );
|
13628 |
-
|
13629 |
-
// Append the help text to the 'value' header.
|
13630 |
-
if('undefined' !== typeof that.model.get('columns') ){
|
13631 |
-
if('undefined' !== typeof that.model.get('columns').value ){
|
13632 |
-
if ( -1 == that.model.get('columns').value.header.indexOf( helpTextWrapper.innerHTML ) ) {
|
13633 |
-
that.model.get('columns').value.header += helpTextWrapper.innerHTML;
|
13634 |
-
}
|
13635 |
-
}
|
13636 |
-
}
|
13637 |
-
}
|
13638 |
-
var columns, beforeColumns, afterColumns;
|
13639 |
-
|
13640 |
-
beforeColumns = document.createElement( 'div' );
|
13641 |
-
|
13642 |
-
columns = document.createElement( 'span' );
|
13643 |
-
columns.appendChild( beforeColumns );
|
13644 |
-
|
13645 |
-
if(!nfAdmin.devMode){
|
13646 |
-
delete this.columns.value;
|
13647 |
-
delete this.columns.calc;
|
13648 |
-
}
|
13649 |
-
|
13650 |
-
_.each( this.columns, function( col ) {
|
13651 |
-
var headerText, headerContainer;
|
13652 |
-
|
13653 |
-
// Use a fragment to support HTML in the col.header property, ie Dashicons.
|
13654 |
-
headerText = document.createRange().createContextualFragment( col.header );
|
13655 |
-
headerContainer = document.createElement( 'div' );
|
13656 |
-
headerContainer.appendChild( headerText );
|
13657 |
-
|
13658 |
-
columns.appendChild( headerContainer );
|
13659 |
-
} );
|
13660 |
-
|
13661 |
-
afterColumns = document.createElement( 'div' );
|
13662 |
-
columns.appendChild( afterColumns );
|
13663 |
-
|
13664 |
-
return columns.innerHTML;
|
13665 |
-
},
|
13666 |
-
|
13667 |
-
renderSetting: function() {
|
13668 |
-
var setting = nfRadio.channel( 'app' ).request( 'get:template', '#tmpl-nf-edit-setting-' + this.type );
|
13669 |
-
return setting( this );
|
13670 |
-
},
|
13671 |
-
|
13672 |
-
renderClasses: function() {
|
13673 |
-
var classes = '';
|
13674 |
-
if ( 'undefined' != typeof this.width ) {
|
13675 |
-
classes += this.width;
|
13676 |
-
} else {
|
13677 |
-
classes += ' one-half';
|
13678 |
-
}
|
13679 |
-
|
13680 |
-
if ( this.error ) {
|
13681 |
-
classes += ' nf-error';
|
13682 |
-
}
|
13683 |
-
|
13684 |
-
return classes;
|
13685 |
-
},
|
13686 |
-
|
13687 |
-
renderVisible: function() {
|
13688 |
-
return nfRadio.channel( 'settings' ).request( 'check:deps', this, that );
|
13689 |
-
},
|
13690 |
-
|
13691 |
-
renderError: function() {
|
13692 |
-
if ( this.error ) {
|
13693 |
-
return this.error;
|
13694 |
-
}
|
13695 |
-
return '';
|
13696 |
-
},
|
13697 |
-
|
13698 |
-
renderFieldsetClasses: function() {
|
13699 |
-
return that.model.get( 'name' );
|
13700 |
-
},
|
13701 |
-
|
13702 |
-
currencySymbol: function() {
|
13703 |
-
return nfRadio.channel( 'settings' ).request( 'get:setting', 'currency' ) || nfi18n.currency_symbol;
|
13704 |
-
}
|
13705 |
-
};
|
13706 |
-
},
|
13707 |
-
|
13708 |
-
attachHtml: function( collectionView, childView ) {
|
13709 |
-
jQuery( collectionView.el ).find( '.nf-listimage-options-tbody' ).append( childView.el );
|
13710 |
-
nfRadio.channel( 'mergeTags' ).request( 'init', this );
|
13711 |
-
},
|
13712 |
-
|
13713 |
-
events: {
|
13714 |
-
'click .nf-add-new': 'clickAddOption',
|
13715 |
-
'click .extra': 'clickExtra'
|
13716 |
-
},
|
13717 |
-
|
13718 |
-
maybeHideNew: function( collection ) {
|
13719 |
-
if( 'undefined' == typeof collection.settingModel ) return false;
|
13720 |
-
var limit = collection.settingModel.get( 'max_options' );
|
13721 |
-
if( 0 !== limit && collection.models.length >= ( limit ) ) {
|
13722 |
-
jQuery(this.el).find('.nf-add-new').addClass('disabled');
|
13723 |
-
} else {
|
13724 |
-
jQuery(this.el).find('.nf-add-new').removeClass('disabled');
|
13725 |
-
}
|
13726 |
-
},
|
13727 |
-
|
13728 |
-
clickAddOption: function( e ) {
|
13729 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel );
|
13730 |
-
jQuery( this.children.findByIndex(this.children.length - 1).el ).find( '[data-id="image"]' ).focus();
|
13731 |
-
},
|
13732 |
-
|
13733 |
-
clickExtra: function( e ) {
|
13734 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'click:extra', e, this.collection, this.dataModel );
|
13735 |
-
nfRadio.channel( 'image-option-repeater-' + this.model.get( 'name' ) ).trigger( 'click:extra', e, this.model, this.collection, this.dataModel );
|
13736 |
-
},
|
13737 |
-
|
13738 |
-
clickImport: function( e ) {
|
13739 |
-
var textarea = jQuery( e.data.jBox.content ).find( 'textarea' );
|
13740 |
-
var value = textarea.val().trimLeft().trimRight();
|
13741 |
-
/*
|
13742 |
-
* Return early if we have no strings.
|
13743 |
-
*/
|
13744 |
-
if ( 0 == value.length ) {
|
13745 |
-
e.data.jBox.close();
|
13746 |
-
return false;
|
13747 |
-
}
|
13748 |
-
/*
|
13749 |
-
* Split our value based on new lines.
|
13750 |
-
*/
|
13751 |
-
|
13752 |
-
var lines = value.split(/\n/);
|
13753 |
-
if ( _.isArray( lines ) ) {
|
13754 |
-
/*
|
13755 |
-
* Loop over
|
13756 |
-
*/
|
13757 |
-
_.each( lines, function( line ) {
|
13758 |
-
var row = line.split( ',' );
|
13759 |
-
var image = row[0];
|
13760 |
-
var value = row[1] || jQuery.slugify( image, { separator: '-' } );
|
13761 |
-
var calc = row[2] || '';
|
13762 |
-
|
13763 |
-
image = image.trimLeft().trimRight();
|
13764 |
-
value = value.trimLeft().trimRight();
|
13765 |
-
calc = calc.trimLeft().trimRight();
|
13766 |
-
/*
|
13767 |
-
* Add our row to the collection
|
13768 |
-
*/
|
13769 |
-
var model = e.data.view.collection.add( { image: row[0], value: value, calc: calc } );
|
13770 |
-
// Add our field addition to our change log.
|
13771 |
-
var image = {
|
13772 |
-
object: 'field',
|
13773 |
-
image: row[0],
|
13774 |
-
change: 'Option Added',
|
13775 |
-
dashicon: 'plus-alt'
|
13776 |
-
};
|
13777 |
-
|
13778 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addListOption', model, null, image );
|
13779 |
-
nfRadio.channel( 'image-option-repeater-' + e.data.view.model.get( 'name' ) ).trigger( 'add:option', model );
|
13780 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'add:option', model );
|
13781 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', model );
|
13782 |
-
}, this );
|
13783 |
-
/*
|
13784 |
-
* Set our state to unclean so that the user can publish.
|
13785 |
-
*/
|
13786 |
-
} else {
|
13787 |
-
/*
|
13788 |
-
* TODO: Error Handling Here
|
13789 |
-
*/
|
13790 |
-
}
|
13791 |
-
textarea.val( '' );
|
13792 |
-
e.data.jBox.close();
|
13793 |
-
},
|
13794 |
-
} );
|
13795 |
-
|
13796 |
-
return view;
|
13797 |
-
} );
|
13798 |
-
|
13799 |
-
/**
|
13800 |
-
* Handles tasks associated with our option-repeater.
|
13801 |
-
*
|
13802 |
-
* Return our repeater child view.
|
13803 |
-
*
|
13804 |
-
* Also listens for changes to the options settings.
|
13805 |
-
*
|
13806 |
-
* @package Ninja Forms builder
|
13807 |
-
* @subpackage App
|
13808 |
-
* @copyright (c) 2015 WP Ninjas
|
13809 |
-
* @since 3.0
|
13810 |
-
*/
|
13811 |
-
define( 'controllers/app/imageOptionRepeater',['models/app/optionRepeaterModel', 'models/app/optionRepeaterCollection', 'views/app/drawer/imageOptionRepeaterComposite'], function( listOptionModel, listOptionCollection, listCompositeView ) {
|
13812 |
-
var controller = Marionette.Object.extend( {
|
13813 |
-
initialize: function() {
|
13814 |
-
// Respond to requests for the childView for list type fields.
|
13815 |
-
nfRadio.channel( 'image-option-repeater' ).reply( 'get:settingChildView', this.getSettingChildView, this );
|
13816 |
-
|
13817 |
-
// Listen for changes to our list options.
|
13818 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'change:option', this.changeOption );
|
13819 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'click:addOption', this.addOption );
|
13820 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'click:deleteOption', this.deleteOption );
|
13821 |
-
|
13822 |
-
// Respond to requests related to our list options sortable.
|
13823 |
-
nfRadio.channel( 'image-option-repeater' ).reply( 'update:optionSortable', this.updateOptionSortable, this );
|
13824 |
-
nfRadio.channel( 'image-option-repeater' ).reply( 'stop:optionSortable', this.stopOptionSortable, this );
|
13825 |
-
nfRadio.channel( 'image-option-repeater' ).reply( 'start:optionSortable', this.startOptionSortable, this );
|
13826 |
-
|
13827 |
-
/**
|
13828 |
-
* When we init our setting model, we need to convert our array/objects into collections/models
|
13829 |
-
*/
|
13830 |
-
this.listenTo( nfRadio.channel( 'image-option-repeater' ), 'init:dataModel', this.convertSettings );
|
13831 |
-
},
|
13832 |
-
|
13833 |
-
/**
|
13834 |
-
* Update an option value in our model.
|
13835 |
-
*
|
13836 |
-
* @since 3.0
|
13837 |
-
* @param Object e event
|
13838 |
-
* @param backbone.model model option model
|
13839 |
-
* @param backbone.model dataModel
|
13840 |
-
* @return void
|
13841 |
-
*/
|
13842 |
-
changeOption: function( e, model, dataModel, settingModel, optionView ) {
|
13843 |
-
var name = jQuery( e.target ).data( 'id' );
|
13844 |
-
if ( 'selected' == name ) {
|
13845 |
-
if ( jQuery( e.target ).prop( 'checked' ) ) {
|
13846 |
-
var value = 1;
|
13847 |
-
} else {
|
13848 |
-
var value = 0;
|
13849 |
-
}
|
13850 |
-
} else {
|
13851 |
-
var value = jQuery( e.target ).val();
|
13852 |
-
}
|
13853 |
-
|
13854 |
-
var before = model.get( name );
|
13855 |
-
|
13856 |
-
model.set( name, value );
|
13857 |
-
// Trigger an update on our dataModel
|
13858 |
-
this.triggerDataModel( model, dataModel );
|
13859 |
-
|
13860 |
-
var after = value;
|
13861 |
-
|
13862 |
-
var changes = {
|
13863 |
-
attr: name,
|
13864 |
-
before: before,
|
13865 |
-
after: after
|
13866 |
-
}
|
13867 |
-
|
13868 |
-
var label = {
|
13869 |
-
object: dataModel.get( 'objectType' ),
|
13870 |
-
label: dataModel.get( 'label' ),
|
13871 |
-
change: 'Option ' + model.get( 'label' ) + ' ' + name + ' changed from ' + before + ' to ' + after
|
13872 |
-
};
|
13873 |
-
|
13874 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'changeSetting', model, changes, label );
|
13875 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'update:option', model, dataModel, settingModel, optionView );
|
13876 |
-
nfRadio.channel( 'image-option-repeater-option-' + name ).trigger( 'update:option', e, model, dataModel, settingModel, optionView );
|
13877 |
-
nfRadio.channel( 'image-option-repeater-' + settingModel.get( 'name' ) ).trigger( 'update:option', model, dataModel, settingModel, optionView );
|
13878 |
-
},
|
13879 |
-
|
13880 |
-
/**
|
13881 |
-
* Add an option to our list
|
13882 |
-
*
|
13883 |
-
* @since 3.0
|
13884 |
-
* @param backbone.collection collection list option collection
|
13885 |
-
* @param backbone.model dataModel
|
13886 |
-
* @return void
|
13887 |
-
*/
|
13888 |
-
addOption: function( collection, dataModel ) {
|
13889 |
-
var modelData = {
|
13890 |
-
order: collection.length,
|
13891 |
-
new: true,
|
13892 |
-
options: {}
|
13893 |
-
};
|
13894 |
-
/**
|
13895 |
-
* If we don't actually have a 'settingModel' duplicated fields
|
13896 |
-
* can't add options until publish and the builder is reloaded.
|
13897 |
-
* If we ignore the code if we don't have settingsModel, then it
|
13898 |
-
* works.
|
13899 |
-
*/
|
13900 |
-
if ( 'undefined' !== typeof collection.settingModel ) {
|
13901 |
-
var limit = collection.settingModel.get( 'max_options' );
|
13902 |
-
if ( 0 !== limit && collection.models.length >= limit ) {
|
13903 |
-
return;
|
13904 |
-
}
|
13905 |
-
_.each( collection.settingModel.get( 'columns' ), function ( col, key ) {
|
13906 |
-
modelData[ key ] = col.default;
|
13907 |
-
|
13908 |
-
if ( 'undefined' != typeof col.options ) {
|
13909 |
-
modelData.options[ key ] = col.options;
|
13910 |
-
}
|
13911 |
-
});
|
13912 |
-
}
|
13913 |
-
var model = new listOptionModel( modelData );
|
13914 |
-
collection.add( model );
|
13915 |
-
|
13916 |
-
// Add our field addition to our change log.
|
13917 |
-
var image = {
|
13918 |
-
object: dataModel.get( 'objectType' ),
|
13919 |
-
image: dataModel.get( 'image' ),
|
13920 |
-
change: 'Option Added',
|
13921 |
-
dashicon: 'plus-alt'
|
13922 |
-
};
|
13923 |
-
|
13924 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addListOption', model, null, image );
|
13925 |
-
|
13926 |
-
if ( 'undefined' !== typeof collection.settingModel ) {
|
13927 |
-
nfRadio.channel('image-option-repeater-' + collection.settingModel.get('name')).trigger('add:option', model);
|
13928 |
-
}
|
13929 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'add:option', model );
|
13930 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'added:option', collection );
|
13931 |
-
this.triggerDataModel( model, dataModel );
|
13932 |
-
},
|
13933 |
-
|
13934 |
-
/**
|
13935 |
-
* Delete an option from our list
|
13936 |
-
*
|
13937 |
-
* @since 3.0
|
13938 |
-
* @param backbone.model model list option model
|
13939 |
-
* @param backbone.collection collection list option collection
|
13940 |
-
* @param backbone.model dataModel
|
13941 |
-
* @return void
|
13942 |
-
*/
|
13943 |
-
deleteOption: function( model, collection, dataModel ) {
|
13944 |
-
var newModel = nfRadio.channel( 'app' ).request( 'clone:modelDeep', model );
|
13945 |
-
|
13946 |
-
// Add our field deletion to our change log.
|
13947 |
-
var image = {
|
13948 |
-
object: dataModel.get( 'objectType' ),
|
13949 |
-
image: dataModel.get( 'image' ),
|
13950 |
-
change: 'Option ' + newModel.get( 'image' ) + ' Removed',
|
13951 |
-
dashicon: 'dismiss'
|
13952 |
-
};
|
13953 |
-
|
13954 |
-
var data = {
|
13955 |
-
collection: collection
|
13956 |
-
}
|
13957 |
-
|
13958 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'removeListOption', newModel, null, image, data );
|
13959 |
-
|
13960 |
-
var changeCollection = nfRadio.channel( 'changes' ).request( 'get:collection' );
|
13961 |
-
var results = changeCollection.where( { model: model } );
|
13962 |
-
|
13963 |
-
_.each( results, function( changeModel ) {
|
13964 |
-
if ( 'object' == typeof changeModel.get( 'data' ) ) {
|
13965 |
-
_.each( changeModel.get( 'data' ), function( dataModel ) {
|
13966 |
-
if ( dataModel.model == dataModel ) {
|
13967 |
-
dataModel.model = newModel;
|
13968 |
-
}
|
13969 |
-
} );
|
13970 |
-
}
|
13971 |
-
changeModel.set( 'model', newModel );
|
13972 |
-
changeModel.set( 'disabled', true );
|
13973 |
-
} );
|
13974 |
-
|
13975 |
-
collection.remove( model );
|
13976 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'remove:option', model );
|
13977 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'removed:option', collection );
|
13978 |
-
nfRadio.channel( 'image-option-repeater-' + collection.settingModel.get( 'name' ) ).trigger( 'remove:option', model );
|
13979 |
-
this.triggerDataModel( model, dataModel );
|
13980 |
-
},
|
13981 |
-
|
13982 |
-
/**
|
13983 |
-
* Creates an arbitrary value on our collection, then clones and updates that collection.
|
13984 |
-
* This forces a change event to be fired on the dataModel where the list option collection data is stored.
|
13985 |
-
*
|
13986 |
-
* @since 3.0
|
13987 |
-
* @param backbone.collection collection list option collection
|
13988 |
-
* @param backbone.model dataModel
|
13989 |
-
* @return void
|
13990 |
-
*/
|
13991 |
-
triggerDataModel: function( model, dataModel ) {
|
13992 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', model );
|
13993 |
-
},
|
13994 |
-
|
13995 |
-
/**
|
13996 |
-
* Return our list composite view to the setting collection view.
|
13997 |
-
*
|
13998 |
-
* @since 3.0
|
13999 |
-
* @param backbone.model model settings model
|
14000 |
-
* @return void
|
14001 |
-
*/
|
14002 |
-
getSettingChildView: function( model ) {
|
14003 |
-
return listCompositeView;
|
14004 |
-
},
|
14005 |
-
|
14006 |
-
/**
|
14007 |
-
* When we sort our list options, change the order in our option model and trigger a change.
|
14008 |
-
*
|
14009 |
-
* @since 3.0
|
14010 |
-
* @param Object sortable jQuery UI element
|
14011 |
-
* @param backbone.view setting Setting view
|
14012 |
-
* @return void
|
14013 |
-
*/
|
14014 |
-
updateOptionSortable: function( ui, sortable, setting ) {
|
14015 |
-
var newOrder = jQuery( sortable ).sortable( 'toArray' );
|
14016 |
-
var dragModel = setting.collection.get( { cid: jQuery( ui.item ).prop( 'id' ) } );
|
14017 |
-
var data = {
|
14018 |
-
collection: setting.collection,
|
14019 |
-
objModels: []
|
14020 |
-
};
|
14021 |
-
|
14022 |
-
_.each( newOrder, function( cid, index ) {
|
14023 |
-
var optionModel = setting.collection.get( { cid: cid } );
|
14024 |
-
var oldPos = optionModel.get( 'order' );
|
14025 |
-
optionModel.set( 'order', index );
|
14026 |
-
var newPos = index;
|
14027 |
-
|
14028 |
-
data.objModels.push( {
|
14029 |
-
model: optionModel,
|
14030 |
-
attr: 'order',
|
14031 |
-
before: oldPos,
|
14032 |
-
after: newPos
|
14033 |
-
} );
|
14034 |
-
} );
|
14035 |
-
|
14036 |
-
setting.collection.sort( { silent: true } );
|
14037 |
-
|
14038 |
-
var image = {
|
14039 |
-
object: setting.dataModel.get( 'objectType' ),
|
14040 |
-
image: setting.dataModel.get( 'image' ),
|
14041 |
-
change: 'Option ' + dragModel.get( 'image' ) + ' re-ordered from ' + dragModel._previousAttributes.order + ' to ' + dragModel.get( 'order' ),
|
14042 |
-
dashicon: 'sort'
|
14043 |
-
};
|
14044 |
-
|
14045 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'sortListOptions', dragModel, null, image, data );
|
14046 |
-
this.triggerDataModel( dragModel, setting.dataModel );
|
14047 |
-
nfRadio.channel( 'image-option-repeater' ).trigger( 'sort:option', dragModel, setting );
|
14048 |
-
nfRadio.channel( 'image-option-repeater-' + setting.model.get( 'name' ) ).trigger( 'sort:option', dragModel, setting );
|
14049 |
-
},
|
14050 |
-
|
14051 |
-
/**
|
14052 |
-
* When we stop sorting our list options, reset our item opacity.
|
14053 |
-
*
|
14054 |
-
* @since 3.0
|
14055 |
-
* @param Object ui jQuery UI element
|
14056 |
-
* @return void
|
14057 |
-
*/
|
14058 |
-
stopOptionSortable: function( ui ) {
|
14059 |
-
jQuery( ui.item ).css( 'opacity', '' );
|
14060 |
-
},
|
14061 |
-
|
14062 |
-
/**
|
14063 |
-
* When we start sorting our list options, remove containing divs and set our item opacity to 0.5
|
14064 |
-
*
|
14065 |
-
* @since 3.0
|
14066 |
-
* @param Objects ui jQuery UI element
|
14067 |
-
* @return void
|
14068 |
-
*/
|
14069 |
-
startOptionSortable: function( ui ) {
|
14070 |
-
jQuery( ui.placeholder ).find( 'div' ).remove();
|
14071 |
-
jQuery( ui.item ).css( 'opacity', '0.5' ).show();
|
14072 |
-
},
|
14073 |
-
|
14074 |
-
/**
|
14075 |
-
* Convert settings from an array/object to a collection/model
|
14076 |
-
*
|
14077 |
-
* @since 3.0
|
14078 |
-
* @param Backbone.Model dataModel
|
14079 |
-
* @param Backbone.Model settingModel
|
14080 |
-
* @return void
|
14081 |
-
*/
|
14082 |
-
convertSettings: function( dataModel, settingModel ) {
|
14083 |
-
/*
|
14084 |
-
* Our options are stored in our database as objects, not collections.
|
14085 |
-
* Before we attempt to render them, we need to convert them to a collection if they aren't already one.
|
14086 |
-
*/
|
14087 |
-
var optionCollection = dataModel.get( settingModel.get( 'name' ) );
|
14088 |
-
|
14089 |
-
if ( false == optionCollection instanceof Backbone.Collection ) {
|
14090 |
-
optionCollection = new listOptionCollection( [], { settingModel: settingModel } );
|
14091 |
-
optionCollection.add( dataModel.get( settingModel.get( 'name' ) ) );
|
14092 |
-
dataModel.set( settingModel.get( 'name' ), optionCollection, { silent: true } );
|
14093 |
-
}
|
14094 |
-
}
|
14095 |
-
|
14096 |
-
});
|
14097 |
-
|
14098 |
-
return controller;
|
14099 |
-
} );
|
14100 |
-
/**
|
14101 |
-
* Handles adding and removing the active class from a field currently being edited.
|
14102 |
-
*
|
14103 |
-
* @package Ninja Forms builder
|
14104 |
-
* @subpackage Fields - Edit Field Drawer
|
14105 |
-
* @copyright (c) 2015 WP Ninjas
|
14106 |
-
* @since 3.0
|
14107 |
-
*/
|
14108 |
-
define( 'controllers/fields/editActive',[], function() {
|
14109 |
-
var controller = Marionette.Object.extend( {
|
14110 |
-
initialize: function() {
|
14111 |
-
// Respond to requests to remove the active class from all our fields.
|
14112 |
-
nfRadio.channel( 'fields' ).reply( 'clear:editActive', this.clearEditActive, this );
|
14113 |
-
// Listen for the closing drawer so that we can remove all of our active classes.
|
14114 |
-
this.listenTo( nfRadio.channel( 'drawer-editSettings' ), 'before:closeDrawer', this.clearEditActive );
|
14115 |
-
},
|
14116 |
-
|
14117 |
-
/**
|
14118 |
-
* Loops through our fields collection and sets editActive to false.
|
14119 |
-
*
|
14120 |
-
* @since 3.0
|
14121 |
-
* @return void
|
14122 |
-
*/
|
14123 |
-
clearEditActive: function() {
|
14124 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
14125 |
-
_.each( fieldCollection.models, function( field ) {
|
14126 |
-
field.set( 'editActive', false );
|
14127 |
-
} );
|
14128 |
-
}
|
14129 |
-
});
|
14130 |
-
|
14131 |
-
return controller;
|
14132 |
-
} );
|
14133 |
-
|
14134 |
-
/**
|
14135 |
-
* Fetches settings models so that we can get setting information
|
14136 |
-
*
|
14137 |
-
* @package Ninja Forms builder
|
14138 |
-
* @subpackage Main App
|
14139 |
-
* @copyright (c) 2015 WP Ninjas
|
14140 |
-
* @since 3.0
|
14141 |
-
*/
|
14142 |
-
define( 'controllers/fields/fieldSettings',['models/app/settingCollection'], function( settingCollection ) {
|
14143 |
-
var controller = Marionette.Object.extend( {
|
14144 |
-
initialize: function() {
|
14145 |
-
this.collection = new settingCollection( fieldSettings, { objectType: 'fields' } );
|
14146 |
-
|
14147 |
-
// Responds to requests for settings models.
|
14148 |
-
nfRadio.channel( 'fields' ).reply( 'get:settingModel', this.getSettingModel, this );
|
14149 |
-
|
14150 |
-
// Responds to requests for our collection.
|
14151 |
-
nfRadio.channel( 'fields' ).reply( 'get:settingCollection', this.getSettingCollection, this );
|
14152 |
-
},
|
14153 |
-
|
14154 |
-
getSettingModel: function( name ) {
|
14155 |
-
return this.collection.findWhere( { name: name } );
|
14156 |
-
},
|
14157 |
-
|
14158 |
-
getSettingCollection: function() {
|
14159 |
-
return this.collection;
|
14160 |
-
}
|
14161 |
-
|
14162 |
-
});
|
14163 |
-
|
14164 |
-
return controller;
|
14165 |
-
} );
|
14166 |
-
/**
|
14167 |
-
* Listens to our app channel to add the individual Credit Card Fields.
|
14168 |
-
*
|
14169 |
-
* @package Ninja Forms builder
|
14170 |
-
* @subpackage Main App
|
14171 |
-
* @copyright (c) 2015 WP Ninjas
|
14172 |
-
* @since 3.0
|
14173 |
-
*/
|
14174 |
-
define( 'controllers/fields/fieldCreditCard',[], function() {
|
14175 |
-
var controller = Marionette.Object.extend( {
|
14176 |
-
initialize: function() {
|
14177 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'after:addField', this.dropCreditCardField );
|
14178 |
-
},
|
14179 |
-
|
14180 |
-
dropCreditCardField: function( fieldModel ) {
|
14181 |
-
|
14182 |
-
if( 'creditcard' == fieldModel.get( 'type' ) ) {
|
14183 |
-
|
14184 |
-
var order = fieldModel.get( 'order' );
|
14185 |
-
|
14186 |
-
nfRadio.channel( 'fields' ).request( 'delete', fieldModel );
|
14187 |
-
|
14188 |
-
_.each( [ 'creditcardfullname', 'creditcardnumber', 'creditcardcvc', 'creditcardexpiration', 'creditcardzip'], function( type ) {
|
14189 |
-
|
14190 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
14191 |
-
|
14192 |
-
var newField = {
|
14193 |
-
id: nfRadio.channel( 'fields' ).request( 'get:tmpID' ),
|
14194 |
-
type: type,
|
14195 |
-
label: fieldType.get( 'nicename' ),
|
14196 |
-
order: order
|
14197 |
-
};
|
14198 |
-
|
14199 |
-
nfRadio.channel( 'fields' ).request( 'add', newField );
|
14200 |
-
});
|
14201 |
-
}
|
14202 |
-
|
14203 |
-
},
|
14204 |
-
|
14205 |
-
stageCreditCardField: function( model ) {
|
14206 |
-
|
14207 |
-
if( 'creditcard' == model.get( 'slug' ) ) {
|
14208 |
-
|
14209 |
-
nfRadio.channel( 'fields' ).request( 'remove:stagedField', '', model );
|
14210 |
-
|
14211 |
-
_.each( [ 'creditcardfullname', 'creditcardnumber', 'creditcardcvc', 'creditcardexpiration', 'creditcardzip'], function( type ) {
|
14212 |
-
nfRadio.channel('fields').request('add:stagedField', type );
|
14213 |
-
});
|
14214 |
-
}
|
14215 |
-
}
|
14216 |
-
|
14217 |
-
});
|
14218 |
-
|
14219 |
-
return controller;
|
14220 |
-
} );
|
14221 |
-
/**
|
14222 |
-
* Listens to our app channel to add the individual List Fields.
|
14223 |
-
*
|
14224 |
-
* @package Ninja Forms builder
|
14225 |
-
* @subpackage Main App
|
14226 |
-
* @copyright (c) 2015 WP Ninjas
|
14227 |
-
* @since 3.0
|
14228 |
-
*/
|
14229 |
-
define( 'controllers/fields/fieldList',[ 'models/app/optionRepeaterCollection' ], function( ListOptionCollection ) {
|
14230 |
-
var controller = Marionette.Object.extend( {
|
14231 |
-
initialize: function() {
|
14232 |
-
this.listenTo( nfRadio.channel( 'option-repeater-option-label' ), 'update:option', this.updateOptionLabel );
|
14233 |
-
this.listenTo( nfRadio.channel( 'option-repeater-option-value' ), 'update:option', this.updateOptionValue );
|
14234 |
-
|
14235 |
-
/*
|
14236 |
-
* When we init our model, convert our options from an array of objects to a collection of models.
|
14237 |
-
*/
|
14238 |
-
this.listenTo( nfRadio.channel( 'fields-list' ), 'init:fieldModel', this.convertOptions );
|
14239 |
-
},
|
14240 |
-
|
14241 |
-
updateOptionLabel: function( e, model, dataModel, settingModel, optionView ) {
|
14242 |
-
|
14243 |
-
if( 'list' != _.findWhere( fieldTypeData, { id: dataModel.get( 'type' ) } ).parentType ) return;
|
14244 |
-
|
14245 |
-
if( model.get( 'manual_value' ) ) return;
|
14246 |
-
|
14247 |
-
value = jQuery.slugify( model.get( 'label' ), { separator: '-' } );
|
14248 |
-
|
14249 |
-
model.set( 'value', value );
|
14250 |
-
model.trigger( 'change', model );
|
14251 |
-
|
14252 |
-
// Set focus on value input
|
14253 |
-
jQuery( optionView.el ).find( '[data-id="value"]' ).focus().select();
|
14254 |
-
},
|
14255 |
-
|
14256 |
-
updateOptionValue: function( e, model, dataModel, settingModel, optionView ) {
|
14257 |
-
if ( 'Field' == dataModel.get( 'objectType' ) ) {
|
14258 |
-
var newVal = model.get( 'value' );
|
14259 |
-
// Sanitize any unwanted special characters.
|
14260 |
-
// TODO: This assumes English is the standard language.
|
14261 |
-
// We might want to allow other language characters through this check later.
|
14262 |
-
var pattern = /[^0-9a-zA-Z _@.-]/g;
|
14263 |
-
newVal = newVal.replace( pattern, '' );
|
14264 |
-
model.set( 'value', newVal );
|
14265 |
-
// Re-render the value.
|
14266 |
-
optionView.render();
|
14267 |
-
}
|
14268 |
-
|
14269 |
-
var findWhere = _.findWhere( fieldTypeData, { id: dataModel.get( 'type' ) } );
|
14270 |
-
if( 'undefined' == typeof findWhere ) return;
|
14271 |
-
if( 'list' != findWhere.parentType ) return;
|
14272 |
-
|
14273 |
-
model.set( 'manual_value', true );
|
14274 |
-
|
14275 |
-
// Set focus on calc input
|
14276 |
-
jQuery( optionView.el ).find( '[data-id="calc"]' ).focus().select();
|
14277 |
-
},
|
14278 |
-
|
14279 |
-
convertOptions: function( fieldModel ) {
|
14280 |
-
/*
|
14281 |
-
* Our options are stored in our database as objects, not collections.
|
14282 |
-
* Before we attempt to render them, we need to convert them to a collection if they aren't already one.
|
14283 |
-
*/
|
14284 |
-
var options = fieldModel.get( 'options' );
|
14285 |
-
|
14286 |
-
var settingModel = nfRadio.channel( 'fields' ).request( 'get:settingModel', 'options' );
|
14287 |
-
|
14288 |
-
if ( false == options instanceof Backbone.Collection ) {
|
14289 |
-
options = new ListOptionCollection( [], { settingModel: settingModel } );
|
14290 |
-
options.add( fieldModel.get( 'options' ) );
|
14291 |
-
fieldModel.set( 'options', options, { silent: true } );
|
14292 |
-
}
|
14293 |
-
}
|
14294 |
-
|
14295 |
-
});
|
14296 |
-
|
14297 |
-
return controller;
|
14298 |
-
} );
|
14299 |
-
/**
|
14300 |
-
* Listens to our app channel to add the individual Credit Card Fields.
|
14301 |
-
*
|
14302 |
-
* @package Ninja Forms builder
|
14303 |
-
* @subpackage Main App
|
14304 |
-
* @copyright (c) 2015 WP Ninjas
|
14305 |
-
* @since 3.0
|
14306 |
-
*/
|
14307 |
-
define( 'controllers/fields/fieldPassword',[], function() {
|
14308 |
-
var controller = Marionette.Object.extend( {
|
14309 |
-
initialize: function() {
|
14310 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'after:addField', this.addField );
|
14311 |
-
},
|
14312 |
-
|
14313 |
-
addField: function( model ) {
|
14314 |
-
|
14315 |
-
if( 'password' == model.get( 'type' ) ) {
|
14316 |
-
|
14317 |
-
var order = model.get( 'order' );
|
14318 |
-
|
14319 |
-
var confirm = this.insertField( 'passwordconfirm', order + 1 );
|
14320 |
-
|
14321 |
-
confirm.set( 'confirm_field', model.get( 'key' ) );
|
14322 |
-
}
|
14323 |
-
},
|
14324 |
-
|
14325 |
-
insertField: function( type, order ) {
|
14326 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
14327 |
-
|
14328 |
-
var newField = {
|
14329 |
-
id: nfRadio.channel( 'fields' ).request( 'get:tmpID' ),
|
14330 |
-
type: type,
|
14331 |
-
label: fieldType.get( 'nicename' ),
|
14332 |
-
order: order
|
14333 |
-
};
|
14334 |
-
|
14335 |
-
return nfRadio.channel('fields').request('add', newField );
|
14336 |
-
}
|
14337 |
-
});
|
14338 |
-
|
14339 |
-
return controller;
|
14340 |
-
} );
|
14341 |
-
/**
|
14342 |
-
* Listens to our app channel for settings views being rendered.
|
14343 |
-
*
|
14344 |
-
* If we're rendering a product_assignment setting, add our products to the data model.
|
14345 |
-
*
|
14346 |
-
* @package Ninja Forms builder
|
14347 |
-
* @subpackage Main App
|
14348 |
-
* @copyright (c) 2015 WP Ninjas
|
14349 |
-
* @since 3.0
|
14350 |
-
*/
|
14351 |
-
define( 'controllers/fields/fieldQuantity',[], function() {
|
14352 |
-
var controller = Marionette.Object.extend( {
|
14353 |
-
initialize: function() {
|
14354 |
-
// Listen for messages that are fired before a setting view is rendered.
|
14355 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
14356 |
-
},
|
14357 |
-
|
14358 |
-
beforeRenderSetting: function( settingModel, dataModel, view ) {
|
14359 |
-
if ( 'product_assignment' == settingModel.get( 'name' ) ) {
|
14360 |
-
var productFields = this.getProductFields( settingModel );
|
14361 |
-
settingModel.set( 'options', productFields );
|
14362 |
-
}
|
14363 |
-
},
|
14364 |
-
|
14365 |
-
getProductFields: function( settingModel ) {
|
14366 |
-
var productFields = [ settingModel.get( 'select_product' ) ];
|
14367 |
-
// Update our dataModel with all of our product fields.
|
14368 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
14369 |
-
_.each( fields.models, function( field ) {
|
14370 |
-
if ( 'product' == field.get( 'type' ) ) {
|
14371 |
-
productFields.push( { label: field.get( 'label' ), value: field.get( 'id' ) } );
|
14372 |
-
}
|
14373 |
-
} );
|
14374 |
-
return productFields;
|
14375 |
-
}
|
14376 |
-
|
14377 |
-
});
|
14378 |
-
|
14379 |
-
return controller;
|
14380 |
-
} );
|
14381 |
-
/**
|
14382 |
-
* Listens to our app channel for settings views being rendered.
|
14383 |
-
*
|
14384 |
-
* If we're rendering a product_assignment setting, add our products to the data model.
|
14385 |
-
*
|
14386 |
-
* @package Ninja Forms builder
|
14387 |
-
* @subpackage Main App
|
14388 |
-
* @copyright (c) 2015 WP Ninjas
|
14389 |
-
* @since 3.0
|
14390 |
-
*/
|
14391 |
-
define( 'controllers/fields/fieldShipping',[], function() {
|
14392 |
-
var controller = Marionette.Object.extend( {
|
14393 |
-
initialize: function() {
|
14394 |
-
this.listenTo( nfRadio.channel( 'setting-shipping_options' ), 'render:setting', this.addMask );
|
14395 |
-
this.listenTo( nfRadio.channel( 'setting-shipping_options-option' ), 'render:setting', this.addMask );
|
14396 |
-
},
|
14397 |
-
|
14398 |
-
addMask: function( settingModel, dataModel, view ) {
|
14399 |
-
jQuery( view.el ).find( '[data-id="value"]' ).each( function() {
|
14400 |
-
jQuery( this ).autoNumeric({
|
14401 |
-
aSign: '$', // TODO: Use form setting
|
14402 |
-
aSep: thousandsSeparator,
|
14403 |
-
aDec: decimalPoint
|
14404 |
-
});
|
14405 |
-
} );
|
14406 |
-
}
|
14407 |
-
});
|
14408 |
-
|
14409 |
-
return controller;
|
14410 |
-
} );
|
14411 |
-
/**
|
14412 |
-
* When we add a new field, update its key.
|
14413 |
-
*
|
14414 |
-
* When we change the key, update any refs to the key.
|
14415 |
-
*
|
14416 |
-
* @package Ninja Forms builder
|
14417 |
-
* @subpackage Fields
|
14418 |
-
* @copyright (c) 2015 WP Ninjas
|
14419 |
-
* @since 3.0
|
14420 |
-
*/
|
14421 |
-
define( 'controllers/fields/key',[], function() {
|
14422 |
-
var controller = Marionette.Object.extend( {
|
14423 |
-
initialize: function() {
|
14424 |
-
// When we add a field, update its key.
|
14425 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'add:field', this.newFieldKey );
|
14426 |
-
|
14427 |
-
// When we edit a label, update our key.
|
14428 |
-
this.listenTo( nfRadio.channel( 'fieldSetting-label' ), 'update:setting', this.updateLabel );
|
14429 |
-
|
14430 |
-
// When we edit a key, check for places that key might be used.
|
14431 |
-
this.listenTo( nfRadio.channel( 'fieldSetting-key' ), 'update:setting', this.updateKey );
|
14432 |
-
|
14433 |
-
// When we type inside the admin key field, we need to save our manual_key setting.
|
14434 |
-
this.listenTo( nfRadio.channel( 'setting-key' ), 'keyup:setting', this.keyUp );
|
14435 |
-
},
|
14436 |
-
|
14437 |
-
/**
|
14438 |
-
* Add a key to our new field model.
|
14439 |
-
*
|
14440 |
-
* @since 3.0
|
14441 |
-
* @param backbone.model model new field model
|
14442 |
-
* @return void
|
14443 |
-
*/
|
14444 |
-
newFieldKey: function( model ) {
|
14445 |
-
var d = new Date();
|
14446 |
-
var n = d.valueOf();
|
14447 |
-
var key = this.slugify( model.get( 'type' ) + '_' + n );
|
14448 |
-
|
14449 |
-
model.set( 'key', key, { silent: true } );
|
14450 |
-
|
14451 |
-
if( 'undefined' == model.get( 'manual_key' ) ) {
|
14452 |
-
model.set('manual_key', false, {silent: true});
|
14453 |
-
}
|
14454 |
-
},
|
14455 |
-
|
14456 |
-
updateLabel: function( model ) {
|
14457 |
-
|
14458 |
-
/*
|
14459 |
-
* If we haven't entered a key manually, update our key when our label changes.
|
14460 |
-
*/
|
14461 |
-
if ( ! model.get( 'manual_key' ) && 0 != jQuery.trim( model.get( 'label' ) ).length ) {
|
14462 |
-
/*
|
14463 |
-
* When we're editing settings, we expect the edits to fire one at a time.
|
14464 |
-
* Since we're calling this in the middle of our label update, anything that inquires about what has changed after we set our key will see both label and key.
|
14465 |
-
* We need to remove the label from our model.changed property so that all that has changed is the key.
|
14466 |
-
*
|
14467 |
-
*/
|
14468 |
-
delete model.changed.label;
|
14469 |
-
var d = new Date();
|
14470 |
-
var n = d.valueOf();
|
14471 |
-
var key = this.slugify( model.get( 'label' ) + '_' + n );
|
14472 |
-
// If our slug didn't setup correctly...
|
14473 |
-
// Force a valid entry.
|
14474 |
-
if ( -1 == key.indexOf( '_' ) ) key = 'field_' + key;
|
14475 |
-
model.set( 'key', key );
|
14476 |
-
}
|
14477 |
-
},
|
14478 |
-
|
14479 |
-
/**
|
14480 |
-
* When a field key is updated, find any merge tags using the key and update them.
|
14481 |
-
*
|
14482 |
-
* @since 3.0
|
14483 |
-
* @param backbone.model model field model
|
14484 |
-
* @return void
|
14485 |
-
*/
|
14486 |
-
updateKey: function( dataModel ) {
|
14487 |
-
var key = dataModel.get( 'key' );
|
14488 |
-
this.settingModel = nfRadio.channel( 'fields' ).request( 'get:settingModel', 'key' );
|
14489 |
-
this.setError( key, dataModel );
|
14490 |
-
},
|
14491 |
-
|
14492 |
-
keyUp: function( e, settingModel, dataModel ) {
|
14493 |
-
dataModel.set( 'manual_key', true );
|
14494 |
-
this.settingModel = settingModel;
|
14495 |
-
var key = jQuery( e.target ).val();
|
14496 |
-
this.setError( key, dataModel );
|
14497 |
-
},
|
14498 |
-
|
14499 |
-
setError: function( key, dataModel ) {
|
14500 |
-
var error = false;
|
14501 |
-
if ( '' == jQuery.trim( key ) ) {
|
14502 |
-
error = 'Field keys can\'t be empty. Please enter a key.';
|
14503 |
-
} else if ( key != key.toLowerCase() ) {
|
14504 |
-
error = 'Field keys must be lowercase.';
|
14505 |
-
} else if ( key != key.replace( ' ', '_' ) ) {
|
14506 |
-
error = 'Field keys must cannot use spaces. Separate with "_" instead.';
|
14507 |
-
} else if ( '_' == key.slice( -1 ) ) {
|
14508 |
-
error = 'Field keys cannot end with a "_"';
|
14509 |
-
} else if ( key != this.slugify( key ) ) {
|
14510 |
-
error = 'Invalid Format.';
|
14511 |
-
} else if ( key != this.keyExists( key, dataModel ) ) {
|
14512 |
-
error = 'Field keys must be unique. Please enter another key.'
|
14513 |
-
}
|
14514 |
-
|
14515 |
-
if ( error ) {
|
14516 |
-
this.settingModel.set( 'error', error );
|
14517 |
-
} else {
|
14518 |
-
nfRadio.channel( 'app' ).trigger( 'update:fieldKey', dataModel );
|
14519 |
-
this.settingModel.set( 'error', false );
|
14520 |
-
}
|
14521 |
-
},
|
14522 |
-
|
14523 |
-
keyExists: function( key, dataModel ) {
|
14524 |
-
var newKey = this.slugify( key );
|
14525 |
-
if ( 0 != newKey.length ) {
|
14526 |
-
key = newKey;
|
14527 |
-
}
|
14528 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
14529 |
-
var x = 1;
|
14530 |
-
var testKey = key;
|
14531 |
-
_.each( fieldCollection.models, function( field ) {
|
14532 |
-
if ( dataModel != field && testKey == field.get( 'key' ) ) {
|
14533 |
-
testKey = key + '_' + x;
|
14534 |
-
x++;
|
14535 |
-
}
|
14536 |
-
} );
|
14537 |
-
|
14538 |
-
key = testKey;
|
14539 |
-
|
14540 |
-
return key;
|
14541 |
-
},
|
14542 |
-
|
14543 |
-
slugify: function( string ){
|
14544 |
-
return jQuery.slugify( string, { separator: '_' } )
|
14545 |
-
}
|
14546 |
-
});
|
14547 |
-
|
14548 |
-
return controller;
|
14549 |
-
} );
|
14550 |
-
|
14551 |
-
/**
|
14552 |
-
* Creates notices for our fields domain.
|
14553 |
-
*
|
14554 |
-
* @package Ninja Forms builder
|
14555 |
-
* @subpackage Fields
|
14556 |
-
* @copyright (c) 2015 WP Ninjas
|
14557 |
-
* @since 3.0
|
14558 |
-
*/
|
14559 |
-
define( 'controllers/fields/notices',[], function() {
|
14560 |
-
var controller = Marionette.Object.extend( {
|
14561 |
-
initialize: function() {
|
14562 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'add:stagedField', this.addStagedField );
|
14563 |
-
},
|
14564 |
-
|
14565 |
-
addStagedField: function( model ) {
|
14566 |
-
nfRadio.channel( 'notices' ).request( 'add', 'addStagedField', model.get( 'nicename' ) + ' added to staging' );
|
14567 |
-
}
|
14568 |
-
});
|
14569 |
-
|
14570 |
-
return controller;
|
14571 |
-
} );
|
14572 |
-
/**
|
14573 |
-
* Handles mobile-specific JS for our fields domain.
|
14574 |
-
*
|
14575 |
-
* @package Ninja Forms builder
|
14576 |
-
* @subpackage Fields
|
14577 |
-
* @copyright (c) 2015 WP Ninjas
|
14578 |
-
* @since 3.0
|
14579 |
-
*/
|
14580 |
-
define( 'controllers/fields/mobile',[], function() {
|
14581 |
-
var controller = Marionette.Object.extend( {
|
14582 |
-
initialize: function() {
|
14583 |
-
// Listen for the start of our sorting.
|
14584 |
-
// this.listenTo( nfRadio.channel( 'app' ), 'render:fieldsSortable', this.initWiggle );
|
14585 |
-
// Listen for when we start sorting.
|
14586 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'sortable:start', this.startWiggle );
|
14587 |
-
// Listen for when we stop sorting.
|
14588 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'sortable:stop', this.stopWiggle );
|
14589 |
-
},
|
14590 |
-
|
14591 |
-
initWiggle: function( view ) {
|
14592 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
14593 |
-
jQuery( view.el ).find( '.nf-field-wrap' ).on( 'taphold', function() {
|
14594 |
-
jQuery( this ).ClassyWiggle( 'start', { degrees: ['.65', '1', '.65', '0', '-.65', '-1', '-.65', '0'], delay: 50 } );
|
14595 |
-
} );
|
14596 |
-
}
|
14597 |
-
},
|
14598 |
-
|
14599 |
-
startWiggle: function( ui ) {
|
14600 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
14601 |
-
jQuery( ui.item ).removeClass( 'ui-sortable-helper' ).ClassyWiggle( 'stop' );
|
14602 |
-
jQuery( ui.helper ).css( 'opacity', '0.75' ).ClassyWiggle( 'start', { degrees: ['.5', '1', '.5', '0', '-.5', '-1', '-.5', '0'] } );
|
14603 |
-
}
|
14604 |
-
},
|
14605 |
-
|
14606 |
-
stopWiggle: function( ui ) {
|
14607 |
-
if ( nfRadio.channel( 'app' ).request( 'is:mobile' ) ) {
|
14608 |
-
jQuery( ui.helper ).ClassyWiggle( 'stop' );
|
14609 |
-
jQuery( ui.item ).removeClass( 'ui-sortable-helper drag-selected' );
|
14610 |
-
}
|
14611 |
-
}
|
14612 |
-
});
|
14613 |
-
|
14614 |
-
return controller;
|
14615 |
-
} );
|
14616 |
-
|
14617 |
-
/**
|
14618 |
-
* If we add a saved field to our form and then update it, set the "saved" flag to false.
|
14619 |
-
*
|
14620 |
-
* @package Ninja Forms builder
|
14621 |
-
* @subpackage Fields
|
14622 |
-
* @copyright (c) 2015 WP Ninjas
|
14623 |
-
* @since 3.0
|
14624 |
-
*/
|
14625 |
-
define( 'controllers/fields/savedFields',[], function() {
|
14626 |
-
var controller = Marionette.Object.extend( {
|
14627 |
-
ignoreAttributes: [
|
14628 |
-
'editActive',
|
14629 |
-
'order',
|
14630 |
-
'saved',
|
14631 |
-
'jBox'
|
14632 |
-
],
|
14633 |
-
|
14634 |
-
initialize: function() {
|
14635 |
-
this.listenTo( nfRadio.channel( 'fields' ), 'update:setting', this.updateField );
|
14636 |
-
// Listen to clicks on our add saved field button.
|
14637 |
-
this.listenTo( nfRadio.channel( 'drawer' ), 'click:addSavedField', this.clickAddSavedField, this );
|
14638 |
-
},
|
14639 |
-
|
14640 |
-
updateField: function( dataModel ) {
|
14641 |
-
if ( dataModel.get( 'saved' ) ) {
|
14642 |
-
|
14643 |
-
var modified = false;
|
14644 |
-
var changedAttributes = _.keys( dataModel.changedAttributes() );
|
14645 |
-
var that = this;
|
14646 |
-
_.each( changedAttributes, function( changed ) {
|
14647 |
-
if ( -1 == that.ignoreAttributes.indexOf( changed ) ) {
|
14648 |
-
modified = true;
|
14649 |
-
}
|
14650 |
-
} );
|
14651 |
-
|
14652 |
-
if ( modified ) {
|
14653 |
-
dataModel.set( 'saved', false );
|
14654 |
-
}
|
14655 |
-
}
|
14656 |
-
},
|
14657 |
-
|
14658 |
-
clickAddSavedField: function( e, dataModel ) {
|
14659 |
-
var modelClone = nfRadio.channel( 'app' ).request( 'clone:modelDeep', dataModel );
|
14660 |
-
|
14661 |
-
var fieldData = modelClone.attributes;
|
14662 |
-
fieldData.saved = true;
|
14663 |
-
|
14664 |
-
delete fieldData.jBox;
|
14665 |
-
delete fieldData.editActive;
|
14666 |
-
delete fieldData.created_at;
|
14667 |
-
delete fieldData.order;
|
14668 |
-
delete fieldData.id;
|
14669 |
-
delete fieldData.formID;
|
14670 |
-
delete fieldData.parent_id;
|
14671 |
-
|
14672 |
-
var type = nfRadio.channel( 'fields' ).request( 'get:type', fieldData.type );
|
14673 |
-
var newType = _.clone( type.attributes );
|
14674 |
-
|
14675 |
-
var nicename = jQuery( e.target ).parent().parent().find( 'input' ).val();
|
14676 |
-
console.log( nicename );
|
14677 |
-
newType.nicename = nicename;
|
14678 |
-
fieldData.label = nicename;
|
14679 |
-
fieldData.nicename = nicename;
|
14680 |
-
dataModel.set( 'addSavedLoading', true );
|
14681 |
-
var newTypeDefaults = JSON.stringify( fieldData );
|
14682 |
-
|
14683 |
-
jQuery.post( ajaxurl, { action: 'nf_create_saved_field', field: newTypeDefaults, security: nfAdmin.ajaxNonce }, function( response ) {
|
14684 |
-
response = JSON.parse( response );
|
14685 |
-
newType.id = response.data.id;
|
14686 |
-
newType.nicename = nicename;
|
14687 |
-
newType.settingDefaults = fieldData;
|
14688 |
-
|
14689 |
-
var typeCollection = nfRadio.channel( 'fields' ).request( 'get:typeCollection' );
|
14690 |
-
var newModel = typeCollection.add( newType );
|
14691 |
-
|
14692 |
-
var typeSections = nfRadio.channel( 'fields' ).request( 'get:typeSections' );
|
14693 |
-
typeSections.get( 'saved' ).get( 'fieldTypes' ).push( newType.id );
|
14694 |
-
|
14695 |
-
// dataModel.set( 'type', response.data.id );
|
14696 |
-
dataModel.set( 'addSavedLoading', false );
|
14697 |
-
dataModel.unset( 'addSavedLoading', { silent: true } );
|
14698 |
-
dataModel.get( 'jBox' ).close();
|
14699 |
-
// dataModel.set( 'saved', true );
|
14700 |
-
|
14701 |
-
nfRadio.channel( 'notices' ).request( 'add', 'addSaved', 'Saved Field Added' );
|
14702 |
-
} );
|
14703 |
-
}
|
14704 |
-
});
|
14705 |
-
|
14706 |
-
return controller;
|
14707 |
-
} );
|
14708 |
-
/**
|
14709 |
-
* Listens to our app channel for settings views being rendered.
|
14710 |
-
*
|
14711 |
-
* If we're rendering a datepicker setting, add our datepicker.
|
14712 |
-
*
|
14713 |
-
* @package Ninja Forms builder
|
14714 |
-
* @subpackage Main App
|
14715 |
-
* @copyright (c) 2015 WP Ninjas
|
14716 |
-
* @since 3.0
|
14717 |
-
*/
|
14718 |
-
define( 'controllers/fields/fieldDatepicker',[], function() {
|
14719 |
-
var controller = Marionette.Object.extend( {
|
14720 |
-
initialize: function() {
|
14721 |
-
this.listenTo( nfRadio.channel( 'setting-type-datepicker' ), 'render:setting', this.addDatepicker );
|
14722 |
-
},
|
14723 |
-
|
14724 |
-
addDatepicker: function( settingModel, dataModel, view ) {
|
14725 |
-
//Switch to flatpickr from pikaday
|
14726 |
-
let el = jQuery( view.el ).find( '.setting' )[0];
|
14727 |
-
let datePickerSettings = {};
|
14728 |
-
|
14729 |
-
// Allow fields to add settings to the datepicker.
|
14730 |
-
let filteredDatePickerSettings = nfRadio.channel( 'setting-type-datepicker' ).request( 'filter:settings', datePickerSettings, settingModel, el );
|
14731 |
-
if ( 'undefined' != typeof filteredDatePickerSettings ) {
|
14732 |
-
datePickerSettings = filteredDatePickerSettings;
|
14733 |
-
}
|
14734 |
-
|
14735 |
-
var dateObject = flatpickr( el, datePickerSettings );
|
14736 |
-
|
14737 |
-
nfRadio.channel( 'setting-type-datepicker' ).trigger( 'loadComplete', dateObject, settingModel, dataModel, view );
|
14738 |
-
}
|
14739 |
-
});
|
14740 |
-
|
14741 |
-
return controller;
|
14742 |
-
} );
|
14743 |
-
/**
|
14744 |
-
* Listens to our app channel for settings views being rendered.
|
14745 |
-
*
|
14746 |
-
* If we're rendering a product_assignment setting, add our products to the data model.
|
14747 |
-
*
|
14748 |
-
* @package Ninja Forms builder
|
14749 |
-
* @subpackage Main App
|
14750 |
-
* @copyright (c) 2015 WP Ninjas
|
14751 |
-
* @since 3.0
|
14752 |
-
*/
|
14753 |
-
define( 'controllers/fields/fieldDisplayCalc',[], function() {
|
14754 |
-
var controller = Marionette.Object.extend( {
|
14755 |
-
initialize: function() {
|
14756 |
-
// Listen for messages that are fired before a setting view is rendered.
|
14757 |
-
this.listenTo( nfRadio.channel( 'setting-calc_var' ), 'before:renderSetting', this.beforeRenderSetting );
|
14758 |
-
},
|
14759 |
-
|
14760 |
-
beforeRenderSetting: function( settingModel, dataModel, view ) {
|
14761 |
-
// console.log( 'render!' );
|
14762 |
-
},
|
14763 |
-
|
14764 |
-
getProductFields: function( settingModel ) {
|
14765 |
-
var productFields = [ settingModel.get( 'select_product' ) ];
|
14766 |
-
// Update our dataModel with all of our product fields.
|
14767 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
14768 |
-
_.each( fields.models, function( field ) {
|
14769 |
-
if ( 'product' == field.get( 'type' ) ) {
|
14770 |
-
productFields.push( { label: field.get( 'label' ), value: field.get( 'id' ) } );
|
14771 |
-
}
|
14772 |
-
} );
|
14773 |
-
return productFields;
|
14774 |
-
}
|
14775 |
-
|
14776 |
-
});
|
14777 |
-
|
14778 |
-
return controller;
|
14779 |
-
} );
|
14780 |
-
/**
|
14781 |
-
* Handles specifics for our repeater field types.
|
14782 |
-
*
|
14783 |
-
*/
|
14784 |
-
define( 'controllers/fields/fieldRepeater',[ 'models/fields/fieldCollection' ], function( fieldCollection ) {
|
14785 |
-
var controller = Marionette.Object.extend( {
|
14786 |
-
|
14787 |
-
initialize: function() {
|
14788 |
-
// Listen for repeater field models.
|
14789 |
-
this.listenTo( nfRadio.channel( 'fields-repeater' ), 'init:fieldModel', this.setupCollection, this );
|
14790 |
-
|
14791 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'add:childField', this.addChildField, this );
|
14792 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'receive:fields', this.receiveFields, this );
|
14793 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'get:childField', this.getChildField, this );
|
14794 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'process:stagedField', this.processStagedFields, this );
|
14795 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'sort:repeaterField', this.sortRepeaterField, this );
|
14796 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'over:repeaterField', this.overRepeaterField, this );
|
14797 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'out:repeaterField', this.outRepeaterField, this );
|
14798 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'stop:repeaterField', this.stopRepeaterField, this );
|
14799 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'start:repeaterField', this.startRepeaterField, this );
|
14800 |
-
nfRadio.channel( 'fields-repeater' ).reply( 'update:repeaterField', this.updateRepeaterField, this );
|
14801 |
-
},
|
14802 |
-
|
14803 |
-
/**
|
14804 |
-
* When we save repeater fields, their 'fields' content will be saved as an array of objects.
|
14805 |
-
* When a repeater field model is created, we need to hyrdate the 'fields' settings and turn it into a Backbone Collection.
|
14806 |
-
*
|
14807 |
-
* @since version
|
14808 |
-
* @param {[type]} fieldModel [description]
|
14809 |
-
* @return {[type]} [description]
|
14810 |
-
*/
|
14811 |
-
setupCollection: function( fieldModel ) {
|
14812 |
-
// The fields var will be an array of field model data.
|
14813 |
-
let fields = fieldModel.get( 'fields' );
|
14814 |
-
|
14815 |
-
// Only turn it into a collection if we haven't already.
|
14816 |
-
if ( false === fields instanceof Backbone.Collection ) {
|
14817 |
-
let collection = new fieldCollection( fields );
|
14818 |
-
fieldModel.set( 'fields', collection );
|
14819 |
-
|
14820 |
-
//Allows to loop through Repeater fields to reset correct state
|
14821 |
-
collection.listenTo( nfRadio.channel( 'fields-repeater' ), 'clearEditActive', this.clearEditActive, collection );
|
14822 |
-
collection.listenTo( nfRadio.channel( 'app' ), 'after:appStart', this.clearEditActive, collection );
|
14823 |
-
|
14824 |
-
// Listen for radio messages that a field was deleted.
|
14825 |
-
collection.listenTo( nfRadio.channel( 'fields' ), 'delete:field', this.maybeDeleteField, collection );
|
14826 |
-
}
|
14827 |
-
},
|
14828 |
-
|
14829 |
-
/**
|
14830 |
-
* In order to delete items from within a repeater field without creating a new convention, we listen to radio messages for field deletion.
|
14831 |
-
* We just have to make sure that these fields weren't just added to our repeater field collection.
|
14832 |
-
*
|
14833 |
-
* @since version
|
14834 |
-
* @param {[type]} fieldModel [description]
|
14835 |
-
* @return {[type]} [description]
|
14836 |
-
*/
|
14837 |
-
maybeDeleteField: function( fieldModel ) {
|
14838 |
-
// Make sure that we didn't just add this field to our repeater.
|
14839 |
-
if ( ! fieldModel.get( 'droppedInRepeater' ) ) {
|
14840 |
-
this.remove( fieldModel );
|
14841 |
-
}
|
14842 |
-
// We're done dropping now.
|
14843 |
-
fieldModel.set( 'droppedInRepeater', false );
|
14844 |
-
},
|
14845 |
-
|
14846 |
-
/**
|
14847 |
-
* Loops through our fields collection and sets editActive to false.
|
14848 |
-
*
|
14849 |
-
* @param {[type]} fieldModel field that was clicked
|
14850 |
-
* @return void
|
14851 |
-
*/
|
14852 |
-
clearEditActive: function( model ) {
|
14853 |
-
_.each( this.models, function( field ) {
|
14854 |
-
if( model.cid !== field.cid ){
|
14855 |
-
field.set( 'editActive', true );
|
14856 |
-
field.set( 'editActive', false );
|
14857 |
-
}
|
14858 |
-
} );
|
14859 |
-
},
|
14860 |
-
|
14861 |
-
|
14862 |
-
/**
|
14863 |
-
* Receive fields in the repeater field sortable zone
|
14864 |
-
*
|
14865 |
-
*/
|
14866 |
-
receiveFields: function( ui, that, e ) {
|
14867 |
-
|
14868 |
-
if( jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
|
14869 |
-
this.processStagedFields( ui, that, e );
|
14870 |
-
} else {
|
14871 |
-
this.addChildField(ui, that, e);
|
14872 |
-
}
|
14873 |
-
|
14874 |
-
},
|
14875 |
-
|
14876 |
-
/**
|
14877 |
-
* Add a field in the repeater fields collection
|
14878 |
-
*
|
14879 |
-
* @since 3.0
|
14880 |
-
* @return void
|
14881 |
-
*/
|
14882 |
-
addChildField: function( ui, that, e ) {
|
14883 |
-
|
14884 |
-
let type = typeof ui.item !== "undefined" ? jQuery( ui.item ).data( 'id' ) : ui.get('slug'),
|
14885 |
-
droppedFieldModel = nfRadio.channel( 'fields' ).request( 'get:field', type ),
|
14886 |
-
collection = that.repeaterFieldModel.get( 'fields' ),
|
14887 |
-
fieldModel;
|
14888 |
-
|
14889 |
-
|
14890 |
-
//Don't process another repeater field
|
14891 |
-
if(type === "repeater") return;
|
14892 |
-
|
14893 |
-
//If a field Model exists and comes from the builder get the field Type and delete Field Model from main collection
|
14894 |
-
if(droppedFieldModel != null){
|
14895 |
-
//Reset type based on the model
|
14896 |
-
type = droppedFieldModel.attributes.type;
|
14897 |
-
// Remove the field from the main field collection.
|
14898 |
-
nfRadio.channel( 'app' ).trigger( 'click:delete', e, droppedFieldModel );
|
14899 |
-
}
|
14900 |
-
|
14901 |
-
// Get our field type model
|
14902 |
-
fieldModel = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
14903 |
-
|
14904 |
-
// Get our tmp ID
|
14905 |
-
let elId = nfRadio.channel( 'fields' ).request( 'get:tmpID' ) != null ? nfRadio.channel( 'fields' ).request( 'get:tmpID' ) : "tmp";
|
14906 |
-
//Add field to collection
|
14907 |
-
newField = collection.add( { id: elId , label: fieldModel.get( 'nicename' ), type: type, repeaterField: true} );
|
14908 |
-
|
14909 |
-
//Sort fields
|
14910 |
-
let sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
14911 |
-
if(! jQuery(sortableEl).hasClass('ui-sortable')){
|
14912 |
-
nfRadio.channel( 'fields-repeater' ).request( 'init:sortable' );
|
14913 |
-
}
|
14914 |
-
let sortableElArray = jQuery( sortableEl ).sortable( 'toArray' );
|
14915 |
-
_.each( sortableElArray, function( element, index ) {
|
14916 |
-
if(false === element.length > 0){
|
14917 |
-
sortableElArray[index] = elId;
|
14918 |
-
} else if (element === elId) {
|
14919 |
-
sortableElArray.splice( index, 1);
|
14920 |
-
}
|
14921 |
-
});
|
14922 |
-
nfRadio.channel( 'fields-repeater' ).request( 'sort:repeaterField', sortableElArray);
|
14923 |
-
|
14924 |
-
// Add our field addition to our change log.
|
14925 |
-
var label = {
|
14926 |
-
object: 'Field',
|
14927 |
-
label: newField.get( 'label' ),
|
14928 |
-
change: 'Added',
|
14929 |
-
dashicon: 'plus-alt'
|
14930 |
-
};
|
14931 |
-
|
14932 |
-
var data = {
|
14933 |
-
collection: collection
|
14934 |
-
}
|
14935 |
-
|
14936 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addObject', newField, null, label, data );
|
14937 |
-
|
14938 |
-
|
14939 |
-
if( typeof elId !== "undefined" && typeof ui.helper !== "undefined" ){
|
14940 |
-
/*
|
14941 |
-
* Update our helper id to the tmpID.
|
14942 |
-
* We do this so that when we sort, we have the proper ID.
|
14943 |
-
*/
|
14944 |
-
jQuery( ui.helper ).prop( 'id', elId );
|
14945 |
-
//Sort fields in repeater
|
14946 |
-
nfRadio.channel( 'app' ).request( 'stop:fieldsSortable', ui );
|
14947 |
-
// Remove the helper. Gets rid of a weird type artifact.
|
14948 |
-
jQuery( ui.helper ).remove();
|
14949 |
-
// Trigger a drop field type event.
|
14950 |
-
nfRadio.channel( 'fields' ).trigger( 'drop:fieldType', type, elId );
|
14951 |
-
}
|
14952 |
-
|
14953 |
-
return elId;
|
14954 |
-
|
14955 |
-
},
|
14956 |
-
|
14957 |
-
/**
|
14958 |
-
* Get a field from a repeater field collection
|
14959 |
-
*
|
14960 |
-
* @return fieldModel
|
14961 |
-
*/
|
14962 |
-
getChildField: function( childFieldID, parentFieldModel, newID ) {
|
14963 |
-
|
14964 |
-
if( typeof childFieldID === "undefined") return;
|
14965 |
-
//Prepare retuned variable
|
14966 |
-
let childFieldModel;
|
14967 |
-
//Allow to retrieve parentFieldModel by the newID that contains the parent Field ID ( USed to update a field ID after saving the form )
|
14968 |
-
if( parentFieldModel == null && typeof newID !== "undefined" ){
|
14969 |
-
const parentID = newID.split('.')[0];
|
14970 |
-
parentFieldModel = nfRadio.channel( 'fields' ).request( 'get:field', parentID );
|
14971 |
-
}
|
14972 |
-
|
14973 |
-
//Check we have the Repeater Field Model
|
14974 |
-
if( parentFieldModel ) {
|
14975 |
-
//Get the fields collection in the repeater Field model
|
14976 |
-
let repeaterFieldsCollection = parentFieldModel.get( 'fields' );
|
14977 |
-
//Get the Child Field Model
|
14978 |
-
childFieldModel = repeaterFieldsCollection.get( childFieldID );
|
14979 |
-
}
|
14980 |
-
|
14981 |
-
return childFieldModel;
|
14982 |
-
},
|
14983 |
-
|
14984 |
-
/**
|
14985 |
-
* Add Staged fields to repeater fieldset
|
14986 |
-
*
|
14987 |
-
* @paran object event dropped
|
14988 |
-
* @param object ui dropped element
|
14989 |
-
*/
|
14990 |
-
processStagedFields( ui, that, e) {
|
14991 |
-
|
14992 |
-
// Make sure that our staged fields are sorted properly.
|
14993 |
-
nfRadio.channel( 'fields' ).request( 'sort:staging' );
|
14994 |
-
// Grab our staged fields.
|
14995 |
-
var stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );
|
14996 |
-
|
14997 |
-
// Get our current field order.
|
14998 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
14999 |
-
|
15000 |
-
let order = [];
|
15001 |
-
if ( jQuery( sortableEl ).hasClass( 'repeater' ) ) { // Sortable isn't empty
|
15002 |
-
// If we're dealing with a sortable that isn't empty, get the order.
|
15003 |
-
order = jQuery( sortableEl ).sortable( 'toArray' );
|
15004 |
-
} else { // Sortable is empty
|
15005 |
-
// Sortable is empty, all we care about is our staged field draggable.
|
15006 |
-
order = ['nf-staged-fields-drag'];
|
15007 |
-
}
|
15008 |
-
|
15009 |
-
// Get the index of our droped element.
|
15010 |
-
let insertedAt = order.indexOf( 'nf-staged-fields-drag' );
|
15011 |
-
|
15012 |
-
// Loop through each staged fields model and insert a field.
|
15013 |
-
_.each( stagedFields.models, function( field, index ) {
|
15014 |
-
// Add our field.
|
15015 |
-
var tmpID = nfRadio.channel( 'fields-repeater' ).request( 'add:childField', field, that, e );
|
15016 |
-
// Add this newly created field to our order array.
|
15017 |
-
order.splice( insertedAt + index, 0, tmpID );
|
15018 |
-
|
15019 |
-
} );
|
15020 |
-
|
15021 |
-
// Remove our dropped element from our order array.
|
15022 |
-
insertedAt = order.indexOf( 'nf-staged-fields-drag' );
|
15023 |
-
order.splice( insertedAt, 1 );
|
15024 |
-
|
15025 |
-
// Sort our fields
|
15026 |
-
nfRadio.channel( 'fields' ).request( 'sort:fields', order );
|
15027 |
-
// Clear our staging
|
15028 |
-
nfRadio.channel( 'fields' ).request( 'clear:staging' );
|
15029 |
-
// Remove our helper. Fixes a weird artifact.
|
15030 |
-
jQuery( ui.helper ).remove();
|
15031 |
-
|
15032 |
-
},
|
15033 |
-
|
15034 |
-
/**
|
15035 |
-
* Sort the fields in a repeater Field
|
15036 |
-
*
|
15037 |
-
* @param Array order optional order array like: [field-1, field-4, field-2]
|
15038 |
-
* @return void
|
15039 |
-
*/
|
15040 |
-
sortRepeaterField: function( order, ui, updateDB ) {
|
15041 |
-
// Add the field to this repeatable collection.
|
15042 |
-
let collection = nfRadio.channel( 'fields-repeater' ).request( 'get:repeaterFieldsCollection' );
|
15043 |
-
|
15044 |
-
if ( null == updateDB ) {
|
15045 |
-
updateDB = true;
|
15046 |
-
}
|
15047 |
-
// Get our sortable element
|
15048 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
15049 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) { // Make sure that sortable is enabled
|
15050 |
-
// JS ternerary for setting our order
|
15051 |
-
var order = order || jQuery( sortableEl ).sortable( 'toArray' );
|
15052 |
-
// Loop through all of our fields and update their order value
|
15053 |
-
_.each( collection.models, function( field ) {
|
15054 |
-
// Get our current position.
|
15055 |
-
var oldPos = field.get( 'order' );
|
15056 |
-
var id = field.get( 'id' );
|
15057 |
-
if ( jQuery.isNumeric( id ) ) {
|
15058 |
-
var search = 'field-' + id;
|
15059 |
-
} else {
|
15060 |
-
var search = id;
|
15061 |
-
}
|
15062 |
-
|
15063 |
-
// Get the index of our field inside our order array
|
15064 |
-
var newPos = order.indexOf( search ) + 1;
|
15065 |
-
field.set( 'order', newPos );
|
15066 |
-
} );
|
15067 |
-
|
15068 |
-
collection.sort();
|
15069 |
-
|
15070 |
-
if ( updateDB ) {
|
15071 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
15072 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
15073 |
-
// Update our preview
|
15074 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
15075 |
-
}
|
15076 |
-
}
|
15077 |
-
},
|
15078 |
-
|
15079 |
-
/**
|
15080 |
-
* When the user drags a field type or staging over our sortable, we need to modify the helper.
|
15081 |
-
*
|
15082 |
-
* @since 3.0
|
15083 |
-
* @param Object ui jQuery UI element
|
15084 |
-
* @return void
|
15085 |
-
*/
|
15086 |
-
overRepeaterField: function( ui ) {
|
15087 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // Field Type
|
15088 |
-
// String type
|
15089 |
-
var type = jQuery( ui.helper ).data( 'id' );
|
15090 |
-
// Get our field type model.
|
15091 |
-
var fieldType = nfRadio.channel( 'fields' ).request( 'get:type', type );
|
15092 |
-
// Get our field type nicename.
|
15093 |
-
var label = fieldType.get( 'nicename' );
|
15094 |
-
// Get our sortable element.
|
15095 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
15096 |
-
|
15097 |
-
// Set our currentHelper to an object var so that we can access it later.
|
15098 |
-
this.currentHelper = ui.helper;
|
15099 |
-
|
15100 |
-
} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging
|
15101 |
-
// Get our sortable, and if it's initialized add our hover class.
|
15102 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
15103 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
15104 |
-
jQuery( sortableEl ).addClass( 'nf-droppable-hover' );
|
15105 |
-
}
|
15106 |
-
}
|
15107 |
-
},
|
15108 |
-
|
15109 |
-
/**
|
15110 |
-
* When the user moves a draggable outside of the sortable, we need to change the helper.
|
15111 |
-
* This returns the item to its pre-over state.
|
15112 |
-
*
|
15113 |
-
* @since 3.0
|
15114 |
-
* @param Object ui jQuery UI element
|
15115 |
-
* @return void
|
15116 |
-
*/
|
15117 |
-
outRepeaterField: function( ui ) {
|
15118 |
-
if( jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) ) { // Field Type
|
15119 |
-
/*
|
15120 |
-
* Get our helper clone.
|
15121 |
-
* This will let us access the previous label and classes of our helper.
|
15122 |
-
*/
|
15123 |
-
var helperClone = nfRadio.channel( 'drawer-addField' ).request( 'get:typeHelperClone' );
|
15124 |
-
// Set our helper label, remove our sortable class, and add the type class back to the type draggable.
|
15125 |
-
jQuery( this.currentHelper ).html( jQuery( helperClone ).html() );
|
15126 |
-
jQuery( this.currentHelper ).removeClass( 'nf-field-wrap' ).addClass( 'nf-field-type-button' ).css( { 'width': '', 'height': '' } );
|
15127 |
-
// Get our sortable and if it has been intialized, remove the droppable hover class.
|
15128 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
15129 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
15130 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-hover' );
|
15131 |
-
}
|
15132 |
-
} else if ( jQuery( ui.item ).hasClass( 'nf-stage' ) ) { // Staging
|
15133 |
-
// If we've initialized our sortable, remove the droppable hover class.
|
15134 |
-
var sortableEl = nfRadio.channel( 'fields-repeater' ).request( 'get:sortableEl' );
|
15135 |
-
if ( jQuery( sortableEl ).hasClass( 'ui-sortable' ) ) {
|
15136 |
-
jQuery( sortableEl ).removeClass( 'nf-droppable-hover' );
|
15137 |
-
}
|
15138 |
-
}
|
15139 |
-
},
|
15140 |
-
|
15141 |
-
/**
|
15142 |
-
* When we stop dragging in the sortable:
|
15143 |
-
* remove our opacity setting
|
15144 |
-
* remove our ui helper
|
15145 |
-
*
|
15146 |
-
* @since 3.0
|
15147 |
-
* @param Object ui jQuery UI element
|
15148 |
-
* @return void
|
15149 |
-
*/
|
15150 |
-
stopRepeaterField: function( ui ) {
|
15151 |
-
jQuery( ui.item ).css( 'opacity', '' );
|
15152 |
-
jQuery( ui.helper ).remove();
|
15153 |
-
//nfRadio.channel( 'fields' ).trigger( 'sortable:stop', ui );
|
15154 |
-
},
|
15155 |
-
|
15156 |
-
/**
|
15157 |
-
* When we start dragging in the sortable:
|
15158 |
-
* add an opacity setting of 0.5
|
15159 |
-
* show our item (jQuery hides the original item by default)
|
15160 |
-
*
|
15161 |
-
* @since 3.0
|
15162 |
-
* @param Object ui jQuery UI element
|
15163 |
-
* @return void
|
15164 |
-
*/
|
15165 |
-
startRepeaterField: function( ui ) {
|
15166 |
-
// If we aren't dragging an item in from types or staging, update our change log.
|
15167 |
-
if( ! jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) && ! jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
|
15168 |
-
|
15169 |
-
// Maintain origional visibility during drag/sort.
|
15170 |
-
jQuery( ui.item ).show();
|
15171 |
-
|
15172 |
-
// Determine helper based on builder/layout type.
|
15173 |
-
if(jQuery(ui.item).hasClass('nf-field-wrap')){
|
15174 |
-
var newHelper = jQuery(ui.item).clone();
|
15175 |
-
} else if(jQuery(ui.item).parent().hasClass('layouts-cell')) {
|
15176 |
-
var newHelper = $parentHelper.clone();
|
15177 |
-
} else {
|
15178 |
-
var newHelper = jQuery(ui.item).clone();
|
15179 |
-
}
|
15180 |
-
|
15181 |
-
// Remove unecessary item controls from helper.
|
15182 |
-
newHelper.find('.nf-item-controls').remove();
|
15183 |
-
|
15184 |
-
// Update helper with clone's content.
|
15185 |
-
jQuery( ui.helper ).html( newHelper.html() );
|
15186 |
-
|
15187 |
-
jQuery( ui.helper ).css( 'opacity', '0.5' );
|
15188 |
-
|
15189 |
-
// Add de-emphasize origional.
|
15190 |
-
jQuery( ui.item ).css( 'opacity', '0.25' );
|
15191 |
-
}
|
15192 |
-
//nfRadio.channel( 'fields' ).trigger( 'sortable:start', ui );
|
15193 |
-
},
|
15194 |
-
|
15195 |
-
/**
|
15196 |
-
* Sort our fields when we change the order.
|
15197 |
-
*
|
15198 |
-
* @since 3.0
|
15199 |
-
* @param Object ui jQuery UI element
|
15200 |
-
* @return void
|
15201 |
-
*/
|
15202 |
-
updateRepeaterField: function( ui, sortable ) {
|
15203 |
-
|
15204 |
-
nfRadio.channel( 'fields-repeater' ).request( 'sort:repeaterField' );
|
15205 |
-
|
15206 |
-
// If we aren't dragging an item in from types or staging, update our change log.
|
15207 |
-
if( ! jQuery( ui.item ).hasClass( 'nf-field-type-draggable' ) && ! jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
|
15208 |
-
|
15209 |
-
var fieldCollection = nfRadio.channel( 'fields-repeater' ).request( 'get:repeaterFieldsCollection' );
|
15210 |
-
var dragFieldID = jQuery( ui.item ).prop( 'id' ).replace( 'field-', '' );
|
15211 |
-
var dragModel = fieldCollection.get( dragFieldID );
|
15212 |
-
|
15213 |
-
// Add our change event to the change tracker.
|
15214 |
-
var data = { fields: [] };
|
15215 |
-
_.each( fieldCollection.models, function( field ) {
|
15216 |
-
var oldPos = field._previousAttributes.order;
|
15217 |
-
var newPos = field.get( 'order' );
|
15218 |
-
|
15219 |
-
data.fields.push( {
|
15220 |
-
model: field,
|
15221 |
-
attr: 'order',
|
15222 |
-
before: oldPos,
|
15223 |
-
after: newPos
|
15224 |
-
} );
|
15225 |
-
|
15226 |
-
} );
|
15227 |
-
|
15228 |
-
var label = {
|
15229 |
-
object: 'Field',
|
15230 |
-
label: dragModel.get( 'label' ),
|
15231 |
-
change: 'Re-ordered from ' + dragModel._previousAttributes.order + ' to ' + dragModel.get( 'order' ),
|
15232 |
-
dashicon: 'sort'
|
15233 |
-
};
|
15234 |
-
|
15235 |
-
//nfRadio.channel( 'changes' ).request( 'register:change', 'sortFields', dragModel, null, label, data );
|
15236 |
-
}
|
15237 |
-
|
15238 |
-
},
|
15239 |
-
|
15240 |
-
});
|
15241 |
-
|
15242 |
-
|
15243 |
-
|
15244 |
-
return controller;
|
15245 |
-
} );
|
15246 |
-
/**
|
15247 |
-
* Creates and stores a collection of action types. This includes all of the settings shown when editing a field.
|
15248 |
-
*
|
15249 |
-
* Loops over our preloaded data and adds that to our action type collection
|
15250 |
-
*
|
15251 |
-
* Also responds to requests for data about action types
|
15252 |
-
*
|
15253 |
-
* @package Ninja Forms builder
|
15254 |
-
* @subpackage Actions
|
15255 |
-
* @copyright (c) 2015 WP Ninjas
|
15256 |
-
* @since 3.0
|
15257 |
-
*/
|
15258 |
-
define( 'controllers/actions/types',[ 'models/app/typeCollection' ], function( TypeCollection ) {
|
15259 |
-
var controller = Marionette.Object.extend( {
|
15260 |
-
initialize: function() {
|
15261 |
-
|
15262 |
-
/*
|
15263 |
-
* Instantiate "installed" actions collection.
|
15264 |
-
*/
|
15265 |
-
this.installedActions = new TypeCollection(
|
15266 |
-
_.filter( actionTypeData, function( type ) {
|
15267 |
-
return type.section == 'installed';
|
15268 |
-
}
|
15269 |
-
),
|
15270 |
-
{
|
15271 |
-
slug: 'installed',
|
15272 |
-
nicename: nfi18n.installed
|
15273 |
-
}
|
15274 |
-
);
|
15275 |
-
|
15276 |
-
this.availableActions = new TypeCollection(
|
15277 |
-
_.filter( actionTypeData, function( type ) {
|
15278 |
-
return type.section == 'available';
|
15279 |
-
}
|
15280 |
-
),
|
15281 |
-
{
|
15282 |
-
slug: 'available',
|
15283 |
-
nicename: nfi18n.available
|
15284 |
-
}
|
15285 |
-
);
|
15286 |
-
|
15287 |
-
// Respond to requests to get field type, collection, settings, and sections
|
15288 |
-
nfRadio.channel( 'actions' ).reply( 'get:type', this.getType, this );
|
15289 |
-
nfRadio.channel( 'actions' ).reply( 'get:installedActions', this.getInstalledActions, this );
|
15290 |
-
nfRadio.channel( 'actions' ).reply( 'get:availableActions', this.getAvailableActions, this );
|
15291 |
-
},
|
15292 |
-
|
15293 |
-
/**
|
15294 |
-
* Return a field type by id
|
15295 |
-
*
|
15296 |
-
* @since 3.0
|
15297 |
-
* @param string id field type
|
15298 |
-
* @return backbone.model field type model
|
15299 |
-
*/
|
15300 |
-
getType: function( id ) {
|
15301 |
-
// Search our installed actions first
|
15302 |
-
var type = this.installedActions.get( id );
|
15303 |
-
if ( ! type ) {
|
15304 |
-
type = this.availableActions.get( id );
|
15305 |
-
}
|
15306 |
-
return type;
|
15307 |
-
},
|
15308 |
-
|
15309 |
-
/**
|
15310 |
-
* Return the installed action type collection
|
15311 |
-
*
|
15312 |
-
* @since 3.0
|
15313 |
-
* @return backbone.collection field type collection
|
15314 |
-
*/
|
15315 |
-
getInstalledActions: function() {
|
15316 |
-
return this.installedActions;
|
15317 |
-
},
|
15318 |
-
|
15319 |
-
/**
|
15320 |
-
* Return the available action type collection
|
15321 |
-
*
|
15322 |
-
* @since 3.0
|
15323 |
-
* @return backbone.collection field type collection
|
15324 |
-
*/
|
15325 |
-
getAvailableActions: function() {
|
15326 |
-
return this.availableActions;
|
15327 |
-
},
|
15328 |
-
|
15329 |
-
/**
|
15330 |
-
* Add a field type to our staging area when the field type button is clicked.
|
15331 |
-
*
|
15332 |
-
* @since 3.0
|
15333 |
-
* @param Object e event
|
15334 |
-
* @return void
|
15335 |
-
*/
|
15336 |
-
addStagedField: function( e ) {
|
15337 |
-
var type = jQuery( e.target ).data( 'id' );
|
15338 |
-
nfRadio.channel( 'fields' ).request( 'add:stagedField', type );
|
15339 |
-
},
|
15340 |
-
|
15341 |
-
/**
|
15342 |
-
* Return our field type settings sections
|
15343 |
-
*
|
15344 |
-
* @since 3.0
|
15345 |
-
* @return backbone.collection field type settings sections
|
15346 |
-
*/
|
15347 |
-
getTypeSections: function() {
|
15348 |
-
return this.fieldTypeSections;
|
15349 |
-
}
|
15350 |
-
});
|
15351 |
-
|
15352 |
-
return controller;
|
15353 |
-
} );
|
15354 |
-
|
15355 |
-
/**
|
15356 |
-
* Model that represents our form action.
|
15357 |
-
*
|
15358 |
-
* @package Ninja Forms builder
|
15359 |
-
* @subpackage Actions
|
15360 |
-
* @copyright (c) 2015 WP Ninjas
|
15361 |
-
* @since 3.0
|
15362 |
-
*/
|
15363 |
-
define( 'models/actions/actionModel',[], function() {
|
15364 |
-
var model = Backbone.Model.extend( {
|
15365 |
-
defaults: {
|
15366 |
-
objectType: 'Action',
|
15367 |
-
objectDomain: 'actions',
|
15368 |
-
editActive: false
|
15369 |
-
},
|
15370 |
-
|
15371 |
-
initialize: function() {
|
15372 |
-
// Listen for model attribute changes
|
15373 |
-
this.on( 'change', this.changeSetting, this );
|
15374 |
-
|
15375 |
-
// Get our parent field type.
|
15376 |
-
var actionType = nfRadio.channel( 'actions' ).request( 'get:type', this.get( 'type' ) );
|
15377 |
-
|
15378 |
-
if( 'undefined' == typeof actionType ) return;
|
15379 |
-
|
15380 |
-
// Loop through our action type "settingDefaults" and add any default settings.
|
15381 |
-
var that = this;
|
15382 |
-
_.each( actionType.get( 'settingDefaults' ), function( val, key ) {
|
15383 |
-
if ( ! that.get( key ) ) {
|
15384 |
-
that.set( key, val, { silent: true } );
|
15385 |
-
}
|
15386 |
-
} );
|
15387 |
-
|
15388 |
-
/*
|
15389 |
-
* Trigger an init event on three channels:
|
15390 |
-
*
|
15391 |
-
* actions
|
15392 |
-
* action-type
|
15393 |
-
*
|
15394 |
-
* This lets specific field types modify model attributes before anything uses them.
|
15395 |
-
*/
|
15396 |
-
nfRadio.channel( 'actions' ).trigger( 'init:actionModel', this );
|
15397 |
-
nfRadio.channel( 'actions-' + this.get( 'type' ) ).trigger( 'init:actionModel', this );
|
15398 |
-
|
15399 |
-
this.listenTo( nfRadio.channel( 'app' ), 'fire:updateFieldKey', this.updateFieldKey );
|
15400 |
-
},
|
15401 |
-
|
15402 |
-
/**
|
15403 |
-
* When we change the model attributes, fire an event saying we've changed something.
|
15404 |
-
*
|
15405 |
-
* @since 3.0
|
15406 |
-
* @return void
|
15407 |
-
*/
|
15408 |
-
changeSetting: function( model, options ) {
|
15409 |
-
nfRadio.channel( 'actionSetting-' + _.keys( this.changedAttributes() )[0] ).trigger( 'update:setting', this, options.settingModel ) ;
|
15410 |
-
nfRadio.channel( 'actions').trigger( 'update:setting', this, options.settingModel );
|
15411 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', this, options.settingModel );
|
15412 |
-
},
|
15413 |
-
|
15414 |
-
updateFieldKey: function( keyModel, settingModel ) {
|
15415 |
-
nfRadio.channel( 'app' ).trigger( 'replace:fieldKey', this, keyModel, settingModel );
|
15416 |
-
}
|
15417 |
-
} );
|
15418 |
-
|
15419 |
-
return model;
|
15420 |
-
} );
|
15421 |
-
/**
|
15422 |
-
* Collection that holds our action models.
|
15423 |
-
* This is the actual action data created by the user.
|
15424 |
-
*
|
15425 |
-
* We listen to the add and remove events so that we can push the new id to either the new action or removed action property.
|
15426 |
-
*
|
15427 |
-
* @package Ninja Forms builder
|
15428 |
-
* @subpackage Actions
|
15429 |
-
* @copyright (c) 2015 WP Ninjas
|
15430 |
-
* @since 3.0
|
15431 |
-
*/
|
15432 |
-
define( 'models/actions/actionCollection',['models/actions/actionModel'], function( actionModel ) {
|
15433 |
-
var collection = Backbone.Collection.extend( {
|
15434 |
-
model: actionModel,
|
15435 |
-
comparator: 'order',
|
15436 |
-
tmpNum: 1,
|
15437 |
-
|
15438 |
-
initialize: function() {
|
15439 |
-
this.on( 'add', this.addAction, this );
|
15440 |
-
this.on( 'remove', this.removeAction, this );
|
15441 |
-
this.newIDs = [];
|
15442 |
-
},
|
15443 |
-
|
15444 |
-
/**
|
15445 |
-
* When we add a field, push the id onto our new action property.
|
15446 |
-
* This lets us tell the server that this is a new field to be added rather than a field to be updated.
|
15447 |
-
*
|
15448 |
-
* @since 3.0
|
15449 |
-
* @param void
|
15450 |
-
*/
|
15451 |
-
addAction: function( model ) {
|
15452 |
-
this.newIDs.push( model.get( 'id' ) );
|
15453 |
-
},
|
15454 |
-
|
15455 |
-
/**
|
15456 |
-
* When we remove a field, push the id onto our removed action property.
|
15457 |
-
*
|
15458 |
-
* @since 3.0
|
15459 |
-
* @param void
|
15460 |
-
*/
|
15461 |
-
removeAction: function( model ) {
|
15462 |
-
this.removedIDs[ model.get( 'id' ) ] = model.get( 'id' );
|
15463 |
-
}
|
15464 |
-
} );
|
15465 |
-
return collection;
|
15466 |
-
} );
|
15467 |
-
/**
|
15468 |
-
* Handles interactions with our actions collection.
|
15469 |
-
*
|
15470 |
-
* @package Ninja Forms builder
|
15471 |
-
* @subpackage Actions
|
15472 |
-
* @copyright (c) 2015 WP Ninjas
|
15473 |
-
* @since 3.0
|
15474 |
-
*/
|
15475 |
-
define( 'controllers/actions/data',['models/actions/actionCollection', 'models/actions/actionModel'], function( actionCollection, actionModel ) {
|
15476 |
-
var controller = Marionette.Object.extend( {
|
15477 |
-
initialize: function() {
|
15478 |
-
// Load our action collection from our localized form data
|
15479 |
-
this.collection = new actionCollection( preloadedFormData.actions );
|
15480 |
-
this.collection.tmpNum = 1;
|
15481 |
-
|
15482 |
-
if ( 0 != this.collection.models.length ) {
|
15483 |
-
var that = this;
|
15484 |
-
_.each( this.collection.models, function( action ) {
|
15485 |
-
if ( ! jQuery.isNumeric( action.get( 'id' ) ) ) {
|
15486 |
-
that.collection.tmpNum++;
|
15487 |
-
}
|
15488 |
-
} );
|
15489 |
-
}
|
15490 |
-
// Set our removedIDs to an empty object. This will be populated when a action is removed so that we can add it to our 'deleted_actions' object.
|
15491 |
-
this.collection.removedIDs = {};
|
15492 |
-
|
15493 |
-
// Respond to requests for data about actions and to update/change/delete actions from our collection.
|
15494 |
-
nfRadio.channel( 'actions' ).reply( 'get:collection', this.getCollection, this );
|
15495 |
-
nfRadio.channel( 'actions' ).reply( 'get:action', this.getAction, this );
|
15496 |
-
nfRadio.channel( 'actions' ).reply( 'get:tmpID', this.getTmpID, this );
|
15497 |
-
|
15498 |
-
nfRadio.channel( 'actions' ).reply( 'add', this.addAction, this );
|
15499 |
-
nfRadio.channel( 'actions' ).reply( 'delete', this.deleteAction, this );
|
15500 |
-
},
|
15501 |
-
|
15502 |
-
getCollection: function() {
|
15503 |
-
return this.collection;
|
15504 |
-
},
|
15505 |
-
|
15506 |
-
getAction: function( id ) {
|
15507 |
-
return this.collection.get( id );
|
15508 |
-
},
|
15509 |
-
|
15510 |
-
/**
|
15511 |
-
* Add a action to our collection. If silent is passed as true, no events will trigger.
|
15512 |
-
*
|
15513 |
-
* @since 3.0
|
15514 |
-
* @param Object data action data to insert
|
15515 |
-
* @param bool silent prevent events from firing as a result of adding
|
15516 |
-
*/
|
15517 |
-
addAction: function( data, silent ) {
|
15518 |
-
silent = silent || false;
|
15519 |
-
|
15520 |
-
if ( false === data instanceof Backbone.Model ) {
|
15521 |
-
var model = new actionModel( data );
|
15522 |
-
} else {
|
15523 |
-
var model = data;
|
15524 |
-
}
|
15525 |
-
|
15526 |
-
this.collection.add( model, { silent: silent } );
|
15527 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
15528 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
15529 |
-
|
15530 |
-
return model;
|
15531 |
-
},
|
15532 |
-
|
15533 |
-
/**
|
15534 |
-
* Delete a action from our collection.
|
15535 |
-
*
|
15536 |
-
* @since 3.0
|
15537 |
-
* @param backbone.model model action model to be deleted
|
15538 |
-
* @return void
|
15539 |
-
*/
|
15540 |
-
deleteAction: function( model ) {
|
15541 |
-
this.collection.remove( model );
|
15542 |
-
// Set our 'clean' status to false so that we get a notice to publish changes
|
15543 |
-
nfRadio.channel( 'app' ).request( 'update:setting', 'clean', false );
|
15544 |
-
nfRadio.channel( 'app' ).request( 'update:db' );
|
15545 |
-
|
15546 |
-
},
|
15547 |
-
|
15548 |
-
|
15549 |
-
/**
|
15550 |
-
* Return a new tmp id for our actions.
|
15551 |
-
* Gets the action collection length, adds 1, then returns that prepended with 'tmp-'.
|
15552 |
-
*
|
15553 |
-
* @since 3.0
|
15554 |
-
* @return string
|
15555 |
-
*/
|
15556 |
-
getTmpID: function() {
|
15557 |
-
var tmpNum = this.collection.tmpNum;
|
15558 |
-
this.collection.tmpNum++;
|
15559 |
-
return 'tmp-' + tmpNum;
|
15560 |
-
}
|
15561 |
-
});
|
15562 |
-
|
15563 |
-
return controller;
|
15564 |
-
} );
|
15565 |
-
/**
|
15566 |
-
* Fetches settings models so that we can get setting information
|
15567 |
-
*
|
15568 |
-
* @package Ninja Forms builder
|
15569 |
-
* @subpackage Main App
|
15570 |
-
* @copyright (c) 2015 WP Ninjas
|
15571 |
-
* @since 3.0
|
15572 |
-
*/
|
15573 |
-
define( 'controllers/actions/actionSettings',['models/app/settingCollection'], function( settingCollection ) {
|
15574 |
-
var controller = Marionette.Object.extend( {
|
15575 |
-
initialize: function() {
|
15576 |
-
this.collection = new settingCollection( actionSettings, { objectType: 'actions' } );
|
15577 |
-
|
15578 |
-
// Responds to requests for settings models.
|
15579 |
-
nfRadio.channel( 'actions' ).reply( 'get:settingModel', this.getSettingModel, this );
|
15580 |
-
},
|
15581 |
-
|
15582 |
-
getSettingModel: function( name ) {
|
15583 |
-
return this.collection.findWhere( { name: name } );
|
15584 |
-
}
|
15585 |
-
|
15586 |
-
});
|
15587 |
-
|
15588 |
-
return controller;
|
15589 |
-
} );
|
15590 |
-
/**
|
15591 |
-
* Handles adding and removing the active class from a action currently being edited.
|
15592 |
-
*
|
15593 |
-
* @package Ninja Forms builder
|
15594 |
-
* @subpackage Actions - Edit Action Drawer
|
15595 |
-
* @copyright (c) 2015 WP Ninjas
|
15596 |
-
* @since 3.0
|
15597 |
-
*/
|
15598 |
-
define( 'controllers/actions/editActive',[], function() {
|
15599 |
-
var controller = Marionette.Object.extend( {
|
15600 |
-
initialize: function() {
|
15601 |
-
// Respond to requests to remove the active class from all our actions.
|
15602 |
-
nfRadio.channel( 'actions' ).reply( 'clear:editActive', this.clearEditActive, this );
|
15603 |
-
// Listen for the closing drawer so that we can remove all of our active classes.
|
15604 |
-
this.listenTo( nfRadio.channel( 'drawer-editSettings' ), 'before:closeDrawer', this.clearEditActive );
|
15605 |
-
},
|
15606 |
-
|
15607 |
-
/**
|
15608 |
-
* Loops through our actions collection and sets editActive to false.
|
15609 |
-
*
|
15610 |
-
* @since 3.0
|
15611 |
-
* @return void
|
15612 |
-
*/
|
15613 |
-
clearEditActive: function() {
|
15614 |
-
var actionCollection = nfRadio.channel( 'actions' ).request( 'get:collection' );
|
15615 |
-
_.each( actionCollection.models, function( action ) {
|
15616 |
-
action.set( 'editActive', false );
|
15617 |
-
} );
|
15618 |
-
}
|
15619 |
-
});
|
15620 |
-
|
15621 |
-
return controller;
|
15622 |
-
} );
|
15623 |
-
|
15624 |
-
/**
|
15625 |
-
* @package Ninja Forms builder
|
15626 |
-
* @subpackage Actions - Action Settings Drawer
|
15627 |
-
* @copyright (c) 2015 WP Ninjas
|
15628 |
-
* @since 3.0
|
15629 |
-
*/
|
15630 |
-
define( 'controllers/actions/emailFromSetting',[], function( ) {
|
15631 |
-
var controller = Marionette.Object.extend( {
|
15632 |
-
initialize: function() {
|
15633 |
-
this.listenTo( nfRadio.channel( 'actionSetting-from_address' ), 'update:setting', this.updateFromAddress );
|
15634 |
-
},
|
15635 |
-
|
15636 |
-
updateFromAddress: function( dataModel, settingModel ) {
|
15637 |
-
if( 'undefined' == typeof settingModel ) return;
|
15638 |
-
|
15639 |
-
var value = dataModel.get( 'from_address' ).trim();
|
15640 |
-
|
15641 |
-
if( '{wp:admin_email}' == value ) {
|
15642 |
-
return settingModel.set( 'warning', false );
|
15643 |
-
}
|
15644 |
-
|
15645 |
-
if( value && ( ! this.isValidEmail( value ) ) || nfAdmin.home_url_host != value.replace(/.*@/, "") ){
|
15646 |
-
return settingModel.set( 'warning', nfi18n.errorInvalidEmailFromAddress );
|
15647 |
-
}
|
15648 |
-
|
15649 |
-
return settingModel.set( 'warning', false );
|
15650 |
-
},
|
15651 |
-
|
15652 |
-
isValidEmail: function(email) {
|
15653 |
-
return /^.+@.+\..+$/.test(email);
|
15654 |
-
}
|
15655 |
-
});
|
15656 |
-
return controller;
|
15657 |
-
} );
|
15658 |
-
/**
|
15659 |
-
* Handles clicks and dragging for our action types.
|
15660 |
-
*
|
15661 |
-
* @package Ninja Forms builder
|
15662 |
-
* @subpackage Fields - New Field Drawer
|
15663 |
-
* @copyright (c) 2015 WP Ninjas
|
15664 |
-
* @since 3.0
|
15665 |
-
*/
|
15666 |
-
define( 'controllers/actions/addActionTypes',['models/actions/actionCollection', 'models/actions/actionModel'], function( actionCollection, actionModel ) {
|
15667 |
-
var controller = Marionette.Object.extend( {
|
15668 |
-
initialize: function() {
|
15669 |
-
this.listenTo( nfRadio.channel( 'actions' ), 'click:addAction', this.addAction );
|
15670 |
-
|
15671 |
-
nfRadio.channel( 'actions' ).reply( 'add:actionType', this.addAction, this );
|
15672 |
-
},
|
15673 |
-
|
15674 |
-
/**
|
15675 |
-
* Add an action to our collection. If silent is passed as true, no events will trigger.
|
15676 |
-
*
|
15677 |
-
* @since 3.0
|
15678 |
-
* @param Object data action data to insert
|
15679 |
-
* @param bool silent prevent events from firing as a result of adding
|
15680 |
-
*/
|
15681 |
-
addAction: function( type ) {
|
15682 |
-
|
15683 |
-
var data = {
|
15684 |
-
id: nfRadio.channel( 'actions' ).request( 'get:tmpID' ),
|
15685 |
-
type: type.get( 'id' ),
|
15686 |
-
label: type.get( 'settingDefaults').label || type.get( 'nicename' )
|
15687 |
-
}
|
15688 |
-
|
15689 |
-
var newModel = nfRadio.channel( 'actions' ).request( 'add', data );
|
15690 |
-
|
15691 |
-
var label = {
|
15692 |
-
object: 'Action',
|
15693 |
-
label: newModel.get( 'label' ),
|
15694 |
-
change: 'Added',
|
15695 |
-
dashicon: 'plus-alt'
|
15696 |
-
};
|
15697 |
-
|
15698 |
-
var data = {
|
15699 |
-
collection: nfRadio.channel( 'actions' ).request( 'get:collection' )
|
15700 |
-
}
|
15701 |
-
|
15702 |
-
nfRadio.channel( 'changes' ).request( 'register:change', 'addObject', newModel, null, label, data );
|
15703 |
-
nfRadio.channel( 'app' ).trigger( 'click:edit', {}, newModel );
|
15704 |
-
}
|
15705 |
-
});
|
15706 |
-
|
15707 |
-
return controller;
|
15708 |
-
} );
|
15709 |
-
/**
|
15710 |
-
* Handles the logic for our action type draggables.
|
15711 |
-
*
|
15712 |
-
* @package Ninja Forms builder
|
15713 |
-
* @subpackage Actions - New Action Drawer
|
15714 |
-
* @copyright (c) 2015 WP Ninjas
|
15715 |
-
* @since 3.0
|
15716 |
-
*/
|
15717 |
-
define( 'controllers/actions/typeDrag',[], function( ) {
|
15718 |
-
var controller = Marionette.Object.extend( {
|
15719 |
-
initialize: function() {
|
15720 |
-
// Listen to our action type draggables and run the appropriate function.
|
15721 |
-
this.listenTo( nfRadio.channel( 'drawer-addAction' ), 'startDrag:type', this.startDrag );
|
15722 |
-
this.listenTo( nfRadio.channel( 'drawer-addAction' ), 'stopDrag:type', this.stopDrag );
|
15723 |
-
/*
|
15724 |
-
* Respond to requests for our helper clone.
|
15725 |
-
* This is used by other parts of the application to modify what the user is dragging in real-time.
|
15726 |
-
*/
|
15727 |
-
nfRadio.channel( 'drawer-addAction' ).reply( 'get:typeHelperClone', this.getCurrentDraggableHelperClone, this );
|
15728 |
-
},
|
15729 |
-
|
15730 |
-
/**
|
15731 |
-
* When we start dragging:
|
15732 |
-
* get our drawer element
|
15733 |
-
* set its overflow property to visible !important -> forces the type drag element to be on at the top of the z-index.
|
15734 |
-
* get our main element
|
15735 |
-
* est its overflow propery to visible !important -> forces the type drag element to be on top of the z-index.
|
15736 |
-
* set our dragging helper clone
|
15737 |
-
*
|
15738 |
-
* @since 3.0
|
15739 |
-
* @param object context This function is going to be called from a draggable. Context is the "this" reference to the draggable.
|
15740 |
-
* @param object ui Object sent by jQuery UI draggable.
|
15741 |
-
* @return void
|
15742 |
-
*/
|
15743 |
-
startDrag: function( context, ui ) {
|
15744 |
-
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
|
15745 |
-
this.mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
|
15746 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
|
15747 |
-
// jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
|
15748 |
-
|
15749 |
-
this.draggableHelperClone = jQuery( ui.helper ).clone();
|
15750 |
-
|
15751 |
-
},
|
15752 |
-
|
15753 |
-
/**
|
15754 |
-
* When we stop dragging, reset our overflow property to hidden !important.
|
15755 |
-
*
|
15756 |
-
* @since 3.0
|
15757 |
-
* @param object context This function is going to be called from a draggable. Context is the "this" reference to the draggable.
|
15758 |
-
* @param object ui Object sent by jQuery UI draggable.
|
15759 |
-
* @return {[type]} [description]
|
15760 |
-
*/
|
15761 |
-
stopDrag: function( context, ui ) {
|
15762 |
-
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
|
15763 |
-
// jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
|
15764 |
-
},
|
15765 |
-
|
15766 |
-
getCurrentDraggableHelperClone: function() {
|
15767 |
-
return this.draggableHelperClone;
|
15768 |
-
}
|
15769 |
-
});
|
15770 |
-
|
15771 |
-
return controller;
|
15772 |
-
} );
|
15773 |
-
/**
|
15774 |
-
* Handles the logic for our action type droppable.
|
15775 |
-
*
|
15776 |
-
* @package Ninja Forms builder
|
15777 |
-
* @subpackage Actions - New Action Drawer
|
15778 |
-
* @copyright (c) 2015 WP Ninjas
|
15779 |
-
* @since 3.0
|
15780 |
-
*/
|
15781 |
-
define( 'controllers/actions/droppable',[], function( ) {
|
15782 |
-
var controller = Marionette.Object.extend( {
|
15783 |
-
initialize: function() {
|
15784 |
-
/*
|
15785 |
-
* Respond to requests for our helper clone.
|
15786 |
-
* This is used by other parts of the application to modify what the user is dragging in real-time.
|
15787 |
-
*/
|
15788 |
-
nfRadio.channel( 'app' ).reply( 'drop:actionType', this.dropActionType, this );
|
15789 |
-
},
|
15790 |
-
|
15791 |
-
dropActionType: function( e, ui ) {
|
15792 |
-
var type_slug = jQuery( ui.helper ).data( 'type' );
|
15793 |
-
var type = nfRadio.channel( 'actions' ).request( 'get:type', type_slug );
|
15794 |
-
nfRadio.channel( 'actions' ).request( 'add:actionType', type );
|
15795 |
-
}
|
15796 |
-
});
|
15797 |
-
|
15798 |
-
return controller;
|
15799 |
-
} );
|
15800 |
-
/**
|
15801 |
-
* Model for our action type
|
15802 |
-
*
|
15803 |
-
* @package Ninja Forms builder
|
15804 |
-
* @subpackage Actions
|
15805 |
-
* @copyright (c) 2015 WP Ninjas
|
15806 |
-
* @since 3.0
|
15807 |
-
*/
|
15808 |
-
define( 'models/actions/typeModel',[], function() {
|
15809 |
-
var model = Backbone.Model.extend( {
|
15810 |
-
|
15811 |
-
} );
|
15812 |
-
|
15813 |
-
return model;
|
15814 |
-
} );
|
15815 |
-
/**
|
15816 |
-
* Collection that holds our action type models.
|
15817 |
-
*
|
15818 |
-
* @package Ninja Forms builder
|
15819 |
-
* @subpackage Actions
|
15820 |
-
* @copyright (c) 2015 WP Ninjas
|
15821 |
-
* @since 3.0
|
15822 |
-
*/
|
15823 |
-
define( 'models/actions/typeCollection',['models/actions/typeModel'], function( actionTypeModel ) {
|
15824 |
-
var collection = Backbone.Collection.extend( {
|
15825 |
-
model: actionTypeModel,
|
15826 |
-
} );
|
15827 |
-
return collection;
|
15828 |
-
} );
|
15829 |
-
/**
|
15830 |
-
* Filters our action type collection.
|
15831 |
-
*
|
15832 |
-
* @package Ninja Forms builder
|
15833 |
-
* @subpackage Actions - New Action Drawer
|
15834 |
-
* @copyright (c) 2015 WP Ninjas
|
15835 |
-
* @since 3.0
|
15836 |
-
*/
|
15837 |
-
define( 'controllers/actions/filterTypes',['models/actions/typeCollection'], function( typeCollection ) {
|
15838 |
-
var controller = Marionette.Object.extend( {
|
15839 |
-
initialize: function() {
|
15840 |
-
// Listen to our change filter event.
|
15841 |
-
this.listenTo( nfRadio.channel( 'drawer-addAction' ), 'change:filter', this.filterActionTypes );
|
15842 |
-
},
|
15843 |
-
|
15844 |
-
/**
|
15845 |
-
* Filter our action types in the add new action drawer
|
15846 |
-
*
|
15847 |
-
* Takes a search string and finds any action types that match either the name or alias.
|
15848 |
-
*
|
15849 |
-
* @since 3.0
|
15850 |
-
* @param string search string being searched for
|
15851 |
-
* @param object e Keyup event
|
15852 |
-
* @return void
|
15853 |
-
*/
|
15854 |
-
filterActionTypes: function( search, e ) {
|
15855 |
-
|
15856 |
-
// Make sure that we aren't dealing with an empty string.
|
15857 |
-
if ( '' != jQuery.trim( search ) ) {
|
15858 |
-
|
15859 |
-
var filteredInstalled = [];
|
15860 |
-
/**
|
15861 |
-
* Call the function that actually filters our collection,
|
15862 |
-
* and then loop through our collection, adding each model to our filteredInstalled array.
|
15863 |
-
*/
|
15864 |
-
var installedActions = nfRadio.channel( 'actions' ).request( 'get:installedActions' );
|
15865 |
-
_.each( this.filterCollection( search, installedActions ), function( model ) {
|
15866 |
-
filteredInstalled.push( model );
|
15867 |
-
} );
|
15868 |
-
|
15869 |
-
var filteredAvailable = [];
|
15870 |
-
var availableActions = nfRadio.channel( 'actions' ).request( 'get:availableActions' );
|
15871 |
-
_.each( this.filterCollection( search, availableActions ), function( model ) {
|
15872 |
-
filteredAvailable.push( model );
|
15873 |
-
} );
|
15874 |
-
|
15875 |
-
// Create a new Action Type Section collection with the filtered array.
|
15876 |
-
var newInstalled = new typeCollection( filteredInstalled );
|
15877 |
-
newInstalled.slug = 'installed';
|
15878 |
-
newInstalled.nicename = 'Installed';
|
15879 |
-
|
15880 |
-
var newAvailable = new typeCollection( filteredAvailable );
|
15881 |
-
newAvailable.slug = 'available';
|
15882 |
-
newAvailable.nicename = 'Available';
|
15883 |
-
|
15884 |
-
// Request that our action types filter be applied, passing the collection we created above.
|
15885 |
-
nfRadio.channel( 'drawer' ).trigger( 'filter:actionTypes', newInstalled, newAvailable );
|
15886 |
-
// If we've pressed the 'enter' key, add the action to staging and clear the filter.
|
15887 |
-
if ( e.addObject ) {
|
15888 |
-
if ( 0 < newInstalled.length ) {
|
15889 |
-
nfRadio.channel( 'actions' ).request( 'add:actionType', newInstalled.models[0] );
|
15890 |
-
nfRadio.channel( 'drawer' ).request( 'clear:filter' );
|
15891 |
-
}
|
15892 |
-
}
|
15893 |
-
} else {
|
15894 |
-
// Clear our filter if the search text is empty.
|
15895 |
-
nfRadio.channel( 'drawer' ).trigger( 'clear:filter' );
|
15896 |
-
}
|
15897 |
-
},
|
15898 |
-
|
15899 |
-
/**
|
15900 |
-
* Search our action type collection for the search string.
|
15901 |
-
*
|
15902 |
-
* @since 3.0
|
15903 |
-
* @param string search string being searched for
|
15904 |
-
* @return backbone.collection
|
15905 |
-
*/
|
15906 |
-
filterCollection: function( search, collection ) {
|
15907 |
-
search = search.toLowerCase();
|
15908 |
-
/*
|
15909 |
-
* Backbone collections have a 'filter' method that loops through every model,
|
15910 |
-
* waiting for you to return true or false. If you return true, the model is kept.
|
15911 |
-
* If you return false, it's removed from the filtered result.
|
15912 |
-
*/
|
15913 |
-
var filtered = collection.filter( function( model ) {
|
15914 |
-
var found = false;
|
15915 |
-
|
15916 |
-
// If we match either the ID or nicename, return true.
|
15917 |
-
if ( model.get( 'id' ).toLowerCase().indexOf( search ) != -1 ) {
|
15918 |
-
found = true;
|
15919 |
-
} else if ( model.get( 'nicename' ).toLowerCase().indexOf( search ) != -1 ) {
|
15920 |
-
found = true;
|
15921 |
-
}
|
15922 |
-
|
15923 |
-
/*
|
15924 |
-
* TODO: Hashtag searching. Doesn't really do anything atm.
|
15925 |
-
*/
|
15926 |
-
if ( model.get( 'tags' ) && 0 == search.indexOf( '#' ) ) {
|
15927 |
-
_.each( model.get( 'tags' ), function( tag ) {
|
15928 |
-
if ( search.replace( '#', '' ).length > 1 ) {
|
15929 |
-
if ( tag.toLowerCase().indexOf( search.replace( '#', '' ) ) != -1 ) {
|
15930 |
-
found = true;
|
15931 |
-
}
|
15932 |
-
}
|
15933 |
-
} );
|
15934 |
-
}
|
15935 |
-
|
15936 |
-
// If we match any of the aliases, return true.
|
15937 |
-
if ( model.get( 'alias' ) ) {
|
15938 |
-
_.each( model.get( 'alias' ), function( alias ) {
|
15939 |
-
if ( alias.toLowerCase().indexOf( search ) != -1 ) {
|
15940 |
-
found = true;
|
15941 |
-
}
|
15942 |
-
} );
|
15943 |
-
}
|
15944 |
-
|
15945 |
-
return found;
|
15946 |
-
} );
|
15947 |
-
|
15948 |
-
// Return our filtered collection.
|
15949 |
-
return filtered;
|
15950 |
-
}
|
15951 |
-
});
|
15952 |
-
|
15953 |
-
return controller;
|
15954 |
-
} );
|
15955 |
-
/**
|
15956 |
-
* @package Ninja Forms builder
|
15957 |
-
* @subpackage Actions - New Action Drawer
|
15958 |
-
* @copyright (c) 2015 WP Ninjas
|
15959 |
-
* @since 3.0
|
15960 |
-
*/
|
15961 |
-
define( 'controllers/actions/newsletterList',[], function( ) {
|
15962 |
-
var controller = Marionette.Object.extend( {
|
15963 |
-
initialize: function() {
|
15964 |
-
this.listenTo( nfRadio.channel( 'setting-newsletter_list' ), 'show:setting', this.defaultFields );
|
15965 |
-
this.listenTo( nfRadio.channel( 'setting-type-newsletter_list' ), 'click:extra', this.clickListUpdate );
|
15966 |
-
this.listenTo( nfRadio.channel( 'actionSetting-newsletter_list' ), 'update:setting', this.maybeRenderFields );
|
15967 |
-
this.listenTo( nfRadio.channel( 'actionSetting-newsletter_list' ), 'update:setting', this.maybeRenderGroups );
|
15968 |
-
this.listenTo( nfRadio.channel( 'setting-name-newsletter_list_fields' ), 'init:settingModel', this.registerFieldsListener );
|
15969 |
-
this.listenTo( nfRadio.channel( 'setting-name-newsletter_list_groups' ), 'init:settingModel', this.registerGroupsListener );
|
15970 |
-
},
|
15971 |
-
|
15972 |
-
defaultFields: function( settingModel, dataModel ) {
|
15973 |
-
this.maybeRenderFields( dataModel, settingModel );
|
15974 |
-
this.maybeRenderGroups( dataModel, settingModel );
|
15975 |
-
},
|
15976 |
-
|
15977 |
-
registerFieldsListener: function ( model ) {
|
15978 |
-
model.listenTo( nfRadio.channel( 'newsletter_list_fields' ), 'update:fieldMapping', this.updateFieldMapping, model );
|
15979 |
-
},
|
15980 |
-
|
15981 |
-
registerGroupsListener: function ( model ) {
|
15982 |
-
model.listenTo( nfRadio.channel( 'newsletter_list_groups' ), 'update:interestGroups', this.updateInterestGroups, model );
|
15983 |
-
},
|
15984 |
-
|
15985 |
-
clickListUpdate: function( e, settingModel, dataModel, settingView ) {
|
15986 |
-
|
15987 |
-
var data = {
|
15988 |
-
action: 'nf_' + dataModel.attributes.type + '_get_lists',
|
15989 |
-
security: nfAdmin.ajaxNonce
|
15990 |
-
};
|
15991 |
-
|
15992 |
-
var that = this;
|
15993 |
-
jQuery( e.srcElement ).addClass( 'spin' );
|
15994 |
-
jQuery.post( ajaxurl, data, function( response ){
|
15995 |
-
var response = JSON.parse( response );
|
15996 |
-
that.updateLists( settingModel, response.lists, settingView, dataModel );
|
15997 |
-
dataModel.set( 'newsletter_list', response.lists[0].value, { settingModel: settingModel } );
|
15998 |
-
}).always( function() {
|
15999 |
-
jQuery( e.srcElement ).removeClass( 'spin' );
|
16000 |
-
});
|
16001 |
-
},
|
16002 |
-
|
16003 |
-
updateLists: function( settingModel, lists, settingView, dataModel ) {
|
16004 |
-
settingModel.set( 'options', lists );
|
16005 |
-
settingView.render();
|
16006 |
-
},
|
16007 |
-
|
16008 |
-
maybeRenderFields: function( dataModel, settingModel ) {
|
16009 |
-
|
16010 |
-
if( 'undefined' == typeof settingModel ) return;
|
16011 |
-
|
16012 |
-
var selectedList = dataModel.get( 'newsletter_list' );
|
16013 |
-
var lists = settingModel.get( 'options' );
|
16014 |
-
_.each( lists, function( list ) {
|
16015 |
-
if ( selectedList == list.value ) {
|
16016 |
-
nfRadio.channel( 'newsletter_list_fields').trigger( 'update:fieldMapping', list.fields );
|
16017 |
-
}
|
16018 |
-
} );
|
16019 |
-
|
16020 |
-
dataModel.set( 'newsletter_list_fields', 0 );
|
16021 |
-
},
|
16022 |
-
|
16023 |
-
maybeRenderGroups: function( dataModel, settingModel ) {
|
16024 |
-
if( 'undefined' == typeof settingModel ) return;
|
16025 |
-
|
16026 |
-
var selectedList = dataModel.get( 'newsletter_list' );
|
16027 |
-
var lists = settingModel.get( 'options' );
|
16028 |
-
_.each( lists, function( list ) {
|
16029 |
-
if ( selectedList == list.value ) {
|
16030 |
-
nfRadio.channel( 'newsletter_list_groups').trigger( 'update:interestGroups', list.groups );
|
16031 |
-
}
|
16032 |
-
} );
|
16033 |
-
|
16034 |
-
dataModel.set( 'newsletter_list_fields', 0 );
|
16035 |
-
},
|
16036 |
-
|
16037 |
-
updateFieldMapping: function( fields ) {
|
16038 |
-
var settings = this.get( 'settings' );
|
16039 |
-
settings.reset();
|
16040 |
-
_.each( fields, function( field ){
|
16041 |
-
|
16042 |
-
settings.add({
|
16043 |
-
name: field.value,
|
16044 |
-
type: 'textbox',
|
16045 |
-
label: field.label,
|
16046 |
-
width: 'full',
|
16047 |
-
use_merge_tags: { exclude: [ 'user', 'post', 'system', 'querystrings' ] }
|
16048 |
-
});
|
16049 |
-
});
|
16050 |
-
this.set( 'settings', settings );
|
16051 |
-
},
|
16052 |
-
|
16053 |
-
updateInterestGroups: function( groups ) {
|
16054 |
-
var settings = this.get( 'settings' );
|
16055 |
-
settings.reset();
|
16056 |
-
_.each( groups, function( group ){
|
16057 |
-
|
16058 |
-
settings.add({
|
16059 |
-
name: group.value,
|
16060 |
-
type: 'toggle',
|
16061 |
-
label: group.label,
|
16062 |
-
width: 'full',
|
16063 |
-
});
|
16064 |
-
});
|
16065 |
-
this.set( 'settings', settings );
|
16066 |
-
},
|
16067 |
-
|
16068 |
-
});
|
16069 |
-
|
16070 |
-
return controller;
|
16071 |
-
} );
|
16072 |
-
|
16073 |
-
/**
|
16074 |
-
* Listens to field deletion, removing any merge tags that reference the field.
|
16075 |
-
*
|
16076 |
-
* @package Ninja Forms builder
|
16077 |
-
* @subpackage Main App
|
16078 |
-
* @copyright (c) 2017 WP Ninjas
|
16079 |
-
* @since 3.1.7
|
16080 |
-
*/
|
16081 |
-
define( 'controllers/actions/deleteFieldListener',[], function() {
|
16082 |
-
var controller = Marionette.Object.extend( {
|
16083 |
-
initialize: function() {
|
16084 |
-
/*
|
16085 |
-
* When we init an action model, register a listener for field deletion.
|
16086 |
-
*/
|
16087 |
-
this.listenTo( nfRadio.channel( 'actions' ), 'init:actionModel', this.registerListener );
|
16088 |
-
},
|
16089 |
-
|
16090 |
-
registerListener: function( actionModel ) {
|
16091 |
-
actionModel.listenTo( nfRadio.channel( 'fields' ), 'delete:field', this.maybeUpdateSettings );
|
16092 |
-
},
|
16093 |
-
|
16094 |
-
maybeUpdateSettings: function( fieldModel ) {
|
16095 |
-
var newObject, filteredCollection,
|
16096 |
-
fieldMergeTag = '{field:' + fieldModel.get( 'key' ) + '}';
|
16097 |
-
|
16098 |
-
/*
|
16099 |
-
* Loop through our action attributes to see if the field mergetag exists in our action.
|
16100 |
-
*
|
16101 |
-
* If it does:
|
16102 |
-
* - Replace the field mergetag in strings with ''.
|
16103 |
-
* - Remove any items with the field merge tag if they are in an array.
|
16104 |
-
*/
|
16105 |
-
_.each( this.attributes, function( attr, key ) {
|
16106 |
-
if ( _.isString( attr ) ) {
|
16107 |
-
// If our attribute is a string, replace any instances of the field merge tag with an empty string.
|
16108 |
-
this.set( key, attr.replace( fieldMergeTag, '' ) );
|
16109 |
-
} else if ( _.isArray( attr ) ) {
|
16110 |
-
// If our attribute is an array, search the contents for field merge tag and remove items that match.
|
16111 |
-
_.each( attr, function( val, index ) {
|
16112 |
-
if ( _.isString( val ) ) {
|
16113 |
-
// If val is a string, search it for the field mergetag.
|
16114 |
-
console.log( 'string replace' );
|
16115 |
-
} else if ( _.isArray( val ) ) {
|
16116 |
-
// If val is an array, search it for the field mergetag.
|
16117 |
-
console.log( 'array search' );
|
16118 |
-
} else if ( _.isObject( val ) ) {
|
16119 |
-
// If val is a object, search it for the field mergetag.
|
16120 |
-
newObject = _.mapObject( val, function( value, key ) {
|
16121 |
-
if ( _.isString( value ) ) {
|
16122 |
-
if ( -1 != value.indexOf( fieldMergeTag ) ) {
|
16123 |
-
attr.splice( index, 1 );
|
16124 |
-
}
|
16125 |
-
};
|
16126 |
-
|
16127 |
-
return value;
|
16128 |
-
} );
|
16129 |
-
|
16130 |
-
this.set( key, attr );
|
16131 |
-
}
|
16132 |
-
}, this );
|
16133 |
-
} else if ( attr instanceof Backbone.Collection ) {
|
16134 |
-
// This is a Backbone Collection, so we need to loop through the models and remove any that have an attribute containing the field merge tag.
|
16135 |
-
var filteredCollection = attr.filter( function ( model ) {
|
16136 |
-
// Make sure that EVERY model attribute does NOT reference the field merge tag.
|
16137 |
-
return _.every( model.attributes, function( val ) {
|
16138 |
-
/*
|
16139 |
-
* Currently only handles items that are one-level deep.
|
16140 |
-
* TODO: Add support for further nesting of values.
|
16141 |
-
*/
|
16142 |
-
if ( _.isString( val ) ) {
|
16143 |
-
if ( -1 != val.indexOf( fieldMergeTag ) ) {
|
16144 |
-
return false;
|
16145 |
-
}
|
16146 |
-
}
|
16147 |
-
return true;
|
16148 |
-
});;
|
16149 |
-
});
|
16150 |
-
// Update our key with the filtered collection value.
|
16151 |
-
this.set( key, filteredCollection );
|
16152 |
-
}
|
16153 |
-
}, this );
|
16154 |
-
}
|
16155 |
-
|
16156 |
-
});
|
16157 |
-
|
16158 |
-
return controller;
|
16159 |
-
} );
|
16160 |
-
/**
|
16161 |
-
* Listens to our app channel for settings views being rendered.
|
16162 |
-
*
|
16163 |
-
* If we're rendering a collect payment setting, add our number fields and total fields to the data model.
|
16164 |
-
*
|
16165 |
-
* @package Ninja Forms builder
|
16166 |
-
* @subpackage Main App
|
16167 |
-
* @copyright (c) 2017 WP Ninjas
|
16168 |
-
* @since 3.1.7
|
16169 |
-
*/
|
16170 |
-
define( 'controllers/actions/collectPaymentFields',[], function() {
|
16171 |
-
var controller = Marionette.Object.extend( {
|
16172 |
-
initialize: function() {
|
16173 |
-
// Listen for messages that are fired before a setting view is rendered.
|
16174 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
16175 |
-
},
|
16176 |
-
|
16177 |
-
beforeRenderSetting: function( settingModel, dataModel, view ) {
|
16178 |
-
if ( 'field' != settingModel.get( 'total_type' ) ) return false;
|
16179 |
-
|
16180 |
-
var fields = this.getFields( settingModel );
|
16181 |
-
|
16182 |
-
/*
|
16183 |
-
* If the field in the payment total isn't in our field list, add it.
|
16184 |
-
*
|
16185 |
-
* Remove the merge tag stuff to get the field key.
|
16186 |
-
*/
|
16187 |
-
|
16188 |
-
var field_key = dataModel.get( 'payment_total' );
|
16189 |
-
field_key = field_key.replace( '{field:', '' );
|
16190 |
-
field_key = field_key.replace( '}', '' );
|
16191 |
-
var fieldModel = nfRadio.channel( 'fields' ).request( 'get:field', field_key );
|
16192 |
-
|
16193 |
-
if ( 'undefined' != typeof fieldModel ) {
|
16194 |
-
if ( 'undefined' == typeof _.findWhere( fields, { value: dataModel.get( 'payment_total' ) } ) ) {
|
16195 |
-
fields.push( { label: fieldModel.get( 'label' ), value: '{field:' + fieldModel.get( 'key' ) + '}' } );
|
16196 |
-
}
|
16197 |
-
}
|
16198 |
-
|
16199 |
-
/*
|
16200 |
-
* Update our fields options.
|
16201 |
-
*/
|
16202 |
-
settingModel.set( 'options', fields );
|
16203 |
-
|
16204 |
-
},
|
16205 |
-
|
16206 |
-
getFields: function( settingModel ) {
|
16207 |
-
var returnFields = [ settingModel.get( 'default_options' ) ];
|
16208 |
-
// Update our dataModel with all of our product fields.
|
16209 |
-
var fields = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
16210 |
-
_.each( fields.models, function( field ) {
|
16211 |
-
if ( 'number' == field.get( 'type' ) || 'total' == field.get( 'type' ) || 'checkbox' == field.get( 'type' ) ) {
|
16212 |
-
returnFields.push( { label: field.get( 'label' ), value: '{field:' + field.get( 'key' ) + '}' } );
|
16213 |
-
}
|
16214 |
-
} );
|
16215 |
-
|
16216 |
-
returnFields = _.sortBy( returnFields, function( field ) { return field.label } );
|
16217 |
-
|
16218 |
-
return returnFields;
|
16219 |
-
}
|
16220 |
-
|
16221 |
-
});
|
16222 |
-
|
16223 |
-
return controller;
|
16224 |
-
} );
|
16225 |
-
/**
|
16226 |
-
* Listens to our app channel for settings views being rendered.
|
16227 |
-
*
|
16228 |
-
* If we're rendering a collect payment setting, add our calculations to the data model.
|
16229 |
-
*
|
16230 |
-
* @package Ninja Forms builder
|
16231 |
-
* @subpackage Main App
|
16232 |
-
* @copyright (c) 2017 WP Ninjas
|
16233 |
-
* @since 3.1.7
|
16234 |
-
*/
|
16235 |
-
define( 'controllers/actions/collectPaymentCalculations',[], function() {
|
16236 |
-
var controller = Marionette.Object.extend( {
|
16237 |
-
initialize: function() {
|
16238 |
-
// Listen for messages that are fired before a setting view is rendered.
|
16239 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
16240 |
-
},
|
16241 |
-
|
16242 |
-
beforeRenderSetting: function( settingModel, dataModel, view ) {
|
16243 |
-
if ( 'calc' == settingModel.get( 'total_type' ) ) {
|
16244 |
-
var calcModels = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
16245 |
-
var calcs = this.getCalcs( calcModels, settingModel );
|
16246 |
-
|
16247 |
-
settingModel.set( 'options', calcs );
|
16248 |
-
}
|
16249 |
-
},
|
16250 |
-
|
16251 |
-
getCalcs: function( calcModels, settingModel ) {
|
16252 |
-
var returnCalcs = [ settingModel.get( 'default_options' ) ];
|
16253 |
-
|
16254 |
-
// Update our dataModel with all of our product fields.
|
16255 |
-
var calcs = calcModels.get( 'settings' ).get( 'calculations' );
|
16256 |
-
|
16257 |
-
_.each( calcs.models, function( calc ) {
|
16258 |
-
returnCalcs.push( { label: calc.get( 'name' ), value: '{calc:' + calc.get( 'name' ) + '}' } );
|
16259 |
-
} );
|
16260 |
-
|
16261 |
-
returnCalcs = _.sortBy( returnCalcs, function( calc ) { return calc.label } );
|
16262 |
-
|
16263 |
-
return returnCalcs;
|
16264 |
-
}
|
16265 |
-
|
16266 |
-
});
|
16267 |
-
|
16268 |
-
return controller;
|
16269 |
-
} );
|
16270 |
-
/**
|
16271 |
-
* Listens to our app channel for settings views being rendered.
|
16272 |
-
*
|
16273 |
-
* If we haven't set a total_type, then set the total_type to fixed.
|
16274 |
-
*
|
16275 |
-
* @package Ninja Forms builder
|
16276 |
-
* @subpackage Main App
|
16277 |
-
* @copyright (c) 2017 WP Ninjas
|
16278 |
-
* @since 3.1.7
|
16279 |
-
*/
|
16280 |
-
define( 'controllers/actions/collectPaymentFixed',[], function() {
|
16281 |
-
var controller = Marionette.Object.extend( {
|
16282 |
-
initialize: function() {
|
16283 |
-
// Listen for messages that are fired before a setting view is rendered.
|
16284 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.beforeRenderSetting );
|
16285 |
-
},
|
16286 |
-
|
16287 |
-
beforeRenderSetting: function( settingModel, dataModel, view ) {
|
16288 |
-
|
16289 |
-
if ( 'payment_total_type' != settingModel.get( 'name' ) || _.isEmpty( dataModel.get( 'payment_total' ) ) ) return false;
|
16290 |
-
|
16291 |
-
/*
|
16292 |
-
* If we don't have a payment total type and we have a payment total, set our total type to the appropriate total type.
|
16293 |
-
*/
|
16294 |
-
if ( ( 'undefined' == dataModel.get( 'payment_total_type' ) || _.isEmpty( dataModel.get( 'payment_total_type' ) ) ) ) {
|
16295 |
-
/*
|
16296 |
-
* If payment_total is a field merge tag, set payment_total_type to "field"
|
16297 |
-
*/
|
16298 |
-
|
16299 |
-
if ( -1 != dataModel.get( 'payment_total' ).indexOf( '{field' ) ) {
|
16300 |
-
dataModel.set( 'payment_total_type', 'field' );
|
16301 |
-
} else if ( -1 != dataModel.get( 'payment_total' ).indexOf( '{calc' ) ) {
|
16302 |
-
dataModel.set( 'payment_total_type', 'calc' );
|
16303 |
-
} else {
|
16304 |
-
dataModel.set( 'payment_total_type', 'fixed' );
|
16305 |
-
}
|
16306 |
-
}
|
16307 |
-
},
|
16308 |
-
|
16309 |
-
});
|
16310 |
-
|
16311 |
-
return controller;
|
16312 |
-
} );
|
16313 |
-
/**
|
16314 |
-
* When we init a collect payment action, listen for calc changes
|
16315 |
-
*
|
16316 |
-
* @package Ninja Forms builder
|
16317 |
-
* @subpackage Main App
|
16318 |
-
* @copyright (c) 2017 WP Ninjas
|
16319 |
-
* @since 3.1.7
|
16320 |
-
*/
|
16321 |
-
define( 'controllers/actions/collectPayment',[], function( settingCollection ) {
|
16322 |
-
var controller = Marionette.Object.extend( {
|
16323 |
-
initialize: function() {
|
16324 |
-
/*
|
16325 |
-
* When we init a collect payment action model, register a listener for calc changes.
|
16326 |
-
*/
|
16327 |
-
this.listenTo( nfRadio.channel( 'actions-collectpayment' ), 'init:actionModel', this.initCollectPayment );
|
16328 |
-
|
16329 |
-
/*
|
16330 |
-
* Before we render our total field, we may want to update its value.
|
16331 |
-
*/
|
16332 |
-
this.listenTo( nfRadio.channel( 'app' ), 'before:renderSetting', this.maybeClearTotal );
|
16333 |
-
},
|
16334 |
-
|
16335 |
-
/**
|
16336 |
-
* When a collect payment action is init'd, register a listener for calc changes and update our data appropriately.
|
16337 |
-
* @since 3.1.7
|
16338 |
-
* @param {backbone.model} actionModel
|
16339 |
-
* @return {void}
|
16340 |
-
*/
|
16341 |
-
initCollectPayment: function( actionModel ) {
|
16342 |
-
actionModel.listenTo( nfRadio.channel( 'calcs' ), 'update:calcName', this.maybeUpdateTotal );
|
16343 |
-
},
|
16344 |
-
|
16345 |
-
//TODO: Add in an error that will not allow drawer to close until total type and total value is selected.
|
16346 |
-
maybeError: function(){},
|
16347 |
-
|
16348 |
-
maybeUpdateTotal: function( optionModel, oldName ) {
|
16349 |
-
/*
|
16350 |
-
* We have changed a calculation. Make sure that 'calc' is our payment total type.
|
16351 |
-
*/
|
16352 |
-
if ( 'calc' != this.get( 'payment_total_type' ) ) {
|
16353 |
-
return
|
16354 |
-
}
|
16355 |
-
|
16356 |
-
/*
|
16357 |
-
* Check our payment_total setting for the old merge tag and replace it with the new one.
|
16358 |
-
*/
|
16359 |
-
var newVal = this.get( 'payment_total' ).replace( '{calc:' + oldName + '}', '{calc:' + optionModel.get( 'name' ) + '}' );
|
16360 |
-
this.set( 'payment_total', newVal );
|
16361 |
-
},
|
16362 |
-
|
16363 |
-
maybeClearTotal: function( settingModel, dataModel, view ) {
|
16364 |
-
/*
|
16365 |
-
* If our payment_total is a merge tag, clear it when we select the "fixed" option.
|
16366 |
-
*/
|
16367 |
-
if ( 'fixed' == dataModel.get( 'payment_total_type' ) ) {
|
16368 |
-
if ( -1 != dataModel.get( 'payment_total' ).indexOf( '{field' ) || -1 != dataModel.get( 'payment_total' ).indexOf( '{calc' ) ) {
|
16369 |
-
dataModel.set( 'payment_total', '' );
|
16370 |
-
}
|
16371 |
-
}
|
16372 |
-
}
|
16373 |
-
|
16374 |
-
});
|
16375 |
-
|
16376 |
-
return controller;
|
16377 |
-
} );
|
16378 |
-
/**
|
16379 |
-
* When we init a save action, listen for form changes
|
16380 |
-
*
|
16381 |
-
* @package Ninja Forms builder
|
16382 |
-
* @subpackage Main App
|
16383 |
-
* @copyright (c) 2017 WP Ninjas
|
16384 |
-
* @since 3.1.7
|
16385 |
-
*/
|
16386 |
-
define( 'controllers/actions/save',[], function( settingCollection ) {
|
16387 |
-
var controller = Marionette.Object.extend( {
|
16388 |
-
initialize: function() {
|
16389 |
-
this.listenTo( nfRadio.channel( 'actions-save' ), 'init:actionModel', this.initSave );
|
16390 |
-
},
|
16391 |
-
|
16392 |
-
/**
|
16393 |
-
* Set listeners up to listen for add/delete fields for Save action
|
16394 |
-
*/
|
16395 |
-
initSave: function( actionModel ) {
|
16396 |
-
|
16397 |
-
this.model = actionModel;
|
16398 |
-
|
16399 |
-
/*
|
16400 |
-
* When we init a save action model, register a listener for new
|
16401 |
-
* fields
|
16402 |
-
*/
|
16403 |
-
this.listenTo( Backbone.Radio.channel( 'fields' ), 'add:field',
|
16404 |
-
this.checkFieldAdded );
|
16405 |
-
|
16406 |
-
/*
|
16407 |
-
* When we init a save action model, register a listener for deleted
|
16408 |
-
* fields
|
16409 |
-
*/
|
16410 |
-
this.listenTo( Backbone.Radio.channel( 'fields' ), 'delete:field',
|
16411 |
-
this.checkFieldDeleted );
|
16412 |
-
},
|
16413 |
-
|
16414 |
-
/**
|
16415 |
-
* When a save action is init'd, check to see if a new field added
|
16416 |
-
* is an email and decide if it needs to be the 'submitter_email'
|
16417 |
-
* for privacy regulation functionality
|
16418 |
-
*
|
16419 |
-
* @param {backbone.model} actionModel
|
16420 |
-
* @return {void}
|
16421 |
-
*/
|
16422 |
-
checkFieldAdded: function( newFieldModel ) {
|
16423 |
-
if( 'email' == newFieldModel.get( 'type' ) ) {
|
16424 |
-
var submitter_email = this.model.get('submitter_email');
|
16425 |
-
|
16426 |
-
if( '' === submitter_email ) {
|
16427 |
-
this.model.set( 'submitter_email', newFieldModel.get( 'key' ) );
|
16428 |
-
}
|
16429 |
-
}
|
16430 |
-
},
|
16431 |
-
|
16432 |
-
/**
|
16433 |
-
* When a save action is init'd, check to see if a field that has been
|
16434 |
-
* deleted is an email and rearrance the submitter email setting
|
16435 |
-
* for privacy regulation functionality
|
16436 |
-
*
|
16437 |
-
* @param {backbone.model} actionModel
|
16438 |
-
* @return {void}
|
16439 |
-
*/
|
16440 |
-
checkFieldDeleted: function( fieldModel ) {
|
16441 |
-
var submitter_email = this.model.get( 'submitter_email' );
|
16442 |
-
|
16443 |
-
if( submitter_email == fieldModel.get( 'key' ) ) {
|
16444 |
-
this.model.set( 'submitter_email', '' );
|
16445 |
-
}
|
16446 |
-
},
|
16447 |
-
|
16448 |
-
});
|
16449 |
-
|
16450 |
-
return controller;
|
16451 |
-
} );
|
16452 |
-
/**
|
16453 |
-
* Creates and stores a collection of form setting types. This includes all of the settings shown when editing a field.
|
16454 |
-
*
|
16455 |
-
* Loops over our preloaded data and adds that to our form setting type collection
|
16456 |
-
*
|
16457 |
-
* Also responds to requests for data about form setting types
|
16458 |
-
*
|
16459 |
-
* @package Ninja Forms builder
|
16460 |
-
* @subpackage Advanced
|
16461 |
-
* @copyright (c) 2015 WP Ninjas
|
16462 |
-
* @since 3.0
|
16463 |
-
*/
|
16464 |
-
define( 'controllers/advanced/types',[
|
16465 |
-
'models/app/typeCollection'
|
16466 |
-
],
|
16467 |
-
function(
|
16468 |
-
TypeCollection
|
16469 |
-
) {
|
16470 |
-
var controller = Marionette.Object.extend( {
|
16471 |
-
initialize: function() {
|
16472 |
-
// Create our field type collection
|
16473 |
-
this.collection = new TypeCollection( formSettingTypeData );
|
16474 |
-
|
16475 |
-
if(!nfAdmin.devMode){
|
16476 |
-
var calculations = this.collection.where({id:'calculations'});
|
16477 |
-
this.collection.remove(calculations);
|
16478 |
-
}
|
16479 |
-
|
16480 |
-
// Respond to requests to get field type, collection, settings, and sections
|
16481 |
-
nfRadio.channel( 'settings' ).reply( 'get:type', this.getType, this );
|
16482 |
-
nfRadio.channel( 'settings' ).reply( 'get:typeCollection', this.getCollection, this );
|
16483 |
-
},
|
16484 |
-
|
16485 |
-
/**
|
16486 |
-
* Return a field type by id
|
16487 |
-
*
|
16488 |
-
* @since 3.0
|
16489 |
-
* @param string id field type
|
16490 |
-
* @return backbone.model field type model
|
16491 |
-
*/
|
16492 |
-
getType: function( id ) {
|
16493 |
-
return this.collection.get( id );
|
16494 |
-
},
|
16495 |
-
|
16496 |
-
/**
|
16497 |
-
* Return the installed action type collection
|
16498 |
-
*
|
16499 |
-
* @since 3.0
|
16500 |
-
* @return backbone.collection field type collection
|
16501 |
-
*/
|
16502 |
-
getCollection: function() {
|
16503 |
-
return this.collection;
|
16504 |
-
}
|
16505 |
-
});
|
16506 |
-
|
16507 |
-
return controller;
|
16508 |
-
} );
|
16509 |
-
|
16510 |
-
/**
|
16511 |
-
* Model that represents our form settings.
|
16512 |
-
*
|
16513 |
-
* @package Ninja Forms builder
|
16514 |
-
* @subpackage Form Settings
|
16515 |
-
* @copyright (c) 2015 WP Ninjas
|
16516 |
-
* @since 3.0
|
16517 |
-
*/
|
16518 |
-
define( 'models/advanced/settingsModel',[], function() {
|
16519 |
-
var model = Backbone.Model.extend( {
|
16520 |
-
defaults: {
|
16521 |
-
objectType: 'Form Setting',
|
16522 |
-
editActive: false
|
16523 |
-
},
|
16524 |
-
|
16525 |
-
initialize: function() {
|
16526 |
-
// Listen for model attribute changes
|
16527 |
-
this.bind( 'change', this.changeSetting, this );
|
16528 |
-
/*
|
16529 |
-
* Check to see if we have any setting defaults to set.
|
16530 |
-
*/
|
16531 |
-
var formSettings = nfRadio.channel( 'settings' ).request( 'get:collection' );
|
16532 |
-
_.each( formSettings.models, function( settingModel ) {
|
16533 |
-
if ( 'undefined' == typeof this.get( settingModel.get( 'name' ) ) ) {
|
16534 |
-
this.set( settingModel.get( 'name' ), settingModel.get( 'value' ), { silent: true } );
|
16535 |
-
}
|
16536 |
-
nfRadio.channel( settingModel.get( 'type' ) ).trigger( 'init:dataModel', this, settingModel );
|
16537 |
-
}, this );
|
16538 |
-
|
16539 |
-
this.listenTo( nfRadio.channel( 'app' ), 'fire:updateFieldKey', this.updateFieldKey );
|
16540 |
-
},
|
16541 |
-
|
16542 |
-
/**
|
16543 |
-
* When we change the model attributes, fire an event saying we've changed something.
|
16544 |
-
*
|
16545 |
-
* @since 3.0
|
16546 |
-
* @return void
|
16547 |
-
*/
|
16548 |
-
changeSetting: function( model, options) {
|
16549 |
-
nfRadio.channel( 'app' ).trigger( 'update:setting', this, options.settingModel );
|
16550 |
-
},
|
16551 |
-
|
16552 |
-
updateFieldKey: function( keyModel, settingModel ) {
|
16553 |
-
nfRadio.channel( 'app' ).trigger( 'replace:fieldKey', this, keyModel, settingModel );
|
16554 |
-
}
|
16555 |
-
} );
|
16556 |
-
|
16557 |
-
return model;
|
16558 |
-
} );
|
16559 |
-
/**
|
16560 |
-
* Handles interactions with our form settings collection.
|
16561 |
-
*
|
16562 |
-
* @package Ninja Forms builder
|
16563 |
-
* @subpackage Advanced
|
16564 |
-
* @copyright (c) 2015 WP Ninjas
|
16565 |
-
* @since 3.0
|
16566 |
-
*/
|
16567 |
-
define( 'controllers/advanced/data',['models/advanced/settingsModel'], function( settingsModel ) {
|
16568 |
-
var controller = Marionette.Object.extend( {
|
16569 |
-
initialize: function() {
|
16570 |
-
// Load our action collection from our localized form data
|
16571 |
-
this.model = new settingsModel( preloadedFormData.settings );
|
16572 |
-
|
16573 |
-
nfRadio.channel( 'settings' ).reply( 'get:settings', this.getSettings, this );
|
16574 |
-
nfRadio.channel( 'settings' ).reply( 'get:setting', this.getSetting, this );
|
16575 |
-
nfRadio.channel( 'settings' ).reply( 'update:setting', this.updateSetting, this );
|
16576 |
-
},
|
16577 |
-
|
16578 |
-
getSettings: function() {
|
16579 |
-
return this.model;
|
16580 |
-
},
|
16581 |
-
|
16582 |
-
updateSetting: function( name, value, silent ) {
|
16583 |
-
silent = silent || false;
|
16584 |
-
this.model.set( name, value, { silent: silent } );
|
16585 |
-
},
|
16586 |
-
|
16587 |
-
getSetting: function( name ) {
|
16588 |
-
return this.model.get( name );
|
16589 |
-
}
|
16590 |
-
});
|
16591 |
-
|
16592 |
-
return controller;
|
16593 |
-
} );
|
16594 |
-
/**
|
16595 |
-
* Fetches settings models so that we can get setting information
|
16596 |
-
*
|
16597 |
-
* @package Ninja Forms builder
|
16598 |
-
* @subpackage Advanced
|
16599 |
-
* @copyright (c) 2015 WP Ninjas
|
16600 |
-
* @since 3.0
|
16601 |
-
*/
|
16602 |
-
define( 'controllers/advanced/formSettings',['models/app/settingCollection'], function( settingCollection ) {
|
16603 |
-
var controller = Marionette.Object.extend( {
|
16604 |
-
initialize: function() {
|
16605 |
-
this.collection = new settingCollection( formSettings, { objectType: 'settings' } );
|
16606 |
-
|
16607 |
-
// Responds to requests for settings models.
|
16608 |
-
nfRadio.channel( 'settings' ).reply( 'get:settingModel', this.getSettingModel, this );
|
16609 |
-
|
16610 |
-
// Responds to requests for our setting collection
|
16611 |
-
nfRadio.channel( 'settings' ).reply( 'get:collection', this.getSettingCollection, this );
|
16612 |
-
},
|
16613 |
-
|
16614 |
-
getSettingModel: function( name ) {
|
16615 |
-
return this.collection.findWhere( { name: name } );
|
16616 |
-
},
|
16617 |
-
|
16618 |
-
getSettingCollection: function() {
|
16619 |
-
return this.collection;
|
16620 |
-
}
|
16621 |
-
|
16622 |
-
});
|
16623 |
-
|
16624 |
-
return controller;
|
16625 |
-
} );
|
16626 |
-
/**
|
16627 |
-
* Handles adding and removing the active class from form settings currently being edited.
|
16628 |
-
*
|
16629 |
-
* @package Ninja Forms builder
|
16630 |
-
* @subpackage Advanced
|
16631 |
-
* @copyright (c) 2015 WP Ninjas
|
16632 |
-
* @since 3.0
|
16633 |
-
*/
|
16634 |
-
define( 'controllers/advanced/editActive',[], function() {
|
16635 |
-
var controller = Marionette.Object.extend( {
|
16636 |
-
initialize: function() {
|
16637 |
-
// Respond to requests to remove the active class from all our fields.
|
16638 |
-
nfRadio.channel( 'settings' ).reply( 'clear:editActive', this.clearEditActive, this );
|
16639 |
-
// Listen for the closing drawer so that we can remove all of our active classes.
|
16640 |
-
this.listenTo( nfRadio.channel( 'drawer-editSettings' ), 'before:closeDrawer', this.clearEditActive );
|
16641 |
-
},
|
16642 |
-
|
16643 |
-
/**
|
16644 |
-
* Loops through our fields collection and sets editActive to false.
|
16645 |
-
*
|
16646 |
-
* @since 3.0
|
16647 |
-
* @return void
|
16648 |
-
*/
|
16649 |
-
clearEditActive: function() {
|
16650 |
-
var collection = nfRadio.channel( 'settings' ).request( 'get:typeCollection' );
|
16651 |
-
_.each( collection.models, function( field ) {
|
16652 |
-
field.set( 'editActive', false );
|
16653 |
-
} );
|
16654 |
-
}
|
16655 |
-
});
|
16656 |
-
|
16657 |
-
return controller;
|
16658 |
-
} );
|
16659 |
-
|
16660 |
-
/**
|
16661 |
-
* Listens for clicks on our form settings sections.
|
16662 |
-
*
|
16663 |
-
* @package Ninja Forms builder
|
16664 |
-
* @subpackage Advanced
|
16665 |
-
* @copyright (c) 2015 WP Ninjas
|
16666 |
-
* @since 3.0
|
16667 |
-
*/
|
16668 |
-
define( 'controllers/advanced/clickEdit',['models/advanced/settingsModel'], function( settingsModel ) {
|
16669 |
-
var controller = Marionette.Object.extend( {
|
16670 |
-
initialize: function() {
|
16671 |
-
this.listenTo( nfRadio.channel( 'settings' ), 'click:edit', this.clickEdit );
|
16672 |
-
},
|
16673 |
-
|
16674 |
-
clickEdit: function( e, typeModel ) {
|
16675 |
-
var model = nfRadio.channel( 'settings' ).request( 'get:settings' );
|
16676 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'editSettings', { model: model, groupCollection: typeModel.get( 'settingGroups' ), typeModel: typeModel } );
|
16677 |
-
var preventClose = nfRadio.channel( 'drawer' ).request( 'get:preventClose' );
|
16678 |
-
if ( ! preventClose ) {
|
16679 |
-
typeModel.set( 'editActive', true );
|
16680 |
-
}
|
16681 |
-
}
|
16682 |
-
});
|
16683 |
-
|
16684 |
-
return controller;
|
16685 |
-
} );
|
16686 |
-
/**
|
16687 |
-
* Makes sure that calculations don't reference calculations with a lower order.
|
16688 |
-
*
|
16689 |
-
* For example, our first caclulation can't reference the second, but the second can reference the first.
|
16690 |
-
*
|
16691 |
-
* @package Ninja Forms builder
|
16692 |
-
* @subpackage Advanced
|
16693 |
-
* @copyright (c) 2015 WP Ninjas
|
16694 |
-
* @since 3.0
|
16695 |
-
*/
|
16696 |
-
define( 'controllers/advanced/calculations',[], function() {
|
16697 |
-
var controller = Marionette.Object.extend( {
|
16698 |
-
initialize: function() {
|
16699 |
-
/*
|
16700 |
-
* When someone types in the "name" or "eq" portion of our calculation, we need to make sure
|
16701 |
-
* that they haven't duplicated a name or made a bad EQ reference.
|
16702 |
-
*/
|
16703 |
-
this.listenTo( nfRadio.channel( 'option-repeater-calculations' ), 'keyup:option', this.keyUp );
|
16704 |
-
/*
|
16705 |
-
* Same thing for when our calculation option is updated
|
16706 |
-
*/
|
16707 |
-
this.listenTo( nfRadio.channel( 'option-repeater-calculations' ), 'update:option', this.updateCalc );
|
16708 |
-
/*
|
16709 |
-
* When we sort our calcluations, we need to make sure that we don't get any bad EQ
|
16710 |
-
* references.
|
16711 |
-
*/
|
16712 |
-
this.listenTo( nfRadio.channel( 'option-repeater-calculations' ), 'sort:option', this.sortCalc );
|
16713 |
-
},
|
16714 |
-
|
16715 |
-
keyUp: function( e, optionModel ) {
|
16716 |
-
// Get our current value
|
16717 |
-
var value = jQuery( e.target ).val();
|
16718 |
-
// Check to see if we're editing a name or eq
|
16719 |
-
var id = jQuery( e.target ).data( 'id' );
|
16720 |
-
if( 'name' == id ) { // We are editing the name field
|
16721 |
-
// Check to see if our name already exists.
|
16722 |
-
this.checkName( value, optionModel );
|
16723 |
-
this.checkEQ( optionModel.get( 'eq' ), optionModel );
|
16724 |
-
} else if( 'eq' == id ) { // We're editing the eq
|
16725 |
-
// Check to see if there are any calcs referenced in our eq
|
16726 |
-
this.checkEQ( value, optionModel );
|
16727 |
-
} else if( 'dec' == id ) { // We're editing the dec
|
16728 |
-
// Check to see that we have a non-negative integer
|
16729 |
-
this.checkDec( value, optionModel );
|
16730 |
-
}
|
16731 |
-
},
|
16732 |
-
|
16733 |
-
updateCalc: function( optionModel ) {
|
16734 |
-
this.checkName( optionModel.get( 'name' ), optionModel, false );
|
16735 |
-
this.checkEQ( optionModel.get( 'eq' ), optionModel );
|
16736 |
-
this.checkDec( optionModel.get( 'dec' ), optionModel );
|
16737 |
-
|
16738 |
-
Backbone.Radio.channel( 'calcs' ).trigger( 'update:calc', optionModel );
|
16739 |
-
},
|
16740 |
-
|
16741 |
-
sortCalc: function( optionModel, setting ) {
|
16742 |
-
this.checkAllCalcs( setting.collection );
|
16743 |
-
},
|
16744 |
-
|
16745 |
-
/**
|
16746 |
-
* Check to see if a calc name exists.
|
16747 |
-
*
|
16748 |
-
* @since 3.0
|
16749 |
-
* @param string name calc name to check
|
16750 |
-
* @param backbone.model optionModel
|
16751 |
-
* @return void
|
16752 |
-
*/
|
16753 |
-
checkName: function( name, optionModel, silent ) {
|
16754 |
-
silent = silent || true;
|
16755 |
-
// Get our current errors, if any.
|
16756 |
-
var errors = optionModel.get( 'errors' );
|
16757 |
-
// Search our calc collection for our name
|
16758 |
-
var found = optionModel.collection.where( { name: jQuery.trim( name ) } );
|
16759 |
-
|
16760 |
-
// If the name that was passed is the same as our current name, return false.
|
16761 |
-
if ( name == optionModel.get( 'name' ) ) {
|
16762 |
-
found = [];
|
16763 |
-
}
|
16764 |
-
|
16765 |
-
// If our name exists, add an errors to the option model
|
16766 |
-
if ( 0 != found.length ) {
|
16767 |
-
errors.nameExists = 'Calculation names must be unique. Please enter another name.';
|
16768 |
-
} else {
|
16769 |
-
var oldName = optionModel.get( 'name' );
|
16770 |
-
optionModel.set( 'name', name, { silent: silent } );
|
16771 |
-
nfRadio.channel( 'calcs' ).trigger( 'update:calcName', optionModel, oldName );
|
16772 |
-
delete errors.nameExists;
|
16773 |
-
}
|
16774 |
-
|
16775 |
-
optionModel.set( 'errors', errors );
|
16776 |
-
optionModel.trigger( 'change:errors', optionModel );
|
16777 |
-
},
|
16778 |
-
|
16779 |
-
/**
|
16780 |
-
* Check to see if an eq contains a reference to a calc at a lower priority.
|
16781 |
-
*
|
16782 |
-
* @since 3.0
|
16783 |
-
* @param string eq our equation
|
16784 |
-
* @param backbone.model optionModel
|
16785 |
-
* @return void
|
16786 |
-
*/
|
16787 |
-
checkEQ: function( eq, optionModel ) {
|
16788 |
-
// Get any current errors on our optionModel
|
16789 |
-
var errors = optionModel.get( 'errors' );
|
16790 |
-
/*
|
16791 |
-
* We're looking for two errors:
|
16792 |
-
* - Calculations that are below the current one can't be processed.
|
16793 |
-
* - Calculations can't refer to themselves.
|
16794 |
-
*/
|
16795 |
-
var errorSelfRef = false;
|
16796 |
-
var errorFutureCalc = false;
|
16797 |
-
// Regex that searches for {calc:key}
|
16798 |
-
var calcs = eq.match( new RegExp( /{calc:(.*?)}/g ) );
|
16799 |
-
/*
|
16800 |
-
* Calcs will be an array like:
|
16801 |
-
* ['{calc:test}'], ['{calc:another}']
|
16802 |
-
*
|
16803 |
-
* If we have any calcs in the eq, loop through them and search for the errors.
|
16804 |
-
*/
|
16805 |
-
if ( calcs ) {
|
16806 |
-
var calculations = optionModel.collection;
|
16807 |
-
// Maps a function to each item in our calcs array.
|
16808 |
-
calcs = calcs.map( function( calc ) {
|
16809 |
-
// calc will be {calc:name}
|
16810 |
-
var name = calc.replace( '}', '' ).replace( '{calc:', '' );
|
16811 |
-
// Get our optionModel from our calculations collection.
|
16812 |
-
var targetCalc = calculations.findWhere( { name: name } );
|
16813 |
-
if ( name == optionModel.get( 'name' ) ) {
|
16814 |
-
// If we already have a calc with this name, set an error.
|
16815 |
-
errors.selfRef = 'A calculation can\'t reference itself!';
|
16816 |
-
errorSelfRef = true;
|
16817 |
-
} else if ( targetCalc && targetCalc.get( 'order' ) > optionModel.get( 'order' ) ) {
|
16818 |
-
// If the calc is after this one, set an error.
|
16819 |
-
errorFutureCalc = true;
|
16820 |
-
errors.futureCalc = 'Can\'t reference a future calculation!';
|
16821 |
-
}
|
16822 |
-
} );
|
16823 |
-
}
|
16824 |
-
|
16825 |
-
// If we didn't find any self ref errors, remove the key.
|
16826 |
-
if ( ! errorSelfRef ) {
|
16827 |
-
delete errors.selfRef;
|
16828 |
-
}
|
16829 |
-
|
16830 |
-
// If we didn't find any future calc errors, remove the key.
|
16831 |
-
if ( ! errorFutureCalc ) {
|
16832 |
-
delete errors.futureCalc;
|
16833 |
-
}
|
16834 |
-
|
16835 |
-
// Set errors and trigger our optionModel change.
|
16836 |
-
optionModel.set( 'errors', errors );
|
16837 |
-
optionModel.trigger( 'change:errors', optionModel );
|
16838 |
-
|
16839 |
-
},
|
16840 |
-
|
16841 |
-
/**
|
16842 |
-
* Ceck to see if a dec is an integer value.
|
16843 |
-
*
|
16844 |
-
* @since 3.1
|
16845 |
-
* @param string dec our decimal value
|
16846 |
-
* @param backbone.model optionModel
|
16847 |
-
* @return void
|
16848 |
-
*/
|
16849 |
-
checkDec: function( dec, optionModel ) {
|
16850 |
-
// If dec isn't defined, bail...
|
16851 |
-
if( 'undefined' === typeof(dec) ) return false;
|
16852 |
-
// Get our current errors, if any.
|
16853 |
-
var errors = optionModel.get( 'errors' );
|
16854 |
-
/**
|
16855 |
-
* We're looking for one error:
|
16856 |
-
* - dec is not a non-negative integer.
|
16857 |
-
*/
|
16858 |
-
var errorNonIntDec = false;
|
16859 |
-
|
16860 |
-
// Get our target value and see if it matches what we got.
|
16861 |
-
var checked = Math.abs( parseInt( dec.trim() ) );
|
16862 |
-
if ( dec.trim() !== '' && checked.toString() !== dec.trim() ) {
|
16863 |
-
errorNonIntDec = true;
|
16864 |
-
errors.nonIntDec = 'Decimals must be a non-negative integer!';
|
16865 |
-
}
|
16866 |
-
|
16867 |
-
// If our dec value is a non-negative integer.
|
16868 |
-
if ( ! errorNonIntDec ) {
|
16869 |
-
delete errors.nonIntDec;
|
16870 |
-
}
|
16871 |
-
|
16872 |
-
// Set errors and trigger our optionModel change.
|
16873 |
-
optionModel.set( 'errors', errors );
|
16874 |
-
optionModel.trigger( 'change:errors', optionModel );
|
16875 |
-
|
16876 |
-
},
|
16877 |
-
|
16878 |
-
checkAllCalcs: function( collection ) {
|
16879 |
-
var that = this;
|
16880 |
-
collection.models.map( function( opt ) {
|
16881 |
-
that.checkName( opt.get( 'name' ), opt );
|
16882 |
-
that.checkEQ( opt.get( 'eq' ), opt );
|
16883 |
-
that.checkDec( opt.get( 'dec' ), opt );
|
16884 |
-
} );
|
16885 |
-
}
|
16886 |
-
|
16887 |
-
});
|
16888 |
-
|
16889 |
-
return controller;
|
16890 |
-
} );
|
16891 |
-
|
16892 |
-
/**
|
16893 |
-
* Loads all of our controllers using Require JS.
|
16894 |
-
*
|
16895 |
-
* @package Ninja Forms builder
|
16896 |
-
* @subpackage Fields
|
16897 |
-
* @copyright (c) 2015 WP Ninjas
|
16898 |
-
* @since 3.0
|
16899 |
-
*/
|
16900 |
-
define(
|
16901 |
-
'controllers/loadControllers',[
|
16902 |
-
/*
|
16903 |
-
* Application controllers
|
16904 |
-
*/
|
16905 |
-
'controllers/app/remote',
|
16906 |
-
'controllers/app/drawer',
|
16907 |
-
'controllers/app/drawerConfig',
|
16908 |
-
'controllers/app/domainConfig',
|
16909 |
-
'controllers/app/data',
|
16910 |
-
'controllers/app/drawerToggleSettingGroup',
|
16911 |
-
'controllers/app/updateDB',
|
16912 |
-
'controllers/app/formData',
|
16913 |
-
'controllers/app/previewLink',
|
16914 |
-
'controllers/app/menuButtons',
|
16915 |
-
'controllers/app/trackChanges',
|
16916 |
-
'controllers/app/undoChanges',
|
16917 |
-
'controllers/app/publishResponse',
|
16918 |
-
'controllers/app/changeDomain',
|
16919 |
-
'controllers/app/pushstate',
|
16920 |
-
'controllers/app/hotkeys',
|
16921 |
-
'controllers/app/cleanState',
|
16922 |
-
'controllers/app/coreUndo',
|
16923 |
-
'controllers/app/cloneModelDeep',
|
16924 |
-
'controllers/app/getSettingChildView',
|
16925 |
-
'controllers/app/changeSettingDefault',
|
16926 |
-
'controllers/app/fieldset',
|
16927 |
-
'controllers/app/toggleSetting',
|
16928 |
-
'controllers/app/buttonToggleSetting',
|
16929 |
-
'controllers/app/numberSetting',
|
16930 |
-
'controllers/app/radioSetting',
|
16931 |
-
'controllers/app/itemControls',
|
16932 |
-
'controllers/app/mergeTags',
|
16933 |
-
'controllers/app/mergeTagBox',
|
16934 |
-
'controllers/app/itemSettingFill',
|
16935 |
-
'controllers/app/confirmPublish',
|
16936 |
-
'controllers/app/rte',
|
16937 |
-
'controllers/app/settingFieldSelect',
|
16938 |
-
'controllers/app/settingFieldList',
|
16939 |
-
'controllers/app/settingHTML',
|
16940 |
-
'controllers/app/settingColor',
|
16941 |
-
'controllers/app/changeMenu',
|
16942 |
-
'controllers/app/mobile',
|
16943 |
-
'controllers/app/notices',
|
16944 |
-
'controllers/app/unloadCheck',
|
16945 |
-
'controllers/app/formContentFilters',
|
16946 |
-
'controllers/app/formContentGutterFilters',
|
16947 |
-
'controllers/app/cloneCollectionDeep',
|
16948 |
-
'controllers/app/trackKeyDown',
|
16949 |
-
'controllers/app/perfectScroll',
|
16950 |
-
'controllers/app/getNewSettingGroupCollection',
|
16951 |
-
'controllers/app/settingMedia',
|
16952 |
-
'controllers/app/publicLink',
|
16953 |
-
/*
|
16954 |
-
* Fields domain controllers
|
16955 |
-
*/
|
16956 |
-
'controllers/fields/types',
|
16957 |
-
'controllers/fields/fieldTypeDrag',
|
16958 |
-
'controllers/fields/stagingDrag',
|
16959 |
-
'controllers/fields/staging',
|
16960 |
-
'controllers/fields/stagingSortable',
|
16961 |
-
'controllers/fields/filterTypes',
|
16962 |
-
'controllers/fields/sortable',
|
16963 |
-
'controllers/fields/data',
|
16964 |
-
'controllers/app/optionRepeater',
|
16965 |
-
'controllers/app/imageOptionRepeater',
|
16966 |
-
'controllers/fields/editActive',
|
16967 |
-
'controllers/fields/fieldSettings',
|
16968 |
-
'controllers/fields/fieldCreditCard',
|
16969 |
-
'controllers/fields/fieldList',
|
16970 |
-
'controllers/fields/fieldPassword',
|
16971 |
-
'controllers/fields/fieldQuantity',
|
16972 |
-
'controllers/fields/fieldShipping',
|
16973 |
-
'controllers/fields/key',
|
16974 |
-
'controllers/fields/notices',
|
16975 |
-
'controllers/fields/mobile',
|
16976 |
-
'controllers/fields/savedFields',
|
16977 |
-
'controllers/fields/fieldDatepicker',
|
16978 |
-
'controllers/fields/fieldDisplayCalc',
|
16979 |
-
'controllers/fields/fieldRepeater',
|
16980 |
-
|
16981 |
-
/*
|
16982 |
-
* TODO: Actions domain controllers
|
16983 |
-
*/
|
16984 |
-
'controllers/actions/types',
|
16985 |
-
'controllers/actions/data',
|
16986 |
-
'controllers/actions/actionSettings',
|
16987 |
-
'controllers/actions/editActive',
|
16988 |
-
'controllers/actions/emailFromSetting',
|
16989 |
-
'controllers/actions/addActionTypes',
|
16990 |
-
'controllers/actions/typeDrag',
|
16991 |
-
'controllers/actions/droppable',
|
16992 |
-
'controllers/actions/filterTypes',
|
16993 |
-
'controllers/actions/newsletterList',
|
16994 |
-
'controllers/actions/deleteFieldListener',
|
16995 |
-
'controllers/actions/collectPaymentFields',
|
16996 |
-
'controllers/actions/collectPaymentCalculations',
|
16997 |
-
'controllers/actions/collectPaymentFixed',
|
16998 |
-
'controllers/actions/collectPayment',
|
16999 |
-
'controllers/actions/save',
|
17000 |
-
|
17001 |
-
/*
|
17002 |
-
* TODO: Settings domain controllers
|
17003 |
-
*/
|
17004 |
-
'controllers/advanced/types',
|
17005 |
-
'controllers/advanced/data',
|
17006 |
-
'controllers/advanced/formSettings',
|
17007 |
-
'controllers/advanced/editActive',
|
17008 |
-
'controllers/advanced/clickEdit',
|
17009 |
-
'controllers/advanced/calculations'
|
17010 |
-
],
|
17011 |
-
function(
|
17012 |
-
/*
|
17013 |
-
* Application controllers
|
17014 |
-
*/
|
17015 |
-
Remote,
|
17016 |
-
Drawer,
|
17017 |
-
DrawerConfig,
|
17018 |
-
DomainConfig,
|
17019 |
-
AppData,
|
17020 |
-
DrawerToggleSettingGroup,
|
17021 |
-
UpdateDB,
|
17022 |
-
FormData,
|
17023 |
-
PreviewLink,
|
17024 |
-
AppMenuButtons,
|
17025 |
-
AppTrackChanges,
|
17026 |
-
AppUndoChanges,
|
17027 |
-
AppPublishResponse,
|
17028 |
-
AppChangeDomain,
|
17029 |
-
Pushstate,
|
17030 |
-
Hotkeys,
|
17031 |
-
CleanState,
|
17032 |
-
CoreUndo,
|
17033 |
-
CloneModelDeep,
|
17034 |
-
DrawerSettingChildView,
|
17035 |
-
ChangeSettingDefault,
|
17036 |
-
Fieldset,
|
17037 |
-
ToggleSetting,
|
17038 |
-
ButtonToggleSetting,
|
17039 |
-
NumberSetting,
|
17040 |
-
RadioSetting,
|
17041 |
-
ItemControls,
|
17042 |
-
MergeTags,
|
17043 |
-
MergeTagsBox,
|
17044 |
-
ItemSettingFill,
|
17045 |
-
ConfirmPublish,
|
17046 |
-
RTE,
|
17047 |
-
SettingFieldSelect,
|
17048 |
-
SettingFieldList,
|
17049 |
-
SettingHTML,
|
17050 |
-
SettingColor,
|
17051 |
-
ChangeMenu,
|
17052 |
-
AppMobile,
|
17053 |
-
AppNotices,
|
17054 |
-
AppUnloadCheck,
|
17055 |
-
FormContentFilters,
|
17056 |
-
FormContentGutterFilters,
|
17057 |
-
CloneCollectionDeep,
|
17058 |
-
TrackKeyDown,
|
17059 |
-
PerfectScroll,
|
17060 |
-
GetNewSettingGroupCollection,
|
17061 |
-
SettingMedia,
|
17062 |
-
PublicLink,
|
17063 |
-
/*
|
17064 |
-
* Fields domain controllers
|
17065 |
-
*/
|
17066 |
-
FieldTypes,
|
17067 |
-
FieldTypeDrag,
|
17068 |
-
FieldStagingDrag,
|
17069 |
-
StagedFieldsData,
|
17070 |
-
StagedFieldsSortable,
|
17071 |
-
DrawerFilterFieldTypes,
|
17072 |
-
MainContentFieldsSortable,
|
17073 |
-
FieldData,
|
17074 |
-
OptionRepeater,
|
17075 |
-
imageOptionRepeater,
|
17076 |
-
FieldsEditActive,
|
17077 |
-
FieldSettings,
|
17078 |
-
FieldCreditCard,
|
17079 |
-
FieldList,
|
17080 |
-
FieldPassword,
|
17081 |
-
FieldQuantity,
|
17082 |
-
FieldShipping,
|
17083 |
-
FieldKey,
|
17084 |
-
Notices,
|
17085 |
-
FieldsMobile,
|
17086 |
-
SavedFields,
|
17087 |
-
FieldDatepicker,
|
17088 |
-
FieldDisplayCalc,
|
17089 |
-
FieldRepeater,
|
17090 |
-
/*
|
17091 |
-
* TODO: Actions domain controllers
|
17092 |
-
*/
|
17093 |
-
ActionTypes,
|
17094 |
-
ActionData,
|
17095 |
-
ActionSettings,
|
17096 |
-
ActionEditActive,
|
17097 |
-
ActionEmailFromSetting,
|
17098 |
-
ActionAddTypes,
|
17099 |
-
ActionTypeDrag,
|
17100 |
-
ActionDroppable,
|
17101 |
-
ActionFilterTypes,
|
17102 |
-
ActionNewsletterList,
|
17103 |
-
ActionDeleteFieldListener,
|
17104 |
-
ActionCollectPaymentFields,
|
17105 |
-
ActionCollectPaymentCalculations,
|
17106 |
-
ActionCollectPaymentFixed,
|
17107 |
-
ActionCollectPayment,
|
17108 |
-
ActionSave,
|
17109 |
-
|
17110 |
-
/*
|
17111 |
-
* TODO: Settings domain controllers
|
17112 |
-
*/
|
17113 |
-
SettingTypes,
|
17114 |
-
SettingData,
|
17115 |
-
FormSettings,
|
17116 |
-
SettingsEditActive,
|
17117 |
-
SettingsClickEdit,
|
17118 |
-
AdvancedCalculations
|
17119 |
-
|
17120 |
-
) {
|
17121 |
-
var controller = Marionette.Object.extend( {
|
17122 |
-
initialize: function() {
|
17123 |
-
/*
|
17124 |
-
* Application controllers
|
17125 |
-
*/
|
17126 |
-
new FormContentFilters();
|
17127 |
-
new FormContentGutterFilters();
|
17128 |
-
new Hotkeys();
|
17129 |
-
new Remote();
|
17130 |
-
new Drawer();
|
17131 |
-
new DrawerConfig();
|
17132 |
-
new DomainConfig();
|
17133 |
-
new DrawerToggleSettingGroup();
|
17134 |
-
new PreviewLink();
|
17135 |
-
new AppMenuButtons();
|
17136 |
-
new AppTrackChanges();
|
17137 |
-
new AppUndoChanges();
|
17138 |
-
new AppPublishResponse();
|
17139 |
-
new AppChangeDomain();
|
17140 |
-
new CleanState();
|
17141 |
-
new CoreUndo();
|
17142 |
-
new CloneModelDeep();
|
17143 |
-
new ItemControls();
|
17144 |
-
new ConfirmPublish();
|
17145 |
-
new RTE();
|
17146 |
-
new SettingFieldSelect();
|
17147 |
-
new SettingFieldList();
|
17148 |
-
new SettingHTML();
|
17149 |
-
new SettingColor();
|
17150 |
-
new SettingMedia();
|
17151 |
-
new ChangeMenu();
|
17152 |
-
new AppMobile();
|
17153 |
-
new AppNotices();
|
17154 |
-
new AppUnloadCheck();
|
17155 |
-
new UpdateDB();
|
17156 |
-
new CloneCollectionDeep();
|
17157 |
-
new TrackKeyDown();
|
17158 |
-
new PerfectScroll();
|
17159 |
-
new GetNewSettingGroupCollection();
|
17160 |
-
new PublicLink();
|
17161 |
-
// new Pushstate();
|
17162 |
-
/*
|
17163 |
-
* Fields domain controllers
|
17164 |
-
*
|
17165 |
-
* Field-specific controllers should be loaded before our field type controller.
|
17166 |
-
* This ensures that any 'init' hooks are properly registered.
|
17167 |
-
*/
|
17168 |
-
new Fieldset();
|
17169 |
-
new OptionRepeater();
|
17170 |
-
new imageOptionRepeater();
|
17171 |
-
new FieldTypes();
|
17172 |
-
new FieldTypeDrag();
|
17173 |
-
new FieldStagingDrag();
|
17174 |
-
new StagedFieldsData();
|
17175 |
-
new StagedFieldsSortable();
|
17176 |
-
new DrawerFilterFieldTypes();
|
17177 |
-
new MainContentFieldsSortable();
|
17178 |
-
new ChangeSettingDefault();
|
17179 |
-
new ToggleSetting();
|
17180 |
-
new ButtonToggleSetting();
|
17181 |
-
new NumberSetting();
|
17182 |
-
new RadioSetting();
|
17183 |
-
new DrawerSettingChildView();
|
17184 |
-
new FieldsEditActive();
|
17185 |
-
new FieldSettings();
|
17186 |
-
new FieldCreditCard();
|
17187 |
-
new FieldList();
|
17188 |
-
new FieldPassword;
|
17189 |
-
new FieldQuantity();
|
17190 |
-
new FieldShipping();
|
17191 |
-
new FieldKey();
|
17192 |
-
new Notices();
|
17193 |
-
new FieldsMobile();
|
17194 |
-
new SavedFields();
|
17195 |
-
new FieldDatepicker();
|
17196 |
-
new FieldDisplayCalc();
|
17197 |
-
new FieldRepeater();
|
17198 |
-
/*
|
17199 |
-
* TODO: Actions domain controllers
|
17200 |
-
*/
|
17201 |
-
new ActionNewsletterList();
|
17202 |
-
new ActionDeleteFieldListener();
|
17203 |
-
new ActionCollectPaymentCalculations();
|
17204 |
-
new ActionCollectPayment();
|
17205 |
-
new ActionSave();
|
17206 |
-
new ActionTypes();
|
17207 |
-
new ActionData();
|
17208 |
-
new ActionSettings();
|
17209 |
-
new ActionEditActive();
|
17210 |
-
new ActionEmailFromSetting();
|
17211 |
-
new ActionAddTypes();
|
17212 |
-
new ActionTypeDrag();
|
17213 |
-
new ActionDroppable();
|
17214 |
-
new ActionFilterTypes();
|
17215 |
-
new ActionCollectPaymentFields();
|
17216 |
-
new ActionCollectPaymentFixed();
|
17217 |
-
|
17218 |
-
/*
|
17219 |
-
* TODO: Settings domain controllers
|
17220 |
-
*/
|
17221 |
-
new SettingTypes();
|
17222 |
-
new FormSettings();
|
17223 |
-
new AdvancedCalculations();
|
17224 |
-
new SettingData();
|
17225 |
-
new SettingsEditActive();
|
17226 |
-
new SettingsClickEdit();
|
17227 |
-
|
17228 |
-
/*
|
17229 |
-
* Data controllers need to be set after every other controller has been setup, even if they aren't domain-specific.
|
17230 |
-
* AppData() was after FormData();
|
17231 |
-
*/
|
17232 |
-
new AppData();
|
17233 |
-
new FieldData();
|
17234 |
-
new FormData();
|
17235 |
-
new MergeTags();
|
17236 |
-
new MergeTagsBox();
|
17237 |
-
new ItemSettingFill();
|
17238 |
-
}
|
17239 |
-
});
|
17240 |
-
|
17241 |
-
return controller;
|
17242 |
-
} );
|
17243 |
-
|
17244 |
-
define( 'views/fields/mainContentEmpty',[], function() {
|
17245 |
-
var view = Marionette.ItemView.extend({
|
17246 |
-
tagName: 'div',
|
17247 |
-
template: '#tmpl-nf-main-content-fields-empty',
|
17248 |
-
|
17249 |
-
onBeforeDestroy: function() {
|
17250 |
-
jQuery( this.el ).parent().removeClass( 'nf-fields-empty-droppable' ).droppable( 'destroy' );
|
17251 |
-
},
|
17252 |
-
|
17253 |
-
onRender: function() {
|
17254 |
-
this.$el = this.$el.children();
|
17255 |
-
this.$el.unwrap();
|
17256 |
-
this.setElement( this.$el );
|
17257 |
-
},
|
17258 |
-
|
17259 |
-
onShow: function() {
|
17260 |
-
if ( jQuery( this.el ).parent().hasClass( 'ui-sortable' ) ) {
|
17261 |
-
jQuery( this.el ).parent().sortable( 'destroy' );
|
17262 |
-
}
|
17263 |
-
jQuery( this.el ).parent().addClass( 'nf-fields-empty-droppable' );
|
17264 |
-
jQuery( this.el ).parent().droppable( {
|
17265 |
-
accept: function( draggable ) {
|
17266 |
-
if ( jQuery( draggable ).hasClass( 'nf-stage' ) || jQuery( draggable ).hasClass( 'nf-field-type-button' ) ) {
|
17267 |
-
return true;
|
17268 |
-
}
|
17269 |
-
},
|
17270 |
-
activeClass: 'nf-droppable-active',
|
17271 |
-
hoverClass: 'nf-droppable-hover',
|
17272 |
-
tolerance: 'pointer',
|
17273 |
-
over: function( e, ui ) {
|
17274 |
-
ui.item = ui.draggable;
|
17275 |
-
nfRadio.channel( 'app' ).request( 'over:fieldsSortable', ui );
|
17276 |
-
},
|
17277 |
-
out: function( e, ui ) {
|
17278 |
-
ui.item = ui.draggable;
|
17279 |
-
nfRadio.channel( 'app' ).request( 'out:fieldsSortable', ui );
|
17280 |
-
},
|
17281 |
-
drop: function( e, ui ) {
|
17282 |
-
ui.item = ui.draggable;
|
17283 |
-
nfRadio.channel( 'app' ).request( 'receive:fieldsSortable', ui );
|
17284 |
-
var fieldCollection = nfRadio.channel( 'fields' ).request( 'get:collection' );
|
17285 |
-
fieldCollection.trigger( 'reset', fieldCollection );
|
17286 |
-
},
|
17287 |
-
} );
|
17288 |
-
}
|
17289 |
-
});
|
17290 |
-
|
17291 |
-
return view;
|
17292 |
-
} );
|
17293 |
-
/**
|
17294 |
-
* Renders our form title.
|
17295 |
-
*
|
17296 |
-
* @package Ninja Forms builder
|
17297 |
-
* @subpackage App
|
17298 |
-
* @copyright (c) 2015 WP Ninjas
|
17299 |
-
* @since 3.0
|
17300 |
-
*/
|
17301 |
-
define( 'views/app/formTitle',[], function() {
|
17302 |
-
var view = Marionette.ItemView.extend({
|
17303 |
-
tagName: 'div',
|
17304 |
-
template: '#tmpl-nf-header-form-title',
|
17305 |
-
|
17306 |
-
initialize: function() {
|
17307 |
-
// When we change the model (to disable it, for example), re-render.
|
17308 |
-
this.model.on( 'change:title', this.render, this );
|
17309 |
-
},
|
17310 |
-
|
17311 |
-
/**
|
17312 |
-
* These functions are available to templates, and help us to remove logic from template files.
|
17313 |
-
*
|
17314 |
-
* @since 3.0
|
17315 |
-
* @return Object
|
17316 |
-
*/
|
17317 |
-
templateHelpers: function() {
|
17318 |
-
var that = this;
|
17319 |
-
return {
|
17320 |
-
renderTitle: function(){
|
17321 |
-
var formData = nfRadio.channel( 'app' ).request( 'get:formModel' );
|
17322 |
-
return _.escape( formData.get( 'settings' ).get( 'title' ) );
|
17323 |
-
},
|
17324 |
-
}
|
17325 |
-
}
|
17326 |
-
|
17327 |
-
});
|
17328 |
-
|
17329 |
-
return view;
|
17330 |
-
} );
|
17331 |
-
/**
|
17332 |
-
* Return views that might be used in extensions.
|
17333 |
-
* These are un-instantiated views.
|
17334 |
-
*
|
17335 |
-
* @package Ninja Forms builder
|
17336 |
-
* @subpackage Main App
|
17337 |
-
* @copyright (c) 2015 WP Ninjas
|
17338 |
-
* @since 3.0
|
17339 |
-
*/
|
17340 |
-
define( 'views/loadViews',[ 'views/fields/fieldItem', 'views/fields/mainContentEmpty', 'views/app/formTitle' ], function( fieldItemView, mainContentEmptyView, FormTitleView ) {
|
17341 |
-
var controller = Marionette.Object.extend( {
|
17342 |
-
initialize: function() {
|
17343 |
-
// Reply to requests for our field item view.
|
17344 |
-
nfRadio.channel( 'views' ).reply( 'get:fieldItem', this.getFieldItem );
|
17345 |
-
|
17346 |
-
// Reply to requests for our empty content view.
|
17347 |
-
nfRadio.channel( 'views' ).reply( 'get:mainContentEmpty', this.getMainContentEmpty );
|
17348 |
-
|
17349 |
-
// Reply to requests for our form title view.
|
17350 |
-
nfRadio.channel( 'views' ).reply( 'get:formTitle', this.getFormTitle );
|
17351 |
-
},
|
17352 |
-
|
17353 |
-
getFieldItem: function( model ) {
|
17354 |
-
return fieldItemView;
|
17355 |
-
},
|
17356 |
-
|
17357 |
-
getMainContentEmpty: function() {
|
17358 |
-
return mainContentEmptyView;
|
17359 |
-
},
|
17360 |
-
|
17361 |
-
getFormTitle: function() {
|
17362 |
-
return FormTitleView;
|
17363 |
-
}
|
17364 |
-
|
17365 |
-
});
|
17366 |
-
|
17367 |
-
return controller;
|
17368 |
-
} );
|
17369 |
-
var nfRadio = Backbone.Radio;
|
17370 |
-
|
17371 |
-
jQuery( document ).ready( function( $ ) {
|
17372 |
-
require( ['views/app/builder', 'controllers/loadControllers', 'views/loadViews'], function( BuilderView, LoadControllers, LoadViews ) {
|
17373 |
-
|
17374 |
-
var NinjaForms = Marionette.Application.extend( {
|
17375 |
-
|
17376 |
-
initialize: function( options ) {
|
17377 |
-
|
17378 |
-
var that = this;
|
17379 |
-
Marionette.Renderer.render = function(template, data){
|
17380 |
-
var template = that.template( template );
|
17381 |
-
return template( data );
|
17382 |
-
};
|
17383 |
-
|
17384 |
-
// Trigger an event before we load our controllers.
|
17385 |
-
nfRadio.channel( 'app' ).trigger( 'before:loadControllers', this );
|
17386 |
-
// Load our controllers.
|
17387 |
-
var loadControllers = new LoadControllers();
|
17388 |
-
// Trigger an event after we load our controllers.
|
17389 |
-
nfRadio.channel( 'app' ).trigger( 'after:loadControllers', this );
|
17390 |
-
|
17391 |
-
// Trigger an event before we load un-instantiated views
|
17392 |
-
nfRadio.channel( 'app' ).trigger( 'before:loadViews', this );
|
17393 |
-
var loadViews = new LoadViews();
|
17394 |
-
// Trigger an event after we load un-instantiated views.
|
17395 |
-
nfRadio.channel( 'app' ).trigger( 'after:loadViews', this );
|
17396 |
-
|
17397 |
-
nfRadio.channel( 'app' ).reply( 'get:template', this.template );
|
17398 |
-
},
|
17399 |
-
|
17400 |
-
onStart: function() {
|
17401 |
-
var builderView = new BuilderView();
|
17402 |
-
// Trigger our after start event.
|
17403 |
-
nfRadio.channel( 'app' ).trigger( 'after:appStart', this );
|
17404 |
-
|
17405 |
-
/*
|
17406 |
-
* If we're on the new forms builder, open the add fields drawer.
|
17407 |
-
*/
|
17408 |
-
if ( 0 == nfAdmin.formID ) {
|
17409 |
-
nfRadio.channel( 'app' ).request( 'open:drawer', 'addField' );
|
17410 |
-
}
|
17411 |
-
},
|
17412 |
-
|
17413 |
-
template: function( template ) {
|
17414 |
-
return _.template( $( template ).html(), {
|
17415 |
-
evaluate: /<#([\s\S]+?)#>/g,
|
17416 |
-
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
17417 |
-
escape: /\{\{([^\}]+?)\}\}(?!\})/g,
|
17418 |
-
variable: 'data'
|
17419 |
-
} );
|
17420 |
-
}
|
17421 |
-
} );
|
17422 |
-
|
17423 |
-
var ninjaForms = new NinjaForms();
|
17424 |
-
ninjaForms.start();
|
17425 |
-
} );
|
17426 |
-
} );
|
17427 |
-
define("main", function(){});
|
17428 |
-
|
17429 |
-
}());
|
1 |
+
!function(){var e,t,n;!function(i){var r,a,l,s,o={},c={},d={},h={},u=Object.prototype.hasOwnProperty,p=[].slice,g=/\.js$/;function f(e,t){return u.call(e,t)}function m(e,t){var n,i,r,a,l,s,o,c,h,u,p,f=t&&t.split("/"),m=d.map,y=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(l=(e=e.split("/")).length-1,d.nodeIdCompat&&g.test(e[l])&&(e[l]=e[l].replace(g,"")),e=f.slice(0,f.length-1).concat(e),h=0;h<e.length;h+=1)if("."===(p=e[h]))e.splice(h,1),h-=1;else if(".."===p){if(1===h&&(".."===e[2]||".."===e[0]))break;h>0&&(e.splice(h-1,2),h-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((f||y)&&m){for(h=(n=e.split("/")).length;h>0;h-=1){if(i=n.slice(0,h).join("/"),f)for(u=f.length;u>0;u-=1)if((r=m[f.slice(0,u).join("/")])&&(r=r[i])){a=r,s=h;break}if(a)break;!o&&y&&y[i]&&(o=y[i],c=h)}!a&&o&&(a=o,s=c),a&&(n.splice(0,s,a),e=n.join("/"))}return e}function y(e,t){return function(){var n=p.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),a.apply(i,n.concat([e,t]))}}function v(e){return function(t){o[e]=t}}function w(e){if(f(c,e)){var t=c[e];delete c[e],h[e]=!0,r.apply(i,t)}if(!f(o,e)&&!f(h,e))throw new Error("No "+e);return o[e]}function b(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function C(e){return function(){return d&&d.config&&d.config[e]||{}}}l=function(e,t){var n,i=b(e),r=i[0];return e=i[1],r&&(n=w(r=m(r,t))),r?e=n&&n.normalize?n.normalize(e,function(e){return function(t){return m(t,e)}}(t)):m(e,t):(r=(i=b(e=m(e,t)))[0],e=i[1],r&&(n=w(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},s={require:function(e){return y(e)},exports:function(e){var t=o[e];return void 0!==t?t:o[e]={}},module:function(e){return{id:e,uri:"",exports:o[e],config:C(e)}}},r=function(e,t,n,r){var a,d,u,p,g,m,b=[],C=typeof n;if(r=r||e,"undefined"===C||"function"===C){for(t=!t.length&&n.length?["require","exports","module"]:t,g=0;g<t.length;g+=1)if("require"===(d=(p=l(t[g],r)).f))b[g]=s.require(e);else if("exports"===d)b[g]=s.exports(e),m=!0;else if("module"===d)a=b[g]=s.module(e);else if(f(o,d)||f(c,d)||f(h,d))b[g]=w(d);else{if(!p.p)throw new Error(e+" missing "+d);p.p.load(p.n,y(r,!0),v(d),{}),b[g]=o[d]}u=n?n.apply(o[e],b):void 0,e&&(a&&a.exports!==i&&a.exports!==o[e]?o[e]=a.exports:u===i&&m||(o[e]=u))}else e&&(o[e]=n)},e=t=a=function(e,t,n,o,c){if("string"==typeof e)return s[e]?s[e](t):w(l(e,t).f);if(!e.splice){if((d=e).deps&&a(d.deps,d.callback),!t)return;t.splice?(e=t,t=n,n=null):e=i}return t=t||function(){},"function"==typeof n&&(n=o,o=c),o?r(i,e,t,n):setTimeout((function(){r(i,e,t,n)}),4),a},a.config=function(e){return a(e)},e._defined=o,(n=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),f(o,e)||f(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),n("../lib/almond",(function(){})),n("views/app/menuItem",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-app-menu-item",initialize:function(){this.listenTo(i.channel("app"),"change:currentDomain",this.render),this.model.on("change",this.render,this)},onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)},events:{"click a":"clickAppMenu"},clickAppMenu:function(e){i.channel("app").trigger("click:menu",e,this.model)},templateHelpers:function(){return{renderDashicons:function(){if(!this.dashicons)return"";var e=document.createElement("span");return e.classList.add("dashicons"),e.classList.add(this.dashicons),e.outerHTML},renderClasses:function(){var e=this.classes;return i.channel("app").request("get:currentDomain").get("id")==this.id&&(e+=" active"),e},renderUrl:function(){if(""!=this.url){var e=i.channel("app").request("get:formModel");return this.url+e.get("id")}return"#"},renderTarget:function(){return""!=this.url?"_blank":"_self"},renderDisabled:function(){return this.disabled?"disabled":""}}}})})),n("views/app/menu",["views/app/menuItem"],(function(e){return Marionette.CollectionView.extend({tagName:"div",childView:e,onShow:function(){jQuery(this.el).find("li:last").unwrap()}})})),n("views/app/menuButtons",[],(function(){return Marionette.ItemView.extend({tagName:"span",template:"#tmpl-nf-app-header-action-button",initialize:function(){this.listenTo(i.channel("app"),"change:clean",this.render,this),this.listenTo(i.channel("app"),"change:loading",this.render,this),this.listenTo(i.channel("app"),"response:updateDB",this.bounceIcon,this)},templateHelpers:function(){var e=this;return{renderPublish:function(){if(e.publishWidth?this.publishWidth=e.publishWidth+"px":this.publishWidth="auto",i.channel("app").request("get:setting","loading"))var t=i.channel("app").request("get:template","#tmpl-nf-add-header-publish-loading");else t=i.channel("app").request("get:template","#tmpl-nf-app-header-publish-button");return t(this)},maybeDisabled:function(){return i.channel("app").request("get:setting","clean")?"disabled":""},maybeRenderCancel:function(){return""},renderPublicLink:function(){var e=Backbone.Radio.channel("app").request("get:formModel");if(!isNaN(e.get("id")))return i.channel("app").request("get:template","#tmpl-nf-app-header-public-link")(this)}}},onShow:function(){jQuery(this.el).find(".publish")},events:{"click .publish":"clickPublish","click .viewChanges":"clickViewChanges","click .publicLink":"clickPublicLink"},clickPublish:function(e){i.channel("app").trigger("click:publish",e)},clickViewChanges:function(e){i.channel("app").trigger("click:viewChanges",e)},clickPublicLink:function(e){i.channel("app").trigger("click:publicLink",e)},bounceIcon:function(e){jQuery(this.el).find(".dashicons-backup").effect("bounce",{times:3},600)}})})),n("views/app/mobileMenuButton",[],(function(){return Marionette.ItemView.extend({tagName:"span",template:"#tmpl-nf-mobile-menu-button",initialize:function(){this.listenTo(i.channel("app"),"change:clean",this.render,this)},templateHelpers:function(){return{maybeDisabled:function(){return i.channel("app").request("get:setting","clean")?"disabled":""}}},events:{"click .nf-mobile-menu":"clickMobileMenu"},clickMobileMenu:function(e){var t=i.channel("app").request("get:builderEl");jQuery(t).toggleClass("nf-menu-expand")}})})),n("views/app/header",["views/app/menu","views/app/menuButtons","views/app/mobileMenuButton"],(function(e,t,n){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-app-header",regions:{menu:".nf-app-menu",buttons:".nf-app-buttons",mobileMenuButton:".nf-mobile-menu-button"},onRender:function(){var r=i.channel("app").request("get:domainCollection");this.menu.show(new e({collection:r})),this.buttons.show(new t),this.mobileMenuButton.show(new n)},events:{"click #nf-logo":"clickLogo"},clickLogo:function(e){}})})),n("views/app/subHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-sub-header"})})),n("views/app/builderHeader",["views/app/header","views/app/subHeader"],(function(e,t){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-header",regions:{app:"#nf-app-header",formTitle:"#nf-app-form-title",appSub:"#nf-app-sub-header"},initialize:function(){this.listenTo(i.channel("app"),"change:currentDomain",this.changeSubHeader)},onShow:function(){this.app.show(new e);var t=i.channel("app").request("get:formModel").get("settings"),n=i.channel("views").request("get:formTitle");this.formTitle.show(new n({model:t})),this.changeSubHeader()},changeSubHeader:function(){var e=i.channel("app").request("get:currentDomain"),t=e.get("getSubHeaderView").call(e);this.appSub.show(t)}})})),n("views/app/main",[],(function(){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-main",className:"nf-main-test",maybeDone:!1,offsetRight:!1,offsetLeft:!1,regions:{gutterLeft:"#nf-main-gutter-left",body:"#nf-main-body",gutterRight:"#nf-main-gutter-right"},initialize:function(){this.listenTo(i.channel("app"),"change:currentDomain",this.render),i.channel("app").reply("get:mainEl",this.getMainEl,this),jQuery(window).on("resize",{context:this},this.resizeBothGutters),this.listenTo(i.channel("drawer"),"before:open",this.setBothGuttersAbsolute),this.listenTo(i.channel("drawer"),"opened",this.setBothGuttersFixed),this.listenTo(i.channel("drawer"),"before:close",this.setBothGuttersAbsolute),this.listenTo(i.channel("drawer"),"closed",this.setBothGuttersFixed),this.listenTo(i.channel("app"),"change:currentDomain",(function(){setTimeout((function(){i.channel("app").request("update:gutters")}),300,this)}),this),i.channel("app").reply("update:gutters",this.updateGutters,this)},onShow:function(){i.channel("main").trigger("show:main",this)},onRender:function(){var e=i.channel("app").request("get:currentDomain"),t=e.get("getMainContentView").call(e);this.body.show(t);var n=e.get("getGutterLeftView").call(e);this.gutterLeft.show(n);var r=e.get("getGutterRightView").call(e);this.gutterRight.show(r),i.channel("main").trigger("render:main")},getMainEl:function(){return jQuery(this.el).parent()},onAttach:function(){this.initialGutterResize()},onBeforeDestroy:function(){jQuery(window).off("resize",this.resize)},initialGutterResize:function(){this.resizeGutter(this.gutterLeft.el),this.resizeGutter(this.gutterRight.el),this.setBothGuttersFixed(this)},resizeBothGutters:function(e){var t=e?e.data.context:this,n=t.gutterLeft.el,i=t.gutterRight.el;t.resizeGutter(n,t),t.resizeGutter(i,t),t.setBothGuttersAbsolute(t),clearTimeout(t.maybeDone),t.maybeDone=setTimeout(t.setBothGuttersFixed,100,t)},resizeGutter:function(e,t){var n=jQuery(e).offset().top,i=jQuery(window).height()-n;jQuery(e).height(i)},setBothGuttersFixed:function(e){e=e||this;var t=(i=jQuery(e.gutterLeft.el).offset()).top,n=i.left;jQuery(e.gutterLeft.el).css({position:"fixed",left:n,top:t});var i=jQuery(e.gutterLeft.el).offset(),r=jQuery(e.gutterRight.el).offset(),a=r.top,l=r.left;jQuery(e.gutterRight.el).css({position:"fixed",left:l,top:a})},setBothGuttersAbsolute:function(e){e=e||this;jQuery(e.gutterLeft.el).offset(),jQuery(e.gutterRight.el).offset();var t=jQuery("#nf-main").scrollTop();jQuery(e.gutterLeft.el).css({position:"absolute",left:0,top:t}),jQuery(e.gutterRight.el).css({position:"absolute",top:t,right:0,left:"auto"})},updateGutters:function(){this.resizeBothGutters()}})})),n("views/app/mobileMenuItem",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-mobile-menu-item",onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)},events:{"click a":"clickAppMenu"},clickAppMenu:function(e){i.channel("app").trigger("click:menu",e,this.model)},templateHelpers:function(){return{renderDashicons:function(){if(!this.mobileDashicon)return"";var e=document.createElement("span");return e.classList.add("dashicons"),e.classList.add(this.mobileDashicon),e.outerHTML},renderClasses:function(){var e=this.classes;return i.channel("app").request("get:currentDomain").get("id")==this.id&&(e+=" active"),e},renderUrl:function(){if(""!=this.url){var e=i.channel("app").request("get:formModel");return this.url+e.get("id")}return"#"},renderTarget:function(){return""!=this.url?"_blank":"_self"},renderDisabled:function(){return this.disabled?"disabled":""}}}})})),n("views/app/mobileMenu",["views/app/mobileMenuItem"],(function(e){return Marionette.CompositeView.extend({tagName:"div",template:"#tmpl-nf-mobile-menu",childView:e,initialize:function(){this.listenTo(i.channel("app"),"change:clean",this.render,this)},attachHtml:function(e,t){jQuery(e.el).find(".secondary").append(t.el)},templateHelpers:function(){return{maybeDisabled:function(){return i.channel("app").request("get:setting","clean")?"disabled":""}}},events:{"click .nf-publish":"clickPublish"},clickPublish:function(e){i.channel("app").trigger("click:publish",e);var t=i.channel("app").request("get:builderEl");jQuery(t).toggleClass("nf-menu-expand")}})})),n("views/app/drawer/contentEmpty",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-empty"})})),n("views/app/drawer",["views/app/drawer/contentEmpty"],(function(e){return Marionette.LayoutView.extend({template:"#tmpl-nf-drawer",regions:{header:"#nf-drawer-header",content:"#nf-drawer-content",footer:"#nf-drawer-footer"},initialize:function(){i.channel("app").reply("get:drawerEl",this.getEl,this),i.channel("drawer").reply("load:drawerContent",this.loadContent,this),i.channel("drawer").reply("empty:drawerContent",this.emptyContent,this)},onShow:function(){jQuery(this.el).parent().perfectScrollbar()},loadContent:function(e,t){var n=i.channel("app").request("get:drawer",e),r=n.get("getContentView").call(n,t),a=n.get("getHeaderView").call(n,t),l=n.get("getFooterView").call(n,t);this.header.show(a),this.content.show(r),this.footer.show(l)},emptyContent:function(){this.header.empty(),this.content.empty(),this.footer.empty()},getEl:function(){return jQuery(this.el).parent()},events:{"click .nf-toggle-drawer":"clickToggleDrawer"},clickToggleDrawer:function(){i.channel("app").trigger("click:toggleDrawerSize")}})})),n("views/app/drawer/mergeTagItem",[],(function(){return Marionette.ItemView.extend({tagName:"li",template:"#tmpl-nf-merge-tags-item",onBeforeDestroy:function(){this.model.off("change:active",this.render)},initialize:function(){this.model.on("change:active",this.render,this)},events:{"click a":"clickTag"},clickTag:function(e){i.channel("mergeTags").trigger("click:mergeTag",e,this.model)},templateHelpers:function(){return{renderClasses:function(){if(this.active)return"active"}}}})})),n("views/app/drawer/mergeTagsSection",["views/app/drawer/mergeTagItem"],(function(e){return Marionette.CompositeView.extend({tagName:"div",childView:e,template:"#tmpl-nf-merge-tags-section",initialize:function(){this.collection=this.model.get("tags"),this.model.on("change",this.render,this),this.model.get("id")},onBeforeDestroy:function(){(this.model.off("change",this.render),"fields"==this.model.get("id"))&&i.channel("fields").request("get:collection").off("all",this.updateFields,this)},attachHtml:function(e,t){jQuery(e.el).find(".merge-tags").append(t.el)},updateFields:function(){var e=i.channel("fields").request("get:collection");this.model.set("tags",e)}})})),n("models/app/mergeTagModel",[],(function(){return Backbone.Model.extend({defaults:{active:!1,exclude:!1}})})),n("models/app/mergeTagCollection",["models/app/mergeTagModel"],(function(e){return Backbone.Collection.extend({model:e})})),n("views/app/drawer/mergeTagsContent",["views/app/drawer/mergeTagsSection","models/app/mergeTagCollection"],(function(e,t){return Marionette.CollectionView.extend({tagName:"div",template:"#tmpl-nf-merge-tags-content",childView:e,initialize:function(){i.channel("mergeTags").reply("get:view",this.getMergeTagsView,this)},reRender:function(e){var n=i.channel("mergeTags").request("get:collection"),r=n.where({default_group:!0});if("actions"==i.channel("app").request("get:currentDomain").get("id")){var a=n.where({id:"calcs"});r=r.concat(a)}this.collection=new t(r);var l=this,s=e.get("use_merge_tags");"object"==typeof s&&(void 0!==s.exclude&&_.each(s.exclude,(function(e){l.collection.remove(e)})),void 0!==s.include&&_.each(n.models,(function(e){-1!=s.include.indexOf(e.get("id"))&&l.collection.add(e)}))),this.render()},getMergeTagsView:function(){return this}})})),n("views/app/builder",["views/app/builderHeader","views/app/main","views/app/mobileMenu","views/app/drawer","views/app/drawer/mergeTagsContent"],(function(e,t,n,r,a){return Marionette.LayoutView.extend({template:"#tmpl-nf-builder",el:"#nf-builder",regions:{header:"#nf-header",main:"#nf-main",menuDrawer:"#nf-menu-drawer",drawer:"#nf-drawer",mergeTagsContent:".merge-tags-content"},initialize:function(){i.channel("app").reply("get:builderEl",this.getBuilderEl,this),i.channel("app").reply("get:builderView",this.getBuilderView,this),this.render();var l=i.channel("mergeTags").request("get:collection").clone();this.mergeTagsContent.show(new a({collection:l})),this.header.show(new e),this.main.show(new t);var s=i.channel("app").request("get:domainCollection");this.menuDrawer.show(new n({collection:s})),this.drawer.show(new r)},onRender:function(){},getBuilderEl:function(){return this.el},getBuilderView:function(){return this},events:{"click .nf-open-drawer":"openDrawer","click .nf-change-domain":"changeDomain","click .nf-close-drawer":"closeDrawer"},openDrawer:function(e){i.channel("app").trigger("click:openDrawer",e)},closeDrawer:function(){i.channel("app").trigger("click:closeDrawer")},changeDomain:function(e){i.channel("app").trigger("click:menu",e)}})})),n("controllers/app/remote",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("setting"),"remote",this.addListener)},addListener:function(e,t){var n=e.get("remote").listen;this.listenTo(i.channel("fieldSetting-"+n),"update:setting",this.updateSetting),this.listenTo(i.channel("actionSetting-"+n),"update:setting",this.updateSetting),this.listenTo(i.channel("setting-type-"+e.get("type")),"click:extra",this.clickExtra),e.listenTo(i.channel("setting-remote"),"get:remote",this.getRemote,e),i.channel("setting-remote").trigger("get:remote",t)},clickExtra:function(e,t,n,r){jQuery(e.srcElement).addClass("spin"),i.channel("setting-remote").trigger("get:remote",n)},updateSetting:function(e,t){i.channel("setting-remote").trigger("get:remote",e)},getRemote:function(e){var t=this.get("remote"),n={parentValue:e.get(t.listen),action:t.action,security:t.security?t.security:nfAdmin.ajaxNonce},i=this;jQuery.post(ajaxurl,n,(function(t){t=JSON.parse(t);"textbox"==i.get("type")&&e.set(i.get("name"),t.value),"select"==i.get("type")&&(i.set("options",t.options),i.trigger("rerender"))}))}})})),n("controllers/app/drawer",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"click:openDrawer",this.clickOpenDrawer),this.listenTo(i.channel("app"),"click:closeDrawer",this.closeDrawer),this.listenTo(i.channel("app"),"click:toggleDrawerSize",this.toggleDrawerSize),i.channel("app").reply("open:drawer",this.openDrawer,this),i.channel("app").reply("close:drawer",this.closeDrawer,this),i.channel("drawer").reply("get:closedRightPos",this.getClosedDrawerPos,this),i.channel("drawer").reply("prevent:close",this.preventClose,this),i.channel("drawer").reply("enable:close",this.enableClose,this),i.channel("drawer").reply("get:preventClose",this.maybePreventClose,this),this.objPreventClose={},this.listenTo(i.channel("drawer"),"filter:focused",this.filterFocused)},closeDrawer:function(){var e=i.channel("app").request("get:currentDrawer");if(!e||this.maybePreventClose())return!1;i.channel("drawer-"+e.get("id")).trigger("before:closeDrawer"),i.channel("drawer").trigger("before:closeDrawer"),i.channel("drawer").trigger("before:close"),i.channel("drawer").request("empty:drawerContent");var t=i.channel("app").request("get:builderEl");jQuery(t).addClass("nf-drawer-closed").removeClass("nf-drawer-opened"),jQuery(t).removeClass("disable-main");var n=this.getClosedDrawerPos(),r=i.channel("app").request("get:drawerEl");jQuery(r).css({right:n});var a=this;this.checkCloseDrawerPos=setInterval((function(){n==jQuery(r).css("right")&&(clearInterval(a.checkCloseDrawerPos),i.channel("app").request("update:currentDrawer",!1),i.channel("drawer").trigger("closed"),jQuery(".nf-master-control").css("z-index",98))}),150)},clickOpenDrawer:function(e){var t=jQuery(e.target).data("drawerid");this.openDrawer(t)},openDrawer:function(e,t){if(this.maybePreventClose())return!1;if(void 0!==(t=t||{}).model){var n=i.channel("app").request("get:currentDomain").get("id");i.channel(n).request("clear:editActive"),t.model.set("editActive",!0),this.dataModel=t.model}i.channel("drawer").request("load:drawerContent",e,t),i.channel("drawer").trigger("before:open");var r=i.channel("app").request("get:builderEl");jQuery(r).addClass("nf-drawer-opened").removeClass("nf-drawer-closed");var a=i.channel("app").request("get:drawerEl");jQuery(a).css({right:"0px"});var l=this;this.hasFocus=!1,jQuery(".nf-master-control").css("z-index",0),this.checkOpenDrawerPos=setInterval((function(){"0px"==jQuery(a).css("right")&&(clearInterval(l.checkOpenDrawerPos),l.hasFocus||(l.focusFilter(),l.hasFocus=!0,i.channel("app").request("update:currentDrawer",e),jQuery(a).scrollTop(0),i.channel("drawer").trigger("opened")))}),150)},toggleDrawerSize:function(){var e=i.channel("app").request("get:drawerEl");jQuery(e).toggleClass("nf-drawer-expand")},focusFilter:function(){var e=i.channel("drawer").request("get:filterEl");jQuery(e).focus()},getClosedDrawerPos:function(){var e=i.channel("app").request("get:builderEl");return"-"+(jQuery(e).width()+300)+"px"},maybePreventClose:function(){return 0!=Object.keys(this.objPreventClose).length},preventClose:function(e){this.objPreventClose[e]=!0,this.dataModel.set("drawerDisabled",!0)},enableClose:function(e){delete this.objPreventClose[e],this.maybePreventClose()||void 0===this.dataModel||this.dataModel.set("drawerDisabled",!1)},filterFocused:function(){clearInterval(this.checkOpenDrawerPos)},getPreventClose:function(){return this.objPreventClose}})})),n("views/app/drawer/headerDefault",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-header-default",initialize:function(){this.model&&this.model.on("change:drawerDisabled",this.render,this)},onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el),i.channel("drawer").reply("clear:filter",this.clearFilter,this),i.channel("drawer").reply("blur:filter",this.blurFilter,this),i.channel("drawer").reply("get:filterEl",this.getEl,this)},onBeforeDestroy:function(){this.model&&this.model.off("change:drawerDisabled",this.render)},events:{"keyup .nf-filter":"maybeChangeFilter","input .nf-filter":"changeFilter","focus input":"getFocus"},changeFilter:function(e){var t=i.channel("app").request("get:currentDrawer");i.channel("drawer-"+t.get("id")).trigger("change:filter",e.target.value,e)},maybeChangeFilter:function(e){13==e.keyCode&&(e.addObject=!0,this.changeFilter(e))},clearFilter:function(){var e=jQuery(this.el).find(".nf-filter");""!=jQuery.trim(e.val())&&(e.val(""),e.trigger("input"),e.focus())},blurFilter:function(){jQuery(this.el).find(".nf-filter").blur()},getEl:function(){return jQuery(this.el).find(".nf-filter")},getFocus:function(){i.channel("drawer").trigger("filter:focused")},templateHelpers:function(){return{renderDisabled:function(){return this.drawerDisabled?"disabled":""}}}})})),n("views/app/drawer/footerDefault",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-empty"})})),n("models/app/drawerModel",["views/app/drawer/headerDefault","views/app/drawer/footerDefault"],(function(e,t){return Backbone.Model.extend({defaults:{getHeaderView:function(t){return new e(t)},getFooterView:function(e){return new t(e)}}})})),n("models/app/drawerCollection",["models/app/drawerModel"],(function(e){return Backbone.Collection.extend({model:e})})),n("views/fields/drawer/stagedField",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-staged-field",onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)},events:{"click .dashicons-dismiss":"removeStagedField"},removeStagedField:function(e){i.channel("drawer-addField").trigger("click:removeStagedField",e,this.model)}})})),n("views/fields/drawer/stagingEmpty",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-staged-fields-empty",onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)}})})),n("views/fields/drawer/stagingCollection",["views/fields/drawer/stagedField","views/fields/drawer/stagingEmpty"],(function(e,t){return Marionette.CollectionView.extend({tagName:"div",childView:e,emptyView:t,activeClass:"nf-staged-fields-active",initialize:function(){i.channel("app").reply("get:stagedFieldsEl",this.getStagedFieldsEl,this)},onShow:function(){this.$el=jQuery(this.el).parent(),jQuery(this.$el).find("span:first").unwrap(),this.setElement(this.$el);jQuery(this.el).sortable({placeholder:"nf-staged-fields-sortable-placeholder",helper:"clone",tolerance:"pointer",over:function(e,t){i.channel("drawer-addField").trigger("over:stagedFields",e,t)},out:function(e,t){i.channel("drawer-addField").trigger("out:stagedFields",t)},receive:function(e,t){i.channel("drawer-addField").trigger("receive:stagedFields",t)},update:function(e,t){i.channel("fields").request("sort:staging")},start:function(e,t){i.channel("drawer-addField").trigger("start:stagedFields",t)},stop:function(e,t){i.channel("drawer-addField").trigger("stop:stagedFields",t)}}),jQuery(this.el).parent().draggable({opacity:.9,connectToSortable:".nf-field-type-droppable",appendTo:"#nf-main",refreshPositions:!0,grid:[3,3],tolerance:"pointer",helper:function(e){var t=jQuery(e.target).parent().width(),n=jQuery(e.target).parent().height(),i=jQuery(e.target).parent().clone(),r=t/4,a=n/2;return jQuery(this).draggable("option","cursorAt",{top:a,left:r}),jQuery(i).css("z-index",1e3),i},start:function(e,t){i.channel("drawer-addField").trigger("startDrag:fieldStaging",this,t)},stop:function(e,t){i.channel("drawer-addField").trigger("stopDrag:fieldStaging",this,t)}})},getStagedFieldsEl:function(){return jQuery(this.el)},onAddChild:function(){jQuery(this.el).addClass(this.activeClass)},onRemoveChild:function(){this.hasStagedFields()||jQuery(this.el).removeClass(this.activeClass)},hasStagedFields:function(){return 0!=this.collection.length}})})),n("models/fields/stagingModel",[],(function(){return Backbone.Model.extend({})})),n("models/fields/stagingCollection",["models/fields/stagingModel"],(function(e){return Backbone.Collection.extend({model:e,comparator:"order"})})),n("views/fields/drawer/typeSection",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-field-type-section",initialize:function(){_.bindAll(this,"render"),i.channel("fields").reply("get:typeSection",this.getTypeSection,this)},onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el),this.dragging=!1;var e=this;i.channel("app").request("is:mobile")||(jQuery(this.el).find("div.nf-field-type-draggable").draggable({opacity:.9,tolerance:"pointer",connectToSortable:".nf-field-type-droppable",refreshPositions:!0,grid:[5,5],appendTo:"#nf-builder",helper:function(e){var t=jQuery(e.target).parent().width(),n=jQuery(e.target).parent().height(),i=jQuery(e.target).parent().clone(),r=t/4,a=n/2;return jQuery(this).draggable("option","cursorAt",{top:a,left:r}),jQuery(i).css("z-index",1e3),i},start:function(t,n){e.dragging=!0,i.channel("drawer-addField").trigger("startDrag:type",this,n)},stop:function(t,n){e.dragging=!1,i.channel("drawer-addField").trigger("stopDrag:type",this,n)},drag:function(e,t){i.channel("drawer-addField").trigger("drag:type",this,t,e)}}).disableSelection(),jQuery(this.el).find(".nf-item").focus((function(){jQuery(this).addClass("active")})).blur((function(){jQuery(this).removeClass("active")})))},events:{"click .nf-item":"clickFieldType","keydown .nf-item":"maybeClickFieldType","mousedown .nf-item":"mousedownFieldType"},clickFieldType:function(e){this.dragging||i.channel("drawer").trigger("click:fieldType",e)},mousedownFieldType:function(e){jQuery(e.target).addClass("clicked"),setTimeout((function(){jQuery(e.target).removeClass("clicked")}),1500)},maybeClickFieldType:function(e){13==e.keyCode&&(this.clickFieldType(e),i.channel("drawer").request("clear:filter"))},templateHelpers:function(){return{renderFieldTypes:function(){var e=document.createElement("span"),t=this;return _.each(this.fieldTypes,(function(n){var r=i.channel("fields").request("get:type",n),a=r.get("nicename"),l=r.get("icon"),s=i.channel("app").request("get:template","#tmpl-nf-drawer-field-type-button")({id:n,nicename:a,icon:l,type:r,savedField:t.savedField}),o=document.createRange().createContextualFragment(s);e.appendChild(o)})),e.innerHTML},savedField:function(){return this.type.get("savedField")?"nf-saved":""}}},getTypeSection:function(){return this.el}})})),n("views/fields/drawer/typeSectionCollection",["views/fields/drawer/typeSection"],(function(e){return Marionette.CollectionView.extend({tagName:"div",childView:e,onShow:function(){jQuery(this.el).find(".nf-settings").unwrap(),i.channel("fields").request("clear:editActive")}})})),n("views/fields/drawer/addField",["views/fields/drawer/stagingCollection","models/fields/stagingCollection","views/fields/drawer/typeSectionCollection"],(function(e,t,n){return Marionette.LayoutView.extend({template:"#tmpl-nf-drawer-content-add-field",regions:{staging:"#nf-drawer-staging .nf-reservoir",primary:"#nf-drawer-primary",secondary:"#nf-drawer-secondary"},initialize:function(){this.listenTo(i.channel("drawer"),"filter:fieldTypes",this.filterFieldTypes),this.listenTo(i.channel("drawer"),"clear:filter",this.removeFieldTypeFilter),this.savedCollection=i.channel("fields").request("get:savedFields"),this.primaryCollection=this.savedCollection,this.fieldTypeSectionCollection=i.channel("fields").request("get:typeSections"),this.secondaryCollection=this.fieldTypeSectionCollection},onShow:function(){var t=i.channel("fields").request("get:staging");this.staging.show(new e({collection:t})),this.primary.show(new n({collection:this.primaryCollection})),this.secondary.show(new n({collection:this.secondaryCollection}))},getEl:function(){return jQuery(this.el).parent()},filterFieldTypes:function(e){this.primary.reset(),this.secondary.reset(),this.filteredSectionCollection=e,this.primary.show(new n({collection:this.filteredSectionCollection}))},removeFieldTypeFilter:function(){this.primary.show(new n({collection:this.savedCollection})),this.secondary.show(new n({collection:this.fieldTypeSectionCollection}))}})})),n("views/app/drawer/itemSettingCollection",[],(function(){return Marionette.CollectionView.extend({tagName:"div",initialize:function(e){this.childViewOptions={dataModel:e.dataModel}},getChildView:function(e){return i.channel("app").request("get:settingChildView",e)}})})),n("views/app/drawer/itemSettingGroup",["views/app/drawer/itemSettingCollection"],(function(e){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-edit-field-setting-group",regions:{settings:".nf-field-settings"},initialize:function(e){this.model.on("change",this.render,this),this.dataModel=e.dataModel},onBeforeDestroy:function(){this.model.off("change",this.render)},onRender:function(){if(this.settings.show(new e({collection:this.model.get("settings"),dataModel:this.dataModel})),!nfAdmin.devMode&&0==this.$el.find(".calculations").length){var t=!1;this.$el.find(".nf-setting").each((function(e,n){if("none"!==n.style.display)return t=!0,!1})),t||this.$el.hide()}this.model.get("display")||this.settings.empty(),i.channel("drawer").trigger("render:settingGroup",this)},events:{"click .toggle":"clickToggleGroup"},clickToggleGroup:function(e){i.channel("drawer").trigger("click:toggleSettingGroup",e,this.model)},templateHelpers:function(){return{renderLabel:function(){return""!=this.label?i.channel("app").request("get:template","#tmpl-nf-drawer-content-edit-setting-group-label")(this):""},renderArrowDir:function(){return this.display?"down":"right"}}}})})),n("views/app/drawer/itemSettingGroupCollection",["views/app/drawer/itemSettingGroup"],(function(e){return Marionette.CollectionView.extend({tagName:"div",childView:e,initialize:function(e){this.childViewOptions={dataModel:e.dataModel}}})})),n("views/app/drawer/editSettings",["views/app/drawer/itemSettingGroupCollection"],(function(e){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-edit-settings",regions:{settingTitle:".nf-setting-title",settingGroups:".nf-setting-groups"},initialize:function(e){this.dataModel=e.model,this.groupCollection=e.groupCollection},onRender:function(){var t=i.channel("app").request("get:currentDomain"),n=t.get("getSettingsTitleView").call(t,{model:this.model});this.settingTitle.show(n),this.settingGroups.show(new e({collection:this.groupCollection,dataModel:this.dataModel}))},templateHelpers:function(){return{maybeRenderTitle:function(){return void 0!==this.type?i.channel("app").request("get:template","#tmpl-nf-drawer-content-edit-settings-title")(this):""},renderTypeNicename:function(){var e=i.channel("app").request("get:currentDomain").get("id");return i.channel(e).request("get:type",this.type).get("nicename")}}}})})),n("views/app/drawer/headerEditSettings",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-header-edit-settings",initialize:function(){this.model&&this.model.on("change:drawerDisabled",this.render,this)},onBeforeDestroy:function(){this.model&&this.model.off("change:drawerDisabled",this.render)},templateHelpers:function(){return{renderDisabled:function(){return this.drawerDisabled?"disabled":""}}}})})),n("views/actions/drawer/typeButton",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-action-type-button",onRender:function(){if(jQuery(this.el).disableSelection(),"installed"==this.model.get("section")){var e=this;jQuery(this.el).draggable({opacity:.9,tolerance:"intersect",scroll:!1,helper:"clone",start:function(t,n){e.dragging=!0,i.channel("drawer-addAction").trigger("startDrag:type",this,n)},stop:function(t,n){e.dragging=!1,i.channel("drawer-addAction").trigger("stopDrag:type",this,n)}})}},events:{"click .nf-item":"clickAddAction"},clickAddAction:function(e){if(!this.dragging)if("installed"==this.model.get("section"))i.channel("actions").trigger("click:addAction",this.model);else{var t=this.model.get("modal_content");new jBox("Modal",{content:t,zIndex:99999999,closeButton:"box",overlay:!0,width:600,repositionOnOpen:!0,reposition:!0}).open()}},templateHelpers:function(){return{renderClasses:function(){var e="nf-item";return""!=jQuery.trim(this.image)&&(e+=" nf-has-img"),"installed"==this.section&&(e+=" nf-action-type"),e},renderStyle:function(){return""!=jQuery.trim(this.image)?"background-image: url('"+jQuery.trim(this.image)+"')":""}}}})})),n("views/actions/drawer/typeCollection",["views/actions/drawer/typeButton"],(function(e){return Marionette.CompositeView.extend({template:"#tmpl-nf-drawer-action-type-section",childView:e,templateHelpers:function(){var e=this;return{hasContents:function(){return e.collection.length>0},renderNicename:function(){return e.collection.nicename},renderClasses:function(){return e.collection.slug}}},attachHtml:function(e,t){jQuery(e.el).find(".action-types").append(t.el)}})})),n("models/app/settingModel",[],(function(){return Backbone.Model.extend({defaults:{settings:!1,hide_merge_tags:!1,error:!1},initialize:function(){i.channel("app").trigger("init:settingModel",this),i.channel(this.get("type")).trigger("init:settingModel",this),i.channel("setting-name-"+this.get("name")).trigger("init:settingModel",this),this.on("change:error",this.maybePreventUI,this),void 0!==this.collection&&this.get("use_merge_tags")&&void 0!==this.collection.options.objectType&&this.listenTo(i.channel("app"),"update:fieldKey",this.updateKey)},updateKey:function(e){i.channel("app").trigger("fire:updateFieldKey",e,this)},maybePreventUI:function(){this.get("error")?(i.channel("drawer").request("prevent:close","setting-"+this.get("name")+"-error"),i.channel("app").request("prevent:changeDomain","setting-"+this.get("name")+"-error")):(i.channel("drawer").request("enable:close","setting-"+this.get("name")+"-error"),i.channel("app").request("enable:changeDomain","setting-"+this.get("name")+"-error"))}})})),n("models/app/settingCollection",["models/app/settingModel"],(function(e){return Backbone.Collection.extend({model:e,initialize:function(e,t){this.options=t||{}}})})),n("models/app/settingGroupModel",["models/app/settingCollection"],(function(e){return Backbone.Model.extend({defaults:{display:!1},initialize:function(t){0==this.get("settings")instanceof Backbone.Collection&&this.set("settings",new e(this.get("settings")))}})})),n("models/app/settingGroupCollection",["models/app/settingGroupModel"],(function(e){return Backbone.Collection.extend({model:e})})),n("models/app/typeModel",["models/app/settingGroupCollection"],(function(e){return Backbone.Model.extend({initialize:function(){!1==this.get("settingGroups")instanceof Backbone.Collection&&this.set("settingGroups",new e(this.get("settingGroups"))),i.channel("fields").trigger("init:typeModel",this)}})})),n("models/app/typeCollection",["models/app/typeModel"],(function(e){return Backbone.Collection.extend({model:e,type:!1,initialize:function(e,t){_.each(t,(function(e,t){this[t]=e}),this)}})})),n("views/actions/drawer/addAction",["views/actions/drawer/typeCollection","models/app/typeCollection"],(function(e,t){return Marionette.LayoutView.extend({template:"#tmpl-nf-drawer-content-add-action",regions:{primary:"#nf-drawer-primary",payments:"#nf-drawer-secondary-payments",marketing:"#nf-drawer-secondary-marketing",management:"#nf-drawer-secondary-management",workflow:"#nf-drawer-secondary-workflow",notifications:"#nf-drawer-secondary-notifications",misc:"#nf-drawer-secondary-misc"},initialize:function(){this.listenTo(i.channel("drawer"),"filter:actionTypes",this.filteractionTypes),this.listenTo(i.channel("drawer"),"clear:filter",this.removeactionTypeFilter),this.installedActions=i.channel("actions").request("get:installedActions"),this.primaryCollection=this.installedActions,this.availableActions=i.channel("actions").request("get:availableActions"),this.updateAvailableActionGroups()},onShow:function(){this.primary.show(new e({collection:this.primaryCollection})),this.payments.show(new e({collection:this.paymentsCollection})),this.marketing.show(new e({collection:this.marketingCollection})),this.management.show(new e({collection:this.managementCollection})),this.workflow.show(new e({collection:this.workflowCollection})),this.notifications.show(new e({collection:this.notificationsCollection})),this.misc.show(new e({collection:this.miscCollection}))},getEl:function(){return jQuery(this.el).parent()},filteractionTypes:function(t,n){this.primary.reset().show(new e({collection:t})),this.availableActions=n,this.updateAvailableActionGroups(),this.payments.reset().show(new e({collection:this.paymentsCollection})),this.marketing.reset().show(new e({collection:this.marketingCollection})),this.management.reset().show(new e({collection:this.managementCollection})),this.workflow.reset().show(new e({collection:this.workflowCollection})),this.notifications.reset().show(new e({collection:this.notificationsCollection})),this.misc.reset().show(new e({collection:this.miscCollection}))},removeactionTypeFilter:function(){this.primary.show(new e({collection:this.primaryCollection})),this.availableActions=i.channel("actions").request("get:availableActions"),this.updateAvailableActionGroups(),this.payments.show(new e({collection:this.paymentsCollection})),this.marketing.show(new e({collection:this.marketingCollection})),this.management.show(new e({collection:this.managementCollection})),this.workflow.show(new e({collection:this.workflowCollection})),this.notifications.show(new e({collection:this.notificationsCollection})),this.misc.show(new e({collection:this.miscCollection}))},updateAvailableActionGroups:function(){this.paymentsCollection=new t(this.availableActions.where({group:"payments"}),{slug:"payments",nicename:nfi18n.paymentsActionNicename}),this.marketingCollection=new t(this.availableActions.where({group:"marketing"}),{slug:"marketing",nicename:nfi18n.marketingActionNicename}),this.managementCollection=new t(this.availableActions.where({group:"management"}),{slug:"management",nicename:nfi18n.managementActionNicename}),this.workflowCollection=new t(this.availableActions.where({group:"workflow"}),{slug:"workflow",nicename:nfi18n.workflowActionNicename}),this.notificationsCollection=new t(this.availableActions.where({group:"notifications"}),{slug:"notifications",nicename:nfi18n.notificationsActionNicename}),this.miscCollection=new t(this.availableActions.where({group:"misc"}),{slug:"misc",nicename:nfi18n.miscActionNicename})}})})),n("views/app/drawer/contentViewChangesItem",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-view-changes-item",initialize:function(){this.model.on("change:disabled",this.render,this)},onBeforeDestroy:function(){this.model.off("change:disabled",this.render)},onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)},events:{"click .undoSingle":"undoSingle"},undoSingle:function(e){i.channel("drawer").trigger("click:undoSingle",this.model)}})})),n("views/app/drawer/contentViewChanges",["views/app/drawer/contentViewChangesItem"],(function(e){return Marionette.CollectionView.extend({tagName:"table",className:"nf-changes",childView:e})})),n("views/app/drawer/headerViewChanges",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-header-view-changes",events:{"click .undoChanges":"clickUndoChanges"},clickUndoChanges:function(e){i.channel("drawer").trigger("click:undoChanges")}})})),n("views/app/drawer/settingError",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-edit-setting-error"})})),n("views/app/drawer/itemSetting",["views/app/drawer/mergeTagsContent","views/app/drawer/settingError"],(function(e,t){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-edit-setting-wrap",regions:{error:".nf-setting-error"},initialize:function(e){this.dataModel=e.dataModel,void 0!==i.channel("setting-type-"+this.model.get("type")).request("renderOnChange")&&i.channel("setting-type-"+this.model.get("type")).request("renderOnChange")&&this.dataModel.on("change:"+this.model.get("name"),this.render,this),this.model.on("change:error",this.renderError,this),this.model.on("change:warning",this.renderWarning,this);var t=this.model.get("deps");if(t){void 0===t.settings&&(t.settings=[],_.each(t,(function(e,n){"settings"!==n&&t.settings.push({name:n,value:e})})),t.match="all");for(var n=t.settings.length-1;n>=0;n--){let e=t.settings[n].name;this.dataModel.on("change:"+e,this.render,this)}}var r=this.model.get("remote");if(r){var a,l,s,o;if(void 0!==r.refresh||r.refresh)a=document.createTextNode(this.model.get("label")),(l=document.createElement("span")).classList.add("dashicons","dashicons-update"),(s=document.createElement("a")).classList.add("extra"),s.appendChild(l),(o=document.createElement("span")).appendChild(a),o.appendChild(s),this.model.set("label",o.innerHTML);i.channel("setting").trigger("remote",this.model,this.dataModel,this),this.model.on("rerender",this.render,this)}this.listenTo(i.channel("drawer"),"opened",this.drawerOpened),this.listenTo(i.channel("drawer"),"closed",this.drawerClosed)},onBeforeDestroy:function(){this.dataModel.off("change:"+this.model.get("name"),this.render),this.model.off("change:error",this.renderError);var e=this.model.get("deps");if(e)for(var t=e.settings.length-1;t>=0;t--){let n=e.settings[t].name;this.dataModel.off("change:"+n,this.render)}if(this.model.get("remote")&&this.model.off("rerender",this.render,this),i.channel("setting-"+this.model.get("name")).trigger("destroy:setting",this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("type")).trigger("destroy:setting",this.model,this.dataModel,this),"textbox"==this.model.get("type")){var n=this.model.get("name"),r=this.dataModel.get(n);this.dataModel.set(n,_.unescape(r),{silent:!0})}},onBeforeRender:function(){if("textbox"==this.model.get("type")){var e=this.model.get("name"),t=this.dataModel.get(e);this.dataModel.set(e,_.escape(t),{silent:!0})}i.channel("app").trigger("before:renderSetting",this.model,this.dataModel),i.channel("setting-type-"+this.model.get("type")).trigger("before:renderSetting",this.model,this.dataModel,this),i.channel("setting-"+this.model.get("name")).trigger("before:renderSetting",this.model,this.dataModel,this)},onRender:function(){this.mergeTagsContentView=!1;i.channel("setting-"+this.model.get("name")).trigger("render:setting",this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("type")).trigger("render:setting",this.model,this.dataModel,this),jQuery(this.el).find(".nf-help").each((function(){var e=jQuery(this).next(".nf-help-text");jQuery(this).jBox("Tooltip",{content:e,maxWidth:200,theme:"TooltipBorder",trigger:"click",closeOnClick:!0})})),this.model.get("use_merge_tags")&&i.channel("mergeTags").request("init",this);var e=this.model.get("mask");if(void 0!==e){var t=jQuery(this.$el).find("input");switch(jQuery(t).attr("contentEditable",!0),e.type){case"numeric":t.autoNumeric({aSep:thousandsSeparator,aDec:decimalPoint});break;case"currency":var n=i.channel("settings").request("get:setting","currency"),r=nfAdmin.currencySymbols[n]||"";t.autoNumeric({aSign:jQuery("<div />").html(r).text(),aSep:thousandsSeparator,aDec:decimalPoint});break;case"custom":e.format&&t.mask(e.format);break;default:console.log('Notice: Mask type of "'+e.type+'" is not supported.')}}this.renderError()},onShow:function(){i.channel("setting-"+this.model.get("name")).trigger("show:setting",this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("type")).trigger("show:setting",this.model,this.dataModel,this)},onAttach:function(){i.channel("setting-"+this.model.get("name")).trigger("attach:setting",this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("type")).trigger("attach:setting",this.model,this.dataModel,this)},renderError:function(){this.model.get("error")?(jQuery(this.el).find(".nf-setting").addClass("nf-error"),this.error.show(new t({model:this.model}))):(jQuery(this.el).find(".nf-setting").removeClass("nf-error"),this.error.empty())},renderWarning:function(){this.model.get("warning")?(jQuery(this.el).find(".nf-setting").addClass("nf-warning"),this.error.show(new t({model:this.model}))):(jQuery(this.el).find(".nf-setting").removeClass("nf-warning"),this.error.empty())},templateHelpers:function(){var e=this;return{renderVisible:function(){if(!nfAdmin.devMode){if("Action"==e.dataModel.get("objectType")&&"email"==e.dataModel.get("type")){if("cc"==this.name)return'style="display:none;"';if("bcc"==this.name)return'style="display:none;"';if("from_name"==this.name)return'style="display:none;"';if("from_address"==this.name)return'style="display:none;"';if("email_format"==this.name)return'style="display:none;"'}if("Action"==e.dataModel.get("objectType")&&"save"==e.dataModel.get("type")&&"submitter_email"==this.name)return'style="display:none;"';if("label_pos"==this.name)return'style="display:none;"';if("input_limit"==this.name)return'style="display:none;"';if("input_limit_type"==this.name)return'style="display:none;"';if("input_limit_msg"==this.name)return'style="display:none;"';if("help_text"==this.name)return'style="display:none;"';if("disable_input"==this.name)return'style="display:none;"';if("disable_browser_autocomplete"==this.name)return'style="display:none;"';if("mask"==this.name)return'style="display:none;"';if("custom_mask"==this.name)return'style="display:none;"';if("custom_name_attribute"==this.name)return'style="display:none;"';if("personally_identifiable"==this.name)return'style="display:none;"';if("key"==this.name)return'style="display:none;"';if("admin_label"==this.name)return'style="display:none;"';if("num_sort"==this.name)return'style="display:none;"';if("user_state"==this.name)return'style="display:none;"';if("checkbox"==e.dataModel.get("type")){if("checked_value"==this.name)return'style="display:none;"';if("unchecked_value"==this.name)return'style="display:none;"';if("checked_calc_value"==this.name)return'style="display:none;"';if("unchecked_calc_value"==this.name)return'style="display:none;"'}if("starrating"==e.dataModel.get("type")&&"default"==this.name)return'style="display:none;"';if("listmultiselect"==e.dataModel.get("type")&&"box_size"==this.name)return'style="display:none;"';if("date"==e.dataModel.get("type")){if("year_range_start"==this.name)return'style="display:none;"';if("year_range_end"==this.name)return'style="display:none;"'}}return i.channel("settings").request("check:deps",this,e)},renderSetting:function(){return void 0!==e.dataModel.get(this.name)?this.value=e.dataModel.get(this.name):void 0===this.value&&(this.value=""),i.channel("app").request("get:template","#tmpl-nf-edit-setting-"+this.type)(this)},renderLabelClasses:function(){var e="";return this.use_merge_tags&&(e+=" has-merge-tags"),"rte"==this.type&&(e+=" rte"),e},renderClasses:function(){var e="nf-setting ";return void 0!==this.width?e+="nf-"+this.width:e+=" nf-one-half",this.error&&(e+=" nf-error"),e},renderTooltip:function(){return this.help?((e=document.createElement("div")).innerHTML=this.help,(t=document.createElement("div")).classList.add("nf-help-text"),t.appendChild(e),(n=document.createElement("span")).classList.add("dashicons","dashicons-admin-comments"),(i=document.createElement("a")).classList.add("nf-help"),i.setAttribute("href","#"),i.setAttribute("tabindex","-1"),i.appendChild(n),(r=document.createElement("span")).appendChild(i),r.appendChild(t),r.innerHTML):"";var e,t,n,i,r},renderEmailFieldOptions:function(){var e=i.channel("fields").request("get:collection");initialOption=document.createElement("option"),initialOption.value="",initialOption.label="--",initialOption.innerHTML="--";var t=document.createElement("select");t.classList.add("setting"),t.setAttribute("data-id","my_seledt"),t.appendChild(initialOption);var n=this;return e.each((function(e){if("email"!=e.get("type"))return"";var i=document.createElement("option");i.value=e.get("key"),i.innerHTML=e.get("label"),i.label=e.get("label"),n.value===e.get("key")&&i.setAttribute("selected","selected"),t.appendChild(i),1})),label=document.createElement("label"),label.classList.add("nf-select"),label.appendChild(t),emptyContainer=document.createElement("div"),label.appendChild(emptyContainer),label.innerHTML},renderMergeTags:function(){return this.use_merge_tags&&!this.hide_merge_tags?'<span class="dashicons dashicons-list-view merge-tags"></span>':""},renderMinMax:function(){var e="";return void 0!==this.min_val&&null!=this.min_val&&jQuery.isNumeric(this.min_val)&&(e=e+"min='"+this.min_val+"'"),void 0!==this.max_val&&""!=this.max_val&&jQuery.isNumeric(this.max_val)&&(e=e+" max='"+this.max_val+"'"),void 0!==this.step&&""!=this.step&&jQuery.isNumeric(this.step)&&(e=e+" step='"+this.step+"'"),e},renderMinMaxHelper:function(){var e="";return void 0!==this.min_val&&null!=this.min_val&&jQuery.isNumeric(this.min_val)&&(0==e.length&&(e="("),e=e+nfi18n.minVal+": "+this.min_val),void 0!==this.max_val&&""!=this.max_val&&jQuery.isNumeric(this.max_val)&&(0==e.length?e="(":e+=", ",e=e+nfi18n.maxVal+": "+this.max_val),0<e.length&&(e+=")"),e}}},events:{"change .setting":"changeSetting","keyup .setting":"keyUpSetting","click .setting":"clickSetting","click .extra":"clickExtra"},changeSetting:function(e){if("textbox"==this.model.get("type")&&this.model.get("name").endsWith("_class")){const t=/^[a-zA-Z 0-9-_]+$/;-1===e.target.value.search(t)&&""!==e.target.value?this.model.set("error","HTML classes only allow - _ and alphanumeric characters."):0!==e.target.value.search(t)&&""!==e.target.value||this.model.unset("error")}else if("textbox"==this.model.get("type")&&"title"===this.model.get("name")){const t=/[/"<>`]/;if(-1!==e.target.value.search(t)&&""!==e.target.value){const n=e.target.value.search(t),i=e.target.value.charAt(n);this.model.set("error","The forbidden "+i+' character was found. Title must not contain / " < > ` characters.')}else-1!==e.target.value.search(t)&&""!==e.target.value||this.model.unset("error")}i.channel("app").trigger("change:setting",e,this.model,this.dataModel)},keyUpSetting:function(e){i.channel("app").trigger("keyup:setting",e,this.model,this.dataModel),i.channel("setting-"+this.model.get("name")).trigger("keyup:setting",e,this.model,this.dataModel)},clickSetting:function(e){i.channel("app").trigger("click:setting",e,this.model,this.dataModel),i.channel("setting-type-"+this.model.get("type")).trigger("click:setting",e,this.model,this.dataModel,this)},clickExtra:function(e){i.channel("setting-type-"+this.model.get("type")).trigger("click:extra",e,this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("name")).trigger("click:extra",e,this.model,this.dataModel,this),i.channel("setting-name-"+this.model.get("name")).trigger("click:extra",e,this.model,this.dataModel,this)},drawerOpened:function(){i.channel("setting-type-"+this.model.get("type")).trigger("drawer:opened",this.model,this.dataModel,this)},drawerClosed:function(){i.channel("setting-type-"+this.model.get("type")).trigger("drawer:closed",this.model,this.dataModel,this)}})})),n("views/app/drawer/contentPublicLink",["views/app/drawer/itemSetting"],(function(e){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-public-link",regions:{embedForm:".embed-form",enablePublicLink:".enable-public-link",copyPublicLink:".copy-public-link"},onRender:function(){var t=Backbone.Radio.channel("app").request("get:formModel"),n=i.channel("settings").request("get:settings"),r=i.channel("settings").request("get:settingModel","allow_public_link");this.enablePublicLink.show(new e({model:r,dataModel:n}));var a="[ninja_form id='{FORM_ID}']".replace("{FORM_ID}",t.get("id"));n.set("embed_form",a);var l=i.channel("settings").request("get:settingModel","embed_form");this.embedForm.show(new e({model:l,dataModel:n}));var s=n.get("public_link_key");s||(s=i.channel("app").request("generate:publicLinkKey"));var o=nfAdmin.publicLinkStructure.replace("[FORM_ID]",s);n.set("public_link",o);var c=i.channel("settings").request("get:settingModel","public_link");this.copyPublicLink.show(new e({model:c,dataModel:n}))},events:{"click #embed_form + .js-click-copytext":"copyFormEmbedHandler","click #public_link + div > .js-click-copytext":"copyPublicLinkHandler","click #public_link + div > .js-click-resettext":"confirmResetPublicLinkHandler","click #public_link + div > .js-click-confirm":"resetPublicLinkHandler","click #public_link + div > .js-click-cancel":"cancelResetPublicLinkHandler"},copyFormEmbedHandler:function(e){document.getElementById("embed_form").select(),document.execCommand("copy"),e.target.innerHTML="Copied!",setTimeout((function(){e.target.innerHTML="Copy"}),1500)},copyPublicLinkHandler:function(e){document.getElementById("public_link").select(),document.execCommand("copy"),e.target.innerHTML="Copied!",setTimeout((function(){e.target.innerHTML="Copy"}),1500)},confirmResetPublicLinkHandler:function(e){_.each(e.target.parentNode.children,(function(e){e.classList.contains("js-click-copytext")||e.classList.contains("js-click-resettext")?e.style.display="none":e.style.display="inline-block"}))},resetPublicLinkHandler:function(e){var t=i.channel("app").request("generate:publicLinkKey"),n=nfAdmin.publicLinkStructure.replace("[FORM_ID]",t);i.channel("settings").request("get:settings").set("public_link",n),this.cancelResetPublicLinkHandler(e),_.each(e.target.parentNode.children,(function(e){e.classList.contains("js-click-resettext")?(e.style.display="inline-block",e.classList.add("primary"),e.classList.remove("secondary"),e.innerHTML="Link Reset!",setTimeout((function(){e.classList.add("secondary"),e.classList.remove("primary"),e.innerHTML="Reset"}),1500)):e.style.display="none",e.classList.contains("js-click-copytext")&&setTimeout((function(){e.style.display="inline-block"}),1500)})),jQuery("#public_link").val(n)},cancelResetPublicLinkHandler:function(e){_.each(e.target.parentNode.children,(function(e){e.classList.contains("js-click-cancel")||e.classList.contains("js-click-confirm")?e.style.display="none":e.style.display="inline-block"}))}})})),n("views/app/drawer/headerPublicLink",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-header-public-link"})})),n("views/app/drawer/contentNewForm",["views/app/drawer/itemSetting"],(function(e){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-new-form",regions:{formName:".new-form-name",formSubmit:".new-form-submit"},onRender:function(){var t=i.channel("settings").request("get:settingModel","title"),n=i.channel("settings").request("get:settingModel","add_submit"),r=i.channel("settings").request("get:settings");this.formName.show(new e({model:t,dataModel:r})),void 0===i.channel("fields").request("get:collection").findWhere({type:"submit"})?this.formSubmit.show(new e({model:n,dataModel:r})):r.set("add_submit",0)},events:{"click .publish":"clickPublish"},clickPublish:function(e){i.channel("app").trigger("click:confirmPublish",e)}})})),n("views/app/drawer/headerNewForm",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-header-new-form"})})),n("controllers/app/drawerConfig",["models/app/drawerCollection","views/fields/drawer/addField","views/app/drawer/editSettings","views/app/drawer/headerEditSettings","views/actions/drawer/addAction","views/app/drawer/contentViewChanges","views/app/drawer/headerViewChanges","views/app/drawer/contentPublicLink","views/app/drawer/headerPublicLink","views/app/drawer/contentNewForm","views/app/drawer/headerNewForm"],(function(e,t,n,r,a,l,s,o,c,d,h,u){return Marionette.Object.extend({initialize:function(){this.collection=new e([{id:"addField",getContentView:function(e){return new t(e)}},{id:"addAction",getContentView:function(e){return new a(e)}},{id:"editSettings",getHeaderView:function(e){if(void 0!==e.typeModel)var t=i.channel(e.typeModel.get("id")).request("get:drawerHeaderView")||r;else t=r;return new t(e)},getContentView:function(e){return new n(e)}},{id:"viewChanges",getHeaderView:function(e){return new s(e)},getContentView:function(e){return new l(e)}},{id:"publicLink",getHeaderView:function(e){return new c(e)},getContentView:function(e){return new o(e)}},{id:"newForm",getHeaderView:function(e){return new h(e)},getContentView:function(e){return new d(e)}}]),i.channel("app").reply("get:drawerCollection",this.getDrawerCollection,this),i.channel("app").reply("get:drawer",this.getDrawer,this)},getDrawerCollection:function(){return this.collection},getDrawer:function(e){return this.collection.get(e)}})})),n("views/app/drawer/defaultSettingsTitle",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-edit-settings-title-default",templateHelpers:function(){return{renderTypeNicename:function(){var e=i.channel("app").request("get:currentDomain").get("id"),t=i.channel(e).request("get:type",this.type);return void 0!==t?t.get("nicename"):""}}}})})),n("views/app/empty",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-empty"})})),n("models/app/domainModel",["views/app/drawer/defaultSettingsTitle","views/app/empty"],(function(e,t){return Backbone.Model.extend({defaults:{dashicons:"",classes:"",active:!1,url:"",hotkeys:!1,disabled:!1,getSettingsTitleView:function(t){return new e(t)},getDefaultSettingsTitleView:function(t){return new e(t)},getGutterLeftView:function(e){return new t},getGutterRightView:function(e){return new t}}})})),n("models/app/domainCollection",["models/app/domainModel"],(function(e){return Backbone.Collection.extend({model:e})})),n("views/fields/subHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-sub-header-fields"})})),n("views/fields/mainContentFieldCollection",[],(function(){return Marionette.CollectionView.extend({tagName:"div",reorderOnSort:!0,getChildView:function(){return i.channel("views").request("get:fieldItem")},getEmptyView:function(){return i.channel("views").request("get:mainContentEmpty")},initialize:function(){i.channel("fields").reply("get:sortableEl",this.getSortableEl,this),i.channel("fields").reply("init:sortable",this.initSortable,this),i.channel("fields").reply("destroy:sortable",this.destroySortable,this)},onRender:function(){if(this.collection.models.length>0){jQuery(this.el).addClass("nf-field-type-droppable").addClass("nf-fields-sortable");this.initSortable()}i.channel("app").trigger("render:fieldsSortable",this)},getSortableEl:function(){return this.el},initSortable:function(){if(i.channel("app").request("is:mobile"));else;jQuery(this.el).sortable({containment:"parent",helper:"clone",cancel:".nf-item-controls",placeholder:"nf-fields-sortable-placeholder",opacity:.95,grid:[5,5],appendTo:"#nf-main",scrollSensitivity:10,receive:function(e,t){t.item.dropping||jQuery(t.item).hasClass("nf-over-repeater")||i.channel("app").request("receive:fieldsSortable",t)},over:function(e,t){t.item.dropping||i.channel("app").request("over:fieldsSortable",t)},out:function(e,t){t.item.dropping||i.channel("app").request("out:fieldsSortable",t)},start:function(e,t){t.item.dropping||i.channel("app").request("start:fieldsSortable",t)},update:function(e,t){t.item.dropping||i.channel("app").request("update:fieldsSortable",t,this)},stop:function(e,t){t.item.dropping||i.channel("app").request("stop:fieldsSortable",t)}})},destroySortable:function(){jQuery(this.el).sortable("destroy")},onAddChild:function(e){i.channel("fields").request("get:adding")&&(e.$el.hide().show("clip"),i.channel("fields").request("set:adding",!1))}})})),n("views/fields/drawer/addSavedField",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-add-saved-field",initialize:function(){this.model.on("change:addSavedLoading",this.renderAddButton,this)},onRender:function(){this.renderAddButton()},renderAddButton:function(){if(this.model.get("addSavedLoading"))var e=i.channel("app").request("get:template","#tmpl-nf-add-saved-field-loading");else e=i.channel("app").request("get:template","#tmpl-nf-add-saved-field-button");jQuery(this.el).find(".add-button").html(e(this))},onBeforeDestroy:function(){this.model.off("change:addSavedLoading",this.render)},events:{"click .nf-button":"clickAddSavedField"},clickAddSavedField:function(e){i.channel("drawer").trigger("click:addSavedField",e,this.model)}})})),n("views/fields/drawer/settingsTitle",["views/fields/drawer/addSavedField"],(function(e){return Marionette.LayoutView.extend({tagName:"div",template:"#tmpl-nf-drawer-content-edit-settings-title-fields",initialize:function(){this.model.on("change:saved",this.render,this),this.model.on("change:label",this.renderjBoxContent,this)},regions:{addSaved:".nf-add-saved-field"},onBeforeDestroy:function(){this.model.off("change:saved",this.render),this.addSavedjBox.destroy(),this.model.unset("jBox",{silent:!0})},onRender:function(){this.renderjBoxContent();var e=this;this.addSavedjBox=new jBox("Tooltip",{trigger:"click",title:"Add to Favorite Fields",position:{x:"left",y:"center"},outside:"x",closeOnClick:"body",onCreated:function(){this.setContent(jQuery(e.el).find(".nf-add-saved-field"))}}),this.addSavedjBox.attach(jQuery(this.el).find(".dashicons")),this.model.set("jBox",this.addSavedjBox,{silent:!0})},renderjBoxContent:function(){this.addSaved&&this.addSaved.show(new e({model:this.model}))},templateHelpers:function(){return{renderTypeNicename:function(){var e=i.channel("app").request("get:currentDomain").get("id"),t=i.channel(e).request("get:type",this.type),n=t.get("nicename");this.saved&&(n+=" - "+i.channel(e).request("get:type",t.get("type")).get("nicename"));return n},renderSavedStar:function(){if(this.saved)var e="filled";else e="empty";return'<span class="dashicons dashicons-star-'+e+'"></span>'}}}})})),n("views/actions/mainHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-main-header-actions",initialize:function(){var e=i.channel("actions").request("get:collection");this.listenTo(e,"add",this.render),this.listenTo(e,"remove",this.render)},onRender:function(){0==i.channel("actions").request("get:collection").models.length?jQuery(this.el).hide():jQuery(this.el).show()}})})),n("views/actions/subHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-sub-header-actions"})})),n("views/app/itemControls",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-item-controls",initialize:function(){},onRender:function(){this.currentDomain=i.channel("app").request("get:currentDomain")},events:{"mouseover .nf-item-control":"mouseoverItemControl","click .nf-edit-settings":"clickEdit","singletap .nf-item-control":"singleTapEdit","click .nf-item-delete":"clickDelete","click .nf-item-duplicate":"clickDuplicateField"},clickEdit:function(e){i.channel("app").request("is:mobile")||i.channel("app").trigger("click:edit",e,this.model)},singleTapEdit:function(e){i.channel("app").trigger("click:edit",e,this.model)},clickDelete:function(e){i.channel("app").trigger("click:delete",e,this.model)},clickDuplicateField:function(e){i.channel("app").trigger("click:duplicate",e,this.model)},mouseoverItemControl:function(e){i.channel("app").trigger("mouseover:itemControl",e,this.model)}})})),n("views/actions/actionItem",["views/app/itemControls"],(function(e){return Marionette.LayoutView.extend({tagName:"tr",template:"#tmpl-nf-action-item",regions:{itemControls:".nf-item-controls"},initialize:function(){this.template=i.channel("actions").request("get:actionItemTemplate")||this.template,this.model.on("change:label",this.render,this),this.model.on("change:editActive",this.render,this),this.model.on("change:active",this.maybeDeactivate,this)},onBeforeDestroy:function(){this.model.off("change:label",this.render),this.model.off("change:editActive",this.render),this.model.off("change:active",this.maybeDeactivate)},onRender:function(){this.model.get("editActive")?jQuery(this.el).addClass("active"):jQuery(this.el).removeClass("active"),this.maybeDeactivate(),this.itemControls.show(new e({model:this.model}))},maybeDeactivate:function(){0==this.model.get("active")?jQuery(this.el).addClass("deactivated"):jQuery(this.el).removeClass("deactivated")},events:{"change input":"changeToggle",click:"maybeClickEdit"},maybeClickEdit:function(e){"TR"==jQuery(e.target).parent().prop("tagName")&&i.channel("app").trigger("click:edit",e,this.model)},changeToggle:function(e){var t=jQuery(e.target).data("setting"),n=i.channel("actions").request("get:settingModel",t);i.channel("app").request("change:setting",e,n,this.model),i.channel("app").request("update:db")},templateHelpers:function(){return{renderToggle:function(e){this.settingName=e||"active";var t=this.label;this.label="",this.value=this[this.settingName],this.name=this.id+"-"+this.settingName;var n=i.channel("app").request("get:template","#tmpl-nf-edit-setting-toggle");return n=n(this),this.label=t,n},renderTypeNicename:function(){var e=i.channel("actions").request("get:type",this.type);if(void 0!==e)return e.get("nicename")},renderTooltip:function(){return""},renderMergeTags:function(){return this.use_merge_tags?'<span class="dashicons dashicons-list-view merge-tags"></span>':""}}}})})),n("views/actions/mainContentEmpty",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-main-content-actions-empty",onBeforeDestroy:function(){jQuery(this.el).parent().parent().removeClass("nf-actions-empty")},onRender:function(){this.$el=this.$el.children(),this.$el.unwrap(),this.setElement(this.$el)},onShow:function(){jQuery(this.el).parent().parent().addClass("nf-actions-empty")}})})),n("views/actions/mainContent",["views/actions/actionItem","views/actions/mainContentEmpty"],(function(e,t){return Marionette.CompositeView.extend({template:"#tmpl-nf-action-table",childView:e,emptyView:t,initialize:function(){this.template=i.channel("actions").request("get:mainContentTemplate")||this.template},onRender:function(){jQuery(this.el).droppable({accept:".nf-action-type-draggable",activeClass:"nf-droppable-active",hoverClass:"nf-droppable-hover",drop:function(e,t){i.channel("app").request("drop:actionType",e,t)}})},attachHtml:function(e,t){void 0!==i.channel("actions").request("get:type",t.model.get("type"))&&jQuery(e.el).find("tbody").append(t.el)}})})),n("views/advanced/mainHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-main-header-settings"})})),n("views/advanced/subHeader",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-sub-header-settings"})})),n("views/advanced/settingItem",[],(function(){return Marionette.ItemView.extend({tagName:"div",template:"#tmpl-nf-form-setting-type",onBeforeDestroy:function(){this.model.off("change:editActive",this.updateActiveClass)},initialize:function(){this.model.on("change:editActive",this.updateActiveClass,this)},events:{click:"clickEdit"},clickEdit:function(e){i.channel("settings").trigger("click:edit",e,this.model)},templateHelpers:function(){return{renderClasses:function(){var e="nf-setting-wrap "+this.id;return this.editActive&&(e+=" active"),e}}},updateActiveClass:function(){this.model.get("editActive")?jQuery(this.el).find(".nf-setting-wrap").addClass("active"):jQuery(this.el).find(".nf-setting-wrap").removeClass("active")}})})),n("views/advanced/mainContent",["views/advanced/settingItem"],(function(e){return Marionette.CompositeView.extend({childView:e,template:"#tmpl-nf-advanced-main-content",attachHtml:function(e,t){jQuery(e.el).find(".child-view-container").append(t.el)}})})),n("models/fields/fieldModel",[],(function(){return Backbone.Model.extend({defaults:{objectType:"Field",objectDomain:"fields",editActive:!1,order:999,idAttribute:"id"},initialize:function(){var e=this.get("type");if(void 0!==e){this.on("change",this.changeSetting,this);var t=i.channel("fields").request("get:type",this.get("type")),n=t.get("parentType");_.each(t.get("settingDefaults"),(function(e,t){void 0===this.get(t)&&this.set(t,e,{silent:!0})}),this),"saved"==t.get("section")&&this.set("type",t.get("type")),"listimage"===e&&(this.get=this.listimageGet,this.set=this.listimageSet),i.channel("fields").trigger("init:fieldModel",this),i.channel("fields-"+n).trigger("init:fieldModel",this),i.channel("fields-"+this.get("type")).trigger("init:fieldModel",this),this.listenTo(i.channel("app"),"fire:updateFieldKey",this.updateFieldKey)}},listimageGet:function(e){return"options"===e&&(e="image_options"),Backbone.Model.prototype.get.call(this,e)},listimageSet:function(e,t){return"options"===e&&(e="image_options"),Backbone.Model.prototype.set.call(this,e,t)},changeSetting:function(e,t){i.channel("fieldSetting-"+_.keys(e.changedAttributes())[0]).trigger("update:setting",this,t.settingModel),i.channel("fields").trigger("update:setting",this,t.settingModel),i.channel("app").trigger("update:setting",this,t.settingModel)},updateFieldKey:function(e,t){i.channel("app").trigger("replace:fieldKey",this,e,t)},formatLabel:function(){var e=this.get("admin_label");return""==e&&(e=this.get("label")),e}})})),n("models/fields/fieldCollection",["models/fields/fieldModel"],(function(e){var t=Backbone.Collection.extend({model:e,comparator:function(e){return parseInt(e.get("order"))},tmpNum:1,initialize:function(){this.on("add",this.addField,this),this.on("remove",this.removeField,this),this.listenTo(this,"add:field",this.addNewField),this.listenTo(this,"append:field",this.appendNewField),this.listenTo(this,"remove:field",this.removeFieldResponse),this.newIDs=[]},addField:function(e){this.newIDs.push(e.get("id"))},removeField:function(e){this.removedIDs=this.removedIDs||{},this.removedIDs[e.get("id")]=e.get("id")},addNewField:function(e){this.add(e)},appendNewField:function(e){if(0==this.length)var t=0;else t=this.at(this.length-1).get("order")+1;e.set("order",t,{silent:!0}),this.add(e)},removeFieldResponse:function(e){this.remove(e)},fieldExists:function(e){return-1!=this.indexOf(e)}});return t})),n("controllers/app/domainConfig",["models/app/domainCollection","views/fields/subHeader","views/fields/mainContentFieldCollection","views/fields/drawer/settingsTitle","views/actions/mainHeader","views/actions/subHeader","views/actions/mainContent","views/advanced/mainHeader","views/advanced/subHeader","views/advanced/mainContent","views/app/empty","models/fields/fieldCollection"],(function(e,t,n,r,a,l,s,o,c,d,h,u){return Marionette.Object.extend({initialize:function(){i.channel("formContent").request("add:viewFilter",this.defaultFormContentView,10,this),i.channel("formContent").request("add:loadFilter",this.defaultFormContentLoad,10,this),i.channel("formContentGutters").request("add:leftFilter",this.defaultFormContentGutterView,10,this),i.channel("formContentGutters").request("add:rightFilter",this.defaultFormContentGutterView,10,this),this.collection=new e([{id:"fields",nicename:nfi18n.domainFormFields,hotkeys:{Esc:"close:drawer","Ctrl+Shift+n":"add:newField","Ctrl+Shift+a":"changeDomain:actions","Ctrl+Shift+s":"changeDomain:settings","Alt+Ctrl+t":"open:mergeTags",up:"up:mergeTags",down:"down:mergeTags","Shift+return":"return:mergeTags"},mobileDashicon:"dashicons-menu",getSubHeaderView:function(){return new t},getMainContentView:function(e){var t=i.channel("settings").request("get:setting","formContentData");t||(t=i.channel("settings").request("get:setting","fieldContentsData"));var n=i.channel("formContent").request("get:loadFilters"),r=_.without(n,void 0);t=(l=_.first(r))(t,i.channel("app").request("get:formModel"),!0);var a=i.channel("formContent").request("get:viewFilters"),l=(r=_.without(a,void 0),_.first(r));return formContentView=l(),i.channel("settings").request("update:setting","formContentData",t,!0),new formContentView({collection:t})},getSettingsTitleView:function(e){return"fields"==e.model.get("objectDomain")?new r(e):this.get("getDefaultSettingsTitleView").call(this,e)},getGutterLeftView:function(e){var t=i.channel("formContentGutters").request("get:leftFilters"),n=_.without(t,void 0),r=_.first(n);return gutterView=r(),new gutterView},getGutterRightView:function(){var e=i.channel("formContentGutters").request("get:rightFilters"),t=_.without(e,void 0),n=_.first(t);return gutterView=n(),new gutterView}},{id:"actions",nicename:nfi18n.domainActions,hotkeys:{Esc:"close:drawer","Ctrl+Shift+n":"add:newAction","Ctrl+Shift+f":"changeDomain:fields","Ctrl+Shift+s":"changeDomain:settings","Alt+Ctrl+t":"open:mergeTags",up:"up:mergeTags",down:"down:mergeTags","Shift+return":"return:mergeTags"},mobileDashicon:"dashicons-external",getSubHeaderView:function(){return new l},getMainContentView:function(){var e=i.channel("actions").request("get:collection");return new s({collection:e})}},{id:"settings",nicename:nfi18n.domainAdvanced,hotkeys:{Esc:"close:drawer","Ctrl+Shift+f":"changeDomain:fields","Ctrl+Shift+a":"changeDomain:actions","Alt+Ctrl+t":"open:mergeTags",up:"up:mergeTags",down:"down:mergeTags","Shift+return":"return:mergeTags"},mobileDashicon:"dashicons-admin-generic",getSubHeaderView:function(){return new c},getMainContentView:function(){var e=i.channel("settings").request("get:typeCollection");return new d({collection:e})}},{id:"preview",nicename:"Preview Form",classes:"preview",dashicons:"dashicons-visibility",mobileDashicon:"dashicons-visibility",url:nfAdmin.previewurl}]),i.channel("app").trigger("init:domainCollection",this.collection),i.channel("app").reply("get:domainCollection",this.getDomainCollection,this),i.channel("app").reply("get:domainModel",this.getDomainModel,this)},getDomainCollection:function(){return this.collection},getDomainModel:function(e){return this.collection.get(e)},defaultFormContentView:function(e){return n},defaultFormContentLoad:function(e){var t=i.channel("fields").request("get:collection"),n=i.channel("formContent").request("get:loadFilters");if(1==_.without(n,void 0).length||void 0===e||!0==e instanceof Backbone.Collection)return t;var r=_.map(e,(function(e){return t.findWhere({key:e})}),this);return new u(r)},defaultFormContentGutterView:function(e){return h}})})),n("models/app/appModel",[],(function(){return Backbone.Model.extend({defaults:{loading:!1},initialize:function(){this.on("change:clean",this.changeStatus,this)},changeStatus:function(){i.channel("app").trigger("change:clean",this.get("clean"))}})})),n("controllers/app/data",["models/app/appModel"],(function(e){return Marionette.Object.extend({initialize:function(){var t=i.channel("app").request("get:domainCollection");this.model=new e({currentDrawer:!1,currentDomain:t.get("fields"),clean:!0});var n=1==nfAdmin.mobile;this.model.set("mobile",n),i.channel("app").reply("is:mobile",this.isMobile,this),i.channel("app").reply("get:data",this.getData,this),i.channel("app").reply("get:setting",this.getSetting,this),i.channel("app").reply("get:currentDomain",this.getCurrentDomain,this),i.channel("app").reply("get:currentDrawer",this.getCurrentDrawer,this),i.channel("drawer").reply("get:current",this.getCurrentDrawer,this),i.channel("app").reply("update:currentDomain",this.updateCurrentDomain,this),i.channel("app").reply("update:currentDrawer",this.updateCurrentDrawer,this),i.channel("app").reply("update:setting",this.updateSetting,this),i.channel("settings").reply("check:deps",this.checkDeps,this)},checkDeps:function(e,t){if(!e.deps)return"";let n=e.deps.settings,i=e.deps.match,r=!1;for(var a=n.length-1;a>=0;a--){let e=n[a].name,l=n[a].value;if(t.dataModel.get(e)==l){if("any"==i){r=!1;break}}else r=!0}return r?'style="display:none;"':""},updateCurrentDomain:function(e){this.updateSetting("currentDomain",e)},updateSetting:function(e,t){return this.model.set(e,t),!0},getSetting:function(e){return this.model.get(e)},getData:function(){return this.model},getCurrentDomain:function(){return this.model.get("currentDomain")},updateCurrentDrawer:function(e){return this.updateSetting("currentDrawer",e),!0},getCurrentDrawer:function(){var e=this.model.get("currentDrawer");return i.channel("app").request("get:drawer",e)},isMobile:function(){return this.model.get("mobile")}})})),n("controllers/app/drawerToggleSettingGroup",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("drawer"),"click:toggleSettingGroup",this.toggleSettingGroup)},toggleSettingGroup:function(e,t){if(t.get("display")){var n=!1;_.each(t.get("settings").models,(function(e){e.get("error")&&(n=!0)})),n||t.set("display",!1)}else t.set("display",!0)}})})),n("controllers/app/updateDB",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("drawer"),"closed",this.updateDB),i.channel("app").reply("update:db",this.updateDB,this),i.channel("formContent").request("add:saveFilter",this.defaultSaveFilter,10,this)},updateDB:function(e){if(i.channel("app").request("get:setting","clean"))return!1;if("preview"==(e=e||"preview"))var t="nf_preview_update";else if("publish"==e)t="nf_save_form";var n=i.channel("app").request("get:formModel");_.each(n.get("fields").models,(function(e,t){e.unset("jBox",{silent:!0})}));var r=i.channel("settings").request("get:setting","formContentData");r||(r=i.channel("settings").request("get:setting","fieldContentsData"));var a=i.channel("formContent").request("get:saveFilters"),l=_.without(a,void 0);if(r=_.first(l)(r),"publish"==e&&n.get("show_publish_options")){i.channel("app").request("open:drawer","newForm");var s=i.channel("app").request("get:builderEl");return jQuery(s).addClass("disable-main"),!1}var o=i.channel("app").request("get:formModel"),c=JSON.parse(JSON.stringify(o));c.settings.formContentData=r;var d=o.get("fields").removedIDs;_.each(c.fields,(function(e){var t=e.id;delete e.id,delete e.parent_id;var n={};for(var i in e)e.hasOwnProperty(i)&&(null!==e[i]&&(n[i]=e[i]),delete e[i]);for(var r in n)null===n[r]&&delete n[r];e.settings=n,e.id=t})),c.deleted_fields=d;d=o.get("actions").removedIDs;for(var h in _.each(c.actions,(function(e){var t=e.id;delete e.id,delete e.parent_id;var n={};for(var i in e)e.hasOwnProperty(i)&&(null!==e[i]&&(n[i]=e[i]),delete e[i]);e.settings=n,e.id=t})),c.settings)null===c.settings[h]&&delete c.settings[h];if(c.deleted_actions=d,c=JSON.stringify(c),i.channel("app").trigger("before:updateDB",c),"publish"==e&&(i.channel("app").request("update:setting","loading",!0),i.channel("app").trigger("change:loading"),i.channel("app").request("is:mobile")&&i.channel("notices").request("add","publishing","Your Changes Are Being Published",{autoClose:!1})),"nf_save_form"===t){var u=1e5,p=[];if(u<c.length&&(p=c.match(new RegExp(".{1,100000}","g"))),1<p.length)this.saveChunkedForm(p,0,"nf_batch_process",e,n.get("id"),!0);else{var g=this,f=null;jQuery.post(ajaxurl,{action:t,form:c,security:nfAdmin.ajaxNonce},(function(t){f=t,g.handleFinalResponse(f,e)})).fail((function(t,n,i){g.handleFinalFailure(t,n,i,e)}))}}else if("nf_preview_update"===t){g=this,f=null;jQuery.post(ajaxurl,{action:t,form:c,security:nfAdmin.ajaxNonce},(function(t){f=t,g.handleFinalResponse(f,e)})).fail((function(t,n,i){g.handleFinalFailure(t,n,i,e)}))}},saveChunkedForm:function(e,t,n,i,r,a){var l=e.length,s={action:n,batch_type:"chunked_publish",data:{new_publish:a,chunk_total:l,chunk_current:t,chunk:e[t],form_id:r},security:nfAdmin.batchNonce},o=this;jQuery.post(ajaxurl,s).then((function(a){try{var l=JSON.parse(a);"success"!==l.last_request||l.batch_complete?l.batch_complete&&o.handleFinalResponse(a,i):(console.log("Chunk "+t+" processed"),o.saveChunkedForm(e,l.requesting,n,i,r,!1))}catch(e){console.log("There was an error in parsing the response"),console.log(e)}})).fail((function(e,t,n){console.log("There was an error sending form data"),console.log(n),o.handleFinalFailure(e,t,n,i)}))},handleFinalResponse:function(e,t){try{(e=JSON.parse(e)).action=t,i.channel("app").trigger("response:updateDB",e),i.channel("app").request("is:mobile")}catch(e){console.log("Something went wrong!"),console.log(e)}},handleFinalFailure:function(e,t,n,i){"preview"!=i?alert(e.status+" "+n+"\r\nAn error on the server caused your form not to publish.\r\nPlease contact Ninja Forms Support with your PHP Error Logs.\r\nhttps://ninjaforms.com/contact"):console.log(n)},defaultSaveFilter:function(e){return e.pluck("key")}})})),n("models/app/formModel",[],(function(){return Backbone.Model.extend({initialize:function(){jQuery.isNumeric(this.get("id"))?this.set("show_publish_options",!1,{silent:!0}):this.set("show_publish_options",!0,{silent:!0})}})})),n("controllers/app/formData",["models/app/formModel"],(function(e){return Marionette.Object.extend({initialize:function(){this.model=new e({id:preloadedFormData.id}),this.model.set("fields",i.channel("fields").request("get:collection")),this.model.set("actions",i.channel("actions").request("get:collection")),this.model.set("settings",i.channel("settings").request("get:settings")),i.channel("app").reply("get:formModel",this.getFormModel,this)},getFormModel:function(){return this.model}})})),n("controllers/app/previewLink",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"before:sendChanges",this.disablePreview,this),this.listenTo(i.channel("app"),"response:sendChanges",this.enablePreview,this),this.listenTo(i.channel("app"),"change:clean",this.changePreviewNicename,this)},disablePreview:function(){i.channel("app").request("get:domainCollection").get("preview").set("disabled",!0)},changePreviewNicename:function(e){if(e)t="Preview Form";else var t="Preview Changes";i.channel("app").request("get:domainCollection").get("preview").set("nicename",t)},enablePreview:function(){i.channel("app").request("get:domainCollection").get("preview").set("disabled",!1)}})})),n("controllers/app/menuButtons",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"click:publish",this.publish),this.listenTo(i.channel("app"),"click:viewChanges",this.viewChanges),this.listenTo(i.channel("app"),"click:publicLink",this.publicLink)},publish:function(){i.channel("app").request("update:db","publish")},viewChanges:function(){var e=i.channel("changes").request("get:collection");i.channel("app").request("open:drawer","viewChanges",{collection:e})},publicLink:function(){i.channel("app").request("open:drawer","publicLink")}})})),n("models/app/changeModel",[],(function(){return Backbone.Model.extend({defaults:{disabled:!1}})})),n("models/app/changeCollection",["models/app/changeModel"],(function(e){return Backbone.Collection.extend({model:e,comparator:function(e){return-parseInt(e.cid.replace("c",""))}})})),n("controllers/app/trackChanges",["models/app/changeCollection","models/app/changeModel"],(function(e,t){return Marionette.Object.extend({initialize:function(){this.collection=new e,i.channel("changes").reply("register:change",this.registerChange,this),i.channel("changes").reply("get:collection",this.getCollection,this),this.listenTo(i.channel("app"),"change:clean",this.maybeResetCollection)},registerChange:function(e,n,r,a,l){l=void 0!==l?l:{};void 0===a.dashicon&&(a.dashicon="admin-generic");var s=new t({action:e,model:n,changes:r,label:a,data:l});return this.collection.add(s),i.channel("fields-repeater").trigger("clearEditActive",n),s},getCollection:function(){return this.collection},maybeResetCollection:function(e){e&&this.collection.reset()}})})),n("controllers/app/undoChanges",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("drawer"),"click:undoChanges",this.undoChanges,this),this.listenTo(i.channel("drawer"),"click:undoSingle",this.undoSingle,this)},undoChanges:function(){var e=i.channel("changes").request("get:collection");e.sort();var t=this;_.each(e.models,(function(e){t.undoSingle(e,!0)})),e.reset(),i.channel("app").request("update:db"),i.channel("app").request("update:setting","clean",!0),i.channel("app").request("close:drawer"),this.dispatchClick()},undoSingle:function(e,t){i.channel("changes").request("undo:"+e.get("action"),e,t),this.dispatchClick()},dispatchClick:function(){if(!document.cookie.includes("nf_undo")){var e=new Date;e.setTime(e.getTime()+6048e5);var t="expires="+e.toUTCString();document.cookie="nf_undo=1;"+t+";path=/";var n={action:"nf_undo_click",security:nfAdmin.ajaxNonce};jQuery.post(ajaxurl,n)}}})})),n("controllers/app/publishResponse",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"response:updateDB",this.publishResponse)},publishResponse:function(e){if("publish"!==e.action)return!1;void 0!==e.data.new_ids&&(void 0!==e.data.new_ids.fields&&_.each(e.data.new_ids.fields,(function(e,t){var n=i.channel("fields").request("get:field",t);n?n.set("id",e):(n=i.channel("fields-repeater").request("get:childField",t,null,e)).set("id",e)})),void 0!==e.data.new_ids.actions&&_.each(e.data.new_ids.actions,(function(e,t){var n=i.channel("actions").request("get:action",t);n&&n.set("id",e)})),void 0!==e.data.new_ids.forms&&_.each(e.data.new_ids.forms,(function(e,t){i.channel("app").request("get:formModel").set("id",e),history.replaceState("","","admin.php?page=ninja-forms&form_id="+e)}))),i.channel("app").request("update:setting","loading",!1),i.channel("app").trigger("change:loading"),i.channel("app").request("is:mobile")&&i.channel("notices").request("close","publishing"),i.channel("app").trigger("app:published",e),i.channel("app").request("update:setting","clean",!0)}})})),n("controllers/app/changeDomain",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"click:menu",this.changeAppDomain),i.channel("app").reply("change:currentDomain",this.changeAppDomain,this),i.channel("app").reply("prevent:changeDomain",this.preventChange,this),i.channel("app").reply("enable:changeDomain",this.enableChange,this),this.objPreventChange={}},changeAppDomain:function(e,t){if(this.maybePreventChange())return!1;if(void 0===t){var n=jQuery(e.target).data("domain");t=i.channel("app").request("get:domainModel",n)}if(i.channel("app").request("get:currentDrawer")&&i.channel("app").request("close:drawer"),0==t.get("url").length){var r=i.channel("app").request("get:mainEl");i.channel("app").request("update:currentDomain",t),jQuery(r).scrollTop(0),i.channel("app").trigger("change:currentDomain",t)}},maybePreventChange:function(){return 0!=Object.keys(this.objPreventChange).length},preventChange:function(e){this.objPreventChange[e]=!0},enableChange:function(e){delete this.objPreventChange[e]}})})),n("controllers/app/pushstate",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("app"),"change:currentDomain",this.changePushState)},changePushState:function(){var e=i.channel("app").request("get:currentDomain");history.pushState(null,null,window.location.href+"&domain="+e.get("id"));var t=window.location.toString().replace(/domain=\\d+/,"");console.log(t)}})})),n("controllers/app/hotkeys",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(i.channel("main"),"render:main",this.changeHotkeys),this.listenTo(i.channel("drawer"),"opened",this.changeHotkeys),this.listenTo(i.channel("drawer"),"render:settingGroup",this.changeHotkeys),this.listenTo(i.channel("hotkeys"),"add:newField",this.addNewField),this.listenTo(i.channel("hotkeys"),"add:newAction",this.addNewAction),this.listenTo(i.channel("hotkeys"),"changeDomain:fields",this.changeDomainFields),this.listenTo(i.channel("hotkeys"),"changeDomain:actions",this.changeDomainActions),this.listenTo(i.channel("hotkeys"),"changeDomain:settings",this.changeDomainSettings),this.listenTo(i.channel("hotkeys"),"close:drawer",this.closeDrawer)},changeHotkeys:function(){var e=i.channel("app").request("get:currentDomain");jQuery(document).off(".nfDomainHotkeys"),jQuery("input").off(".nfDomainHotkeys"),e.get("hotkeys")&&jQuery.each(e.get("hotkeys"),(function(e,t){jQuery(document).on("keydown.nfDomainHotkeys",null,e,(function(e){i.channel("hotkeys").trigger(t,e)})),jQuery("input").on("keydown.nfDomainHotkeys",null,e,(function(e){i.channel("hotkeys").trigger(t,e)})),jQuery("textarea").on("keydown.nfDomainHotkeys",null,e,(function(e){i.channel("hotkeys").trigger(t,e)}))}))},addNewField:function(){"addField"!=i.channel("app").request("get:currentDrawer")?i.channel("app").request("open:drawer","addField"):i.channel("app").request("close:drawer")},addNewAction:function(){"addAction"!=i.channel("app").request("get:currentDrawer")?i.channel("app").request("open:drawer","addAction"):i.channel("app").request("close:drawer")},changeDomainFields:function(){var e=i.channel("app").request("get:domainCollection").get("fields");i.channel("app").request("change:currentDomain",{},e)},changeDomainActions:function(){var e=i.channel("app").request("get:domainCollection").get("actions");i.channel("app").request("change:currentDomain",{},e)},changeDomainSettings:function(){var e=i.channel("app").request("get:domainCollection").get("settings");i.channel("app").request("change:currentDomain",{},e)},closeDrawer:function(){i.channel("app").request("close:drawer")}})})),n("controllers/app/cleanState",[],(function(){return Marionette.Object.extend({initialize:function(){this.ignoreAttributes=["editActive"],this.listenTo(i.channel("app"),"update:setting",this.setAppClean)},setAppClean:function(e){for(var t in e.changedAttributes())e.changedAttributes()[t];i.channel("undo-"+e.get("type")).request("ignore:attributes",this.ignoreAttributes)||this.ignoreAttributes;if(-1!=this.ignoreAttributes.indexOf(t))return!1;i.channel("app").request("update:setting","clean",!1),i.channel("fields-repeater").trigger("clearEditActive",e)}})})),n("controllers/app/coreUndo",[],(function(){return Marionette.Object.extend({initialize:function(){i.channel("changes").reply("undo:changeSetting",this.undoChangeSetting,this),i.channel("changes").reply("undo:addObject",this.undoAddObject,this),i.channel("changes").reply("undo:removeObject",this.undoRemoveObject,this),i.channel("changes").reply("undo:duplicateObject",this.undoDuplicateObject,this),i.channel("changes").reply("undo:sortFields",this.undoSortFields,this),i.channel("changes").reply("undo:addListOption",this.undoAddListOption,this),i.channel("changes").reply("undo:removeListOption",this.undoRemoveListOption,this),i.channel("changes").reply("undo:sortListOptions",this.undoSortListOptions,this)},undoChangeSetting:function(e,t){var n=e.get("model"),i=e.get("changes"),r=i.attr,a=i.before;n.set(r,a),this.maybeRemoveChange(e,t)},undoAddObject:function(e,t){var n=e.get("model"),r=e.get("data").collection;if(void 0!==r.newIDs&&delete r.newIDs[n.get("id")],!t){var a=i.channel("changes").request("get:collection"),l=a.where({model:n});_.each(l,(function(t){t!==e&&a.remove(t)}))}r.remove(n),this.maybeRemoveChange(e,t)},undoDuplicateObject:function(e,t){var n=e.get("model"),r=e.get("data").collection;if(!t){var a=i.channel("changes").request("get:collection"),l=a.where({model:n});_.each(l,(function(t){t!==e&&a.remove(t)}))}r.remove(n),this.maybeRemoveChange(e,t)},undoRemoveObject:function(e,t){var n=e.get("model"),r=e.get("data").collection;if(i.channel(n.get("objectDomain")).request("add",n),delete r.removedIDs[n.get("id")],!t){var a=i.channel("changes").request("get:collection").where({model:n});_.each(a,(function(t){t!==e&&t.set("disabled",!1)}))}r.trigger("reset",r),this.maybeRemoveChange(e,t)},undoSortFields:function(e,t){var n=e.get("data").fields,r=i.channel("fields").request("get:collection");_.each(n,(function(e){var t=e.before;e.model.set("order",t)})),r.sort(),this.maybeRemoveChange(e,t)},undoAddListOption:function(e,t){var n=e.get("model");if(!t){var r=i.channel("changes").request("get:collection"),a=r.where({model:n});_.each(a,(function(t){t!==e&&r.remove(t)}))}n.collection.remove(n),this.maybeRemoveChange(e,t)},undoRemoveListOption:function(e,t){var n=e.get("model");if(e.get("data").collection.add(n),!t){var r=i.channel("changes").request("get:collection").where({model:n});_.each(r,(function(t){t!==e&&t.set("disabled",!1)}))}this.maybeRemoveChange(e,t)},undoSortListOptions:function(e,t){var n=e.get("data"),i=n.collection,r=n.objModels;_.each(r,(function(e){var t=e.before;e.model.set("order",t)})),i.sort(),this.maybeRemoveChange(e,t)},maybeRemoveChange:function(e,t){if(!(t=void 0!==t&&t)){i.channel("app").request("update:db");var n=i.channel("changes").request("get:collection");n.remove(e),0==n.length&&(i.channel("app").request("update:setting","clean",!0),i.channel("app").request("close:drawer"))}}})})),n("controllers/app/cloneModelDeep",[],(function(){return Marionette.Object.extend({initialize:function(){i.channel("app").reply("clone:modelDeep",this.cloneModelDeep,this)},cloneModelDeep:function(e){var t={};_.each(e.attributes,(function(e,n){if(e instanceof Backbone.Collection){var r=i.channel("app").request("clone:collectionDeep",e);t[n]=r}else e instanceof Backbone.Model&&(t[n]=this.cloneModelDeep(e))}),this);var n=e.clone();return _.each(t,(function(e,t){n.set(t,e)})),n}})})),n("controllers/app/getSettingChildView",["views/app/drawer/itemSetting"],(function(e){return Marionette.Object.extend({initialize:function(){i.channel("app").reply("get:settingChildView",this.getSettingChildView,this)},getSettingChildView:function(t){var n=t.get("type");return i.channel(n).request("get:settingChildView",t)||e}})})),n("controllers/app/changeSettingDefault",[],(function(){return Marionette.Object.extend({initialize:function(){i.channel("app").reply("change:setting",this.changeSetting,this),this.listenTo(i.channel("app"),"change:setting",this.changeSetting,this)},changeSetting:function(e,t,n,r){var a=t.get("name"),l=n.get(a);(r=r||null)||(r=i.channel(t.get("type")).request("before:updateSetting",e,n,a,t)),void 0===r&&(r=jQuery(e.target).val()),n.set(a,r,{settingModel:t}),i.channel("setting-"+a).trigger("after:updateSetting",n,t);var s=r,o={attr:a,before:l,after:s},c=(i.channel("app").request("get:currentDomain").get("id"),{object:n.get("objectType"),label:n.get("label"),change:"Changed "+t.get("label")+" from "+l+" to "+s});i.channel("changes").request("register:change","changeSetting",n,o,c)}})})),n("views/app/drawer/typeSettingFieldset",["views/app/drawer/itemSetting"],(function(e){return Marionette.CompositeView.extend({template:"#tmpl-nf-edit-setting-wrap",childView:e,initialize:function(e){this.collection=this.model.get("settings"),this.childViewOptions={dataModel:e.dataModel},this.dataModel=e.dataModel;var t=this.model.get("deps");if(t){void 0===t.settings&&(t.settings=[],_.each(t,(function(e,n){"settings"!==n&&t.settings.push({name:n,value:e})})),t.match="all");for(var n=t.settings.length-1;n>=0;n--){let e=t.settings[n].name;this.dataModel.on("change:"+e,this.render,this)}}this.model.on("rerender",this.render,this)},onBeforeDestroy:function(){var e=this.model.get("deps");if(e)for(var t=e.settings.length-1;t>=0;t--)name=e.settings[t].name,this.dataModel.off("change:"+name,this.render)},onBeforeRender:function(){i.channel("app").trigger("before:renderSetting",this.model,this.dataModel),i.channel("setting-type-"+this.model.get("type")).trigger("before:renderSetting",this.model,this.dataModel,this),i.channel("setting-"+this.model.get("name")).trigger("before:renderSetting",this.model,this.dataModel,this)},onRender:function(){i.channel("setting-"+this.model.get("name")).trigger("render:setting",this.model,this.dataModel,this),i.channel("setting-type-"+this.model.get("type")).trigger("render:setting",this.model,this.dataModel,this)},templateHelpers:function(){var e=this;return{renderVisible:function(){if(!nfAdmin.devMode){if("help"==this.name)return'style="display:none;"';if("classes"==this.name)return'style="d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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