Changeset 13621
- Timestamp:
- 04/30/2024 05:32:22 AM (5 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/locale-notice.asset.php
r12130 r13621 1 <?php return array('dependencies' => array(), 'version' => ' 75158a71213280929fbc');1 <?php return array('dependencies' => array(), 'version' => '6ab2c759f5f19a11f996'); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/build/locale-notice.js
r12130 r13621 1 !function(e,o,i){"use strict";const c=e.WPOrgLearnLocaleNotice||{},n=o.extend(c,{$notice:o(),init(){n.$notice=o(".wporg-learn-locale-notice"),n.$notice.on("click",".wporg-learn-locale-notice-dismiss",(function(e){e.preventDefault(),n.dismissNotice()}))},dismissNotice(){n.$notice.fadeTo(100,0,(function(){n.$notice.slideUp(100,(function(){n.$notice.remove()}))})),i.set("wporg-learn-locale-notice-dismissed",!0,n.cookie.expires,n.cookie.cpath,n.cookie.domain,n.cookie.secure)}});o(document).ready((function(){n.init()}))}(window,jQuery,wpCookies);1 !function(e,o,i){"use strict";const n=e.WPOrgLearnLocaleNotice||{},c=o.extend(n,{$notice:o(),init:function(){c.$notice=o(".wporg-learn-locale-notice"),c.$notice.on("click",".wporg-learn-locale-notice-dismiss",(function(e){e.preventDefault(),c.dismissNotice()}))},dismissNotice:function(){c.$notice.fadeTo(100,0,(function(){c.$notice.slideUp(100,(function(){c.$notice.remove()}))})),i.set("wporg-learn-locale-notice-dismissed",!0,c.cookie.expires,c.cookie.cpath,c.cookie.domain,c.cookie.secure)}});o(document).ready((function(){c.init()}))}(window,jQuery,wpCookies); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/constants.js
r12096 r13621 5 5 6 6 export const errors = { 7 BLOCK_SIDEBAR_TYPE_INCOMPATIBLE: __( 8 'Error: This block is not compatible with this sidebar.', 9 'wporg-learn' 10 ), 11 BLOCK_POST_TYPE_INCOMPATIBLE: __( 12 'Error: This block is not compatible with this post type.', 13 'wporg-learn' 14 ), 7 BLOCK_SIDEBAR_TYPE_INCOMPATIBLE: __( 'Error: This block is not compatible with this sidebar.', 'wporg-learn' ), 8 BLOCK_POST_TYPE_INCOMPATIBLE: __( 'Error: This block is not compatible with this post type.', 'wporg-learn' ), 15 9 }; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/course-data/src/edit.js
r12289 r13621 5 5 import { Placeholder } from '@wordpress/components'; 6 6 7 import { use IsBlockInSidebar, useGetCurrentPostType} from '../../hooks';7 import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks'; 8 8 import { getBlockPlaceholderMessage } from '../../utils'; 9 9 … … 13 13 useGetCurrentPostType(), 14 14 useIsBlockInSidebar( clientId, 'wporg-learn-courses' ), 15 __( 16 'This will be dynamically populated based on the current course data.', 17 'wporg-learn' 18 ) 15 __( 'This will be dynamically populated based on the current course data.', 'wporg-learn' ) 19 16 ); 20 17 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/course-data/src/index.js
r12289 r13621 44 44 * It will be shown in the Block Tab in the Settings Sidebar. 45 45 */ 46 description: __( 47 'Show average learner details for the course.', 48 'wporg-learn' 49 ), 46 description: __( 'Show average learner details for the course.', 'wporg-learn' ), 50 47 51 48 /** -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/expiration-date/index.js
r13587 r13621 2 2 * WordPress dependencies 3 3 */ 4 import { 5 Button, 6 DateTimePicker, 7 Dropdown, 8 PanelRow, 9 } from '@wordpress/components'; 4 import { Button, DateTimePicker, Dropdown, PanelRow } from '@wordpress/components'; 10 5 import { useDispatch, useSelect } from '@wordpress/data'; 11 6 // eslint-disable-next-line @wordpress/no-unsafe-wp-apis -- Experimental is OK. 12 import { format, __experimentalGetSettings} from '@wordpress/date';7 import { __experimentalGetSettings, format } from '@wordpress/date'; 13 8 import { PluginPostStatusInfo } from '@wordpress/edit-post'; 14 import { use State, useRef} from '@wordpress/element';9 import { useRef, useState } from '@wordpress/element'; 15 10 import { __ } from '@wordpress/i18n'; 16 11 import { registerPlugin } from '@wordpress/plugins'; … … 19 14 const settings = __experimentalGetSettings(); 20 15 return date 21 ? format( 22 `${ settings.formats.date } ${ settings.formats.time }`, 23 date 24 ) 16 ? format( `${ settings.formats.date } ${ settings.formats.time }`, date ) 25 17 : __( 'No expiration date', 'wporg-learn' ); 26 18 } 27 19 28 20 const ExpirationDate = () => { 29 const postMetaData = useSelect( 30 ( select ) => 31 select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} 32 ); 21 const postMetaData = useSelect( ( select ) => select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} ); 33 22 const { editPost } = useDispatch( 'core/editor' ); 34 23 const [ expDate, setExpDate ] = useState( postMetaData?.expiration_date ); … … 78 67 } ); 79 68 80 const { ownerDocument } = 81 pickerRef.current; 69 const { ownerDocument } = pickerRef.current; 82 70 ownerDocument.activeElement.blur(); 83 71 } } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/form.js
r10376 r13621 1 1 const jQuery = window.jQuery || {}; 2 2 3 // eslint-disable-next-line id-length 3 4 ( ( $ ) => { 4 5 const checkOther = document.querySelectorAll( '.checkbox-and-text' ); … … 8 9 text = container.querySelector( 'input[type="text"]' ); 9 10 10 text.addEventListener( 11 'input', 12 ( event ) => ( checkbox.checked = !! event.target.value ) 13 ); 11 text.addEventListener( 'input', ( event ) => ( checkbox.checked = !! event.target.value ) ); 14 12 15 13 checkbox.addEventListener( 'change', ( event ) => { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/hooks/use-is-block-in-sidebar.js
r13587 r13621 6 6 export const useIsBlockInSidebar = ( clientId, sidebarName ) => { 7 7 return useSelect( ( select ) => { 8 const { getBlockAttributes, getBlockName, getBlockParents } = 9 select( 'core/block-editor' ); 8 const { getBlockAttributes, getBlockName, getBlockParents } = select( 'core/block-editor' ); 10 9 const parents = getBlockParents( clientId ); 11 10 return parents.some( ( parent ) => { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/language-meta/index.js
r12174 r13621 15 15 16 16 const LanguageMeta = () => { 17 const postMetaData = useSelect( 18 ( select ) => 19 select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} 20 ); 17 const postMetaData = useSelect( ( select ) => select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {} ); 21 18 const { editPost } = useDispatch( 'core/editor' ); 22 19 const [ language, setLanguage ] = useState( postMetaData?.language ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-actions/src/edit.js
r12096 r13621 5 5 import { Placeholder } from '@wordpress/components'; 6 6 7 import { use IsBlockInSidebar, useGetCurrentPostType} from '../../hooks';7 import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks'; 8 8 import { getBlockPlaceholderMessage } from '../../utils'; 9 9 … … 13 13 useGetCurrentPostType(), 14 14 useIsBlockInSidebar( clientId, 'wporg-learn-lesson-plans' ), 15 __( 16 'This will be dynamically populated based on media attached to the Lesson Plan.', 17 'wporg-learn' 18 ) 15 __( 'This will be dynamically populated based on media attached to the Lesson Plan.', 'wporg-learn' ) 19 16 ); 20 17 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-actions/src/index.js
r12096 r13621 44 44 * It will be shown in the Block Tab in the Settings Sidebar. 45 45 */ 46 description: __( 47 'Show actions for the Lesson Plan, depending on post media.', 48 'wporg-learn' 49 ), 46 description: __( 'Show actions for the Lesson Plan, depending on post media.', 'wporg-learn' ), 50 47 51 48 /** -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-details/src/edit.js
r12096 r13621 5 5 import { Placeholder } from '@wordpress/components'; 6 6 7 import { use IsBlockInSidebar, useGetCurrentPostType} from '../../hooks';7 import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks'; 8 8 import { getBlockPlaceholderMessage } from '../../utils'; 9 9 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/lesson-plan-details/src/index.js
r12096 r13621 44 44 * It will be shown in the Block Tab in the Settings Sidebar. 45 45 */ 46 description: __( 47 'Show details about the Lesson Plan, pulled from post meta.', 48 'wporg-learn' 49 ), 46 description: __( 'Show details about the Lesson Plan, pulled from post meta.', 'wporg-learn' ), 50 47 51 48 /** -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/locale-notice.js
r10880 r13621 1 1 /* global jQuery, wpCookies */ 2 // eslint-disable-next-line id-length 2 3 ( function ( window, $, wpCookies ) { 3 4 'use strict'; … … 8 9 $notice: $(), 9 10 10 init () {11 init: function () { 11 12 app.$notice = $( '.wporg-learn-locale-notice' ); 12 13 13 app.$notice.on( 14 'click', 15 '.wporg-learn-locale-notice-dismiss', 16 function ( event ) { 17 event.preventDefault(); 18 app.dismissNotice(); 19 } 20 ); 14 app.$notice.on( 'click', '.wporg-learn-locale-notice-dismiss', function ( event ) { 15 event.preventDefault(); 16 app.dismissNotice(); 17 } ); 21 18 }, 22 19 23 dismissNotice () {20 dismissNotice: function () { 24 21 app.$notice.fadeTo( 100, 0, function () { 25 22 app.$notice.slideUp( 100, function () { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/utils.js
r12096 r13621 1 1 import { errors } from './constants'; 2 2 3 export const getBlockPlaceholderMessage = ( 4 blockPostType, 5 currentPostType, 6 isBlockInSidebar, 7 defaultMessage 8 ) => { 3 export const getBlockPlaceholderMessage = ( blockPostType, currentPostType, isBlockInSidebar, defaultMessage ) => { 9 4 if ( currentPostType === null ) { 10 5 if ( ! isBlockInSidebar ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-application-form/src/edit.js
r10376 r13621 9 9 <Placeholder 10 10 label={ __( 'Workshop Application Form', 'wporg-learn' ) } 11 instructions={ __( 12 'This will render a form on the front end.', 13 'wporg-learn' 14 ) } 11 instructions={ __( 'This will render a form on the front end.', 'wporg-learn' ) } 15 12 /> 16 13 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-application-form/src/index.js
r10376 r13621 12 12 registerBlockType( 'wporg-learn/workshop-application-form', { 13 13 title: __( 'Workshop Application Form', 'wporg-learn' ), 14 description: __( 15 'Render a form for applying to present a workshop.', 16 'wporg-learn' 17 ), 14 description: __( 'Render a form for applying to present a workshop.', 'wporg-learn' ), 18 15 category: 'widgets', 19 16 icon: 'forms', -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/edit.js
r12096 r13621 5 5 import { Placeholder } from '@wordpress/components'; 6 6 7 import { use IsBlockInSidebar, useGetCurrentPostType} from '../../hooks';7 import { useGetCurrentPostType, useIsBlockInSidebar } from '../../hooks'; 8 8 import { getBlockPlaceholderMessage } from '../../utils'; 9 9 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/js/workshop-details/src/index.js
r10169 r13621 43 43 * It will be shown in the Block Tab in the Settings Sidebar. 44 44 */ 45 description: __( 46 'Show details about the workshop, pulled from post meta.', 47 'wporg-learn' 48 ), 45 description: __( 'Show details about the workshop, pulled from post meta.', 'wporg-learn' ), 49 46 50 47 /**
Note: See TracChangeset
for help on using the changeset viewer.