-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into enhancement/issue-1528
- Loading branch information
Showing
71 changed files
with
4,975 additions
and
4,315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,5 @@ phpunit | |
project.json | ||
README.md | ||
tsconfig.* | ||
webpack.config.js | ||
webpack.config.js | ||
phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: PHPStan | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'release/**' | ||
paths-ignore: | ||
- '**.md' | ||
- '**.txt' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
phpstan: | ||
name: 'WP latest on PHP 8.3' | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# TODO Use the composer action below | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.3' | ||
extensions: uopz | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install dependencies (other PHP versions) | ||
run: | | ||
composer install --prefer-dist --no-progress --ignore-platform-reqs | ||
- name: Run static suite | ||
run: | | ||
composer dump-autoload -o | ||
#- uses: actions/checkout@v4 | ||
#- uses: php-actions/composer@v6 | ||
|
||
- name: PHPStan Static Analysis | ||
uses: php-actions/phpstan@v3 | ||
with: | ||
configuration: phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
(function ($) { | ||
'use strict'; | ||
$(function () { | ||
const mapSettingsForm = $("#cmb2-metabox-cb_map-custom-fields"); | ||
|
||
const hideFieldset = function (set) { | ||
$.each(set, function () { | ||
$(this).parents('.cmb-row').hide(); | ||
}); | ||
}; | ||
|
||
/** | ||
* Show set-elements. | ||
* @param set | ||
*/ | ||
const showFieldset = function (set) { | ||
$.each(set, function () { | ||
$(this).parents('.cmb-row').show(); | ||
}); | ||
}; | ||
|
||
const copyToClipboard = function (element) { | ||
let code = $(element).find('code')[0]; | ||
let text = code.innerText; | ||
navigator.clipboard.writeText(text).then(function () { | ||
let button = $(element).find('.button'); | ||
let buttonText = button.text(); | ||
button.text('✓'); | ||
button.disabled = true; | ||
setTimeout(function () { | ||
button.text(buttonText); | ||
button.disabled = false; | ||
}, 2000); | ||
}); | ||
} | ||
|
||
const copyToClipboardButton = $('#shortcode-field').find('.button'); | ||
copyToClipboardButton.on('click', function () { | ||
copyToClipboard($('#shortcode-field')); | ||
}); | ||
|
||
function handleCustomFileInput(fileSelectorID, fileInputFields) { | ||
const markerFileSelect = document.querySelector(fileSelectorID); | ||
const handleSelectCustomMarker = function () { | ||
showFieldset(fileInputFields); | ||
if (markerFileSelect.value === '') { | ||
hideFieldset(fileInputFields); | ||
} | ||
}; | ||
|
||
handleSelectCustomMarker(); | ||
|
||
const observerConfig = {attributes: true, childList: false, subtree: false}; | ||
const observer = new MutationObserver(function (mutations) { | ||
mutations.forEach(function (mutation) { | ||
if (mutation.attributeName === 'value') { | ||
handleSelectCustomMarker(); | ||
} | ||
}); | ||
}); | ||
observer.observe(markerFileSelect, observerConfig); | ||
} | ||
|
||
if (mapSettingsForm.length) { | ||
handleCustomFileInput( | ||
'#custom_marker_media', | ||
[ | ||
$('#marker_icon_width'), | ||
$('#marker_icon_height'), | ||
$('#marker_icon_anchor_x'), | ||
$('#marker_icon_anchor_y') | ||
]); | ||
handleCustomFileInput( | ||
'#custom_marker_cluster_media', | ||
[ | ||
$('#marker_cluster_icon_width'), | ||
$('#marker_cluster_icon_height') | ||
] | ||
); | ||
handleCustomFileInput( | ||
'#marker_item_draft_media', | ||
[ | ||
$('#marker_item_draft_icon_width'), | ||
$('#marker_item_draft_icon_height'), | ||
$('#marker_item_draft_icon_anchor_x'), | ||
$('#marker_item_draft_icon_anchor_y') | ||
] | ||
); | ||
} | ||
}); | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.