Sindbad~EG File Manager

Current Path : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt/panel/gutenberg/
Upload File :
Current File : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt/panel/gutenberg/docs.js

/**
 * Block dependencies
 */
(function(blocks,i18n,element){
var el = wp.element.createElement;
var __ = wp.i18n.__; 
var registerBlockType = wp.blocks.registerBlockType;
var _wp$editor = wp.editor,
    RichText = _wp$editor.RichText,
    InspectorControls = _wp$editor.InspectorControls,
    BlockControls = _wp$editor.BlockControls,
	MediaUpload = _wp$editor.MediaUpload,
	MediaUploadCheck = _wp$editor.MediaUploadCheck;
var _wp$components = wp.components,
    PanelBody = _wp$components.PanelBody,
    TextareaControl = _wp$components.TextareaControl,
    TextControl = _wp$components.TextControl,
    SelectControl = _wp$components.SelectControl,
    ToggleControl = _wp$components.ToggleControl,
    Dashicon = _wp$components.Dashicon,
    Toolbar = _wp$components.Toolbar,
    Button = _wp$components.Button,
	DropZoneProvider = _wp$components.Button, 
	DropZone = _wp$components.Button,
	Placeholder = _wp$components.Button,
	FormFileUpload = _wp$components.Button,
    Tooltip = _wp$components.Tooltip;
var ALLOWED_MEDIA_TYPES = [ 
	"text/plain",
	"text/richtext",
	"text/css",
	"application/javascript",
	"application/pdf",
	"application/postscript",
	"image/tiff",
	"image/tiff",
	"application/msword",
	"application/vnd.ms-powerpoint",
	"application/vnd.ms-excel",
	"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
	"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
	"application/vnd.ms-word.template.macroEnabled.12",
	"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
	"application/vnd.ms-excel.sheet.macroEnabled.12",
	"application/vnd.openxmlformats-officedocument.presentationml.presentation",
	"application/vnd.openxmlformats-officedocument.presentationml.slideshow",
	"application/vnd.apple.pages",
	"image/svg+xml"
];
/**
 * Register block
*/
registerBlockType( 'mwp/doc-viewer', {
	title:'Google Docs Viewer',
	category:'mwp-all-blocks',
	icon:{
		foreground:'green',
		src:'media-interactive',
	},
	attributes:{
		embedUrl:{
			type: 'string'
		},
		downloadLink:{
			type: 'boolean',
			default: false
		},
		downloadText:{
			type: 'string'
		},
	},
	edit:function(props) {
		var onChangedownloadText = function onChangedownloadText(value) {
			props.setAttributes({downloadText:value});
		};
		function onChange(event){
			props.setAttributes({embedUrl:event.target.value});
		}
		function onImageSelect(imageObject) {
			props.setAttributes({embedUrl:imageObject.url})
		}
		return [!!props.isSelected && el(
			InspectorControls,
			{key:'inspector'},
			el(
				PanelBody,
				{title:'Google Docs Viewer'},
				el(TextControl,{
					label:docs_lang.embed_url,
					value:props.attributes.embedUrl,
					onChange:onChange
				}),
				el(ToggleControl,{
					label:docs_lang.embed_download,
					checked:props.attributes.downloadLink,
					onChange:function onChange() {
						return props.setAttributes({downloadLink:!props.attributes.downloadLink});
					}
				}),
				el(TextControl,{
					label:docs_lang.embed_text,
					value:props.attributes.downloadText,
					onChange:onChangedownloadText
				}),
			)
		), 
		el(
			'div',
			{ className:'components-placeholder wp-block-embed'},
			el(
				'div',
				{ className:'components-placeholder__label'},
				el('span',{className:'editor-block-icon has-colors dashicons dashicons-media-interactive',style:{color:'green'}}),
				'Google Docs Viewer'
			),
			el(
				'form', 
				{className:'components-placeholder__fieldset'},
				el(
					'input',{ 
						id:'input_url',
						className: 'upload-url plus-button components-placeholder__input',
						type:'url',
						value:props.attributes.embedUrl, 
						placeholder:'Enter Document URL here...',
						onChange:onChange,
						onSelect:onChange,
					}
				),
				el(MediaUploadCheck,null,
					el(MediaUpload,{
						gallery:false,
						multiple:false,
						allowedTypes:ALLOWED_MEDIA_TYPES,
						onSelect:onImageSelect,
						render:function render(_ref4) {
							var open = _ref4.open;
							return el(Button,{
								onClick:open,
								className:'button st_upload_button', 
							}, 'Upload');
						}
					}),
				),
			)
		)];
	},
	// Defining the front-end interface
	save: function save() {
		// Rendering in PHP
		return null;
	}
});
})(
   window.wp.blocks,
   window.wp.i18n,
   window.wp.element,
);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists