PluginProbe
Borderless – Addons and Templates for Elementor / 1.6.1
Borderless – Addons and Templates for Elementor v1.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / assets / scripts / ai-button.js

ai-button.js in Borderless – Addons and Templates for Elementor 1.6.1, at assets/scripts/ai-button.js

30 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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