PageSourceSearch

https://maxgid.ru/assets/js/foruformconstructor.js?

js maxgid.ru collected 2026-10-07 06:01:30 UTC 16,067 bytes, 1 lines download raw bytes

1angular.module("YepCom").directive("foruformconstructor",function($state,Layout,$compile,ThemeLayer,$timeout,RandomString,Msgservice,toaster,$sce,$rootScope,$sanitize,$window,ForuPolicy,$ocLazyLoad,$injector,$translate){return{restrict:"EA",replace:!0,template:'<div class="foruformconstructor" extraname="forublockformconstructor" elementid="elforuformconstructorouter" ng-style="sitecontent.elforuformconstructorouter.style" ng-class="sitecontent.elforuformconstructorouter.classes" ></div>',link:function(scope,element,attrs){function onUserModalLoadedBlock(){if(scope.showModal=!1,scope.showOverlayModal=!1,scope.showModalReady=!0,$(element).attr("data-foru-user-modal-id",scope.sitecontent.forusermodal.id),scope.sitecontent.forusermodal.hasOwnProperty("timer")&&scope.sitecontent.forusermodal.timer.enable&&scope.sitecontent.forusermodal.timer.hasOwnProperty("value"))return $timeout(function(){return scope.showUserModal()},scope.sitecontent.forusermodal.timer.value.time)}var name;("preview2"===(name=$state.current.name)||"localpreview"===name||"templatepreview"===name||"previewimage"===name)&&scope.sitecontent&&scope.sitecontent.forusermodal&&(scope.forusermodalFlag=!0,scope.$on("loadedBlock",onUserModalLoadedBlock),scope._loadedBlockEmitted)&&onUserModalLoadedBlock(),$translate.onReady(function(){scope.vnimanie=$translate.instant("vnimanie"),scope.nepravilnoUkazanAdresElektronnoyPoch=$translate.instant("nepravilno_ukazan_adres_elektronnoy_poch__"),scope.neVseObyazatelnyePolyaZapolneny=$translate.instant("ne_vse_obyazatelnye_polya_zapolneny"),scope.imya=$translate.instant("imya"),scope.zagolovok=$translate.instant("zagolovok"),scope.podskazka=$translate.instant("podskazka"),scope.yaSoglashayusS1=$translate.instant("ya_soglashayus_s__1"),scope.yaSoglashayusS2=$translate.instant("ya_soglashayus_s__2"),scope.podtverzhdenieOSoglasiiSPolitikoyOb=$translate.instant("podtverzhdenie_o_soglasii_s_politikoy_ob__"),scope.vsplyvayuscheeOkno=$translate.instant("vsplyvayuschee_okno"),scope.vOpublikovannoyVersiiSaytaEtoOknoB=$translate.instant("v_opublikovannoy_versii_sayta_eto_okno_b__"),scope.yaSoglashayusS=$translate.instant("ya_soglashayus_s"),scope.politikoyObrabotkiPersonalnyhDannyh=$translate.instant("politikoy_obrabotki_personalnyh_dannyh"),scope.obyazatelnoeDlyaZapolneniyaPole=$translate.instant("obyazatelnoe_dlya_zapolneniya_pole"),scope.nastroit_politiku=$translate.instant("nastroit_politiku"),scope.init()}),scope.validEmail=!0,scope.formFlag=!1,scope.successMsgFlag=!1,scope.showModal=!1,scope.showOverlayModal=!1,scope.forusermodalFlag=!1,scope.showModalReady=!1,scope.defaultValues=[],scope.trustAsHtml=function(string){string=$sanitize(string);return $sce.trustAsHtml(string)},scope.updateExtraTemplate=function(name){var id=scope.elemdata.extrablock_id.$oid;return Layout.updateTemplate(id,name).then(function(templ){element.html(""),scope.elemdata.templatename=name,scope.elemdata.templatehtml=templ,$compile(ThemeLayer.rewriteNgStyle(templ,scope.elemdata.templatename,scope.sitecontent,scope))(scope,function(newelem){element.html(newelem),scope.disableCheckbox(),scope.initBaseDropZone()})})},$rootScope.$on("showUserModal",function(evt,id){if(id===(null!=(id=scope.sitecontent)&&null!=(id=id.forusermodal)?id.id:void 0))return scope.showUserModal();scope.closeUserModal()}),scope.$on("setLayoutelforuformconstructor",function(evt,template,yelemid,classes){if(null==classes&&(classes=null),yelemid===scope.yeid)return yelemid=scope.sitecontent.elforuformconstructorouter.classes,classes?-1===yelemid.indexOf(classes)&&(scope.sitecontent.elforuformconstructorouter.classes=classes):-1===yelemid.indexOf(template)&&(scope.sitecontent.elforuformconstructorouter.classes=template),scope.updateExtraTemplate(template)}),scope.validateEmail=function(email){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(email).toLowerCase())},scope.afterSendForm=function(result,fResult){var _k,_len2,_ref2,_ref5;for($("#formconstructorSplash").remove(),scope.successMsgFlag=!0,scope.formFlag=!0,_k=0,_len2=(_ref2=scope.sitecontent.formconstructor.formItems).length;_k<_len2;
1_k++){var index,item=_ref2[_k];"text"===item.type||"textarea"===item.type||"number"===item.type?-1<(index=_.findIndex(scope.defaultValues,function(o){return o.id===item.id}))&&(item.value=null!=(index=scope.defaultValues[index])?index.value:void 0):"email"===item.type&&null!=(index=scope.$parent.$parent.$parent)&&null!=(_ref5=index.userData)&&_ref5.email?item.value=null!=(_ref5=scope.$parent.$parent.$parent)&&null!=(_ref5=_ref5.userData)?_ref5.email:void 0:item.value=""}$timeout(function(){scope.successMsgFlag=!1},1800),$timeout(function(){scope.formFlag=!1},2200),scope.forusermodalFlag&&$timeout(function(){scope.closeUserModal()},2300),scope.sitecontent&&scope.sitecontent.formconstructor&&scope.sitecontent.formconstructor.afterSubmitEnableRedirect&&scope.sitecontent.formconstructor.afterSubmitRedirectURL&&0<scope.sitecontent.formconstructor.afterSubmitRedirectURL.length&&$timeout(function(){window.location.href=scope.sitecontent.formconstructor.afterSubmitRedirectURL},2e3),scope.sitecontent&&scope.sitecontent.formconstructor&&scope.sitecontent.formconstructor.enableSuccessModaDialog&&scope.sitecontent.formconstructor.enableSuccessModaDialogId&&0<scope.sitecontent.formconstructor.enableSuccessModaDialogId.length&&$timeout(function(){$rootScope.$broadcast("showUserModal",scope.sitecontent.formconstructor.enableSuccessModaDialogId)},1500)},scope.disableCheckbox=function(){"preview2"!==$state.current.name&&($timeout(function(){$(element).find('input[type="checkbox"]').attr("disabled","disabled")},1e3),scope.$on("changeFoRuFormConstructorInput",function(evt){scope.drawConfigPrivacyBtn(),$timeout(function(){$(element).find('input[type="checkbox"]').attr("disabled","disabled")},1e3)}))},scope.sendFormData=function(){for(var item,_j,_len1,requeredFlag=!0,actions=[],_ref=scope.sitecontent.formconstructor.formItems,_i=0,_len=_ref.length;_i<_len;_i++)(item=_ref[_i]).requered&&("checkbox"===item.type?item.value||(requeredFlag=!1):"fileupload"===item.type?scope.fileList&&0!==scope.fileList.length||(requeredFlag=!1):null!=item.value&&0!==String(item.value).trim().length||(requeredFlag=!1)),"email"===item.type&&(scope.validEmail=scope.validateEmail(item.value),0);if("preview2"===$state.current.name)if(requeredFlag){if(scope.validEmail){var sendData=_.cloneDeep(scope.sitecontent.formconstructor.formItems),sendForm="",externalServiceFlag=!1,validUrl=!1;for(scope.sitecontent.formconstructor.hasOwnProperty("enableExternalService")&&scope.sitecontent.formconstructor.hasOwnProperty("externalService")&&scope.sitecontent.formconstructor.enableExternalService&&(scope.sitecontent.formconstructor.externalService.hasOwnProperty("method")||(scope.sitecontent.formconstructor.externalService.method={}),scope.sitecontent.formconstructor.externalService.method.hasOwnProperty("name")||(scope.sitecontent.formconstructor.externalService.method.name="get"),scope.sitecontent.formconstructor.externalService.hasOwnProperty("url")||(scope.sitecontent.formconstructor.externalService.url=""),externalServiceFlag=!0,validUrl=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i.test(scope.sitecontent.formconstructor.externalService.url))&&(scope.mywindow=$window.open("","_blank","width=900,height=800"),sendForm="<form id='externalForm' method='"+scope.sitecontent.formconstructor.externalService.method.name+"' action='"+scope.sitecontent.formconstructor.externalService.url+'\' accept-charset="windows-1251"> '),_j=0,_len1=sendData.length;_j<_len1;_j++)(item=sendData[_j]).label=item.text.replace(/<\/?[^>]+>/gi,""),externalServiceFlag&&(sendForm+="<input type='hidden' name='"+item.externalField+"' value='"+item.value+"'>");externalServiceFlag&&validUrl&&$compile(sendForm+="</form>")(scope,function(newelem){var form;return $(scope.mywindow.document.body).html(newelem),form=$(scope.mywindow.document.body).find("#externalForm"),$timeout(function(){return form.submit()},500)});validUrl=null;scope.sitecontent.formconstructor.hasOwnProperty("contactmails")&&(validUrl=scope.sitecontent.formconstructor.contactmails);return $compile('<div id="formconstructorSplash" style="position: fixed; top: 0; width: 100%; height: 100vh; background-color: #00000026;"><div class="c-loader c-loader--bricks ng-isolate-scope"><div></div> <div></div> <div></div> </div></div>')(scope,function(newelem){$(element).append(newelem)}),Msgservice.sendForm(sendData,actions,validUrl).then(function(result){scope.fileList&&0<scope.fileList.length?Msgservice.sendfiles(result._id.$oid,scope.fileList).then(function(fResult){scope.fileList=[],scope.afterSendForm(result,fResult)}):scope.afterSendForm(result,null)})}toaster.pop("error",scope.vnimanie+"!",scope.nepravilnoUkazanAdresElektronnoyPoch+"!!")}else toaster.pop("warning",scope.vnimanie+"!",scope.neVseObyazatelnyePolyaZapolneny+"!")},scope.setForuFormConstructor=function(event){var newelem,yelem=$("[yelemid="+scope.elemdata.yeid+"]");return scope.$emit("showSettingsEditor",scope,yelem),$timeout(function(){return scope.$emit("openPartSettingFormContrictor")},600),yelem="input_"+RandomString.generateRandomString(32).toLowerCase(),scope.sitecontent.formconstructor.formItems.push({selectOptions:[],value:"",type:"text",typeObj:{name:scope.imya,type:"text"},typeName:scope.imya,label:scope.zagolovok,id:yelem,placeholder:scope.podskazka,requered:!1,text:scope.zagolovok,classes:"",style:{}}),newelem=scope.sitecontent.formconstructor.formItems[scope.sitecontent.formconstructor.formItems.length-1],scope.sitecontent[yelem]=newelem},scope.closeUserModal=function(){if(scope.isView)return scope.showModal=!1,scope.showOverlayModal=!1},scope.hideAllUserModal=function(){$rootScope.$emit("showUserModal",null)},scope.showUserModal=function(){var winH,winW;scope.hideAllUserModal(),scope.showModalReady&&(scope.showModal=!0,scope.showOverlayModal=!0,winH=parseInt(0|$(window).height()),winW=parseInt(0|$(window).width()),$timeout(function(){var modalSizes=$(element).find(".foru-user-modal-container")[0].getBoundingClientRect(),topOffset=parseInt((winH-modalSizes.height)/2),modalSizes=(topOffset<0&&(topOffset=0),parseInt((winW-modalSizes.width)/2));modalSizes<0&&(modalSizes=0),$(element).find(".foru-user-modal-container").css({position:"fixed",top:topOffset+"px",left:modalSizes+"px","z-index":"9999",opacity:"1"})},500))},scope.init=function(){var item,key,keys,templ,_i,_j,_k,_len,_len1,_len2,_ref4;if(null!=(_ref=scope.sitecontent)&&_ref.formconstructor||(scope.sitecontent.formconstructor={}),null!=(_ref=scope.sitecontent.formconstructor)&&_ref.formId||null!=(_ref=scope.sitecontent)&&(_ref.formconstructor.formId="form_"+RandomString.generateRandomString(32).toLowerCase()),null!=(_ref=scope.sitecontent.formconstructor)&&_ref.formItems||(scope.sitecontent.formconstructor.formItems=[]),scope.sitecontent.formconstructor.formItems&&(scope.defaultValues=_.cloneDeep(scope.sitecontent.formconstructor.formItems),0<scope.sitecontent.formconstructor.formItems.length))for(_i=0,_len=(_ref4=scope.sitecontent.formconstructor.formItems).length;_i<_len;_i++)(item=_ref4[_i]).text||(item.text=item.label),scope.sitecontent[item.id]=item,scope.sitecontent[item.id].text||(scope.sitecontent[item.id].text=""),scope.sitecontent[item.id].style||(scope.sitecontent[item.id].style={}),scope.sitecontent[item.id].classes||(scope.sitecontent[item.id].classes=""),"text"===item.type||"textarea"===item.type||"number"===item.type?scope.sitecontent[item.id].value=item.value:scope.sitecontent[item.id].value="";if(scope.isView=!1,"preview2"===$state.current.name||"localpreview"===$state.current.name||"templatepreview"===$state.current.name||"previewimage"===$state.current.name){scope.isView=!0,$timeout(function(){$(element).find(".formpolicylink").on("click",function(event){scope.sitecontent.formconstructor.hasOwnProperty("useCustomPersonalPolicy")&&scope.sitecontent.formconstructor.useCustomPersonalPolicy&&scope.sitecontent.formconstructor.hasOwnProperty("customPersonalPolicyURL")&&scope.sitecontent.formconstructor.customPersonalPolicyURL?window.open(scope.sitecontent.formconstructor.customPersonalPolicyURL,"_blank").focus():ForuPolicy.checkPolicy().then(function(res){(res?(res=window.origin+"/foru-privacy/privacy",window.open(res,"_blank")):window.open("https://fo.ru/blog/politika-konfidentsialnosti/","_blank")).focus()})})},3e3);var _ref=!0;for((_ref=scope.sitecontent.formconstructor&&scope.sitecontent.formconstructor.hasOwnProperty("hideprivacyconfirm")&&scope.sitecontent.formconstructor.hideprivacyconfirm?!1:_ref)&&(_ref='<span style="line-height: 1.3;" class="agreetext"><span>'+scope.yaSoglashayusS1+'</span> <span class="c-link formpolicylink" >'+scope.yaSoglashayusS2+"</span></span>",scope.sitecontent.formconstructor.hasOwnProperty("useCustomPersonalPolicyTitle")&&scope.sitecontent.formconstructor.useCustomPersonalPolicyTitle&&scope.sitecontent.formconstructor.hasOwnProperty("customPersonalPolicyTitle")&&scope.sitecontent.formconstructor.customPersonalPolicyTitle&&(_ref='<span style="line-height: 1.3;" class="agreetext"><span class="c-link formpolicylink" >'+scope.sitecontent.formconstructor.customPersonalPolicyTitle+"</span></span>"),scope.sitecontent.formconstructor.formItems.push({classes:"check_class",id:"input_confirm",label:"",placeholder:"",requered:!0,style:{},text:_ref,type:"checkbox",typeName:scope.podtverzhdenieOSoglasiiSPolitikoyOb,typeObj:{name:scope.podtverzhdenieOSoglasiiSPolitikoyOb,type:"checkbox",value:!1}})),templ=scope.elemdata.templatehtml.replace(/\&\#39\;/g,"'"),_j=0,_len1=(keys=Object.keys(scope.sitecontent)).length;_j<_len1;_j++)key=keys[_j],scope.sitecontent[key]&&scope.sitecontent[key].text&&(templ=templ.replace("ng-model=\"sitecontent['"+key+"']['text']\"",'fomce="true" ng-bind-html="trustAsHtml(sitecontent[\''+key+"']['text'])\"")),"forusermodal"===key&&(scope.forusermodalFlag=!0);$compile(ThemeLayer.rewriteNgStyle(templ,scope.elemdata.templatename,scope.sitecontent,scope))(scope,function(newelem){return $timeout(function(){$(".check_class").closest(".checkbox").addClass("politicscheckbox"),scope.initBaseDropZone()},300),element.html(newelem)})}else{for(scope.showModal=!0,scope.showOverlayModal=!1,_k=0,_len2=(keys=Object.keys(scope.sitecontent)).length;_k<_len2;
1_k++)"forusermodal"===(key=keys[_k])&&(scope.sitecontent[key].hasOwnProperty("id")||(scope.sitecontent[key].id="userModal_"+RandomString.generateRandomString(32).toLowerCase()),$(element).attr("data-foru-user-modal-id",scope.sitecontent.forusermodal.id),scope.sitecontent[key].hasOwnProperty("name")||(scope.sitecontent[key].name=$("[data-foru-user-modal-id]").length),$(element).attr("data-foru-user-modal-name",scope.sitecontent.forusermodal.name),$(element).css("position","static"),$timeout(function(pass){return $(element).prepend("<h2 class='foru-user-modal-title'>"+scope.vsplyvayuscheeOkno+" "+pass+"</h2> <div class='foru-user-modal-description'>"+scope.vOpublikovannoyVersiiSaytaEtoOknoB+"</div>"),$(element).css("margin-bottom","32px")},2e3,!0,scope.sitecontent[key].name));scope.elemdata&&scope.elemdata.templatename&&(scope.updateExtraTemplate(scope.elemdata.templatename),scope.sitecontent.formconstructor.template=scope.elemdata.templatename,scope.rebuildsitecontent(),scope.tojsoncontent(),scope.formId=scope.sitecontent.formconstructor.formId),$timeout(function(){scope.drawConfigPrivacyBtn()},9e3)}},scope.fileList=[],scope.openFileSelect=function(itemId){itemId="#"+itemId+"_fileinput";$(itemId).trigger("click"),$(itemId).off("change").on("change",function(event){for(var i=0;i<event.target.files.length;i++)scope.fileList.push(event.target.files[i])})},scope.drawConfigPrivacyBtn=function(){},scope.removeFileItem=function(index){scope.fileList.splice(index,1)},scope.configPrivacy=function(event){event.preventDefault(),event.stopPropagation(),window.open("https://privacy.fo.ru/","_blank").focus()}}}});

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.