PluginProbe
MisterPlan – Booking Engines / trunk
MisterPlan – Booking Engines vtrunk
1.1.46 trunk 1. 1.0.10 1.0.11 1.0.13 1.0.14 1.0.15 1.0.9 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.21 1.1.22 All 52 releases
misterplan / lib / mplan_block.js

mplan_block.js in MisterPlan – Booking Engines trunk, at lib/mplan_block.js

82 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var blockStyle = {
2 backgroundColor: 'azure',
3 color: '#666',
4 padding: '15px'
5 }
6 wp.blocks.registerBlockType('mrplan/mplan-block', {
7 title: 'MisterPlan Motor de Reservas',
8 icon: 'media-spreadsheet',
9 category: 'layout',
10 edit: editBlock,
11 save: function() {
12 return wp.element.createElement( 'h2', { style: blockStyle }, 'Este es el contenido que se salva!!' );
13 }
14 }
15 )
16
17 function editBlock(props){
18 function updateheader(event) {
19 props.setAttributes({
20 header: event.target.value
21 })
22 }
23 function updatecontent(event) {
24 props.setAttributes({
25 content: event.target.value
26 })
27 }
28 var element = null;
29 const response = fetch( `https://api.microlink.io?`, {
30 cache: 'no-cache',
31 headers: {
32 'user-agent': 'WP Block',
33 'content-type': 'application/json'
34 },
35 method: 'GET',
36 redirect: 'follow',
37 referrer: 'no-referrer',
38 })
39 .then(
40 returned => {
41 element = wp.element.createElement(
42 "div",
43 null,
44 wp.element.createElement(
45 "h3",
46 null,
47 "MisterPlan"
48 ),
49 wp.element.createElement(
50 "input",
51 {
52 type: "text",
53 value: props.attributes.header,
54 onChange: updateheader
55 }
56 ),
57 wp.element.createElement(
58 "p",
59 null,
60 "Seleccione el motor"
61 ),
62 wp.element.createElement(
63 "select",{
64 onChange: updatecontent
65 },
66 wp.element.createElement('option',
67 {
68 value: '1',
69 text: 'a',
70 }, 'a')
71 ),
72 );
73 }
74 );
75
76 return element;
77
78
79
80 return "<select><option value='a'>A</option></select>";
81 return wp.element.createElement('select',{ style: blockStyle }, 'Este es el contenido que se salva!!' )
82 }