MediaWiki:Common.css: Difference between revisions
Appearance
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 36: | Line 36: | ||
.mw- | /* Botão de Copiar para SyntaxHighlight */ | ||
$(function() { | |||
$('.mw-highlight').each(function() { | |||
var $block = $(this); | |||
if ($block.find('.copy-btn').length > 0) return; // Evita duplicados | |||
var $button = $('<button>') | |||
.text('Copy') | |||
.addClass('copy-btn') | |||
.css({ | |||
'position': 'absolute', | |||
} | 'top': '5px', | ||
'right': '5px', | |||
'z-index': '100', | |||
'padding': '3px 8px', | |||
'background': '#3366cc', | |||
'color': '#fff', | |||
'border': 'none', | |||
'border-radius': '3px', | |||
'cursor': 'pointer', | |||
'font-size': '12px' | |||
}); | |||
$button.on('click', function() { | |||
var text = $block.find('pre').text(); | |||
navigator.clipboard.writeText(text).then(function() { | |||
$button.text('Copied!').css('background', '#00af89'); | |||
setTimeout(function() { | |||
$button.text('Copy').css('background', '#3366cc'); | |||
}, 2000); | |||
}); | |||
}); | |||
$block.css('position', 'relative').prepend($button); | |||
}); | |||
}); | |||
Revision as of 18:02, 12 March 2026
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 30px;
margin-top: 20px;
}
.product-item {
text-align: center;
}
.product-image {
display: block;
margin: 0 auto 10px;
}
.product-title {
font-weight: 600;
margin-top: 6px;
}
.product-subtitle {
font-size: 14px;
color: #666;
}
.product-item strong {
display: block;
}
.product-subtitle {
display: block;
}
/* Botão de Copiar para SyntaxHighlight */
$(function() {
$('.mw-highlight').each(function() {
var $block = $(this);
if ($block.find('.copy-btn').length > 0) return; // Evita duplicados
var $button = $('<button>')
.text('Copy')
.addClass('copy-btn')
.css({
'position': 'absolute',
'top': '5px',
'right': '5px',
'z-index': '100',
'padding': '3px 8px',
'background': '#3366cc',
'color': '#fff',
'border': 'none',
'border-radius': '3px',
'cursor': 'pointer',
'font-size': '12px'
});
$button.on('click', function() {
var text = $block.find('pre').text();
navigator.clipboard.writeText(text).then(function() {
$button.text('Copied!').css('background', '#00af89');
setTimeout(function() {
$button.text('Copy').css('background', '#3366cc');
}, 2000);
});
});
$block.css('position', 'relative').prepend($button);
});
});