From 0ed5768f609d72f475885b46d783865da0f00f1a Mon Sep 17 00:00:00 2001 From: ashfame Date: Wed, 17 Jan 2024 22:12:59 +0400 Subject: [PATCH 1/6] move assets directory one level below .wporg --- .github/workflows/publish-release.yml | 2 +- .wporg/{ => assets}/screenshot-1.png | Bin .wporg/{ => assets}/screenshot-2.png | Bin .wporg/{ => assets}/screenshot-3.png | Bin .wporg/{ => assets}/screenshot-4.png | Bin .wporg/{ => assets}/screenshot-5.png | Bin README.md | 10 +++++----- 7 files changed, 6 insertions(+), 6 deletions(-) rename .wporg/{ => assets}/screenshot-1.png (100%) rename .wporg/{ => assets}/screenshot-2.png (100%) rename .wporg/{ => assets}/screenshot-3.png (100%) rename .wporg/{ => assets}/screenshot-4.png (100%) rename .wporg/{ => assets}/screenshot-5.png (100%) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index f6860275..44494b7c 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -47,5 +47,5 @@ jobs: SVN_USERNAME: ${{ secrets.SVN_USERNAME }} SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} BUILD_DIR: release/${{ inputs.version }} - ASSETS_DIR: .wporg + ASSETS_DIR: .wporg/assets VERSION: ${{ inputs.version }} diff --git a/.wporg/screenshot-1.png b/.wporg/assets/screenshot-1.png similarity index 100% rename from .wporg/screenshot-1.png rename to .wporg/assets/screenshot-1.png diff --git a/.wporg/screenshot-2.png b/.wporg/assets/screenshot-2.png similarity index 100% rename from .wporg/screenshot-2.png rename to .wporg/assets/screenshot-2.png diff --git a/.wporg/screenshot-3.png b/.wporg/assets/screenshot-3.png similarity index 100% rename from .wporg/screenshot-3.png rename to .wporg/assets/screenshot-3.png diff --git a/.wporg/screenshot-4.png b/.wporg/assets/screenshot-4.png similarity index 100% rename from .wporg/screenshot-4.png rename to .wporg/assets/screenshot-4.png diff --git a/.wporg/screenshot-5.png b/.wporg/assets/screenshot-5.png similarity index 100% rename from .wporg/screenshot-5.png rename to .wporg/assets/screenshot-5.png diff --git a/README.md b/README.md index 0381c93a..330b4551 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ Easily add a [Matrix](https://matrix.org) client to WordPress pages, either thro If you have any feedback or questions about Chatrix, please do talk to plugin maintainers at [#chatrix:matrix.org](https://matrix.to/#/#chatrix:matrix.org). ## Screenshots -![Block - Login](.wporg/screenshot-1.png) -![Block - Room List](.wporg/screenshot-2.png) -![Block - Timeline](.wporg/screenshot-3.png) -![Popup - Settings](.wporg/screenshot-4.png) -![Popup - Timeline](.wporg/screenshot-5.png) +![Block - Login](.wporg/assets/screenshot-1.png) +![Block - Room List](.wporg/assets/screenshot-2.png) +![Block - Timeline](.wporg/assets/screenshot-3.png) +![Popup - Settings](.wporg/assets/screenshot-4.png) +![Popup - Timeline](.wporg/assets/screenshot-5.png) ## Frequently Asked Questions ### How can I install this plugin on my site? From 295009838c0e462bf118ec841777cda7c4006666 Mon Sep 17 00:00:00 2001 From: ashfame Date: Wed, 17 Jan 2024 22:26:17 +0400 Subject: [PATCH 2/6] add blueprint.json and files used to manage the php code that goes into runPHP step --- .wporg/assets/blueprints/blueprint.json | 34 +++++++++++++ .wporg/assets/readme.md | 3 ++ .wporg/blueprint_runphp_step_code.php | 65 +++++++++++++++++++++++++ .wporg/update_blueprint.sh | 16 ++++++ 4 files changed, 118 insertions(+) create mode 100644 .wporg/assets/blueprints/blueprint.json create mode 100644 .wporg/assets/readme.md create mode 100644 .wporg/blueprint_runphp_step_code.php create mode 100644 .wporg/update_blueprint.sh diff --git a/.wporg/assets/blueprints/blueprint.json b/.wporg/assets/blueprints/blueprint.json new file mode 100644 index 00000000..b2424ba6 --- /dev/null +++ b/.wporg/assets/blueprints/blueprint.json @@ -0,0 +1,34 @@ +{ + "landingPage": "/sample-page/", + "preferredVersions": { + "php": "8.0", + "wp": "latest" + }, + "steps": [ + { + "step": "login", + "username": "admin", + "password": "password" + }, + { + "step": "setSiteOptions", + "options": { + "permalink_structure": "/%year%/%monthnum%/%day%/%postname%/" + } + }, + { + "step": "installPlugin", + "pluginZipFile": { + "resource": "wordpress.org/plugins", + "slug": "chatrix" + } + }, + { + "step": "runPHP", + "code": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Here can be some login instructions of participating in the chat window on the right side:

\n\n
\n\n\n
\n\n
\n\n
\n\n\n\n

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 :)

\n\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' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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" + } + } + ] +} diff --git a/.wporg/assets/readme.md b/.wporg/assets/readme.md new file mode 100644 index 00000000..624f8ad9 --- /dev/null +++ b/.wporg/assets/readme.md @@ -0,0 +1,3 @@ +Run `update_blueprint.sh` after making changes in `blueprint_runphp_step_code.php` so that `.wporg/assets/blueprints/blueprint.json` is updated. + +[See blueprint in action on playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/automattic/chatrix/main/.wporg/assets/blueprints/blueprint.json) diff --git a/.wporg/blueprint_runphp_step_code.php b/.wporg/blueprint_runphp_step_code.php new file mode 100644 index 00000000..83ae3329 --- /dev/null +++ b/.wporg/blueprint_runphp_step_code.php @@ -0,0 +1,65 @@ +

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

'; + +$chatrix_block_2col = << +

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

+ + + +
+ +
+ +

Here can be some login instructions of participating in the chat window on the right side:

+ +
+ + +
+ +
+ +
+ + + +

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 :)

+ +CHATRIXBLOCK2COLUMNS; + +$sample_page_post_id = 2; + +wp_update_post( array( + 'ID' => $sample_page_post_id, + 'post_title' => 'Chatrix [Regular]', + 'post_content' => $chatrix_block_simple +) ); + +wp_insert_post( array( + 'ID' => 3, + 'post_title' => 'Chatrix [2 Column]', + 'post_type' => 'page', + 'post_status' => 'publish', + 'post_content' => $chatrix_block_2col +) ); + +wp_insert_post( array( + 'ID' => 4, + 'post_title' => 'Chatrix [Popup]', + 'post_type' => 'page', + 'post_status' => 'publish', + 'post_content' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

' +) ); + +update_option( 'chatrix_settings', array( + 'homeserver' => 'matrix.org', + 'room' => '#matrix:matrix.org', + 'show_on' => 'specific', + 'pages' => array( + 0 => '4' + ) +) ); diff --git a/.wporg/update_blueprint.sh b/.wporg/update_blueprint.sh new file mode 100644 index 00000000..a2304576 --- /dev/null +++ b/.wporg/update_blueprint.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if ! command -v jq &> /dev/null ; then + echo "jq is not installed. Please install jq (https://jqlang.github.io/jq/) before running this script." +fi + +# Get the directory of the script +script_dir="$(dirname "$(readlink -f "$0")")" + +blueprint_location="$script_dir/assets/blueprints/blueprint.json" +phpsrc_location="$script_dir/blueprint_runphp_step_code.php" + +jq --arg newCode "$(cat $phpsrc_location)" '.steps[] |= if .step == "runPHP" then .code = $newCode else . end' $blueprint_location > updated_blueprint.json + +rm $blueprint_location +mv updated_blueprint.json $blueprint_location From 4e1c2e94d7e0c8ed32f74d3cb73fbd8f190048ce Mon Sep 17 00:00:00 2001 From: ashfame Date: Fri, 19 Jan 2024 15:45:09 +0400 Subject: [PATCH 3/6] specify "enableServiceWorker":false in chatrix block and update blueprint --- .wporg/assets/blueprints/blueprint.json | 2 +- .wporg/blueprint_runphp_step_code.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.wporg/assets/blueprints/blueprint.json b/.wporg/assets/blueprints/blueprint.json index b2424ba6..581d9095 100644 --- a/.wporg/assets/blueprints/blueprint.json +++ b/.wporg/assets/blueprints/blueprint.json @@ -25,7 +25,7 @@ }, { "step": "runPHP", - "code": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Here can be some login instructions of participating in the chat window on the right side:

\n\n
\n\n\n
\n\n
\n\n
\n\n\n\n

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 :)

\n\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' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Here can be some login instructions of participating in the chat window on the right side:

\n\n
\n\n\n
\n\n
\n\n
\n\n\n\n

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 :)

\n\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' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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" } diff --git a/.wporg/blueprint_runphp_step_code.php b/.wporg/blueprint_runphp_step_code.php index 83ae3329..767241fa 100644 --- a/.wporg/blueprint_runphp_step_code.php +++ b/.wporg/blueprint_runphp_step_code.php @@ -2,7 +2,7 @@ require_once 'wordpress/wp-load.php'; -$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

'; +$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

'; $chatrix_block_2col = << @@ -20,7 +20,7 @@
- +
From 0aac179c1d99d362a7e2fad724b5edd8c2043a81 Mon Sep 17 00:00:00 2001 From: ashfame Date: Fri, 19 Jan 2024 23:23:33 +0400 Subject: [PATCH 4/6] improve blueprint --- .wporg/assets/blueprints/blueprint.json | 2 +- .wporg/blueprint_runphp_step_code.php | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.wporg/assets/blueprints/blueprint.json b/.wporg/assets/blueprints/blueprint.json index 581d9095..08d6e58a 100644 --- a/.wporg/assets/blueprints/blueprint.json +++ b/.wporg/assets/blueprints/blueprint.json @@ -25,7 +25,7 @@ }, { "step": "runPHP", - "code": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Here can be some login instructions of participating in the chat window on the right side:

\n\n
\n\n\n
\n\n
\n\n
\n\n\n\n

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 :)

\n\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' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Edit this page to specify what room should Chatrix run in as, single-room mode. By default it loads up

#matrix:matrix.org

\n\n\n

You would need to select Chatrix block to reveal its settings on the right side panel.

\n\n
\n\n\n
\n\n
\n\n
\n\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_name' => 'chatrix-regular-mode',\n 'post_content' => $chatrix_block_simple\n) );\n\nwp_insert_post( array(\n 'ID' => 3,\n 'post_title' => 'Chatrix [Single Room Mode]',\n 'post_name' => 'chatrix-single-room-mode',\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_name' => 'chatrix-in-popup-mode',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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" } diff --git a/.wporg/blueprint_runphp_step_code.php b/.wporg/blueprint_runphp_step_code.php index 767241fa..a10bc744 100644 --- a/.wporg/blueprint_runphp_step_code.php +++ b/.wporg/blueprint_runphp_step_code.php @@ -2,7 +2,7 @@ require_once 'wordpress/wp-load.php'; -$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

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 :)

'; +$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

'; $chatrix_block_2col = << @@ -14,21 +14,20 @@
-

Here can be some login instructions of participating in the chat window on the right side:

+

Edit this page to specify what room should Chatrix run in as, single-room mode. By default it loads up

#matrix:matrix.org

+ + +

You would need to select Chatrix block to reveal its settings on the right side panel.

- +
- - -

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 :)

- CHATRIXBLOCK2COLUMNS; $sample_page_post_id = 2; @@ -36,12 +35,14 @@ wp_update_post( array( 'ID' => $sample_page_post_id, 'post_title' => 'Chatrix [Regular]', + 'post_name' => 'chatrix-regular-mode', 'post_content' => $chatrix_block_simple ) ); wp_insert_post( array( 'ID' => 3, - 'post_title' => 'Chatrix [2 Column]', + 'post_title' => 'Chatrix [Single Room Mode]', + 'post_name' => 'chatrix-single-room-mode', 'post_type' => 'page', 'post_status' => 'publish', 'post_content' => $chatrix_block_2col @@ -50,6 +51,7 @@ wp_insert_post( array( 'ID' => 4, 'post_title' => 'Chatrix [Popup]', + 'post_name' => 'chatrix-in-popup-mode', 'post_type' => 'page', 'post_status' => 'publish', 'post_content' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

' From 44ec8331781a5fb052aa4c6cc9d3fab053b45a67 Mon Sep 17 00:00:00 2001 From: ashfame Date: Fri, 19 Jan 2024 23:27:51 +0400 Subject: [PATCH 5/6] update landing page in blueprint --- .wporg/assets/blueprints/blueprint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.wporg/assets/blueprints/blueprint.json b/.wporg/assets/blueprints/blueprint.json index 08d6e58a..0b11085c 100644 --- a/.wporg/assets/blueprints/blueprint.json +++ b/.wporg/assets/blueprints/blueprint.json @@ -1,5 +1,5 @@ { - "landingPage": "/sample-page/", + "landingPage": "/chatrix-regular-mode/", "preferredVersions": { "php": "8.0", "wp": "latest" From e5caa9729291b9e43c90b0f97635a21dcb40afe3 Mon Sep 17 00:00:00 2001 From: ashfame Date: Fri, 19 Jan 2024 23:44:53 +0400 Subject: [PATCH 6/6] more improvements in blueprint --- .wporg/assets/blueprints/blueprint.json | 2 +- .wporg/blueprint_runphp_step_code.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.wporg/assets/blueprints/blueprint.json b/.wporg/assets/blueprints/blueprint.json index 0b11085c..623a4197 100644 --- a/.wporg/assets/blueprints/blueprint.json +++ b/.wporg/assets/blueprints/blueprint.json @@ -25,7 +25,7 @@ }, { "step": "runPHP", - "code": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Edit this page to specify what room should Chatrix run in as, single-room mode. By default it loads up

#matrix:matrix.org

\n\n\n

You would need to select Chatrix block to reveal its settings on the right side panel.

\n\n
\n\n\n
\n\n
\n\n
\n\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_name' => 'chatrix-regular-mode',\n 'post_content' => $chatrix_block_simple\n) );\n\nwp_insert_post( array(\n 'ID' => 3,\n 'post_title' => 'Chatrix [Single Room Mode]',\n 'post_name' => 'chatrix-single-room-mode',\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_name' => 'chatrix-in-popup-mode',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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": "

Below you can see \"Chatrix\" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

';\n\n$chatrix_block_2col = <<\n

Below you can see “Chatrix” block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

\n\n\n\n
\n\n
\n\n

Edit this page to specify what room should Chatrix run in as, single-room mode. By default, it loads up:

\n\n\n
#matrix:matrix.org
\n\n\n

You would need to select Chatrix block to reveal its settings on the right side panel.

\n\n
\n\n\n
\n\n
\n\n
\n\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_name' => 'chatrix-regular-mode',\n 'post_content' => $chatrix_block_simple\n) );\n\nwp_insert_post( array(\n 'ID' => 3,\n 'post_title' => 'Chatrix [Single Room Mode]',\n 'post_name' => 'chatrix-single-room-mode',\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_name' => 'chatrix-in-popup-mode',\n 'post_type' => 'page',\n 'post_status' => 'publish',\n 'post_content' => '

On this page, you can see the popup widget at the bottom right of your screen. Click on it to show Chatrix.

'\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" } diff --git a/.wporg/blueprint_runphp_step_code.php b/.wporg/blueprint_runphp_step_code.php index a10bc744..67cd10c9 100644 --- a/.wporg/blueprint_runphp_step_code.php +++ b/.wporg/blueprint_runphp_step_code.php @@ -2,7 +2,7 @@ require_once 'wordpress/wp-load.php'; -$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

'; +$chatrix_block_simple = '

Below you can see "Chatrix" block in action. You can add it anywhere using either /chatrix or by looking up chatrix when choosing which block to insert.

Chatrix can also run in single room mode.

'; $chatrix_block_2col = << @@ -14,8 +14,11 @@
-

Edit this page to specify what room should Chatrix run in as, single-room mode. By default it loads up

#matrix:matrix.org

+

Edit this page to specify what room should Chatrix run in as, single-room mode. By default, it loads up:

+ +
#matrix:matrix.org
+

You would need to select Chatrix block to reveal its settings on the right side panel.