-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d2f5ea7
commit dadfd76
Showing
7 changed files
with
460 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,90 @@ | ||
wp.blocks.registerBlockType('rrze/faudir-block', { | ||
title: 'FAUDIR Block', | ||
icon: 'admin-users', | ||
category: 'common', | ||
attributes: { | ||
category: { type: 'string', default: '' }, | ||
identifier: { type: 'string', default: '' }, | ||
format: { type: 'string', default: 'list' }, | ||
show: { type: 'string', default: 'name, email, phone, organization, function' }, | ||
hide: { type: 'string', default: '' }, | ||
}, | ||
edit: function(props) { | ||
return wp.element.createElement( | ||
'div', | ||
null, | ||
wp.element.createElement( | ||
'label', | ||
null, | ||
'Category', | ||
wp.element.createElement('input', { | ||
type: 'text', | ||
value: props.attributes.category, | ||
onChange: function(event) { | ||
props.setAttributes({ category: event.target.value }); | ||
} | ||
}) | ||
), | ||
wp.element.createElement( | ||
'label', | ||
null, | ||
'Identifier', | ||
wp.element.createElement('input', { | ||
type: 'text', | ||
value: props.attributes.identifier, | ||
onChange: function(event) { | ||
props.setAttributes({ identifier: event.target.value }); | ||
} | ||
}) | ||
), | ||
wp.element.createElement( | ||
'label', | ||
null, | ||
'Format', | ||
wp.element.createElement('select', { | ||
value: props.attributes.format, | ||
onChange: function(event) { | ||
props.setAttributes({ format: event.target.value }); | ||
} | ||
}, | ||
wp.element.createElement('option', { value: 'list' }, 'List'), | ||
wp.element.createElement('option', { value: 'table' }, 'Table'), | ||
wp.element.createElement('option', { value: 'card' }, 'Card'), | ||
wp.element.createElement('option', { value: 'page' }, 'Page') | ||
) | ||
), | ||
wp.element.createElement( | ||
'label', | ||
null, | ||
'Show Fields', | ||
wp.element.createElement('input', { | ||
type: 'text', | ||
value: props.attributes.show, | ||
onChange: function(event) { | ||
props.setAttributes({ show: event.target.value }); | ||
} | ||
}) | ||
), | ||
wp.element.createElement( | ||
'label', | ||
null, | ||
'Hide Fields', | ||
wp.element.createElement('input', { | ||
type: 'text', | ||
value: props.attributes.hide, | ||
onChange: function(event) { | ||
props.setAttributes({ hide: event.target.value }); | ||
} | ||
}) | ||
) | ||
); | ||
}, | ||
save: function() { | ||
// This block will be rendered dynamically on the server-side, so no need to save anything here | ||
return null; | ||
}, | ||
}); | ||
|
||
jQuery(document).ready(function ($) { | ||
console.log('RRZE FAUDIR JS from src directory'); | ||
}); |
Oops, something went wrong.