Skip to content

Commit

Permalink
Merge pull request #3 from jdmdigital/develop
Browse files Browse the repository at this point in the history
Fix #2
  • Loading branch information
jdmdigital committed Apr 26, 2016
2 parents 2e56737 + 3d4d43b commit 6072b33
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions css/jdm-fab.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@

/* general styles */
.jdm-fab{width:170px; position:fixed; top:60px; right:0; opacity:0.7;-webkit-transition: all 300ms ease; -moz-transition: all 300ms ease;-ms-transition: all 300ms ease;-o-transition: all 300ms ease;transition: all 300ms ease;}

.home .jdm-fab{ top:105px;}
.jdm-fab:hover{-webkit-transition: all 300ms ease; -moz-transition: all 300ms ease;-ms-transition: all 300ms ease;-o-transition: all 300ms ease;transition: all 300ms ease;}
.admin-btns-wrapper .btn{font-family:"Open Sans",sans-serif; margin-bottom:2px; margin-right:0; text-align:left; line-height:2; border-top-right-radius:0; border-bottom-right-radius:0;}
.admin-btns-wrapper .btn span{margin-right:15px; margin-left:5px;}

.jdm-fab{opacity:1;-moz-transform: translateX(115px);-webkit-transform: translateX(115px);-o-transform: translateX(115px);-ms-transform: translateX(115px);transform: translateX(115px);}
.jdm-fab:hover, #admin-btns:focus, #admin-btns:active{-moz-transform: translateX(0);-webkit-transform: translateX(0);-o-transform: translateX(0);-ms-transform: translateX(0);transform: translateX(0);}

/* @since v0.9 */
.jdm-fab.fontawesome {-moz-transform: translateX(125px);-webkit-transform: translateX(125px);-o-transform: translateX(115px);-ms-transform: translateX(125px);transform: translateX(125px);}
20 changes: 15 additions & 5 deletions jdm-frontend-admin-buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: JDM Frontend Admin Buttons
* Plugin URI: https://github.com/jdmdigital/jdm-frontend-admin-buttons/
* Description: JDM Frontend Admin Buttons is a lightweight WordPress plugin that hides the default Admin Bar and replaces it with out of the way, contextually-aware, floating buttons for basic admin tasks.
* Version: 0.7
* Version: 0.9
* Author: JDM Digital
* Author URI: http://jdmdigital.co
* License: GPLv2 or later
Expand Down Expand Up @@ -59,7 +59,7 @@ function jdm_edit_with_vc(){
$vcEditlink = $adminURL.'post.php?vc_action=vc_inline&post_id='.$id.'&post_type='.$type;

if($vc) {
return '<a href="'.$vcEditlink.'" class="btn btn-block btn-primary"><span class="glyphicon glyphicon-fullscreen genericon genericon-maximize"></span> Visual Editor</a>';
return '<a href="'.$vcEditlink.'" class="btn btn-block btn-warning"><span class="glyphicon glyphicon-fullscreen genericon genericon-maximize"></span> Visual Editor</a>';
}

}
Expand All @@ -71,11 +71,11 @@ function jdm_edit_with_vc(){

function jdmfab_show_admin_buttons() {
if(wp_style_is('bootstrap')) {
$fabclass = 'jdm-fab';
$fabclass = 'jdm-fab bs';
} elseif(wp_style_is('bootstrap-css')) {
$fabclass = 'jdm-fab';
$fabclass = 'jdm-fab bs';
} elseif(wp_style_is('bootstrap-style')) {
$fabclass = 'jdm-fab';
$fabclass = 'jdm-fab bs';
} else {
// Bootstrap CSS not enqueued
$fabclass = 'jdm-fab no-bs';
Expand All @@ -84,18 +84,24 @@ function jdmfab_show_admin_buttons() {
if(wp_style_is('fontawesome')) {
$icon_prefix = 'fa';
$icon_edit = 'fa-pencil';
$icon_customize = 'fa-paint-brush';
$icon_admin = 'fa-cog';
$icon_close = 'fa-eye-slash';
$icon_logout = 'fa-power-off';
$fabclass .= ' fontawesome';
} elseif (wp_style_is('genericons')) {
$fabclass .= ' genericons';
$icon_prefix = 'genericon';
$icon_edit = 'genericon-edit';
$icon_customize = 'genericon-maximize';
$icon_admin = 'genericon-cog';
$icon_close = 'genericon-close';
$icon_logout = 'genericon-unapprove';
} else {
$fabclass .= ' glyphicons';
$icon_prefix = 'glyphicon';
$icon_edit = 'glyphicon-edit';
$icon_customize = 'glyphicon-fullscreen bp-link';
$icon_admin = 'glyphicon-cog';
$icon_close = 'glyphicon-eye-close';
$icon_logout = 'glyphicon-log-out';
Expand Down Expand Up @@ -125,6 +131,10 @@ function jdmfab_show_admin_buttons() {

if(is_plugin_active('js_composer/js_composer.php')) {
$html .= ' '.jdm_edit_with_vc();
} else {
if ( current_user_can( 'customize' ) ) {
$html .= ' <a href="'. get_admin_url().'customize.php?return='.get_permalink().'" class="btn btn-block btn-warning"><span class="'.$icon_prefix.' '.$icon_customize.'"></span> Customize</a>';
}
}

$html .= ' <a href="'. network_admin_url().'" class="btn btn-block btn-primary"><span class="'.$icon_prefix.' '.$icon_admin.'"></span> WP Admin</a>';
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://jdmdigital.co
Tags: administration, admin, frontend, buttons.
Requires at least: 3.0.1
Tested up to: 4.4.2
Stable tag: 0.7
Stable tag: 0.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -38,6 +38,10 @@ TBD

== Upgrade Notice ==

= 0.8 =
* new customizer link added
* version Bump

= 0.7 =
* Test if Bootstrap enqueued
* jdm-fab.css file updated
Expand Down

0 comments on commit 6072b33

Please sign in to comment.