first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
.jetpack-social-icons-widget-item {
background: #fff;
border: 1px solid #e5e5e5;
cursor: move;
margin: 0;
}
html[class*='wordpress_com'] .jetpack-social-icons-widget-item,
.in-calypso .jetpack-social-icons-widget-item {
border-color: #c8d7e1;
}
.jetpack-social-icons-widget-item:hover {
outline: 1px solid #999;
outline-offset: -1px;
}
html[class*='wordpress_com'] .jetpack-social-icons-widget-item:hover,
.in-calypso .jetpack-social-icons-widget-item:hover {
outline-color: #a8bece;
}
.jetpack-social-icons-widget-item.ui-sortable-helper {
border-color: #999;
}
html[class*='wordpress_com'] .jetpack-social-icons-widget-item.ui-sortable-helper,
.in-calypso .jetpack-social-icons-widget-item.ui-sortable-helper {
border-color: #a8bece;
}
.jetpack-social-icons-widget-item.ui-sortable-helper {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.jetpack-social-icons-widget-item.ui-state-placeholder {
border-color: #a0a5aa;
border-style: dashed;
margin: 0 0 1px;
}
.jetpack-social-icons-widget-item + .jetpack-social-icons-widget-item:not(.ui-state-placeholder) {
margin-top: -1px;
}
.jetpack-social-icons-widget-item-wrapper {
padding: 1em;
position: relative;
}
.jetpack-social-icons-widget-item .handle {
display: block;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
.jetpack-social-icons-widget-item p {
margin: 0;
position: relative;
}
.jetpack-social-icons-widget-item p + p {
margin-top: 1em;
}
.jetpack-widget-social-icons-remove-item {
display: inline-block;
}
.jetpack-widget-social-icons-remove-item-button {
color: #a00;
text-decoration: none;
}
.jetpack-widget-social-icons-remove-item-button:focus,
.jetpack-widget-social-icons-remove-item-button:hover {
color: #f00;
}
.jetpack-social-icons-add-button:before {
content: "\f132";
display: inline-block;
position: relative;
left: -2px;
top: -1px;
font: 400 20px/1 dashicons;
vertical-align: middle;
transition: all 0.2s;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

View File

@@ -0,0 +1,144 @@
( function( $ ) {
var timeout = null;
// Make the list of items sortable.
function initWidget( widget ) {
widget.find( '.jetpack-social-icons-widget-list' ).sortable( {
items: '> .jetpack-social-icons-widget-item',
handle: '.handle',
cursor: 'move',
placeholder: 'jetpack-social-icons-widget-item ui-state-placeholder',
containment: widget,
forcePlaceholderSize: true,
update: function() {
livePreviewUpdate(
$( this )
.parents( '.form' )
.find( '.widget-control-save' )
);
},
} );
}
// Live preview update.
function livePreviewUpdate( button ) {
if ( ! $( document.body ).hasClass( 'wp-customizer' ) || ! button.length ) {
return;
}
button.trigger( 'click' ).hide();
}
$( document ).ready( function() {
// Add an item.
$( document ).on( 'click', '.jetpack-social-icons-widget.add-button button', function( event ) {
event.preventDefault();
var template, widgetContent, widgetList, widgetLastItem, urlId, urlName;
template = $( $.trim( $( '#tmpl-jetpack-widget-social-icons-template' ).html() ) );
widgetContent = $( this ).parents( '.widget-content' );
widgetList = widgetContent.find( '.jetpack-social-icons-widget-list' );
urlId = widgetList.data( 'url-icon-id' );
urlName = widgetList.data( 'url-icon-name' );
template
.find( '.jetpack-widget-social-icons-url input' )
.attr( 'id', urlId )
.attr( 'name', urlName + '[]' );
widgetList.append( template );
widgetLastItem = widgetContent.find( '.jetpack-social-icons-widget-item:last' );
widgetLastItem.find( 'input:first' ).trigger( 'focus' );
} );
// Remove an item.
$( document ).on( 'click', '.jetpack-widget-social-icons-remove-item-button', function(
event
) {
event.preventDefault();
var button = $( this )
.parents( '.form' )
.find( '.widget-control-save' );
$( this )
.parents( '.jetpack-social-icons-widget-item' )
.remove();
livePreviewUpdate( button );
} );
// Event handler for widget open button.
$( document ).on(
'click',
'div.widget[id*="jetpack_widget_social_icons"] .widget-title, div.widget[id*="jetpack_widget_social_icons"] .widget-action',
function() {
if ( $( this ).parents( '#available-widgets' ).length ) {
return;
}
initWidget( $( this ).parents( '.widget[id*="jetpack_widget_social_icons"]' ) );
}
);
// Event handler for widget added.
$( document ).on( 'widget-added', function( event, widget ) {
if ( widget.is( '[id*="jetpack_widget_social_icons"]' ) ) {
event.preventDefault();
initWidget( widget );
}
} );
// Event handler for widget updated.
$( document ).on( 'widget-updated', function( event, widget ) {
if ( widget.is( '[id*="jetpack_widget_social_icons"]' ) ) {
event.preventDefault();
initWidget( widget );
}
} );
// Live preview update on input focus out.
$( document ).on( 'focusout', 'input[name*="jetpack_widget_social_icons"]', function() {
livePreviewUpdate(
$( this )
.parents( '.form' )
.find( '.widget-control-save' )
);
} );
// Live preview update on input enter key.
$( document ).on( 'keydown', 'input[name*="jetpack_widget_social_icons"]', function( event ) {
if ( event.keyCode === 13 ) {
livePreviewUpdate(
$( this )
.parents( '.form' )
.find( '.widget-control-save' )
);
}
} );
// Live preview update on input key up 1s.
$( document ).on( 'keyup', 'input[name*="jetpack_widget_social_icons"]', function() {
clearTimeout( timeout );
timeout = setTimeout( function() {
livePreviewUpdate(
$( this )
.parents( '.form' )
.find( '.widget-control-save' )
);
}, 1000 );
} );
// Live preview update on select change.
$( document ).on( 'change', 'select[name*="jetpack_widget_social_icons"]', function() {
livePreviewUpdate(
$( this )
.parents( '.form' )
.find( '.widget-control-save' )
);
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,75 @@
.jetpack_widget_social_icons ul,
.jetpack_widget_social_icons li {
list-style: none;
}
.jetpack_widget_social_icons ul {
display: block;
margin: 0 0 1.5em;
padding: 0;
}
.jetpack_widget_social_icons ul li {
border: 0;
display: inline-block;
line-height: 1;
margin: 0;
padding: 0;
}
.jetpack_widget_social_icons ul li:before,
.jetpack_widget_social_icons ul li:after {
display: none;
}
.jetpack_widget_social_icons a {
border: 0;
box-shadow: none;
display: block;
height: 24px;
text-decoration: none;
width: 24px;
}
.jetpack_widget_social_icons svg {
color: inherit;
fill: currentColor;
height: inherit;
vertical-align: middle;
width: inherit;
}
/* Sizes */
.jetpack_widget_social_icons ul.size-small a {
height: 24px;
width: 24px;
}
.jetpack_widget_social_icons ul.size-medium a {
height: 32px;
width: 32px;
}
.jetpack_widget_social_icons ul.size-large a {
height: 48px;
width: 48px;
}
/*
Text meant only for screen readers.
Provides support for themes that do not bundle this CSS yet.
@see https://make.wordpress.org/accessibility/2015/02/09/hiding-text-for-screen-readers-with-wordpress-core/
***********************************/
.screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute ! important;
width: 1px;
word-wrap: normal ! important;
}