Skip to content

Commit

Permalink
specify "enableServiceWorker":false in chatrix block and update bluep…
Browse files Browse the repository at this point in the history
…rint
  • Loading branch information
ashfame committed Jan 19, 2024
1 parent 2950098 commit 4e1c2e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .wporg/assets/blueprints/blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"step": "runPHP",
"code": "<?php\n\nrequire_once 'wordpress/wp-load.php';\n\n$chatrix_block_simple = '<!-- wp:paragraph --> <p>Below you can see \"Chatrix\" block in action. You can add it anywhere using either <code>/chatrix</code> or by looking up chatrix when choosing which block to insert.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Even though its not functional in this Playground demo, since it requires its own service worker and that is not compatible with the Playground (running WordPress in your browser) at the moment, you can at least see how it looks and it can be added anywhere you can add a Gutenberg block :)</p> <!-- /wp:paragraph --> <!-- wp:automattic/chatrix {\"instanceId\":\"2530674218113325\",\"defaultHomeserver\":\"matrix.org\"} /-->';\n\n$chatrix_block_2col = <<<CHATRIXBLOCK2COLUMNS\n<!-- wp:paragraph -->\n<p>Below you can see “Chatrix” block in action. You can add it anywhere using either&nbsp;<code>/chatrix</code>&nbsp;or by looking up chatrix when choosing which block to insert.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:columns -->\n<div class=\"wp-block-columns\">\n<!-- wp:column {\"width\":\"33.33%\"} -->\n<div class=\"wp-block-column\" style=\"flex-basis:33.33%\">\n<!-- wp:paragraph -->\n<p>Here can be some login instructions of participating in the chat window on the right side:</p>\n<!-- /wp:paragraph -->\n</div>\n<!-- /wp:column -->\n<!-- wp:column {\"width\":\"66.66%\"} -->\n<div class=\"wp-block-column\" style=\"flex-basis:66.66%\">\n<!-- wp:automattic/chatrix {\"instanceId\":\"4986644425212020\",\"defaultHomeserver\":\"matrix.org\"} /-->\n</div>\n<!-- /wp:column -->\n</div>\n<!-- /wp:columns -->\n\n<!-- wp:paragraph -->\n<p>Unfortunately, it's not possible to login into Matrix inside of Playground demo, since it requires its own service worker and that is not compatible with the Playground at the moment. You can explore how it looks and how it can be added anywhere you can add a Gutenberg block :)</p>\n<!-- /wp:paragraph -->\nCHATRIXBLOCK2COLUMNS;\n\n$sample_page_post_id = 2;\n\nwp_update_post( array(\n 'ID' => $sample_page_post_id,\n 'post_title' => 'Chatrix [Regular]',\n 'post_content' => $chatrix_block_simple\n) );\n\nwp_insert_post( array(\n 'ID' => 3,\n 'post_title' => 'Chatrix [2 Column]',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => $chatrix_block_2col\n) );\n\nwp_insert_post( array(\n 'ID' => 4,\n 'post_title' => 'Chatrix [Popup]',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => '<!-- wp:paragraph --> <p>On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.</p> <!-- /wp:paragraph -->'\n) );\n\nupdate_option( 'chatrix_settings', array(\n 'homeserver' => 'matrix.org',\n 'room' => '#matrix:matrix.org',\n 'show_on' => 'specific',\n 'pages' => array(\n 0 => '4'\n )\n) );",
"code": "<?php\n\nrequire_once 'wordpress/wp-load.php';\n\n$chatrix_block_simple = '<!-- wp:paragraph --> <p>Below you can see \"Chatrix\" block in action. You can add it anywhere using either <code>/chatrix</code> or by looking up chatrix when choosing which block to insert.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Even though its not functional in this Playground demo, since it requires its own service worker and that is not compatible with the Playground (running WordPress in your browser) at the moment, you can at least see how it looks and it can be added anywhere you can add a Gutenberg block :)</p> <!-- /wp:paragraph --> <!-- wp:automattic/chatrix {\"enableServiceWorker\":false,\"instanceId\":\"2530674218113325\",\"defaultHomeserver\":\"matrix.org\"} /-->';\n\n$chatrix_block_2col = <<<CHATRIXBLOCK2COLUMNS\n<!-- wp:paragraph -->\n<p>Below you can see “Chatrix” block in action. You can add it anywhere using either&nbsp;<code>/chatrix</code>&nbsp;or by looking up chatrix when choosing which block to insert.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:columns -->\n<div class=\"wp-block-columns\">\n<!-- wp:column {\"width\":\"33.33%\"} -->\n<div class=\"wp-block-column\" style=\"flex-basis:33.33%\">\n<!-- wp:paragraph -->\n<p>Here can be some login instructions of participating in the chat window on the right side:</p>\n<!-- /wp:paragraph -->\n</div>\n<!-- /wp:column -->\n<!-- wp:column {\"width\":\"66.66%\"} -->\n<div class=\"wp-block-column\" style=\"flex-basis:66.66%\">\n<!-- wp:automattic/chatrix {\"enableServiceWorker\":false,\"instanceId\":\"4986644425212020\",\"defaultHomeserver\":\"matrix.org\"} /-->\n</div>\n<!-- /wp:column -->\n</div>\n<!-- /wp:columns -->\n\n<!-- wp:paragraph -->\n<p>Unfortunately, it's not possible to login into Matrix inside of Playground demo, since it requires its own service worker and that is not compatible with the Playground at the moment. You can explore how it looks and how it can be added anywhere you can add a Gutenberg block :)</p>\n<!-- /wp:paragraph -->\nCHATRIXBLOCK2COLUMNS;\n\n$sample_page_post_id = 2;\n\nwp_update_post( array(\n 'ID' => $sample_page_post_id,\n 'post_title' => 'Chatrix [Regular]',\n 'post_content' => $chatrix_block_simple\n) );\n\nwp_insert_post( array(\n 'ID' => 3,\n 'post_title' => 'Chatrix [2 Column]',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => $chatrix_block_2col\n) );\n\nwp_insert_post( array(\n 'ID' => 4,\n 'post_title' => 'Chatrix [Popup]',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => '<!-- wp:paragraph --> <p>On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.</p> <!-- /wp:paragraph -->'\n) );\n\nupdate_option( 'chatrix_settings', array(\n 'homeserver' => 'matrix.org',\n 'room' => '#matrix:matrix.org',\n 'show_on' => 'specific',\n 'pages' => array(\n 0 => '4'\n )\n) );",
"progress": {
"caption": "Setting Chatrix instances"
}
Expand Down
4 changes: 2 additions & 2 deletions .wporg/blueprint_runphp_step_code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once 'wordpress/wp-load.php';

$chatrix_block_simple = '<!-- wp:paragraph --> <p>Below you can see "Chatrix" block in action. You can add it anywhere using either <code>/chatrix</code> or by looking up chatrix when choosing which block to insert.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Even though its not functional in this Playground demo, since it requires its own service worker and that is not compatible with the Playground (running WordPress in your browser) at the moment, you can at least see how it looks and it can be added anywhere you can add a Gutenberg block :)</p> <!-- /wp:paragraph --> <!-- wp:automattic/chatrix {"instanceId":"2530674218113325","defaultHomeserver":"matrix.org"} /-->';
$chatrix_block_simple = '<!-- wp:paragraph --> <p>Below you can see "Chatrix" block in action. You can add it anywhere using either <code>/chatrix</code> or by looking up chatrix when choosing which block to insert.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Even though its not functional in this Playground demo, since it requires its own service worker and that is not compatible with the Playground (running WordPress in your browser) at the moment, you can at least see how it looks and it can be added anywhere you can add a Gutenberg block :)</p> <!-- /wp:paragraph --> <!-- wp:automattic/chatrix {"enableServiceWorker":false,"instanceId":"2530674218113325","defaultHomeserver":"matrix.org"} /-->';

$chatrix_block_2col = <<<CHATRIXBLOCK2COLUMNS
<!-- wp:paragraph -->
Expand All @@ -20,7 +20,7 @@
<!-- /wp:column -->
<!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%">
<!-- wp:automattic/chatrix {"instanceId":"4986644425212020","defaultHomeserver":"matrix.org"} /-->
<!-- wp:automattic/chatrix {"enableServiceWorker":false,"instanceId":"4986644425212020","defaultHomeserver":"matrix.org"} /-->
</div>
<!-- /wp:column -->
</div>
Expand Down

0 comments on commit 4e1c2e9

Please sign in to comment.