Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1f953f7
Add single license page sidebar widget area
nickpagz May 11, 2024
5574b1b
Initial pass at styling the donation form
nickpagz May 22, 2024
8a6013f
Fix multiple issues with header menu
geoffguillain Jul 29, 2024
46e1a84
Fix menu position while admin bar is on
geoffguillain Jul 29, 2024
38403f1
Change mobile button menu size to pixels
geoffguillain Aug 12, 2024
9d18308
Merge pull request #110 from OpenSourceOrg/merge/menu-header
geoffguillain Aug 12, 2024
8cc6c1d
Move comment section
geoffguillain Aug 27, 2024
ac3553c
linting errors
geoffguillain Aug 27, 2024
2831da6
Merge pull request #118 from OpenSourceOrg/merge/discourse-comment-te…
geoffguillain Aug 27, 2024
543fd5f
Add header to the discourse comment link output
geoffguillain Aug 27, 2024
d4ea947
Merge pull request #120 from OpenSourceOrg/merge/discourse-comment-te…
geoffguillain Aug 27, 2024
88a2fa6
Always display comment block
geoffguillain Aug 28, 2024
654c9b5
Merge pull request #122 from OpenSourceOrg/merge/discourse-comment-te…
geoffguillain Aug 28, 2024
8ca3a35
Merge CSS from the customizer for comments
geoffguillain Sep 4, 2024
b427008
Compile CSS
geoffguillain Sep 4, 2024
e85f0c7
Merge pull request #124 from OpenSourceOrg/merge/discourse-comment-te…
geoffguillain Sep 4, 2024
1ceb571
Open non-osi content links on new tab
Vrishabhsk Sep 4, 2024
c42749a
Remove style manipulation for CiviCRM donation form integration
nickpagz Sep 9, 2024
5681be4
Merge branch 'main' into add/donation-widget-license-pages-main
nickpagz Sep 9, 2024
6da3b0e
Rebuild theme css and js
nickpagz Sep 9, 2024
86e0faf
Tweak sidebar box-sizing for mobile
nickpagz Sep 9, 2024
15428cb
Merge pull request #73 from OpenSourceOrg/add/donation-widget-license…
nickpagz Sep 9, 2024
0f5e727
Fix PHPCS in newly added block of code
Vrishabhsk Sep 4, 2024
76a69dd
Update function name
Vrishabhsk Sep 4, 2024
674f18e
Verify EM plugin is active using fn_exists check
Vrishabhsk Sep 10, 2024
a24aadb
Merge pull request #130 from Vrishabhsk/feature/VJ-52-target-blank
ahegyes Sep 13, 2024
b0082a4
Add comments section to single license template part
nickpagz Sep 20, 2024
9d19631
Re-compile css
nickpagz Sep 20, 2024
6cea542
Tweak css to hide background when no comments
nickpagz Sep 20, 2024
41ce0df
Merge pull request #136 from OpenSourceOrg/add/license-comments-field
nickpagz Oct 16, 2024
a3a86dd
Add ai.php
wpspecialprojects Oct 18, 2024
a1ddea6
Merge pull request #140 from OpenSourceOrg/add/ai-php
ajolo2ky Oct 20, 2024
8b7abb0
Add filter to reduce the Discourse comment body to 50 words
gin0115 Oct 24, 2024
eb85f56
Dev init
gin0115 Nov 11, 2024
71bf4a2
All tweaks are now cherry picked in.
gin0115 Mar 10, 2025
15a21d4
Pull in remote dev
gin0115 Mar 10, 2025
d2e73bd
fix merge conflicts
gin0115 Mar 10, 2025
ad90514
House Keeping
gin0115 Mar 10, 2025
798835b
Fix simple liniting issues
gin0115 Mar 10, 2025
5d92dae
Fix simple liniting issues
gin0115 Mar 10, 2025
f13663d
Fix simple liniting issues
gin0115 Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mu-plugins/*
!mu-plugins/osi-sponsors-list
!websub-compat.php
!mu-plugins/osi-events-manager-tweaks
!mu-plugins/osi-editor-tweaks

themes/*
!themes/osi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '162399256cc2e0280b43');

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'd8b92db19a6588800e2b');
1 change: 1 addition & 0 deletions mu-plugins/osi-editor-tweaks/build/scripts/theme/theme.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'eda230210ce9238b2938');

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'eda230210ce9238b2938');

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
76 changes: 76 additions & 0 deletions mu-plugins/osi-editor-tweaks/osi-editor-tweaks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
/**
* Plugin Name: OSI Event List
* Version: 1.0.0
* Author: WordPress.com Special Projects
* Author URI: https://wpspecialprojects.wordpress.com/
*/

if ( ! defined( 'ABSPATH' ) ) {
return;
}

define( 'OSI_ET_VERSION', '1.0.0' );
define( 'OSI_BUILD_PATH', plugin_dir_path( __FILE__ ) . 'build/' );
define( 'OSI_BUILD_URL', plugin_dir_url( __FILE__ ) . 'build/' );


/**
* Renders the block editor scripts.
*
* @return void
*/
function osi_et_admin_scripts() {
// If file exists, enqueue the script.
if ( file_exists( OSI_BUILD_PATH . 'scripts/editor/editor.asset.php' ) ) {
$assets = include OSI_BUILD_PATH . 'scripts/editor/editor.asset.php';
wp_enqueue_script(
'osi-event-list',
OSI_BUILD_URL . 'scripts/editor/editor.js',
$assets['dependencies'],
$assets['version'],
true
);
}

// If file exists, enqueue the editor styles.
if ( file_exists( OSI_BUILD_PATH . 'styles/editor/editor.scss.css' ) ) {
wp_enqueue_style(
'osi-event-list-editor',
OSI_BUILD_URL . 'styles/editor/editor.scss.css',
array(),
OSI_ET_VERSION
);
}
}
add_action( 'enqueue_block_editor_assets', 'osi_et_admin_scripts' );

/**
* Renders the front-end scripts.
*
* @return void
*/
function osi_et_frontend_scripts() {
// If file exists, enqueue the script.
if ( file_exists( OSI_BUILD_PATH . 'scripts/theme/theme.asset.php' ) ) {
$assets = include OSI_BUILD_PATH . 'scripts/theme/theme.asset.php';
wp_enqueue_script(
'osi-et-theme',
OSI_BUILD_URL . 'scripts/theme/theme.js',
$assets['dependencies'],
$assets['version'],
true
);
}

// If file exists, enqueue the front-end styles.
if ( file_exists( OSI_BUILD_PATH . 'styles/theme/theme.scss.css' ) ) {
wp_enqueue_style(
'osi-et-theme',
OSI_BUILD_URL . 'styles/theme/theme.scss.css',
array(),
OSI_ET_VERSION
);
}
}
add_action( 'wp_enqueue_scripts', 'osi_et_frontend_scripts' );
30 changes: 30 additions & 0 deletions mu-plugins/osi-editor-tweaks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "osi-editor-tweaks",
"version": "1.0.0",
"scripts": {
"build:scripts:editor": "wp-scripts build src/editor.js --output-path=build/scripts/editor",
"build:scripts:theme": "wp-scripts build src/theme.js --output-path=build/scripts/theme",
"build:scripts": "npm run build:scripts:editor && npm run build:scripts:theme",

"build:styles:editor": "wp-scripts build src/editor.scss --output-path=build/styles/editor",
"build:styles:theme": "wp-scripts build src/theme.scss --output-path=build/styles/theme",
"build:styles": "npm run build:styles:editor && npm run build:styles:theme",

"build": "npm-run-all --sequential build:scripts build:styles",
"watch:scripts:editor": "wp-scripts start src/editor.js --output-path=build/scripts/editor",
"watch:scripts:theme": "wp-scripts start src/theme.js --output-path=build/scripts/theme",
"watch:scripts": "npm run watch:scripts:editor && npm run watch:scripts:theme",

"watch:styles:editor": "wp-scripts start src/editor.scss --output-path=build/styles/editor",
"watch:styles:theme": "wp-scripts start src/theme.scss --output-path=build/styles/theme",
"watch:styles": "npm run watch:styles:editor && npm run watch:styles:theme",

"watch": "npm-run-all --parallel watch:scripts watch:styles"
},
"author": "",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@wordpress/scripts": "^26.3.0",
"npm-run-all": "^4.1.5"
}
}
81 changes: 81 additions & 0 deletions mu-plugins/osi-editor-tweaks/src/common.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* Image Styles */

.wp-block-image {
&.is-style-custom-filter-blackwhite {
img {
filter: grayscale(100%);
transition: filter 0.5s ease-in-out;
&:hover {
filter: grayscale(0%);
}
}
}
&.is-style-round-logo-border {
img {
padding: 10px;
border: 1px solid #E9E9E9;
border-radius: 50%;
}
}
}


/* Card Styles */

.wp-block-group {
&.osi-card {
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.03);
margin-bottom: 20px !important;
h3 {
line-height: 30px !important;
}
}
}


/* Slide-Up Animation */

.content .wp-block-heading {
&.slide-up {
transform: translateY(20px);
opacity: 0;
transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out, visibility 0s 0.5s;
overflow: hidden;
&.visible {
transform: translateY(0);
opacity: 1;
overflow: hidden;
}
}
}

.plethoraplugins-tabs-container.button-tabs {
h3 {
line-height: 36px !important;
}
.plethoraplugins-tabs {
margin-bottom: 26px;
}
.js-plethoraplugins-tabs {
li {
a {
font-weight: 600;
font-size: 16px;
line-height: 19px;
color: rgb(31, 31, 37);
padding: 15px 33px;
background: rgb(255, 255, 255);
border-radius: 5px;
text-decoration: none;
&.active {
background-color: #3Ea638;
color: #fff;
text-decoration: none !important;
span {
color: #fff;
}
}
}
}
}
}
143 changes: 143 additions & 0 deletions mu-plugins/osi-editor-tweaks/src/editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import { registerBlockStyle } from '@wordpress/blocks';
import { addFilter } from '@wordpress/hooks';
import { Fragment } from '@wordpress/element';
import { InspectorControls } from '@wordpress/block-editor';
import { PanelBody, ToggleControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

// Register the custom style for the core/image block
registerBlockStyle('core/image', {
name: 'custom-filter-blackwhite',
label: __('Black & White with Fade', 'osi-et'),
});

registerBlockStyle('core/image', {
name: 'round-logo-border',
label: __('Round Logo with Border', 'osi-et'),
});

/**
* Custom filter to add an "Animations" panel to the Inspector Controls of Heading blocks.
*
* @param {Function} BlockEdit The original BlockEdit component.
* @returns {Function} Modified BlockEdit component with additional Inspector Controls.
*/
addFilter('editor.BlockEdit', 'custom/animation-panel', (BlockEdit) => {
return (props) => {
// Only modify the core/heading block
if (props.name !== 'core/heading') {
return <BlockEdit {...props} />;
}

const { attributes, setAttributes } = props;

/**
* Handles the toggle switch change to enable or disable the "slide-up" class.
*
* @param {boolean} value Whether the "slide-up" class should be added or removed.
*/
const handleToggleChange = (value) => {
const classList = attributes.className ? attributes.className.split(' ') : [];

if (value) {
// Add the class if it doesn’t already exist
if (!classList.includes('slide-up')) {
classList.push('slide-up');
}
} else {
// Remove the class if it exists
const index = classList.indexOf('slide-up');
if (index > -1) {
classList.splice(index, 1);
}
}

// Update both enableSlider attribute and className
setAttributes({
enableSlider: value,
className: classList.join(' '),
});
};

return (
<Fragment>
{/* Render the original block edit component */}
<BlockEdit {...props} />

{/* Add custom Inspector Controls for animation */}
<InspectorControls>
<PanelBody title={__("Animations", 'osi-et')}>
<ToggleControl
label={__("Slide Up", 'osi-et')}
checked={attributes.className && attributes.className.includes('slide-up')}
onChange={handleToggleChange}
/>
</PanelBody>
</InspectorControls>
</Fragment>
);
};
});

/**
* Custom filter to add an "OSI Card" panel to the Inspector Controls of Group blocks.
*
* @param {Function} BlockEdit The original BlockEdit component.
* @returns {Function} Modified BlockEdit component with additional Inspector Controls.
*/
addFilter('editor.BlockEdit', 'custom/group-panel', (BlockEdit) => {
return (props) => {
// Only modify the core/group block
if (props.name !== 'core/group') {
return <BlockEdit {...props} />;
}

const { attributes, setAttributes } = props;

/**
* Handles the toggle switch change to enable or disable the "osi-card" class.
*
* @param {boolean} value Whether the "osi-card" class should be added or removed.
*/
const handleToggleChange = (value) => {
const classList = attributes.className ? attributes.className.split(' ') : [];

if (value) {
// Add the class if it doesn’t already exist
if (!classList.includes('osi-card')) {
classList.push('osi-card');
}
} else {
// Remove the class if it exists
const index = classList.indexOf('osi-card');
if (index > -1) {
classList.splice(index, 1);
}
}

// Update both isCard attribute and className
setAttributes({
isCard: value,
className: classList.join(' '),
});
};

return (
<Fragment>
{/* Render the original block edit component */}
<BlockEdit {...props} />

{/* Add custom Inspector Controls for OSI Card toggle */}
<InspectorControls>
<PanelBody title={__("OSI Card", 'osi-et')}>
<ToggleControl
label={__("Show as Card", 'osi-et')}
checked={attributes.className && attributes.className.includes('osi-card')}
onChange={handleToggleChange}
/>
</PanelBody>
</InspectorControls>
</Fragment>
);
};
});
1 change: 1 addition & 0 deletions mu-plugins/osi-editor-tweaks/src/editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "common";
Loading