-
Notifications
You must be signed in to change notification settings - Fork 70
/
bundle.js
1 lines (1 loc) · 6.42 KB
/
bundle.js
1
!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";var n=i(2),a=function(t){return t&&t.__esModule?t:{default:t}}(n);a.default.noConflict(),window.ss=window.ss||{},a.default.entwine("ss",function(t){var e={toggle:{show:function(t){t.show()},hide:function(t){t.hide()}},slide:{show:function(t){t.slideDown()},hide:function(t){t.slideUp()}},fade:{show:function(t){t.fadeIn()},hide:function(t){t.fadeOut()}},perform:function(t,e,i){void 0===i&&(i="toggle"),e?this[i].show(t):this[i].hide(t)}};t("div.display-logic, div.display-logic-master").entwine({escapeSelector:function(t){return t.replace(/(\[)/g,"_").replace(/(\])/g,"")},findHolder:function(t){return this.closest("form").find(this.escapeSelector("#"+this.nameToHolder(t)))},getFormField:function(){var t=this.getFieldName();return t&&(t=this.escapeSelector(t)),this.find("[name="+t+"]").length?this.find("[name="+t+"]"):this.find("#"+this.getFormID()+"_"+t)},getFieldName:function(){return this.attr("id")?this.attr("id").replace(new RegExp("^"+this.getFormID()+"_"),"").replace(/_Holder$/,""):null},nameToHolder:function(t){var e=this.escapeSelector(t);return e=e.replace(/[^a-zA-Z0-9\-_:.]+/g,"_").replace(/_+/g,"_"),this.getFormID()+"_"+e+"_Holder"},getFormID:function(){return this.closest("form").attr("id")},getFieldValue:function(){return this.getFormField().val()},evaluateEqualTo:function(t){return this.getFieldValue()===t},evaluateNotEqualTo:function(t){return this.getFieldValue()!==t},evaluateGreaterThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())>e},evaluateLessThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())<e},evaluateContains:function(t){return null!==this.getFieldValue().match(t)},evaluateStartsWith:function(t){return null!==this.getFieldValue().match(new RegExp("^"+t))},evaluateEndsWith:function(t){return null!==this.getFieldValue().match(new RegExp(t+"$"))},evaluateEmpty:function(){return 0===t.trim(this.getFieldValue()).length},evaluateNotEmpty:function(){return!this.evaluateEmpty()},evaluateBetween:function(t){var e=parseFloat(this.getFieldValue()),i=t.split("-");return 2===i.length&&(e>parseFloat(i[0])&&e<parseFloat(i[1]))},evaluateChecked:function(){return this.getFormField().is(":checked")},evaluateNotChecked:function(){return!this.getFormField().is(":checked")},onmatch:function(){var t=!0,e=[],i=this.getFormField();i.data("display-logic-eval")&&i.data("display-logic-masters")&&this.data("display-logic-eval",i.data("display-logic-eval")).data("display-logic-masters",i.data("display-logic-masters")).data("display-logic-animation",i.data("display-logic-animation")),e=this.getMasters();for(var n in e){var a=this.nameToHolder(this.escapeSelector(e[n])),s=this.closest("form").find(this.escapeSelector("#"+a));s.is(".readonly")||(t=!1),s.addClass("display-logic-master"),s.find("input[type=radio]").length&&s.addClass("optionset"),s.find("input[type=checkbox]").length>1&&s.addClass("checkboxset")}e.length&&t&&this.show()},getLogic:function(){return t.trim(this.data("display-logic-eval"))},parseLogic:function(){var t=this.getLogic();return new Function("return "+t).bind(this)()},getMasters:function(){var t=this.getFormField().data("display-logic-masters");return t?t.split(","):[]},getAnimationTargets:function(){return[this.findHolder(this.getFieldName())]}}),t("div.checkboxset").entwine({evaluateHasCheckedOption:function(e){var i=!1;return this.find(":checkbox").filter(":checked").each(function(){i=i||t(this).val()===e||t(this).getLabel().text()===e}),i},evaluateHasCheckedAtLeast:function(t){return this.find(":checked").length>=t},evaluateHasCheckedLessThan:function(t){return this.find(":checked").length<=t}}),t("input[type=checkbox]").entwine({getLabel:function(){return this.closest("form").find("label[for="+this.getHolder().escapeSelector(this.attr("id"))+"]")}}),t("div.display-logic.display-logic-display").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,t.parseLogic(),t.data("display-logic-animation"))})}}),t("div.display-logic.display-logic-hide").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,!t.parseLogic(),t.data("display-logic-animation"))})}}),t('div.display-logic-master input[type="text"], div.display-logic-master input[type="email"], div.display-logic-master input[type="numeric"]').entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onkeyup:function(){this.closest(".display-logic-master").notify()},onchange:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic-master select").entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onchange:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic-master :checkbox, div.display-logic-master :radio").entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onclick:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic.optionset, div.display-logic-master.optionset").entwine({getFieldValue:function(){return this.find(":checked").val()},getAnimationTargets:function(){return this._super().concat(this.findHolder(this.getFieldName()).find(".optionset"))}}),t("div.display-logic-master").entwine({Listeners:null,notify:function(){t.each(this.getListeners(),function(){t(this).testLogic()})},getListeners:function(){var e=this._super();if(e)return e;var i=this,n=[];return this.closest("form").find(".display-logic").each(function(){var e=t(this).getMasters();for(var a in e)if(e.hasOwnProperty(a)&&i.nameToHolder(e[a])===i.attr("id")){n.push(t(this)[0]);break}}),this.setListeners(n),this.getListeners()}}),t("div.display-logic.displaylogicwrapper.display-logic-display,\n div.display-logic.displaylogicwrapper.display-logic-hide").entwine({getFormField:function(){return this},getFieldName:function(){return""},getAnimationTargets:function(){return[this]}}),t("div.field *").entwine({getHolder:function(){return this.parents(".field")}})})},function(t,e,i){"use strict";i(0)},function(t,e){t.exports=jQuery}]);