diff --git a/activitypub-event-bridge.php b/activitypub-event-bridge.php index a4e0cad..9a7ca6b 100644 --- a/activitypub-event-bridge.php +++ b/activitypub-event-bridge.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub Event Bridge * Description: Integrating popular event plugins with the ActivityPub plugin. * Plugin URI: https://event-federation.eu/ - * Version: 0.1.0 + * Version: 0.1.1 * Author: André Menrath * Author URI: https://graz.social/@linos * Text Domain: activitypub-event-bridge diff --git a/assets/css/activitypub-event-bridge-admin.css b/assets/css/activitypub-event-bridge-admin.css index b6eaae1..8455b96 100644 --- a/assets/css/activitypub-event-bridge-admin.css +++ b/assets/css/activitypub-event-bridge-admin.css @@ -68,3 +68,90 @@ #activitypub_event_bridge_initially_activated { display: hidden; } + +/* Accordions for admin pages */ +.activitypub-event-bridge-settings-accordion { + border: 1px solid #c3c4c7; +} + +.activitypub-event-bridge-settings-accordion-heading { + margin: 0; + border-top: 1px solid #c3c4c7; + font-size: inherit; + line-height: inherit; + font-weight: 600; + color: inherit; +} + +.activitypub-event-bridge-settings-accordion-heading:first-child { + border-top: none; +} + +.activitypub-event-bridge-settings-accordion-panel { + margin: 0; + padding: 1em 1.5em; + background: #fff; +} + +.activitypub-event-bridge-settings-accordion-trigger { + background: #fff; + border: 0; + color: #2c3338; + cursor: pointer; + display: flex; + font-weight: 400; + margin: 0; + padding: 1em 3.5em 1em 1.5em; + min-height: 46px; + position: relative; + text-align: left; + width: 100%; + align-items: center; + justify-content: space-between; + -webkit-user-select: auto; + user-select: auto; +} + +.activitypub-event-bridge-settings-accordion-trigger { + color: #2c3338; + cursor: pointer; + font-weight: 400; + text-align: left; +} + +.activitypub-event-bridge-settings-accordion-trigger .title { + pointer-events: none; + font-weight: 600; + flex-grow: 1; +} + +.activitypub-event-bridge-settings-accordion-trigger .icon, +.activitypub-event-bridge-settings-accordion-viewed .icon { + border: solid #50575e medium; + border-width: 0 2px 2px 0; + height: .5rem; + pointer-events: none; + position: absolute; + right: 1.5em; + top: 50%; + transform: translateY(-70%) rotate(45deg); + width: .5rem; +} + +.activitypub-event-bridge-settings-accordion-trigger[aria-expanded="true"] .icon { + transform: translateY(-30%) rotate(-135deg); +} + +.activitypub-event-bridge-settings-accordion-trigger:active, +.activitypub-event-bridge-settings-accordion-trigger:hover { + background: #f6f7f7; +} + +.activitypub-event-bridge-settings-accordion-trigger:focus { + color: #1d2327; + border: none; + box-shadow: none; + outline-offset: -1px; + outline: 2px solid #2271b1; + background-color: #f6f7f7; +} diff --git a/assets/js/activitypub-event-bridge-admin.js b/assets/js/activitypub-event-bridge-admin.js new file mode 100644 index 0000000..bf00a1c --- /dev/null +++ b/assets/js/activitypub-event-bridge-admin.js @@ -0,0 +1,14 @@ +jQuery( function( $ ) { + // Accordion handling in various areas. + $( '.activitypub-event-bridge-settings-accordion' ).on( 'click', '.activitypub-event-bridge-settings-accordion-trigger', function() { + var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) ); + + if ( isExpanded ) { + $( this ).attr( 'aria-expanded', 'false' ); + $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true ); + } else { + $( this ).attr( 'aria-expanded', 'true' ); + $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false ); + } + } ); +} ); diff --git a/includes/class-setup.php b/includes/class-setup.php index e9b602c..966d1d3 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -208,6 +208,16 @@ class Setup { array(), ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION ); + wp_enqueue_script( + 'activitypub-event-bridge-admin-script', + plugins_url( + 'assets/js/activitypub-event-bridge-admin.js', + ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_FILE + ), + array( 'jquery' ), + ACTIVITYPUB_EVENT_BRIDGE_PLUGIN_VERSION, + false + ); } } diff --git a/templates/welcome.php b/templates/welcome.php index 3fbed43..e1def8e 100644 --- a/templates/welcome.php +++ b/templates/welcome.php @@ -57,6 +57,26 @@ WP_Filesystem(); +
+

+

+
+

+ +

+ +
+
+