| 1 |
wp.domReady(function() { |
| 2 |
var el = wp.element.createElement; |
| 3 |
var Button = wp.components.Button; |
| 4 |
var SVGIcon = el('svg', { |
| 5 |
xmlns: "http://www.w3.org/2000/svg", |
| 6 |
width: "32px", |
| 7 |
height: "32px", |
| 8 |
viewBox: "0 -2 24 24", |
| 9 |
dangerouslySetInnerHTML: { |
| 10 |
__html: '<g stroke="none" stroke-width="1" fill="#ffffff" fill-rule="evenodd"><path class="st0" d="M1.2,20L1.2,20l0-20h7.5v12.5C8.8,16.6,5.4,20,1.2,20z M17.6,4.8L17.6,4.8c0-2.6-2.1-4.8-4.8-4.8H9.6v9.6h3.2 C15.4,9.6,17.6,7.4,17.6,4.8z M18.8,15.2L18.8,15.2c0-2.6-2.1-4.8-4.8-4.8H9.6V20H14C16.6,20,18.8,17.9,18.8,15.2z"/></g>' |
| 11 |
} |
| 12 |
}); |
| 13 |
|
| 14 |
// Register the custom button in the Gutenberg editor |
| 15 |
wp.plugins.registerPlugin('borderless-ai-button', { |
| 16 |
render: function() { |
| 17 |
return el(wp.editPost.PluginPostStatusInfo, {}, |
| 18 |
el(Button, { |
| 19 |
className: 'ai-button', |
| 20 |
isPrimary: true, |
| 21 |
onClick: function() { |
| 22 |
window.open('https://visualmodo.com/artificial-intelligence', '_blank'); |
| 23 |
}, |
| 24 |
icon: SVGIcon |
| 25 |
}, 'Generate with Visualmodo AI') |
| 26 |
); |
| 27 |
} |
| 28 |
}); |
| 29 |
}); |
| 30 |
|