1var CRM; 2(function (CRM) { 3 "use strict"; 4 var SubmitWorkaround = (function () { 5 function SubmitWorkaround() { 6 this.intTryCount = 0; 7 } 8 SubmitWorkaround.prototype.enableSubmit = function () { 9 var blnLaunched = false; 10 jQuery('input, textarea', 'form').each(function () { 11 if (this.value != this.defaultValue) { 12 jQuery(this).trigger('change'); 13 blnLaunched = true; 14 } 15 }); 16 if (!blnLaunched && 5 > this.intTryCount) { 17 this.intTryCount++; 18 window.setTimeout(this.enableSubmit(), 500); 19 } 20 }; 21 return SubmitWorkaround; 22 })(); 23 CRM.SubmitWorkaround = SubmitWorkaround; 24 var PlaceholderWorkaround = (function () { 25 function PlaceholderWorkaround() { 26 this.blnPlaceholderSupportAvailable = false; 27 var test = document.createElement('input'); 28 this.blnPlaceholderSupportAvailable = ('placeholder' in test); 29 } 30 PlaceholderWorkaround.prototype.enablePlaceholderText = function () { 31 var elmActive = document.activeElement; 32 if (this.blnPlaceholderSupportAvailable) { 33 return; 34 } 35 jQuery(':text,textarea,:password,.jqueryDatepicker').focus(function () { 36 if (jQuery(this).prop('placeholder') !== '') { 37 jQuery(this).css('background-image', 'none'); 38 } 39 }).blur(function () { 40 var strPlaceholderText = jQuery(this).prop('placeholder'); 41 if (!strPlaceholderText) { 42 return; 43 } 44 if (jQuery(this).val()) { 45 return; 46 } 47 if ('Pflichtfeld' === strPlaceholderText) { 48 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -185px'); 49 } 50 else if ('Pflichtfeld - Maximal 560 Zeichen' === strPlaceholderText) { 51 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -279px'); 52 } 53 else if ('Datum' === strPlaceholderText) { 54 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -37px'); 55 } 56 else if ('Von' === strPlaceholderText) { 57 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -86px'); 58 } 59 else if ('Bis' === strPlaceholderText) { 60 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -135px'); 61 } 62 else if ('Maximal 70 Zeichen' == strPlaceholderText) { 63 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px 2px'); 64 } 65 else if ('Maximal 500 Zeichen' === strPlaceholderText) { 66 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -596px'); 67 } 68 else if ('Pflichtfeld' === strPlaceholderText.substring(0, 11)) { 69 jQuery(this).css('background', 'url(/images/form_placeholders_de.png) no-repeat 3px -185px'); 70 } 71 }); 72 jQuery(':text,textarea,:password,.jqueryDatepicker').blur(); 73 jQuery(elmActive).focus(); 74 jQuery('form').submit(function () { 75 jQuery(this).find('.hasPlaceholder').each(function () { jQuery(this).val(''); }); 76 }); 77 }; 78 PlaceholderWorkaround.prototype.enableRegistrationFieldPopups = function () { 79 var maxLoop = 0; 80 if (jQuery('#contentInscriptionPrt').length) { 81 var registrationInterval = window.setInterval(function () { 82 if (maxLoop++ > 40) { 83 return; 84 } 85 var fields = jQuery("#contentInscriptionPrt input"); 86 if (fields.length) { 87 fields.popover({ trigger: 'focus' }); 88 this.enablePlaceholderText(); 89 window.clearInterval(registrationInterval); 90 } 91 }, 250); 92 } 93 }; 94 return PlaceholderWorkaround; 95 })(); 96 CRM.PlaceholderWorkaround = PlaceholderWorkaround; 97 var HorizontalDefinitionListWorkaround = (function () { 98 function HorizontalDefinitionListWorkaround(strCssClassHorizontalDL, intGridFloatBreakPoint) { 99 if (strCssClassHorizontalDL === void 0) { strCssClassHorizontalDL = 'dl-horizontal'; } 100 if (intGridFloatBreakPoint === void 0) { intGridFloatBreakPoint = 1050; } 101 this.strCssClassHorizontalDL = strCssClassHorizontalDL; 102 this.intGridFloatBreakPoint = intGridFloatBreakPoint; 103 } 104 HorizontalDefinitionListWorkaround.prototype.getHorizontalDefinitionLists = function () {
105 if (!this.jqDefList) { 106 this.jqDefList = jQuery('dl.' + this.strCssClassHorizontalDL); 107 } 108 return this.jqDefList; 109 }; 110 HorizontalDefinitionListWorkaround.prototype.isWidthChangeApplicable = function () { 111 return window.matchMedia('(min-width:' + this.intGridFloatBreakPoint + 'px)').matches; 112 }; 113 HorizontalDefinitionListWorkaround.prototype.adjustWidthOfDT = function (strCssClassAdjustDT) { 114 if (strCssClassAdjustDT === void 0) { strCssClassAdjustDT = 'adjustWidthOfDT'; } 115 if (this.isWidthChangeApplicable()) { 116 var jqDefinitionList = this.getHorizontalDefinitionLists().filter('.' + strCssClassAdjustDT+':visible'); 117 var intDefaultWidthDT = parseInt(jQuery('dt', jqDefinitionList).first().css('width'), 10); 118 var intDefaultGap = Math.max(20, parseInt(jQuery('dd', jqDefinitionList).first().css('margin-left'), 10) - intDefaultWidthDT); 119 var intMaxWidth = Math.max(0, intDefaultWidthDT); 120 var intMaxWidthLimit = Math.floor((jqDefinitionList.width() - intDefaultGap) / 2); 121 jQuery('dt', jqDefinitionList).each(function () { 122 var jqCurrent = jQuery(this); 123 var intLen = CRM.HorizontalDefinitionListWorkaround.calcTextWidth(jqCurrent.text(), CRM.HorizontalDefinitionListWorkaround.getFontCSS(jqCurrent)); 124 if (intLen > intMaxWidth) { 125 intMaxWidth = intLen; 126 } 127 }); 128 // adjust by 2px - sometimes, the wrong width is calculated 129 // intMaxWidth += 2; 130 if (intMaxWidth > intMaxWidthLimit) { 131 intMaxWidth = intMaxWidthLimit; 132 } 133 if (intMaxWidth > intDefaultWidthDT) { 134 jQuery('dd', jqDefinitionList).css('margin-left', intMaxWidth + intDefaultGap); 135 jQuery('dt', jqDefinitionList).css('width', intMaxWidth); 136 } 137 } 138 }; 139 HorizontalDefinitionListWorkaround.prototype.appendTitleToDT = function () { 140 jQuery('dt', this.getHorizontalDefinitionLists()).each(function () { 141 jQuery(this).attr('title', jQuery(this).text()); 142 }); 143 }; 144 HorizontalDefinitionListWorkaround.getFontCSS = function (elm) { 145 var strTextCSS = ''; 146 strTextCSS += CRM.HorizontalDefinitionListWorkaround.getCssAttributeValue(elm, 'font-size'); 147 strTextCSS += CRM.HorizontalDefinitionListWorkaround.getCssAttributeValue(elm, 'font-weight'); 148 strTextCSS += CRM.HorizontalDefinitionListWorkaround.getCssAttributeValue(elm, 'font-variant'); 149 strTextCSS += CRM.HorizontalDefinitionListWorkaround.getCssAttributeValue(elm, 'font-family'); 150 return strTextCSS; 151 }; 152 HorizontalDefinitionListWorkaround.getCssAttributeValue = function (elm, strAttribute) { 153 var strValue = elm.css(strAttribute); 154 return '' === strValue ? '' : strAttribute + ':' + strValue + ';'; 155 }; 156 HorizontalDefinitionListWorkaround.calcTextWidth = function (strText, strTextCSS) { 157 var elmTmp = document.createElement('div'); 158 var strStyle = 'position:absolute;visibility:hidden;height:auto;width:auto;white-space:nowrap;'; 159 elmTmp.setAttribute('style', strStyle + strTextCSS); 160 elmTmp.innerHTML = strText; 161 document.body.appendChild(elmTmp); 162 var intWidth = elmTmp.offsetWidth; 163 elmTmp.parentNode.removeChild(elmTmp); 164 return intWidth; 165 }; 166 return HorizontalDefinitionListWorkaround; 167 })(); 168 CRM.HorizontalDefinitionListWorkaround = HorizontalDefinitionListWorkaround; 169})(CRM || (CRM = {})); 170jQuery(document).ready(function () { 171 "use strict"; 172 if (('standalone' in window.navigator) && window.navigator['standalone']) { 173 jQuery("a").click(function (event) { 174 var strURL = jQuery(event.target).attr("href"); 175 if (strURL === '#' || strURL === undefined || strURL === '') { 176 return true; 177 } 178 event.preventDefault(); 179 window.location.href = strURL; 180 }); 181 } 182 jQuery("form button[type='submit']").addClass('disabled').prop('disabled', true); 183 jQuery("form input,form select") 184 .bind('change.evtEnableSubmitButton keyup.evtEnableSubmitButton', function () { 185 jQuery(this).parents("form").find("button[type='submit']").removeClass('disabled').prop('disabled', false); 186 jQuery(this).parents("form").find("input,select,textarea").unbind('.evtEnableSubmitButton'); 187 }).not('[data-toggle=tooltip]').popover({ trigger: 'focus' }); 188 jQuery('[data-toggle=popover]').popover(); 189 jQuery('input[type=text],input[type=password],textarea') 190 .bind('keyup.evtEnableSubmitButton', function (event) { 191 var keyCode = event.which; 192 if (!(9 == keyCode || 33 <= keyCode && 44 >= keyCode)) { 193 jQuery(this).parents("form").find("button[type='submit']").removeClass('disabled').prop('disabled', false); 194 jQuery(this).parents("form").find("input,select,textarea").unbind('.evtEnableSubmitButton'); 195 } 196 });
197 jQuery(".controls.edit button[type='reset']") 198 .bind('click.evtEnableEdit', function () { 199 jQuery(this).parents("form").find("input,select").prop('disabled', true); 200 jQuery(this).parents(".controls.edit").hide().next(".controls.editEnabler").show(); 201 }); 202 jQuery(".controls.editEnabler button") 203 .bind('click.evtEnableEdit', function () { 204 jQuery(this).parents("form").find("input,select").prop('disabled', false); 205 jQuery(this).parents(".controls.editEnabler").hide().parents(".control-group").find(".controls.edit").show(); 206 }); 207 jQuery('form.simulationOfFormSubmission') 208 .bind('submit', function () { 209 this.reset(); 210 jQuery('div.simulationOfFormSubmission').show(); 211 return false; 212 }); 213 jQuery('[rel=tooltip]').tooltip(); 214 jQuery('iframe.resize-height').each(function () { 215 var jqFrame = jQuery(this); 216 var fltFactor = parseFloat(jqFrame.data('resize-height')); 217 var intHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight); 218 fltFactor = isNaN(fltFactor) || fltFactor > 1 ? 0.75 : fltFactor; 219 jqFrame.css('height', Math.round(intHeight * fltFactor) + 'px'); 220 }); 221 (new CRM.SubmitWorkaround()).enableSubmit(); 222 var placeholderWorkaround = new CRM.PlaceholderWorkaround(); 223 placeholderWorkaround.enablePlaceholderText(); 224 placeholderWorkaround.enableRegistrationFieldPopups(); 225 var hdl = new CRM.HorizontalDefinitionListWorkaround(); 226 hdl.appendTitleToDT(); 227 hdl.adjustWidthOfDT(); 228}); 229//# sourceMappingURL=application.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.