-
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 datengraben/add-phpstan-action
- Loading branch information
Showing
55 changed files
with
3,901 additions
and
3,998 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
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
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
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,41 @@ | ||
/* | ||
* The CPT creation form map | ||
*/ | ||
|
||
#cmb2-metabox-cb_map-custom-fields { | ||
.map-organizer { | ||
.cmb2-metabox-title { | ||
font-size: x-large; | ||
} | ||
.cmb2-metabox-title:before { | ||
/* arrow to right */ | ||
content: "\2192 "; | ||
} | ||
} | ||
|
||
.cmb-group-name { | ||
font-size: x-large; | ||
font-weight: bold; | ||
} | ||
|
||
.cmb-group-name:before { | ||
content: "\2192 "; | ||
} | ||
|
||
#shortcode-field { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: nowrap; | ||
gap: 10px; | ||
} | ||
|
||
#shortcode-field code { | ||
white-space: nowrap; | ||
margin-right: 10px; | ||
} | ||
|
||
#shortcode-field .button { | ||
padding: 5px 10px; | ||
line-height: 1.5; | ||
} | ||
} |
Oops, something went wrong.