Browse Source

Use a separate cookie for root font size.

pull/107/head
Ned Zimmerman 7 years ago
parent
commit
d10949677c
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 10
      assets/scripts/routes/common.js
  2. 2
      dist/mix-manifest.json
  3. 2
      dist/scripts/aldine.js
  4. 7
      inc/activation/namespace.php

10
assets/scripts/routes/common.js

@ -9,7 +9,7 @@ export default {
.addClass( 'js' );
$( document ).ready( function () {
// Fontsize handler
if ( Cookies.get( 'a11y-larger-fontsize' ) === '1' ) {
if ( Cookies.get( 'a11y-root-larger-fontsize' ) === '1' ) {
$( 'html' ).addClass( 'fontsize' );
$( '#is_normal_fontsize' )
.attr( 'id', 'is_large_fontsize' )
@ -28,9 +28,9 @@ export default {
.addClass( 'active' )
.text( PB_A11y.decrease_label )
.attr( 'title', PB_A11y.decrease_label );
Cookies.set( 'a11y-larger-fontsize', '1', {
Cookies.set( 'a11y-root-larger-fontsize', '1', {
expires: 365,
path: '',
path: '/',
} );
return false;
} else {
@ -41,9 +41,9 @@ export default {
.removeClass( 'active' )
.text( PB_A11y.increase_label )
.attr( 'title', PB_A11y.increase_label );
Cookies.set( 'a11y-larger-fontsize', '0', {
Cookies.set( 'a11y-root-larger-fontsize', '0', {
expires: 365,
path: '',
path: '/',
} );
return false;
}

2
dist/mix-manifest.json vendored

@ -1,5 +1,5 @@
{
"/scripts/aldine.js": "/scripts/aldine.js?id=1f58027f7de9942caf57",
"/scripts/aldine.js": "/scripts/aldine.js?id=e222d7e1e1c71c6bdb98",
"/styles/aldine.css": "/styles/aldine.css?id=2648daa49889948f53c9",
"/styles/editor.css": "/styles/editor.css?id=e96b3d10ea63fa07d09b",
"/scripts/customizer.js": "/scripts/customizer.js?id=1b0d3cfc1d85f460af53",

2
dist/scripts/aldine.js vendored

File diff suppressed because one or more lines are too long

7
inc/activation/namespace.php

@ -21,7 +21,7 @@ function create_default_content() {
$home_content = apply_filters(
'pb_root_home_page_content',
sprintf(
'[aldine_page_section title="%1$s"]<p>"%2$s</p><p>[aldine_call_to_action link="/about" text="%3$s"]</p>',
'[aldine_page_section title="%1$s"]<p>%2$s</p><p>[aldine_call_to_action link="/about" text="%3$s"]</p>[/aldine_page_section]',
__( 'About Pressbooks', 'pressbooks-aldine' ),
__( 'Pressbooks is easy-to-use book writing software that lets you create a book in all the formats you need to publish.', 'pressbooks-aldine' ),
__( 'Learn More', 'pressbooks-aldine' )
@ -69,10 +69,7 @@ function create_default_content() {
],
'home' => [
'post_title' => __( 'Home', 'pressbooks-aldine' ),
'post_content' => sprintf(
'<div class="page-section">%s</div>',
$home_content
),
'post_content' => $home_content,
],
];

Loading…
Cancel
Save