HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/testingff/public_html/fdfctr/wp-content/plugins/quiz-cat/includes/block.js
( function( blocks, editor, element ) {

	var createElement  = element.createElement
	var BlockControls = wp.blockEditor.BlockControls
	var SelectControl = wp.components.SelectControl
	var Toolbar = wp.components.Toolbar
	var quizzes = fca_qc_gutenblock_script_data.quizzes

	blocks.registerBlockType( 'quiz-cat/gutenblock', {
		title: 'Quiz Cat Quiz',
		icon: 'welcome-learn-more',
		category: 'widgets',
		keywords: ['quiz', 'quizzes', 'test' ],
		edit: function( props ) {
			return [
				createElement(
					BlockControls,
					{ 
						key: 'qc-controls'
					},		
					createElement(
						SelectControl,
						{	
							className: 'fca-qc-gutenblock-select',
							value: props.attributes.post_id,
							options: quizzes,
							onChange: function( newValue ){ props.setAttributes({ post_id: newValue }) }
						}
					),
					props.attributes.post_id == 0 ? '' : 
					createElement(
						'a',
						{	
							href: fca_qc_gutenblock_script_data.editurl + '?post=' + props.attributes.post_id + '&action=edit',
							target: '_blank',
							className: 'fca-qc-gutenblock-link'
						},
						'Edit'
					),
					createElement(
						'a',
						{	
							href: fca_qc_gutenblock_script_data.newurl + '?post_type=fca_qc_quiz',
							target: '_blank',
							className: 'fca-qc-gutenblock-link'
						},
						'New'
					)
				),
				createElement( wp.serverSideRender, {
					key: 'qc_ssr',
					block: 'quiz-cat/gutenblock',
					attributes:  props.attributes,
				})
			]
		},

		save: function( props ) {
			return null
		},
	} )
}(
	window.wp.blocks,
	window.wp.editor,
	window.wp.element
))