var InputCustomFont=api.InputCustomFont=api.extendReactClass('MixinInput',{render:function(){return this.renderPopupInput();},popupForm:function(){var href=api.urls.ajaxBase+'&context=media-selector&format=html&type=font&selected='+this.state.value;api.Modal.get({id:'file_manager_modal',type:'iframe',title:'JSN_EXTFW_SELECT_CUSTOM_FONT',width:'90%',height:'90%',content:{src:href+'&fieldid='+this.props.id,height:'100%',width:'100%'},buttons:[{text:'select',className:'btn btn-primary select-font'},{text:'cancel',onClick:api.Modal.hide,className:'btn btn-default'}],onModalShown:function(event){setTimeout(function(){var iframeWindow=event.target.refs.iframe.contentWindow;if(iframeWindow.location.href.indexOf('index.php?option=com_media&')>-1){var selectMedia=function(event){event.preventDefault();var selected=iframeWindow.ImageManager.frame.document.querySelector('.img-preview.selected');if(selected){selected=selected.href.match(/javascript:ImageManager.populateFields\('([^']+)'\)/);if(selected){jInsertFieldValue(iframeWindow.ImageManager.base+selected[1]);api.Modal.hide();}}};var insertBtn=iframeWindow.document.querySelector('.button-save-selected');if(insertBtn){insertBtn.addEventListener('click',selectMedia);}var selectBtn=document.querySelector('.modal-footer .btn-primary.select-font');if(selectBtn){selectBtn.addEventListener('click',selectMedia);}}}.bind(this),2000);}});window.jInsertFieldValue=function(value){this.setState({value:value});this.change(this.props.setting,value);api.Modal.hide();}.bind(this);}});