1/*1764360306000*/ 2Liferay.Loader.define._amd = Liferay.Loader.define.amd; 3Liferay.Loader.define.amd = false; 4if (!Object.assign) { 5 Object.defineProperty(Object, 'assign', { 6 enumerable: false, 7 configurable: true, 8 writable: true, 9 value: function(target) { 10 'use strict'; 11 if (target === undefined || target === null) { 12 throw new TypeError('Cannot convert first argument to object'); 13 } 14 15 var to = Object(target); 16 for (var i = 1; i < arguments.length; i++) { 17 var nextSource = arguments[i]; 18 if (nextSource === undefined || nextSource === null) { 19 continue; 20 } 21 nextSource = Object(nextSource); 22 23 var keysArray = Object.keys(Object(nextSource)); 24 for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { 25 var nextKey = keysArray[nextIndex]; 26 var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); 27 if (desc !== undefined && desc.enumerable) { 28 to[nextKey] = nextSource[nextKey]; 29 } 30 } 31 } 32 return to; 33 } 34 }); 35} 36/*! npm.im/object-fit-images 3.2.3 */ 37var objectFitImages=function(){"use strict";function t(t,e){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+t+"' height='"+e+"'%3E%3C/svg%3E"}function e(t){if(t.srcset&&!m&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}function i(t){for(var e,i=getComputedStyle(t).fontFamily,r={};null!==(e=l.exec(i));)r[e[1]]=e[2];return r}function r(e,i,r){var n=t(i||1,r||0);p.call(e,"src")!==n&&b.call(e,"src",n)}function n(t,e){t.naturalWidth?e(t):setTimeout(n,100,t,e)}function c(t){var c=i(t),o=t[a];if(c["object-fit"]=c["object-fit"]||"fill",!o.img){if("fill"===c["object-fit"])return;if(!o.skipTest&&g&&!c["object-position"])return}if(!o.img){o.img=new Image(t.width,t.height),o.img.srcset=p.call(t,"data-ofi-srcset")||t.srcset,o.img.src=p.call(t,"data-ofi-src")||t.src,b.call(t,"data-ofi-src",t.src),t.srcset&&b.call(t,"data-ofi-srcset",t.srcset),r(t,t.naturalWidth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{s(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}e(o.img),t.style.backgroundImage='url("'+(o.img.currentSrc||o.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=c["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(c["object-fit"])?n(o.img,function(){o.img.naturalWidth>t.width||o.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=c["object-fit"].replace("none","auto").replace("fill","100% 100%"),n(o.img,function(e){r(t,e.naturalWidth,e.naturalHeight)})}function s(t){var e={get:function(e){return t[a].img[e||"src"]},set:function(e,i){return t[a].img[i||"src"]=e,b.call(t,"data-ofi-"+i,e),c(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}function o(t,e){var i=!h&&!t;if(e=e||{},t=t||"img",f&&!e.skipTest||!d)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var r=0;r<t.length;r++)t[r][a]=t[r][a]||{skipTest:e.skipTest},c(t[r]);i&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&o(t.target,{skipTest:e.skipTest})},!0),h=!0,t="img"),e.watchMQ&&window.addEventListener("resize",o.bind(null,t,{skipTest:e.skipTest}))}var a="bfred-it:object-fit-images",l=/(object-fit|object-position)\s*:\s*([-\w\s%]+)/g,u="undefined"==typeof Image?{style:{"object-position":1}}:new Image,g="object-fit"in u.style,f="object-position"in u.style,d="background-size"in u.style,m="string"==typeof u.currentSrc,p=u.getAttribute,b=u.setAttribute,h=!1;return o.supportsObjectFit=g,o.supportsObjectPosition=f,function(){function t(t,e){return t[a]&&t[a].img&&("src"===e||"srcset"===e)?t[a].img:t}f||(HTMLImageElement.prototype.getAttribute=function(e){return p.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,i){return b.call(t(this,e),e,String(i))})}(),o}(); 38 39;(function (window) { 40 'use strict'; 41 42 var VersionManager = {} 43 44 VersionManager.getVersion = function () { 45 return '1743535993102' 46 } 47 48 VersionManager.buildUrl = function (path) { 49 50 var extension = path.split('.').pop(), 51 staticParams = '?t=' + this.getVersion() 52 53 if (/js|css/.test(extension)) { 54 staticParams += '&minifierType=' + extension 55 } 56 57 return path + staticParams 58 } 59 60 window.VersionManager = VersionManager 61})(window) 62 63;(function (AUI, Liferay, VersionManager) { 64 'use strict' 65 66 function moduleUrl (url) { 67 var fullPath = Liferay.ThemeDisplay.getPathThemeRoot() + '/js/modules/' + url 68 return VersionManager.buildUrl(fullPath) 69 } 70 71 AUI().applyConfig({ 72 modules: { 73 'ent-portlet': { 74 fullpath: moduleUrl('portlet.js'), 75 }, 76 'ent-validator-builder': { 77 fullpath: moduleUrl('validator-builder.js'), 78 }, 79 'ent-filter-combo': { 80 fullpath: moduleUrl('ent-filter-combo.js'), 81 }, 82 'ent-auto-complete': { 83 fullpath: moduleUrl('ent-auto-complete.js'), 84 }, 85 'ent-custom-form-validator': { 86 fullpath: moduleUrl('custom-form-validator.js'), 87 requires: ['aui-form-validator'] 88 } 89 } 90 }) 91 92})(window.AUI || window.YUI, window.Liferay, window.VersionManager) 93 94;(function (YUI, $) { 95 'use strict' 96 97 var BOUNDING_BOX = 'boundingBox' 98 99 YUI.add('ent-custom-form-validator', function (Y) { 100 function fixNativeExtractRulesFrom () { 101 Y.FormValidator.prototype._extractRulesFromMarkup = function (rules) { 102 var instance = this 103 var domBoundingBox = instance.get(BOUNDING_BOX).getDOM() 104 var elements = domBoundingBox.elements 105 var regex = Y.DOM._getRegExp('(field-)\\w+', 'g') 106 var i 107 var length 108 var ruleNameMatch = [] 109 110 function ruleMatcher (m1, m2) { 111 ruleNameMatch.push(m1.replace(m2, '')) 112 } 113 114 for (i = 0, length = elements.length; i < length; i++) { 115 var el = elements[i] 116 var isVisible = (el.offsetParent !== null) 117 var fieldName = el.name 118 119 if (isVisible) { 120 el.className.replace(regex, ruleMatcher) 121 if (ruleNameMatch.length) { 122 var fieldRules = rules[fieldName] 123 var j 124 var ruleNameLength 125 126 if (!fieldRules) { 127 fieldRules = {} 128 rules[fieldName] = fieldRules 129 } 130 131 for (j = 0, ruleNameLength = ruleNameMatch.length; j < ruleNameLength; j++) { 132 var rule = ruleNameMatch[j] 133 134 if (!(rule in fieldRules)) { 135 fieldRules[rule] = el.getAttribute(rule) || true 136 } 137 } 138 ruleNameMatch.length = 0 139 } 140 } 141 } 142 instance._rulesAlreadyExtracted = true 143 } 144 } 145 146 function fixCustonValidatorCall () { 147 Y.FormValidator.prototype.validatable = function (field) { 148 var instance = this
149 var validatable = false 150 var fieldRules = instance.get('rules')[field.get('name')] 151 152 if (fieldRules && $(field.getDOM()).is(':visible')) { 153 validatable = fieldRules.custom || 154 instance.normalizeRuleValue(fieldRules.required, field) || 155 Y.config.FormValidator.RULES.hasValue.apply(instance, [field.val(), field]) 156 } 157 158 return !!validatable 159 } 160 } 161 162 function addStringMessages () { 163 Y.FormValidator.ATTRS.strings.valueFn = function () { 164 return { 165 'default': 'Por favor, conserte este campo.', 166 'acceptFiles': 'Por favor, insira um valor com uma extensão válida ({0}).', 167 'alpha': 'Por favor, insira somente caracteres alfa.', 168 'alphanum': 'Por favor, insira somente caracteres alfanuméricos.', 169 'date': 'Por favor, insira uma data válida.', 170 'digits': 'Por favor, insira somente caracteres numéricos.', 171 'email': 'Por favor, insira um endereço de e-mail válido.', 172 'equalTo': 'Por favor, insira o mesmo valor novamente.', 173 'bincode': 'Por favor, insira um Bincode válido.', 174 'iri': 'Por favor, insira uma IRI válida.', 175 'max': 'Por favor, insira um valor menor ou igual à {0}.', 176 'maxFiles': 'Por favor, insira não mais que {0} arquivos.', 177 'minFiles': 'Por favor, insira não menos que {0} arquivos.', 178 'maxLength': 'Por favor, insira não mais que {0} caracteres.', 179 'maxYersOld': 'Você deve ter no máximo {0} anos.', 180 'min': 'Por favor, insira um valor maior ou igual à {0}.', 181 'minLength': 'Por favor, insira pelo menos {0} caracteres.', 182 'minYersOld': 'Você deve ter no mÃnimo {0} anos.', 183 'number': 'Por favor, insira um número válido.', 184 'range': 'Por favor, insira um valor entre {0} e {1}.', 185 'rangeLength': 'Por favor, insira um valor de tamanho entre {0} e {1} caracteres.', 186 'required': 'Este campo é obrigatório.', 187 'whenVisibleRequired': 'Este campo é obrigatório.', 188 'conditionalFieldRequired': 'Este campo é obrigatório.', 189 'url': 'Por favor, insira uma URL válida.', 190 'password': 'A senha precisa ter 8 caracteres numéricos e não pode ser uma sequência de números, nem pode repetir o mesmo número cinco vezes seguidas.', 191 'dateHourRange': 'Hora inválida.', 192 'customBirthDate': 'Data aniversário inválida.', 193 'cpf': 'Por favor, insira um CPF válido.', 194 'zipCode': 'Por favor, insira um CEP válido.', 195 'hour': 'Por favor, entre um valor entre 00:00 e 23:59.', 196 'letters': 'Por favor, insira somente letras e espaços.', 197 'cnpj': 'Por favor, insira um CNPJ válido.', 198 'dateWithMask': 'Por favor, insira uma data válida.', 199 'lessThanCurrentDate': 'Por favor, insira uma data válida.', 200 'selectMultipleLimit': 'Por favor, selecione no máximo {0} elementos.', 201 'fullName': 'Por favor, insira o nome completo.', 202 'hostDomain': 'E-mail informado não pode ser do domÃnio Unifor.', 203 'fileSize': 'O tamanho do arquivo não pode exceder {0} MB', 204 'requiredPieceSet': 'Este campo é obrigatório.' 205 } 206 } 207 } 208 209 function addUpdateFields () { 210 Y.FormValidator.prototype.updateFields = function () { 211 this.updateFormRules() 212 213 $('.field-required, .field-whenVisibleRequired').each(function (i, element) { 214 getLabelOf(element).addClass('required') 215 }) 216 217 $('.field-conditionalFieldRequired').each(function (i, element) { 218 var $element = $(element) 219 var fieldLabel = getLabelOf($element) 220 if (getConditional($element)) { 221 fieldLabel.addClass('required') 222 } else { 223 fieldLabel.removeClass('required') 224 } 225 }) 226 227 updateRequiredPieceSet.call(this) 228 } 229 230 function updateRequiredPieceSet () { 231 var instance = this, 232 $requiredPieceSet = $('.field-requiredPieceSet'),
233 nameSets = [] 234 235 $requiredPieceSet.each(function () { 236 var $piece = $(this), 237 nameSet = $piece.attr('requiredPieceSet') 238 239 if (nameSets.indexOf(nameSet) === -1) { 240 nameSets.push(nameSet) 241 } 242 }) 243 244 $requiredPieceSet.off('.requiredPiece').on('blur.requiredPiece change.requiredPiece', function () { 245 var nameSet = $(this).attr('requiredPieceSet'), 246 $members = getMembers(nameSet), 247 isRequired = isRequiredSet($members) 248 249 if (!isRequired) { 250 setTimeout(function () { 251 resetMembers($members) 252 }, 100) 253 } 254 }) 255 256 nameSets.map(function (nameSet) { 257 var $members = getMembers(nameSet), 258 isRequired = isRequiredSet($members), 259 $labels = $() 260 261 $members.each(function () { 262 $labels.push(getLabelOf(this)) 263 }) 264 265 if (isRequired) { 266 $labels.each(function () { 267 $(this).addClass('required') 268 }) 269 } else { 270 $labels.each(function () { 271 $(this).removeClass('required') 272 }) 273 274 resetMembers($members) 275 } 276 }) 277 278 function resetMembers ($members) { 279 $members.each(function () { 280 instance.validateField(this.name) 281 }) 282 } 283 284 function getMembers (nameSet) { 285 return $requiredPieceSet.filter('[requiredPieceSet=' + nameSet + ']') 286 } 287 288 function isRequiredSet ($members) { 289 var fieldsRule = $members.filter(function () { 290 return $(this).val().length === 0 291 }) 292 293 return fieldsRule.length !== $members.length 294 } 295 } 296 297 function getLabelOf (field) { 298 return $($(field).closest('.form-group')).find('label') 299 } 300 } 301 302 function addUpdateFormRulesMethod () { 303 Y.FormValidator.prototype.updateFormRules = function () { 304 this._rulesAlreadyExtracted = false 305 } 306 } 307 308 function addWhenVisibleRequiredValidator () { 309 Y.config.FormValidator.RULES.whenVisibleRequired = function (val, node) { 310 var isVisible = $(node._node || node).is(':visible') 311 if (!isVisible) { 312 return true 313 } else { 314 return !!val 315 } 316 } 317 } 318 319 function getConditional ($element) { 320 var declaredConditional = $element.data('conditional-field') || '' 321 var conditionals = declaredConditional.split(';') 322 var resultOfConditionals = false 323 324 conditionals.forEach(function (conditional) { 325 var splitedConditional = null 326 if (conditional.indexOf('===') >= 0) { 327 splitedConditional = conditional.split('===') 328 resultOfConditionals |= $(splitedConditional[0]).val() === splitedConditional[1] 329 } else if (conditional.indexOf('!==') >= 0) { 330 splitedConditional = conditional.split('!==') 331 resultOfConditionals |= $(splitedConditional[0]).val() !== splitedConditional[1] 332 } 333 334 if (resultOfConditionals) { 335 return true 336 } 337 }) 338 339 return resultOfConditionals 340 } 341 342 function addConditionalFieldRequired () { 343 Y.config.FormValidator.RULES.conditionalFieldRequired = function (val, node) { 344 var $element = $(node._node || node) 345 if (getConditional($element)) { 346 return !!val 347 } 348 return true 349 } 350 } 351 352 function addMaxFiles () { 353 Y.config.FormValidator.RULES.maxFiles = function (val, node, maxFiles) { 354 return maxFiles >= node._node.files.length 355 } 356 } 357 358 function addMinFiles () { 359 Y.config.FormValidator.RULES.minFiles = function (val, node, minFiles) { 360 return minFiles <= node._node.files.length 361 } 362 } 363 364 function addMinYersOld () { 365 Y.config.FormValidator.RULES.minYersOld = function (val, node, minYersOld) { 366 var splitedDate = val.split('/') 367 var informedDate = new Date(splitedDate[2], splitedDate[1] - 1, splitedDate[0]).getTime() 368 var currentDate = new Date() 369 var limitYearsOldTime = new Date(currentDate.getFullYear() - minYersOld, currentDate.getMonth(), currentDate.getDate()).getTime() 370 return informedDate <= limitYearsOldTime 371 } 372 } 373 374 function addMaxYersOld () { 375 Y.config.FormValidator.RULES.maxYersOld = function (val, node, maxYersOld) { 376 var splitedDate = val.split('/') 377 var informedDate = new Date(splitedDate[2], splitedDate[1] - 1, splitedDate[0] - 1).getTime() 378 var currentDate = new Date() 379 var limitYearsOldTime = new Date(currentDate.getFullYear() - maxYersOld, currentDate.getMonth(), currentDate.getDate()).getTime() 380 return informedDate >= limitYearsOldTime 381 } 382 } 383 384 function addDateWithMask () { 385 Y.config.FormValidator.RULES.dateWithMask = function (val, node, maskRule) { 386 var splitedDate = val.split('/') 387 var dateFormat = Y.Lang.isString(maskRule) ? maskRule : 'dd/mm/yyyy' 388 var maskElements = dateFormat.split('/') 389 var maskSize = maskElements.length 390 391 if (splitedDate.length !== maskSize) { 392 return false 393 } 394 395 return maskElements.filter(function (mask, index) { 396 var dateItem = splitedDate[index] 397 switch (mask.toLowerCase()[0]) { 398 case 'y': 399 return checkYear(dateItem, mask) 400 case 'm': 401 return checkMonth(dateItem) 402 case 'd': 403 return checkDay(dateItem) 404 } 405 }).length === maskSize 406 407 function checkDay (day) { 408 return day > 0 && day <= 31 409 } 410 411 function checkMonth (month) { 412 return month > 0 && month <= 12 413 } 414 415 function checkYear (year, mask) { 416 if (mask) { 417 if (year.length !== mask.length) return false 418 } 419 return (year > 0) 420 } 421 } 422 } 423 424 function addLessThanCurrentDate () { 425 Y.config.FormValidator.RULES.lessThanCurrentDate = function (val, node) { 426 var splitedDate = val.split('/') 427 var informedDate = new Date(splitedDate[2], splitedDate[1] - 1, splitedDate[0]) 428 var currentDate = new Date() 429 currentDate.setHours(0, 0, 0, 0) 430 return informedDate.getTime() < currentDate.getTime() 431 } 432 } 433 434 function addSelectMultipleLimit () { 435 Y.config.FormValidator.RULES.selectMultipleLimit = function (val, node, limit) { 436 var $element = $(node._node || node) 437 var elements = $element.val() || [] 438 return elements.length <= limit 439 } 440 } 441 442 function addCpf () { 443 Y.config.FormValidator.RULES.cpf = function (val) { 444 if (!val) return true 445 446 var sum 447 var rest 448 var i = 0 449 sum = 0 450 val = val.replace(/[.-]/g, '') 451 if (val.length < 11) { return false } 452 453 // equal numbers 454 var arrCpf = val.split('') 455 var first = arrCpf.shift() 456 var equalNumbersLength = arrCpf.filter(function (n) { 457 return n === first 458 }).length 459 460 if (equalNumbersLength === arrCpf.length) { 461 return false 462 } 463 464 if (val === '00000000000') { 465 return false 466 } 467 468 for (i = 1; i <= 9; i++) { 469 sum = sum + parseInt(val.substring(i - 1, i)) * (11 - i) 470 } 471 472 rest = (sum * 10) % 11 473 474 if ((rest === 10) || (rest === 11)) { 475 rest = 0 476 } 477 478 if (rest !== parseInt(val.substring(9, 10))) { 479 return false 480 } 481 sum = 0 482 483 for (i = 1; i <= 10; i++) { 484 sum = sum + parseInt(val.substring(i - 1, i)) * (12 - i) 485 } 486 487 rest = (sum * 10) % 11 488 489 if ((rest === 10) || (rest === 11)) { 490 rest = 0 491 } 492 493 if (rest !== parseInt(val.substring(10, 11))) { 494 return false 495 } 496 return true 497 } 498 } 499 500 function isInteger (num) { 501 var numCopy = parseFloat(num)
502 return !isNaN(numCopy) && numCopy == numCopy.toFixed() 503 } 504 505 function hasSequencePattern (val) { 506 var sequencePattern = '01234567890987654321' // to match circular sequence as well. 507 return sequencePattern.indexOf(val) == -1 508 } 509 510 function hasRepeatableSequence (val) { 511 return /(.)\1\1\1\1/.test(val) 512 } 513 514 function addPassword () { 515 Y.config.FormValidator.RULES.password = function (val, node, password) { 516 /* 517 * 8 numeric characters. 518 * Password can not be a sequence of numbers, nor can it repeat the same number five times. 519 */ 520 if ((!hasRepeatableSequence(val) && hasSequencePattern(val) && isInteger(val)) || !val) { 521 return true 522 } 523 return false 524 } 525 } 526 527 function addFullName () { 528 Y.config.FormValidator.RULES.fullName = function (val, node, ruleValue) { 529 var value = val.trim() 530 531 if (value.length !== 0) { 532 var namesMatched = value.match(/\s/gi) 533 return namesMatched && namesMatched.length >= 1 534 } 535 536 return true 537 } 538 } 539 540 function addDomain () { 541 Y.config.FormValidator.RULES.hostDomain = function (val, node, ruleValue) { 542 var validExcept = [ 543 'unifor.' 544 ] 545 546 var mailDomain = val.match(/@.*/gi) 547 548 if (mailDomain && mailDomain[0].indexOf(validExcept) >= 0) { 549 return false 550 } 551 552 return true 553 } 554 } 555 556 function addFileSize () { 557 Y.config.FormValidator.RULES.fileSize = function (val, fieldNode, ruleMaxSize) { 558 if (Y.Lang.isString(ruleMaxSize) && !isNaN(ruleMaxSize)) { 559 var files = fieldNode.get('files'), 560 maxSize = parseFloat(ruleMaxSize) * 1024 * 1024 561 562 if (files.size() > 0) { 563 var file = files.shift() 564 565 if (file.size < maxSize) { 566 return true 567 } 568 569 return false 570 } 571 } 572 573 return true 574 } 575 } 576 577 function addRequiredPieceSet () { 578 Y.config.FormValidator.RULES.requiredPieceSet = function (val, fieldNode, nameSet) { 579 var $members = $('[requiredPieceSet=' + nameSet + ']') 580 581 if ($members.length > 0) { 582 var fieldsRule = $members.filter(function () { 583 return $(this).val().length === 0 584 }), 585 $labels = $(), 586 isRequiredSet = fieldsRule.length !== $members.length 587 588 $members.each(function () { 589 $labels.push($(this).closest('.form-group').find('label')) 590 }) 591 592 if (isRequiredSet) { 593 $labels.each(function () { 594 $(this).addClass('required') 595 }) 596 return val.length !== 0 597 } 598 599 $labels.each(function () { 600 $(this).removeClass('required') 601 }) 602 603 return true 604 } 605 606 return true 607 } 608 } 609 610 function overwriteDigitsValidation () { 611 var digitsValidation = Y.config.FormValidator.RULES.digits 612 Y.config.FormValidator.RULES.digits = function (val) { 613 if (val.length === 0) return true 614 615 return digitsValidation(val) 616 } 617 } 618 619 function init () { 620 fixNativeExtractRulesFrom() 621 fixCustonValidatorCall() 622 addUpdateFields() 623 addUpdateFormRulesMethod() 624 addWhenVisibleRequiredValidator() 625 addStringMessages() 626 addConditionalFieldRequired() 627 addMaxFiles() 628 addMinFiles() 629 addMinYersOld() 630 addMaxYersOld() 631 addDateWithMask() 632 addLessThanCurrentDate() 633 addSelectMultipleLimit() 634 addCpf() 635 addPassword() 636 addFullName() 637 addDomain() 638 addFileSize() 639 addRequiredPieceSet() 640 641 overwriteDigitsValidation() 642 } 643 644 init() 645 }, '0.0.1', { 646 requires: [ 647 'aui-form-validator' 648 ] 649 }) 650})(window.YUI, window.$) 651 652;(function configModalClass ($) { 653 'use strict' 654 655 var OVERLAY_CLASS = 'ent-modal-overlay' 656 var MODAL_OPEN_CLASS = 'ent-modal--open' 657 658 function EntModal (options) { 659 if (!options || !options.selector) throw new Error('Option Selector is Required!') 660 this._node = $(options.selector)
661 this._overlay = $('<div>').addClass(OVERLAY_CLASS) 662 } 663 664 EntModal.prototype.open = function openModal () { 665 $('body').append(this._overlay) 666 .css('overflow', 'hidden') 667 .css('position', 'fixed') 668 this._node.addClass(MODAL_OPEN_CLASS) 669 } 670 671 EntModal.prototype.close = function closeModal () { 672 this._overlay.remove() 673 $('body').css('overflow', '') 674 .css('position', '') 675 this._node.removeClass(MODAL_OPEN_CLASS) 676 } 677 678 window.EntModal = EntModal 679})(window.$) 680 681function preventCopyPaste($container) { 682 683 if (Liferay.Browser.isMobile() && Liferay.Browser.isLinux()) { 684 $container 685 .on('input', '[type=email],[type=password]', function (e) { 686 var $field = $(this), 687 currentValue = $field.data('currentValue') 688 689 if ( ($field.val().length - currentValue.length) > 1) { 690 $field.val(null) 691 $field.data('currentValue', '') 692 } else { 693 $field.data('currentValue', $field.val()) 694 } 695 696 }) 697 .on('focus', '[type=email],[type=password]', function(e) { 698 var $field = $(this) 699 700 $field.data('currentValue', $field.val()) 701 }) 702 703 } else { 704 705 $container.on('copy paste', '[type=email],[type=password]', function (e) { 706 e.preventDefault() 707 e.stopImmediatePropagation() 708 }) 709 710 } 711} 712 713window.preventCopyPaste = preventCopyPaste 714 715 716Liferay.Loader.define.amd = Liferay.Loader.define._amd; 717//# sourceMappingURL=assets.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.