Your IP : 3.134.108.183
(function(){"use strict";BX.namespace("BX.Disk.Document");BX.Disk.Document.CreateProcess=function(e){BX.Disk.Document.EditProcess.apply(this,arguments);this.typeFile=e.typeFile;this.targetFolderId=e.targetFolderId;this.serviceCode=e.serviceCode;this.service=null;this.popupConfirm=null};BX.Disk.Document.CreateProcess.prototype={__proto__:BX.Disk.Document.EditProcess.prototype,constructor:BX.Disk.Document.CreateProcess,buildModalWindow:function(){return this.openModal(BX.util.add_url_param("/bitrix/services/main/ajax.php",{action:"disk.api.documentService.goToCreate",serviceCode:this.serviceCode,typeFile:this.typeFile}))},getConfirmMessages:function(){return{title:BX.message("JS_DISK_DOC_PROCESS_NOW_CREATING_IN_SERVICE").replace("#SERVICE#",this.service.name),text:BX.message("JS_DISK_DOC_PROCESS_CREATE_DESCR_SAVE_DOC_F").replace("#SAVE_AS_DOC#",BX.message("JS_DISK_DOC_PROCESS_SAVE_AS")),saveButton:BX.message("JS_DISK_DOC_PROCESS_SAVE_AS")}},save:function(){return this.commit().then(function(e){this.objectId=e.objectId;this.showSaveFileDialog(e)}.bind(this))},showSaveFileDialog:function(e){var t=e.extension;var i=e.nameWithoutExtension;var s=BX.create("div",{props:{className:"bx-disk-document-edit-confirm"},children:[BX.create("div",{props:{className:"bx-disk-document-edit-confirm-title"},text:BX.message("JS_DISK_DOC_PROCESS_NOW_CREATING_IN_SERVICE").replace("#SERVICE#",this.service.name),children:[]}),BX.create("div",{props:{className:"bx-disk-document-edit-confirm-text-wrap bx-disk-document-edit-confirm-center"},children:[BX.create("input",{props:{id:"wd-new-create-filename",className:"bx-disk-document-edit-name-input",type:"text",value:i}}),BX.create("span",{props:{className:"bx-disk-document-edit-confirm-extension"},text:t})]})]});var n=this;var o=BX.PopupWindowManager.create("document-save-as-confirm",null,{content:s,overlay:true,buttons:[new BX.PopupWindowCustomButton({text:BX.message("DISK_JS_BTN_SAVE"),className:"ui-btn ui-btn-success",events:{click:function(){var s=BX("wd-new-create-filename").value;if(!s){BX.focus(BX("wd-new-create-filename"));return}this.addClassName("ui-btn-clock");n.rename({newName:s,oldName:i,extension:t}).then(function(t){this.onAfterSave.call(this,t,{object:{id:e.objectId,name:e.name,size:e.size,sizeInt:e.sizeInt,extension:e.extension},folderName:e.folderName});o.close()}.bind(n))}}}),new BX.PopupWindowCustomButton({text:BX.message("DISK_JS_BTN_CLOSE"),className:"ui-btn ui-btn-link",events:{click:function(){this.discard();o.close();this.closeModal()}.bind(this)}})],autoHide:false,closeByEsc:false,zIndex:this.getViewerZindex(),events:{onPopupClose:function(){this.destroy()}}});o.show()},rename:function(e){var t=new BX.Promise;var i=e.newName;var s=e.nameWithoutExtension;var n=e.extension;if(i===s||i+"."+n===s){t.fulfill({status:"success",data:{newName:s}});return t}var o=this.urlHelper().getUrlRenameFile(BX.Disk.Document.EditProcess.prototype.buildLinkToCommit.apply(this));return BX.ajax.promise({method:"POST",dataType:"json",url:o,data:{objectId:this.objectId,newName:i+"."+n,sessid:BX.bitrix_sessid()}})},commit:function(){return BX.Disk.Document.EditProcess.prototype.commit.apply(this,arguments).then(function(e){console.log("create file",e);return e})},buildLinkToCommit:function(){return this.urlHelper().getUrlCommitBlank(BX.Disk.Document.EditProcess.prototype.buildLinkToCommit.apply(this),this.typeFile,this.targetFolderId)},buildLinkToDiscard:function(){return this.urlHelper().getUrlDiscardBlankFile(this.buildLinkToCommit())}}})();
//# sourceMappingURL=createprocess.map.js