Skip to content

Commit

Permalink
Docs: Update readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones committed Aug 24, 2017
1 parent 81d3cbf commit 2d8eee2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Genesis js / no-js
# Genesis JS / No JS

Make front-end styling easier for child themes on the Genesis Framework based on whether JavaScript is enabled or not.
Make front end styling easier for child themes on the Genesis Framework based on whether JavaScript is enabled or not.

## Description

If you look at the source of a WordPress back-end page, you'll see it has a body class of `no-js`. Immediately after the opening `body` tag is a small script which replaces `no-js` with `js` (you can see the amended class with Firebug / Inspector).
If you look at the source of a WordPress back end page, you'll see it has a body class of `no-js`. Immediately after the opening `body` tag is a small script which replaces `no-js` with `js` (you can see the amended class with Firebug / Inspector).

WordPress uses this to apply different styles to the same elements, depending on whether JavaScript is present or not.

This plugin recreates the same effect, but for the front-end of <a href="http://genesis-theme-framework.com/">Genesis Framework</a> child themes. It uses the `genesis_before` hook supplied by Genesis, so it won't work for other themes.
This plugin recreates the same effect, but for the front end of <a href="http://genesis-theme-framework.com/">Genesis Framework</a> child themes. It uses the `genesis_before` hook supplied by Genesis, so it won't work for other themes.

The script is fairly small so does not block rendering of other content for any noticeable length of time.

Expand Down Expand Up @@ -42,11 +42,17 @@ Using git, browse to your `/wp-content/plugins/` directory and clone this reposi

Then go to your Plugins screen and click __Activate__.

### Composer

~~~sh
composer require gamajo/genesis-js-no-js
~~~

## Updates

This plugin supports the [GitHub Updater](https://github.com/afragen/github-updater) plugin, so if you install that, this plugin becomes automatically updateable direct from GitHub.

## Credits

Built by [Gary Jones](https://twitter.com/GaryJ)
Copyright 2011 [Gamajo Tech](http://gamajo.com/)
Copyright 2011 [Gamajo](https://gamajo.com/)
77 changes: 39 additions & 38 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,63 @@
=== Plugin Name ===
=== Genesis JS / No JS ===
Contributors: GaryJ
Donate link: http://code.garyjones.co.uk/donate/
Tags: genesis, js-no-js
Requires at least: 3.0
Requires at least: 4.6
Tested up to: 4.8.1
Stable tag: 2.1.0

Make front-end styling easier for child themes on the Genesis Framework based on whether JavaScript is enabled or not.
Make front end styling easier for child themes on the Genesis Framework based on whether JavaScript is enabled or not.

== Description ==

Make front-end styling easier for child themes on the <a href="http://genesis-theme-framework.com/">Genesis Framework</a> based on whether JavaScript is enabled or not.
Make front end styling easier for child themes on the <a href="http://genesis-theme-framework.com/">Genesis Framework</a> based on whether JavaScript is enabled or not.

Adds a `no-js` body class to the front-end, and a script on `genesis_before` which immediately changes the class to `js` if JavaScript is enabled.
This is how WP does things on the back-end, to allow different styles for the same elements depending if JavaScript is active or not.
Adds a `no-js` body class to the front end, and a script on `genesis_before` which immediately changes the class to `js` if JavaScript is enabled.
This is how WP does things on the back end, to allow different styles for the same elements depending if JavaScript is active or not.

This plugin is only useful if you're using a child theme of the Genesis Framework since it uses the `genesis_before` hook.

== Installation ==

1. Unzip and upload `genesis-js-no-js` folder to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
Once this plugin is installed and activated, then it will work automatically. There are no options, and nothing to set-up.

Once installed and activated, then the plugin will work. There are no options, and nothing to set-up.
= Upload =

1. Download the latest tagged archive (choose the "zip" option).
2. Go to the __Plugins -> Add New__ screen and click the __Upload__ tab.
3. Upload the zipped archive directly.
4. Go to the Plugins screen and click __Activate__.

= Manual =

1. Download the latest tagged archive (choose the "zip" option).
2. Unzip the archive.
3. Copy the folder to your `/wp-content/plugins/` directory.
4. Go to the Plugins screen and click __Activate__.

Check out the Codex for more information about [installing plugins manually](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

= Git =

Using git, browse to your `/wp-content/plugins/` directory and clone this repository:

`git clone [email protected]:GaryJones/genesis-js-no-js.git`

Then go to your Plugins screen and click __Activate__.

= Composer =

`composer require gamajo/genesis-js-no-js`

== Frequently Asked Questions ==

= What does this plugin actually do? =

If you look at the source of a WordPress back-end page, you'll see it has a body class of `no-js`. Immediately after the opening `body` tag is a small script which replaces `no-js` with `js` (you can see the amended class with Firebug / Inspector).
If you look at the source of a WordPress back end page, you'll see it has a body class of `no-js`. Immediately after the opening `body` tag is a small script which replaces `no-js` with `js` (you can see the amended class with browser developer tools).

WordPress uses this to apply different styles to the same elements, depending on whether JavaScript is present or not.

This plugin recreates the same effect, but for the front-end of <a href="http://genesis-theme-framework.com/">Genesis Framework</a> child themes.
This plugin recreates the same effect, but for the front end of <a href="http://genesis-theme-framework.com/">Genesis Framework</a> child themes.

= Shouldn't the script be at the end of the page? =

Expand All @@ -42,33 +67,9 @@ Doing it immediately also reduces a flash of incorrectly styled content, as the

== Changelog ==

= 2.1.0 =
* Load plugin text domain.
* Add `composer.json`.
* Better change log format.
* Tweak documentation.

= 2.0.0 =
* GitHub Updater plugin support
* Refactor class into a new file. Stops using half-implemented Singleton pattern.
* Update documentation.

= 1.0.1 =
* Improved plugin so script is hooked in with priority 1 - avoids a theme placing anything before the script (props [Josh Stauffer](http://twitter.com/joshstauffer))

= 1.0 =
* First public version.
See <a href="https://github.com/GaryJones/genesis-js-no-js/blob/master/CHANGELOG.md">CHANGELOG.md</a> for all of the changes.

== Upgrade Notice ==

= 2.1.0 =
Load plugin text domain.

= 2.0.0 =
Update to add GitHub Updater plugin support.

= 1.0.1 =
Minor change to avoid potential problems with themes hooking in elements before the script.

= 1.0 =
Update from nothingness. You will feel better for it.
= 3.0.0 =
Requires PHP 7.1 and WordPress 4.6.

0 comments on commit 2d8eee2

Please sign in to comment.