Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman committed Sep 12, 2017
2 parents b4fea90 + 7739cc4 commit 07d8368
Show file tree
Hide file tree
Showing 10 changed files with 674 additions and 15 deletions.
15 changes: 5 additions & 10 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

_Check the boxes below by changing them from `[ ]` to `[x]`._

* [ ] Can you reproduce the behavior you wish to address with [all other plugins deactivated](http://codex.wordpress.org/Multisite_Network_Administration#Plugins)?
* [ ] Are you running the [latest version of Pressbooks](http://github.com/pressbooks/pressbooks/releases/latest/) and the [latest version of WordPress](http://codex.wordpress.org/Upgrading_WordPress)?
* [ ] Are you experiencing this issue with a book using this theme?
* [ ] Did you [perform a cursory search](https://github.com/issues?q=+is%3Aissue+repo%3Apressbooks%2Fpressbooks) to see if your bug or enhancement is already listed?
* [ ] Can you reproduce the behavior you wish to address with [all plugins except Pressbooks deactivated](http://codex.wordpress.org/Multisite_Network_Administration#Plugins)?
* [ ] Are you running the [latest version of Pressbooks](http://github.com/pressbooks/pressbooks/releases/latest/), the latest version of [Pressbooks Book](http://github.com/pressbooks/pressbooks-book/releases/latest/), the latest version of [this book theme](http://github.com/pressbooks/pressbooks-custom-css/releases/latest/) and the [latest version of WordPress](http://codex.wordpress.org/Upgrading_WordPress)?
* [ ] Are you experiencing the issue while using this book theme?
* [ ] Did you [perform a cursory search](https://github.com/issues?q=+is%3Aissue+repo%3Apressbooks%2Fpressbooks-custom-css) to see if your bug or enhancement is already listed?

### Description

Expand All @@ -23,9 +23,4 @@ _Check the boxes below by changing them from `[ ]` to `[x]`._

### System Information

_Enter the relevant information from the Diagnostics page, available at `https://<yourdomain.tld>/<yourbook>/wp-admin/options.php?page=pressbooks_diagnostics` or via the Diagnostics link in the admin footer._

Book Theme: [Enter book theme name and version here]
Pressbooks: [Enter Pressbooks version here]
WordPress: [Enter WordPress version here]
PHP: [Enter PHP version here]
_Replace this section with the contents of the Diagnostics page, available at `https://<yourdomain.tld>/<yourbook>/wp-admin/options.php?page=pressbooks_diagnostics` or via the Diagnostics link in the admin footer._
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Roll your own CSS using this custom theme.
## Requirements

* PHP >= 5.6
* WordPress >= 4.8.0
* Pressbooks >= 4.0.0
* Pressbooks Book >= 1.7.0
* WordPress >= 4.8.1
* Pressbooks >= 4.3.0
* Pressbooks Book >= 1.10

## Installation

Expand Down
3 changes: 3 additions & 0 deletions assets/dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"/styles/custom-css.css": "/styles/custom-css.css?id=6bbe722767d0bba3e29b"
}
1 change: 1 addition & 0 deletions assets/dist/styles/custom-css.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.custom-css-page form #my_custom_css{width:100%;margin-top:1em;font-family:Lucida Console,Monaco,monospace}
5 changes: 5 additions & 0 deletions assets/src/styles/custom-css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.custom-css-page form #my_custom_css {
width: 100%;
margin-top: 1em;
font-family: "Lucida Console", Monaco, monospace;
}
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@
"name": "Pressbooks (Book Oven Inc.)",
"email": "code@pressbooks.com"
}
]
],
"scripts": {
"test": [
"@standards"
],
"standards": [
"vendor/bin/phpcs --standard=phpcs.ruleset.xml *.php"
]
}
}
39 changes: 39 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

// -------------------------------------------------------------------------------------------------------------------
// Check minimum requirements
// -------------------------------------------------------------------------------------------------------------------

if ( ! function_exists( 'pb_meets_minimum_requirements' ) && ! @include_once( WP_PLUGIN_DIR . '/pressbooks/compatibility.php' ) ) { // @codingStandardsIgnoreLine
return add_action( 'admin_notices', function () {
echo '<div id="message" class="error fade"><p>' . __( 'Cannot find Pressbooks install.', 'pressbooks-stats' ) . '</p></div>';
} );
} elseif ( ! pb_meets_minimum_requirements() ) {
return;
}

// -------------------------------------------------------------------------------------------------------------------
// Class autoloader
// -------------------------------------------------------------------------------------------------------------------

\HM\Autoloader\register_class_path( 'PressbooksCustomCssTheme', __DIR__ . '/inc' );

// -------------------------------------------------------------------------------------------------------------------
// Requires
// -------------------------------------------------------------------------------------------------------------------

require( __DIR__ . '/inc/namespace.php' );

// -------------------------------------------------------------------------------------------------------------------
// Hooks
// -------------------------------------------------------------------------------------------------------------------

add_action( 'init', '\PressbooksCustomCssTheme\register_post_types' );

if ( is_admin() ) {
add_action( 'init', '\PressbooksCustomCssTheme\form_submit', 50 );
add_action( 'admin_menu', '\PressbooksCustomCssTheme\add_menu' );
add_action( 'admin_enqueue_scripts', '\PressbooksCustomCssTheme\enqueue_style' );
add_action( 'load-post.php', '\PressbooksCustomCssTheme\redirect_css_editor' );
add_action( 'wp_ajax_pb_load_css_from', '\PressbooksCustomCssTheme\load_css_from' );
}
Loading

0 comments on commit 07d8368

Please sign in to comment.