Skip to content

Commit

Permalink
Adjusted structure for PDS skeleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Feb 23, 2018
1 parent 4238509 commit d92a778
Show file tree
Hide file tree
Showing 17 changed files with 270 additions and 418 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@
[![Code Coverage](https://scrutinizer-ci.com/g/Rarst/laps/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/rarst/laps/v/stable)](https://packagist.org/packages/rarst/laps)
[![Total Downloads](https://poser.pugx.org/rarst/laps/downloads)](https://packagist.org/packages/rarst/laps)
[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg)](https://github.com/php-pds/skeleton)

![Laps screenshot](http://i.imgur.com/zFokmkU.png)

Expand Down
18 changes: 9 additions & 9 deletions RoboFile.php
Expand Up @@ -15,10 +15,10 @@ class RoboFile extends \Robo\Tasks {
public function watch() {

$this->taskWatch()
->monitor( [ 'css/variables.less', 'css/laps.less' ], function () {
->monitor( [ 'public/css/variables.less', 'public/css/laps.less' ], function () {
$this->makeCss();
} )
->monitor( 'js/source.js', function () {
->monitor( 'public/js/source.js', function () {
$this->makeJs();
} )
->run();
Expand All @@ -39,9 +39,9 @@ public function makeAll() {
*/
public function makeCss() {

$this->taskExec( 'lessc css/laps.less css/laps.css --source-map=css/laps.css.map' )->run();
$this->taskExec( 'lessc public/css/laps.less public/css/laps.css --source-map=public/css/laps.css.map' )->run();

$this->taskMinify( 'css/laps.css' )
$this->taskMinify( 'public/css/laps.css' )
->run();
}

Expand All @@ -52,24 +52,24 @@ public function makeJs() {

$this->taskConcat( [
'vendor/twbs/bootstrap/js/tooltip.js',
'js/source.js',
'public/js/source.js',
] )
->to( 'js/laps.js' )
->to( 'public/js/laps.js' )
->run();

$this->taskMinify( 'js/laps.js' )
$this->taskMinify( 'public/js/laps.js' )
->run();
}

/**
* Compiles plugin's mustache template
*/
public function makeMustache() {
$dir = __DIR__ . '/views/cache';
$dir = __DIR__ . '/src/mustache/cache';
$this->_cleanDir( $dir );
$mustache = new \Mustache_Engine(
array(
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/views' ),
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/src/mustache' ),
'cache' => $dir,
)
);
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -32,6 +32,7 @@
},
"require-dev": {
"twbs/bootstrap": "~3.2",
"brain/monkey" : "^2.2"
"brain/monkey" : "^2.2",
"pds/skeleton": "^1.0"
}
}
33 changes: 32 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
166 changes: 83 additions & 83 deletions css/laps.less → public/css/laps.less
@@ -1,83 +1,83 @@
@import (reference) "../vendor/twbs/bootstrap/less/variables.less";
@import (reference) "../vendor/twbs/bootstrap/less/mixins.less";
@import (reference) "../vendor/twbs/bootstrap/less/progress-bars.less";
@import (reference) "../vendor/twbs/bootstrap/less/scaffolding.less";
@import "variables.less";

#wpadminbar {

#wp-admin-bar-laps {

.ab-sub-wrapper {
min-width: 90%;
width: 90%;
position: fixed;
left: 5%;
}

.ab-submenu {
padding: 0;
}
}

#wp-admin-bar-laps_output {

padding: 0 10px;

&:hover {
background-color: transparent;
}

.ab-empty-item {
display: none;
}
}

.laps-timeline {
.progress;
margin: 6px 0;
position: relative;

.event {
.progress-bar;
position: absolute; // disable stacking at start
border-left: 1px solid @timeline-bg;
min-width: 2px;
}

.event-theme {
background-color: @event-theme-color;
}
.event-plugin {
background-color: @event-plugin-color;
}
.event-core {
background-color: @event-core-color;
}
.event-query-read {
background-color: @event-info-color;
}
.event-query-write {
background-color: @event-warning-color;
}
.event-http {
background-color: @event-warning-color;
}

.sr-only {
.sr-only;
}
}

@import "../vendor/twbs/bootstrap/less/tooltip.less";

.tooltip.in {
.opacity(1);
}

.tooltip-inner {
line-height: 20px;
text-align: left;
}
}

@import (reference) "../../vendor/twbs/bootstrap/less/variables.less";
@import (reference) "../../vendor/twbs/bootstrap/less/mixins.less";
@import (reference) "../../vendor/twbs/bootstrap/less/progress-bars.less";
@import (reference) "../../vendor/twbs/bootstrap/less/scaffolding.less";
@import "variables.less";

#wpadminbar {

#wp-admin-bar-laps {

.ab-sub-wrapper {
min-width: 90%;
width: 90%;
position: fixed;
left: 5%;
}

.ab-submenu {
padding: 0;
}
}

#wp-admin-bar-laps_output {

padding: 0 10px;

&:hover {
background-color: transparent;
}

.ab-empty-item {
display: none;
}
}

.laps-timeline {
.progress;
margin: 6px 0;
position: relative;

.event {
.progress-bar;
position: absolute; // disable stacking at start
border-left: 1px solid @timeline-bg;
min-width: 2px;
}

.event-theme {
background-color: @event-theme-color;
}
.event-plugin {
background-color: @event-plugin-color;
}
.event-core {
background-color: @event-core-color;
}
.event-query-read {
background-color: @event-info-color;
}
.event-query-write {
background-color: @event-warning-color;
}
.event-http {
background-color: @event-warning-color;
}

.sr-only {
.sr-only;
}
}

@import "../../vendor/twbs/bootstrap/less/tooltip.less";

.tooltip.in {
.opacity(1);
}

.tooltip-inner {
line-height: 20px;
text-align: left;
}
}

File renamed without changes.
40 changes: 20 additions & 20 deletions css/variables.less → public/css/variables.less
@@ -1,21 +1,21 @@
@font-size-small: 12px;
@line-height-computed: 20px;

// colors
@timeline-bg: #f5f5f5;
@event-theme-color: #5cb85c;
@event-plugin-color: #428bca;
@event-core-color: #f0ad4e;
@event-info-color: #5bc0de;
@event-warning-color: #d9534f;
@progress-bg: @timeline-bg;
@progress-bar-bg: @event-info-color;

// because admin bar is 99999
@zindex-tooltip: 100000;
@tooltip-max-width: 300px;
@tooltip-color: #ccc;
@tooltip-bg: #464646;
@tooltip-arrow-width: 5px;
@tooltip-arrow-color: @tooltip-bg;
@font-size-small: 12px;
@line-height-computed: 20px;

// colors
@timeline-bg: #f5f5f5;
@event-theme-color: #5cb85c;
@event-plugin-color: #428bca;
@event-core-color: #f0ad4e;
@event-info-color: #5bc0de;
@event-warning-color: #d9534f;
@progress-bg: @timeline-bg;
@progress-bar-bg: @event-info-color;

// because admin bar is 99999
@zindex-tooltip: 100000;
@tooltip-max-width: 300px;
@tooltip-color: #ccc;
@tooltip-bg: #464646;
@tooltip-arrow-width: 5px;
@tooltip-arrow-color: @tooltip-bg;
@border-radius-base: 4px;
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Manager/Asset_Manager.php
Expand Up @@ -22,8 +22,8 @@ public function __construct() {
public function enqueue_scripts() {

$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_register_script( 'laps', plugins_url( "js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
wp_register_style( 'laps', plugins_url( "css/laps{$suffix}.css", dirname( __DIR__ ) ) );
wp_register_script( 'laps', plugins_url( "public/js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
wp_register_style( 'laps', plugins_url( "public/css/laps{$suffix}.css", dirname( __DIR__ ) ) );

if ( is_admin_bar_showing() ) {
wp_enqueue_script( 'laps' );
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin.php
Expand Up @@ -28,8 +28,8 @@ public function __construct( array $values = [] ) {

$laps['mustache'] = function () {
return new \Mustache_Engine( [
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/views/cache' ),
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/src/mustache' ),
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/src/mustache/cache' ),
] );
};

Expand Down

0 comments on commit d92a778

Please sign in to comment.