Skip to content

Commit

Permalink
version 1.1.2, fixed bug, changed keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph committed Dec 14, 2016
1 parent 0d9361d commit 57e6a0c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Tags: admin bar, adminbar, admin, developer, development, staging, robots, keyboard, shortcut
* Requires at least: 4.0
* Tested up to: 4.7.0
* Stable tag: 1.1.1
* Stable tag: 1.1.2
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -22,6 +22,14 @@ If you want to participate in the development [head over to GitHub](https://gith
2. Activate the 'Apermo AdminBar' plugin through the 'Plugins' menu in WordPress
3. Open Settings -> Apermo AdminBar to set up the links and colors (currently you have to repeat this on all sites)

== Screenshots ==

1. The basic idea of the plugin, 3 instances of a website, with 3 distinct color schemes and quicklinks between the instances.
2. The Adminbar on the frontend, showing the info panel on the right and the watermark for a draft post. The info panel can be hidden with a click. And there are keyboard shortcuts to hide the whole adminbar and the watermark to see what the site looks like for a regular user.
3. The settings page, with the options for the first of the 3 default stages.
4. The import and export function on the settings page.
5. The settings page when the settings are set using the filter `add_filter( 'apermo-adminbar-sites', 'sites_filter' );`

## Frequently Asked Questions ##

### I have more than 3 sites, can I add more? ###
Expand Down Expand Up @@ -67,8 +75,16 @@ Head over to the [GitHub Repository](https://github.com/apermo/apermo-adminbar)

## Changelog ##



### 1.1.2 ###
* changed: Keyboard shortcuts had to be changed as they colided with windows standards
* Hide Watermark: Mac: CMD + CTRL + W - Win/Linux: ALT + SHIFT + W
* Hide Adminbar: Mac: CMD + CTRL + A - Win/Linux: ALT + SHIFT + A
* fixed: backend color scheme was overwritten if being set by a user prior to plugin activation

### 1.1.1 ###
* fixed: keyboard shortcut for watermark is now CTRL +
* fixed: keyboard shortcut for watermark is now CTRL + D
* changed: made status icons bigger & clearer, changed color for scheduled status

### 1.1.0 ###
Expand Down
13 changes: 12 additions & 1 deletion apermo-adminbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @wordpress-plugin
* Plugin Name: Apermo AdminBar
* Plugin URI: https://wordpress.org/plugins/apermo-adminbar/
* Version: 1.1.1
* Version: 1.1.2
* Description: A simple plugin that enhances the AdminBar with navigation links between your different stages, a statusbox about the current post and keyboard shortcuts to hide or show the adminbar
* Author: Christoph Daum
* Author URI: http://apermo.de/
Expand Down Expand Up @@ -122,6 +122,8 @@ public function __construct() {
//has to be loaded as early as possible to ensure that the css does not overwrite theme css.
add_action( 'admin_bar_init', array( $this, 'color_scheme' ), 1 );

add_filter( 'get_user_option_admin_color', array( $this, 'filter_admin_color' ) );

add_action( 'admin_enqueue_scripts', array( $this, 'options_reading' ) );

add_filter( 'pre_option_blog_public', array( $this, 'blog_public' ), 99, 2 );
Expand Down Expand Up @@ -313,6 +315,15 @@ public function color_scheme() {
}
}

/**
* Filters the User defined admin_color and sets it to default.
*
* @return string
*/
public function filter_admin_color() {
return 'fresh';
}

public function js_keycodes() {
wp_enqueue_script( 'apermo-adminbar-js-keycodes', plugins_url( 'js/keycodes.js', __FILE__ ), array( 'jquery' ) );
}
Expand Down
26 changes: 18 additions & 8 deletions js/keycodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ jQuery(document).ready(function ($) {


$(document).on('keydown', function ( e ) {
if ( e.ctrlKey ) {
switch ( e.which ) {
case 69: //e
adminbar_toggle();
break;
case 68: //d
watermark_toggle();
break;
if ( navigator.platform == 'MacIntel' || navigator.platform == 'iPhone' || navigator.platform == 'iPad' ) {
// Mac/iPhone
if ( ! ( e.metaKey && e.ctrlKey ) ) {
return;
}
} else {
// Anything else
if ( ! ( e.altKey && e.shiftKey ) ) {
return;
}
}

switch ( e.which ) {
case 65: //a
adminbar_toggle();
break;
case 87: //w
watermark_toggle();
break;
}
});
});

0 comments on commit 57e6a0c

Please sign in to comment.