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
/* Based on Heydon Pickering's REVENGE.css */ | |
:root { | |
--error-outline: 0.25rem solid red; | |
--span-outline: 0.25rem solid goldenrod; | |
} | |
h1:not(:only-of-type) { | |
outline: 5px solid blue !important; | |
--error-multiple-h1: 'You have more than one H1 heading.'; | |
} |
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
function matchISBNs(html) { | |
// flatten string and find ISBN-looking things | |
let isbns = html.replaceAll("\n", ' ').match("/(?=([0-9]|X|-){10,20})(97(8|9))?-?(0|1|8)([0-9]|-){8,14}([0-9]|X)/gi"); | |
if (!isbns || !isbns.length) | |
return; | |
// remove dashes | |
isbns = isbns.map((value) => value.replaceAll('-', '')); | |
// throw out anything that isn't 10 or 13 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
:root { | |
--primary: #9EC5FE; | |
--danger: #F1AEB5; | |
--warning: #FFE69C; | |
--success: #A3CFBB; | |
--bs-dark: #fff; | |
} | |
html, | |
body, |
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
:root { | |
/* Tailwind colors, plus some additional intermediate shades */ | |
/* Tailwind Sky */ | |
--blue-050: #f0f9ff; | |
--blue-100: #e0f2fe; | |
--blue-200: #bae6fd; | |
--blue-300: #7dd3fc; | |
--blue-400: #38bdf8; | |
--blue-500: #0ea5e9; | |
--blue-600: #0284c7; |
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
/* USAGE: Copy this code into a bookmarklet creator such as https://mrcoles.com/bookmarklet/ and bookmark the result */ | |
const links = Array.prototype.slice.call(document.querySelectorAll('ol.work.group li.work .header .heading a:first-child')); | |
const urls = links.map(function(elem){ return 'https://archiveofourown.org'+elem.getAttribute("href"); }); | |
if (!urls.length) return; | |
urls.reverse(); | |
const dialog = document.createElement("dialog"); |
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
/* TO USE: Add this as a site skin. This is the base for the other two color schemes. | |
You may use this as the preview image for the basic (white background) skin: https://www.dropbox.com/s/iutrts8fawidn0d/ao3skin-instafic-gentle-antidote.jpeg?dl=0 | |
/**/ | |
.listbox blockquote, | |
.listbox pre { | |
font-family: Georgia, serif; | |
font-size: 1.15em; | |
line-height: 1.4; |
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
<?php | |
// well-known filter to change JPG quality: | |
add_filter( 'jpeg_quality', function( $arg ){ return 100; } ); | |
// lesser-known filter to change quality for any image type: | |
add_filter( 'wp_editor_set_quality', 'any_image_quality', 10, 2 ); | |
add_filter( 'jpeg_quality', 'any_image_quality' ); | |
function any_image_quality( $default_quality, $mime_type = NULL ) { |
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
<?php | |
$fields = array(); | |
$field_group = get_page_by_title( 'GROUP TITLE HERE', OBJECT, 'acf-field-group' ); | |
if ( is_object( $field_group ) ) { | |
$acf_fields = acf_get_fields_by_id( $field_group->ID ); | |
$fields = wp_list_pluck( $acf_fields, 'label', 'name' ); | |
} | |
foreach ( $fields as $field_name => $field_label ) { |
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
.r-1ovo9ad div { | |
width: 0px !important; | |
} | |
.r-1ovo9ad div div.r-1oszu61 { | |
width: 360px !important; | |
} | |
.r-1ovo9ad form div { | |
width: inherit !important; |
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
<?php | |
// PHP goes in functions.php or similar | |
// Callback function to filter the MCE settings | |
function my_mce_style_options( $init_array ) { | |
// Define the style_formats array | |
$style_formats = my_mce_styleselect_options(); | |
// Insert the array, JSON ENCODED, into 'style_formats' | |
$init_array['style_formats'] = json_encode( $style_formats ); |
NewerOlder