%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/js/landing/ui/panel/
Upload File :
Create Path :
Current File : /home/bitrix/www/bitrix/js/landing/ui/panel/image_panel.min.js

(function(){"use strict";BX.namespace("BX.Landing.UI.Panel");BX.Landing.UI.Panel.Image=function(e){BX.Landing.UI.Panel.Content.apply(this,arguments);this.layout.classList.add("landing-ui-panel-image");this.onChangeHandler=function(){};this.headerButtonsField=this.createHeaderButtons();this.cards=new BX.Landing.Collection.BaseCollection;this.overlay.classList.add("landing-ui-panel-image");this.title.appendChild(this.headerButtonsField.layout);document.body.appendChild(this.layout);this.title.innerText=BX.message("LANDING_IMAGE_LIBRARY_PANEL_TITLE")};BX.Landing.UI.Panel.Image.getInstance=function(){if(!BX.Landing.UI.Panel.Image.instance){BX.Landing.UI.Panel.Image.instance=new BX.Landing.UI.Panel.Image("image_panel")}return BX.Landing.UI.Panel.Image.instance};BX.Landing.UI.Panel.Image.instance=null;BX.Landing.UI.Panel.Image.prototype={constructor:BX.Landing.UI.Panel.Image,__proto__:BX.Landing.UI.Panel.Content.prototype,onChangeView:function(e){if(e==="unsplash"){this.showUnsplash()}if(e==="google"){this.showGoogle()}if(e==="disk"){this.showUploader()}},showUploader:function(){var e=this.cards.get("uploader");if(!e){e=new BX.Landing.UI.Card.Uploader({id:"uploader"});this.appendCard(e);this.cards.add(e)}this.hideAll();e.show()},showGoogle:function(){var e=this.cards.get("google");if(!e){e=new BX.Landing.UI.Card.Google({id:"google",searchLabel:BX.message("GOOGLE_SEARCH_FIELD_LABEL"),searchTips:[{name:"Nature",value:"Nature"},{name:"People",value:"People"},{name:"Buildings",value:"Buildings"},{name:"Sunset",value:"Sunset"}],description:BX.message("LANDING_IMAGE_GOOGLE_DESCRIPTION"),onChange:this.onChange.bind(this),params:this.uploadParams});this.appendCard(e);this.cards.add(e)}this.hideAll();e.showPopular();e.show()},showUnsplash:function(){var e=this.cards.get("unsplash");if(!e){e=new BX.Landing.UI.Card.Unsplash({id:"unsplash",searchLabel:BX.message("UNSPLASH_SEARCH_FIELD_LABEL"),searchTips:[{name:"Nature",value:"Nature"},{name:"People",value:"People"},{name:"Buildings",value:"Buildings"},{name:"Sunset",value:"Sunset"}],description:BX.message("LANDING_IMAGE_UNSPLASH_DESCRIPTION"),onChange:this.onChange.bind(this)});this.appendCard(e);this.cards.add(e)}this.hideAll();e.show()},hideAll:function(){this.cards.forEach(function(e){e.layout.hidden=true})},createHeaderButtons:function(){return new BX.Landing.UI.Field.ButtonGroup({items:[{name:BX.message("LANDING_CONTENT_EDIT_IMAGE_HEADER_BUTTON_UNSPLASH"),value:"unsplash",active:true},{name:BX.message("LANDING_CONTENT_EDIT_IMAGE_HEADER_BUTTON_GOOGLE"),value:"google"},{name:BX.message("LANDING_CONTENT_EDIT_IMAGE_HEADER_BUTTON_FROM_DISK"),value:"disk"}],onChange:this.onChangeView.bind(this)})},show:function(e,n,a,i){this.uploadParams=i||{};this.externalLoader=a;this.params=n;this.onChangeView(e);BX.Landing.UI.Panel.Content.prototype.show.call(this);return new Promise(function(e){this.promiseResolve=e}.bind(this))},hide:function(){this.params=null;BX.Landing.UI.Panel.Content.prototype.hide.call(this)},onChange:function(e){BX.Landing.Utils.urlToBlob(e.link).then(function(n){n.lastModifiedDate=new Date;n.name=e.name;return n}).then(this.promiseResolve.bind(this));this.hide()}}})();

Zerion Mini Shell 1.0