8 Commits
13 changed files with 312 additions and 186 deletions

No files matched your search

+49 -11
View File
@@ -1,39 +1,77 @@
# Changelog # Change Log
All notable changes to this project will be documented in this file.
## 1.3.2 The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased
## 1.4 - 2016-10-01
### Added
- added screen reader text to events
- colorized writing SQL queries to warning color
### Changed
- updated change log format to Keep a Changelog
- updated dependencies (Stopwatch 2.8.11, Mustache 2.11.1, Bootstrap 3.3.7)
- updated assets
### Removed
- removed release Robo task
## 1.3.2 - 2015-08-27
### Fixed
- fixed dynamic method call crash on PHP 7 - fixed dynamic method call crash on PHP 7
- fixed issue with slashes in generated release archives - fixed issue with slashes in generated release archives
## 1.3.1 ## 1.3.1 - 2015-08-12
### Fixed
- fixed crash on event stop without matching start - fixed crash on event stop without matching start
## 1.3 ## 1.3 - 2015-06-12
### Added
- implemented minified assets - implemented minified assets
- implemented pre-cached template - implemented pre-cached template
- fixed crash with upcoming Hybrid Core v3
- implemented release build command - implemented release build command
- split plugins_loaded hook into separate event
- added WP SEO event - added WP SEO event
## 1.2.1 ### Changed
- split plugins_loaded hook into separate event
### Fixed
- fixed crash with upcoming Hybrid Core v3
## 1.2.1 - 2014-07-12
### Fixed
- disabled tooltip animation to fix JS errors and UI disappearing from under cursor - disabled tooltip animation to fix JS errors and UI disappearing from under cursor
## 1.2 ## 1.2 - 2014-05-18
- merged RP with additional core events in admin ### Added
- implemented (ballpark) toolbar event - implemented (ballpark) toolbar event
### Changed
- merged RP with additional core events in admin
### Fixed
- fixed issue with event offsets in timelines - fixed issue with event offsets in timelines
## 1.1 ## 1.1 - 2013-12-11
### Added
- added SQL timeline - added SQL timeline
- added HTTP timeline - added HTTP timeline
### Changed
- switched tooltips implementation to Bootstrap script - switched tooltips implementation to Bootstrap script
## 1.0 ## 1.0 - 2013-04-22
### Added
- Initial public release - Initial public release
-67
View File
@@ -77,20 +77,6 @@ class RoboFile extends \Robo\Tasks {
$mustache->loadTemplate( 'laps' ); $mustache->loadTemplate( 'laps' );
} }
/**
* @return string
*/
private function versionGet() {
$content = file_get_contents( __DIR__ . '/laps.php' );
if ( false !== preg_match( '|^Version: (?P<version>.+)$|m', $content, $matches ) ) {
return trim( $matches['version'] );
}
return '';
}
/** /**
* Sets the plugin version in header. * Sets the plugin version in header.
* *
@@ -103,57 +89,4 @@ class RoboFile extends \Robo\Tasks {
->to( 'Version: ' . $version ) ->to( 'Version: ' . $version )
->run(); ->run();
} }
/**
* Creates release zip
*
* @param string $version
*/
public function makeRelease( $version = '' ) {
if ( empty( $version ) ) {
$version = $this->versionGet();
}
$this->taskFileSystemStack()
->mkdir( 'release' )
->run();
$this->taskCleanDir( 'release' )->run();
$this->taskExec( 'composer' )
->dir( __DIR__ . '/release' )
->arg( 'create-project rarst/laps laps ' . $version )
->arg( '--prefer-dist --no-dev' )
->run();
$this->taskExec( 'composer' )
->dir( __DIR__ . '/release/laps' )
->arg( 'dump-autoload --optimize' )
->run();
$zipFile = "release/laps-{$version}.zip";
$zipArchive = new ZipArchive();
if ( ! $zipArchive->open( $zipFile, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) ) {
die( "Failed to create archive\n" );
}
$finder = new Symfony\Component\Finder\Finder();
$finder->files()->in( 'release/laps' )->ignoreDotFiles( false );
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ( $finder as $file ) {
$relativePathname = str_replace( '\\', '/', $file->getRelativePathname() );
$zipArchive->addFile( $file->getRealPath(), 'laps/' . $relativePathname );
}
if ( ! $zipArchive->status === ZIPARCHIVE::ER_OK ) {
echo "Failed to write files to zip\n";
}
$zipArchive->close();
$this->taskDeleteDir( 'release/laps' )->run();
}
} }
Generated
+46 -33
View File
@@ -5,21 +5,25 @@
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "7495421e8df337988c9906e05aab637b", "hash": "7495421e8df337988c9906e05aab637b",
"content-hash": "3a8ac6bb545eee9eb5d1ce8b87136995",
"packages": [ "packages": [
{ {
"name": "composer/installers", "name": "composer/installers",
"version": "v1.0.21", "version": "v1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/installers.git", "url": "https://github.com/composer/installers.git",
"reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45" "reference": "d78064c68299743e0161004f2de3a0204e33b804"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804",
"reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45", "reference": "d78064c68299743e0161004f2de3a0204e33b804",
"shasum": "" "shasum": ""
}, },
"require": {
"composer-plugin-api": "^1.0"
},
"replace": { "replace": {
"roundcube/plugin-installer": "*", "roundcube/plugin-installer": "*",
"shama/baton": "*" "shama/baton": "*"
@@ -28,16 +32,16 @@
"composer/composer": "1.0.*@dev", "composer/composer": "1.0.*@dev",
"phpunit/phpunit": "4.1.*" "phpunit/phpunit": "4.1.*"
}, },
"type": "composer-installer", "type": "composer-plugin",
"extra": { "extra": {
"class": "Composer\\Installers\\Installer", "class": "Composer\\Installers\\Plugin",
"branch-alias": { "branch-alias": {
"dev-master": "1.0-dev" "dev-master": "1.0-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Composer\\Installers\\": "src/" "Composer\\Installers\\": "src/Composer/Installers"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@@ -52,28 +56,35 @@
} }
], ],
"description": "A multi-framework Composer library installer", "description": "A multi-framework Composer library installer",
"homepage": "http://composer.github.com/installers/", "homepage": "https://composer.github.io/installers/",
"keywords": [ "keywords": [
"Craft", "Craft",
"Dolibarr", "Dolibarr",
"Hurad", "Hurad",
"ImageCMS",
"MODX Evo", "MODX Evo",
"Mautic",
"OXID", "OXID",
"Plentymarkets",
"RadPHP",
"SMF", "SMF",
"Thelia", "Thelia",
"WolfCMS", "WolfCMS",
"agl", "agl",
"aimeos", "aimeos",
"annotatecms", "annotatecms",
"attogram",
"bitrix", "bitrix",
"cakephp", "cakephp",
"chef", "chef",
"cockpit",
"codeigniter", "codeigniter",
"concrete5", "concrete5",
"croogo", "croogo",
"dokuwiki", "dokuwiki",
"drupal", "drupal",
"elgg", "elgg",
"expressionengine",
"fuelphp", "fuelphp",
"grav", "grav",
"installer", "installer",
@@ -90,37 +101,39 @@
"piwik", "piwik",
"ppi", "ppi",
"puppet", "puppet",
"reindex",
"roundcube", "roundcube",
"shopware", "shopware",
"silverstripe", "silverstripe",
"symfony", "symfony",
"typo3", "typo3",
"wordpress", "wordpress",
"yawik",
"zend", "zend",
"zikula" "zikula"
], ],
"time": "2015-02-18 17:17:01" "time": "2016-08-13 20:53:52"
}, },
{ {
"name": "mustache/mustache", "name": "mustache/mustache",
"version": "v2.8.0", "version": "v2.11.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/bobthecow/mustache.php.git", "url": "https://github.com/bobthecow/mustache.php.git",
"reference": "64c28cc73e01d5edcef7de8cb2b16782615f648a" "reference": "a3f6d55996dd28b58f3a909d474189a3c1aa693f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/64c28cc73e01d5edcef7de8cb2b16782615f648a", "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/a3f6d55996dd28b58f3a909d474189a3c1aa693f",
"reference": "64c28cc73e01d5edcef7de8cb2b16782615f648a", "reference": "a3f6d55996dd28b58f3a909d474189a3c1aa693f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.2.4" "php": ">=5.2.4"
}, },
"require-dev": { "require-dev": {
"fabpot/php-cs-fixer": "~1.6", "friendsofphp/php-cs-fixer": "~1.11",
"phpunit/phpunit": "~3.7|~4.0" "phpunit/phpunit": "~3.7|~4.0|~5.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -145,38 +158,38 @@
"mustache", "mustache",
"templating" "templating"
], ],
"time": "2015-04-01 06:37:33" "time": "2016-07-31 06:18:27"
}, },
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v2.7.0", "version": "v2.8.11",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Stopwatch.git", "url": "https://github.com/symfony/stopwatch.git",
"reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce" "reference": "35bae476693150728b0eb51647faac82faf9aaca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/7702945bceddc0e1f744519abb8a2baeb94bd5ce", "url": "https://api.github.com/repos/symfony/stopwatch/zipball/35bae476693150728b0eb51647faac82faf9aaca",
"reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce", "reference": "35bae476693150728b0eb51647faac82faf9aaca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
}, },
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.7-dev" "dev-master": "2.8-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Symfony\\Component\\Stopwatch\\": "" "Symfony\\Component\\Stopwatch\\": ""
} },
"exclude-from-classmap": [
"/Tests/"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@@ -194,22 +207,22 @@
], ],
"description": "Symfony Stopwatch Component", "description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2015-05-02 15:21:08" "time": "2016-06-29 05:29:29"
} }
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "twbs/bootstrap", "name": "twbs/bootstrap",
"version": "v3.3.4", "version": "v3.3.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twbs/bootstrap.git", "url": "https://github.com/twbs/bootstrap.git",
"reference": "a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f" "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f", "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86",
"reference": "a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f", "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86",
"shasum": "" "shasum": ""
}, },
"replace": { "replace": {
@@ -247,7 +260,7 @@
"responsive", "responsive",
"web" "web"
], ],
"time": "2015-03-16 15:44:41" "time": "2016-07-25 15:51:55"
} }
], ],
"aliases": [], "aliases": [],
+30 -6
View File
@@ -33,7 +33,7 @@
height: 100%; height: 100%;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
color: #ffffff; color: #fff;
text-align: center; text-align: center;
background-color: #5bc0de; background-color: #5bc0de;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
@@ -54,20 +54,45 @@
#wpadminbar .laps-timeline .event-core { #wpadminbar .laps-timeline .event-core {
background-color: #f0ad4e; background-color: #f0ad4e;
} }
#wpadminbar .laps-timeline .event-query { #wpadminbar .laps-timeline .event-query-read {
background-color: #5bc0de; background-color: #5bc0de;
} }
#wpadminbar .laps-timeline .event-query-write {
background-color: #d9534f;
}
#wpadminbar .laps-timeline .event-http { #wpadminbar .laps-timeline .event-http {
background-color: #d9534f; background-color: #d9534f;
} }
#wpadminbar .laps-timeline .sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
#wpadminbar .tooltip { #wpadminbar .tooltip {
position: absolute; position: absolute;
z-index: 100000; z-index: 100000;
display: block; display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px; font-style: normal;
font-weight: normal; font-weight: normal;
line-height: 1.4; letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 12px;
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
} }
@@ -94,9 +119,8 @@
#wpadminbar .tooltip-inner { #wpadminbar .tooltip-inner {
max-width: 300px; max-width: 300px;
padding: 3px 8px; padding: 3px 8px;
color: #cccccc; color: #ccc;
text-align: center; text-align: center;
text-decoration: none;
background-color: #464646; background-color: #464646;
border-radius: 4px; border-radius: 4px;
} }
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["laps.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/progress-bars.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/mixins/vendor-prefixes.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/tooltip.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/variables.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/mixins/opacity.less"],"names":[],"mappings":"AAKA,WAEC,mBAEC;EACC,cAAA;EACA,UAAA;EACA,eAAA;EACA,QAAA;;AARH,WAEC,mBASC;EACC,UAAA;;AAZH,WAgBC;EAEC,eAAA;;AAEA,WAJD,0BAIE;EACA,6BAAA;;AArBH,WAgBC,0BAQC;EACC,aAAA;;AAzBH,WA6BC;ECRC,gBAAA;EACA,YAAA;EACA,mBAAA;EACA,yBAAA;EACA,kBAAA;ECsCA,sDAAA;EACQ,8CAAA;EFjCR,aAAA;EACA,kBAAA;;AAhCF,WA6BC,eAKC;ECHA,WAAA;EACA,SAAA;EACA,YAAA;EACA,eAAA;EACA,iBAAA;EACA,cAAA;EACA,kBAAA;EACA,yBAAA;ECyBA,sDAAA;EACQ,8CAAA;EAyHR,mCAAA;EACK,8BAAA;EACG,2BAAA;EFvJP,kBAAA;EACA,8BAAA;EACA,cAAA;;AAtCH,WA6BC,eAYC;EACC,yBAAA;;AA1CH,WA6BC,eAeC;EACC,yBAAA;;AA7CH,WA6BC,eAkBC;EACC,yBAAA;;AAhDH,WA6BC,eAqBC;EACC,yBAAA;;AAnDH,WA6BC,eAwBC;EACC,yBAAA;;AAtDH,WGCA;EACE,kBAAA;EACA,eAAA;EACA,cAAA;EAEA,aCiCwB,8CDjCxB;EACA,eAAA;EACA,mBAAA;EACA,gBAAA;EEXA,UAAA;EAGA,wBAAA;;AFWA,WAXF,SAWG;EEdD,YAAA;EAGA,yBAAA;;AFYA,WAZF,SAYG;EAAU,gBAAA;EAAmB,cAAA;;AAC9B,WAbF,SAaG;EAAU,gBAAA;EAAmB,cAAA;;AAC9B,WAdF,SAcG;EAAU,eAAA;EAAmB,cAAA;;AAC9B,WAfF,SAeG;EAAU,iBAAA;EAAmB,cAAA;;AHhBhC,WGoBA;EACE,gBAAA;EACA,gBAAA;EACA,cAAA;EACA,kBAAA;EACA,qBAAA;EACA,yBAAA;EACA,kBAAA;;AH3BF,WG+BA;EACE,kBAAA;EACA,QAAA;EACA,SAAA;EACA,yBAAA;EACA,mBAAA;;AAIA,WADF,SACG,IAAK;EACJ,SAAA;EACA,SAAA;EACA,iBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WARF,SAQG,SAAU;EACT,SAAA;EACA,UAAA;EACA,mBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WAfF,SAeG,UAAW;EACV,SAAA;EACA,SAAA;EACA,mBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WAtBF,SAsBG,MAAO;EACN,QAAA;EACA,OAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;;AAEF,WA7BF,SA6BG,KAAM;EACL,QAAA;EACA,QAAA;EACA,gBAAA;EACA,2BAAA;EACA,0BAAA;;AAEF,WApCF,SAoCG,OAAQ;EACP,MAAA;EACA,SAAA;EACA,iBAAA;EACA,uBAAA;EACA,4BAAA;;AAEF,WA3CF,SA2CG,YAAa;EACZ,MAAA;EACA,UAAA;EACA,gBAAA;EACA,uBAAA;EACA,4BAAA;;AAEF,WAlDF,SAkDG,aAAc;EACb,MAAA;EACA,SAAA;EACA,gBAAA;EACA,uBAAA;EACA,4BAAA;;AH9FJ,WA4DC,SAAQ;EK9DP,UAAA;EAGA,0BAAA;;ALDF,WAgEC;EACC,iBAAA;EACA,gBAAA","file":"laps.css"} {"version":3,"sources":["laps.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/progress-bars.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/mixins/vendor-prefixes.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/scaffolding.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/tooltip.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/mixins/reset-text.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/variables.less","C:/server/www/dev/wp-content/plugins/laps/vendor/twbs/bootstrap/less/mixins/opacity.less"],"names":[],"mappings":"AAMA,WAEC,mBAEC;EACC,cAAA;EACA,UAAA;EACA,eAAA;EACA,QAAA;;AARH,WAEC,mBASC;EACC,UAAA;;AAZH,WAgBC;EAEC,eAAA;;AAEA,WAJD,0BAIE;EACA,6BAAA;;AArBH,WAgBC,0BAQC;EACC,aAAA;;AAzBH,WA6BC;ECTC,gBAAA;EACA,YAAA;EACA,mBAAA;EACA,yBAAA;EACA,kBAAA;ECsCA,sDAAA;EACQ,8CAAA;EFhCR,aAAA;EACA,kBAAA;;AAhCF,WA6BC,eAKC;ECJA,WAAA;EACA,SAAA;EACA,YAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;ECyBA,sDAAA;EACQ,8CAAA;EAyHR,mCAAA;EACK,8BAAA;EACG,2BAAA;EFtJP,kBAAA;EACA,8BAAA;EACA,cAAA;;AAtCH,WA6BC,eAYC;EACC,yBAAA;;AA1CH,WA6BC,eAeC;EACC,yBAAA;;AA7CH,WA6BC,eAkBC;EACC,yBAAA;;AAhDH,WA6BC,eAqBC;EACC,yBAAA;;AAnDH,WA6BC,eAwBC;EACC,yBAAA;;AAtDH,WA6BC,eA2BC;EACC,yBAAA;;AAzDH,WA6BC,eA+BC;EG2DA,kBAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,gBAAA;EACA,MAAM,gBAAN;EACA,SAAA;;AH9HF,WIAA;EACE,kBAAA;EACA,eAAA;EACA,cAAA;ECRA,aC2CwB,8CD3CxB;EAEA,kBAAA;EACA,mBAAA;EACA,sBAAA;EACA,gBAAA;EACA,uBAAA;EACA,gBAAA;EACA,iBAAA;EACA,qBAAA;EACA,iBAAA;EACA,oBAAA;EACA,mBAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;EDHA,eAAA;EGVA,UAAA;EAGA,wBAAA;;AHWA,WAXF,SAWG;EGdD,YAAA;EAGA,yBAAA;;AHYA,WAZF,SAYG;EAAU,gBAAA;EAAmB,cAAA;;AAC9B,WAbF,SAaG;EAAU,gBAAA;EAAmB,cAAA;;AAC9B,WAdF,SAcG;EAAU,eAAA;EAAmB,cAAA;;AAC9B,WAfF,SAeG;EAAU,iBAAA;EAAmB,cAAA;;AJfhC,WImBA;EACE,gBAAA;EACA,gBAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;EACA,kBAAA;;AJzBF,WI6BA;EACE,kBAAA;EACA,QAAA;EACA,SAAA;EACA,yBAAA;EACA,mBAAA;;AAIA,WADF,SACG,IAAK;EACJ,SAAA;EACA,SAAA;EACA,iBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WARF,SAQG,SAAU;EACT,SAAA;EACA,UAAA;EACA,mBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WAfF,SAeG,UAAW;EACV,SAAA;EACA,SAAA;EACA,mBAAA;EACA,uBAAA;EACA,yBAAA;;AAEF,WAtBF,SAsBG,MAAO;EACN,QAAA;EACA,OAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;;AAEF,WA7BF,SA6BG,KAAM;EACL,QAAA;EACA,QAAA;EACA,gBAAA;EACA,2BAAA;EACA,0BAAA;;AAEF,WApCF,SAoCG,OAAQ;EACP,MAAA;EACA,SAAA;EACA,iBAAA;EACA,uBAAA;EACA,4BAAA;;AAEF,WA3CF,SA2CG,YAAa;EACZ,MAAA;EACA,UAAA;EACA,gBAAA;EACA,uBAAA;EACA,4BAAA;;AAEF,WAlDF,SAkDG,aAAc;EACb,MAAA;EACA,SAAA;EACA,gBAAA;EACA,uBAAA;EACA,4BAAA;;AJ5FJ,WAmEC,SAAQ;EOtEP,UAAA;EAGA,0BAAA;;APAF,WAuEC;EACC,iBAAA;EACA,gBAAA","file":"laps.css"}
+9 -1
View File
@@ -1,6 +1,7 @@
@import (reference) "../vendor/twbs/bootstrap/less/variables.less"; @import (reference) "../vendor/twbs/bootstrap/less/variables.less";
@import (reference) "../vendor/twbs/bootstrap/less/mixins.less"; @import (reference) "../vendor/twbs/bootstrap/less/mixins.less";
@import (reference) "../vendor/twbs/bootstrap/less/progress-bars.less"; @import (reference) "../vendor/twbs/bootstrap/less/progress-bars.less";
@import (reference) "../vendor/twbs/bootstrap/less/scaffolding.less";
@import "variables.less"; @import "variables.less";
#wpadminbar { #wpadminbar {
@@ -53,12 +54,19 @@
.event-core { .event-core {
background-color: @event-core-color; background-color: @event-core-color;
} }
.event-query { .event-query-read {
background-color: @event-info-color; background-color: @event-info-color;
} }
.event-query-write {
background-color: @event-warning-color;
}
.event-http { .event-http {
background-color: @event-warning-color; background-color: @event-warning-color;
} }
.sr-only {
.sr-only;
}
} }
@import "../vendor/twbs/bootstrap/less/tooltip.less"; @import "../vendor/twbs/bootstrap/less/tooltip.less";
+1 -1
View File
@@ -1 +1 @@
#wpadminbar #wp-admin-bar-laps .ab-sub-wrapper{min-width:90%;width:90%;position:fixed;left:5%}#wpadminbar #wp-admin-bar-laps .ab-submenu{padding:0}#wpadminbar #wp-admin-bar-laps_output{padding:0 10px}#wpadminbar #wp-admin-bar-laps_output:hover{background-color:transparent}#wpadminbar #wp-admin-bar-laps_output .ab-empty-item{display:none}#wpadminbar .laps-timeline{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);margin:6px 0;position:relative}#wpadminbar .laps-timeline .event{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#ffffff;text-align:center;background-color:#5bc0de;-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;position:absolute;border-left:1px solid #f5f5f5;min-width:2px}#wpadminbar .laps-timeline .event-theme{background-color:#5cb85c}#wpadminbar .laps-timeline .event-plugin{background-color:#428bca}#wpadminbar .laps-timeline .event-core{background-color:#f0ad4e}#wpadminbar .laps-timeline .event-query{background-color:#5bc0de}#wpadminbar .laps-timeline .event-http{background-color:#d9534f}#wpadminbar .tooltip{position:absolute;z-index:100000;display:block;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-size:12px;font-weight:normal;line-height:1.4;opacity:0;filter:alpha(opacity=0)}#wpadminbar .tooltip.in{opacity:0.9;filter:alpha(opacity=90)}#wpadminbar .tooltip.top{margin-top:-3px;padding:5px 0}#wpadminbar .tooltip.right{margin-left:3px;padding:0 5px}#wpadminbar .tooltip.bottom{margin-top:3px;padding:5px 0}#wpadminbar .tooltip.left{margin-left:-3px;padding:0 5px}#wpadminbar .tooltip-inner{max-width:300px;padding:3px 8px;color:#cccccc;text-align:center;text-decoration:none;background-color:#464646;border-radius:4px}#wpadminbar .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}#wpadminbar .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#464646}#wpadminbar .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#464646}#wpadminbar .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.in{opacity:1;filter:alpha(opacity=100)}#wpadminbar .tooltip-inner{line-height:20px;text-align:left} #wpadminbar #wp-admin-bar-laps .ab-sub-wrapper{min-width:90%;width:90%;position:fixed;left:5%}#wpadminbar #wp-admin-bar-laps .ab-submenu{padding:0}#wpadminbar #wp-admin-bar-laps_output{padding:0 10px}#wpadminbar #wp-admin-bar-laps_output:hover{background-color:transparent}#wpadminbar #wp-admin-bar-laps_output .ab-empty-item{display:none}#wpadminbar .laps-timeline{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);margin:6px 0;position:relative}#wpadminbar .laps-timeline .event{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#5bc0de;-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;position:absolute;border-left:1px solid #f5f5f5;min-width:2px}#wpadminbar .laps-timeline .event-theme{background-color:#5cb85c}#wpadminbar .laps-timeline .event-plugin{background-color:#428bca}#wpadminbar .laps-timeline .event-core{background-color:#f0ad4e}#wpadminbar .laps-timeline .event-query-read{background-color:#5bc0de}#wpadminbar .laps-timeline .event-query-write{background-color:#d9534f}#wpadminbar .laps-timeline .event-http{background-color:#d9534f}#wpadminbar .laps-timeline .sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}#wpadminbar .tooltip{position:absolute;z-index:100000;display:block;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}#wpadminbar .tooltip.in{opacity:0.9;filter:alpha(opacity=90)}#wpadminbar .tooltip.top{margin-top:-3px;padding:5px 0}#wpadminbar .tooltip.right{margin-left:3px;padding:0 5px}#wpadminbar .tooltip.bottom{margin-top:3px;padding:5px 0}#wpadminbar .tooltip.left{margin-left:-3px;padding:0 5px}#wpadminbar .tooltip-inner{max-width:300px;padding:3px 8px;color:#ccc;text-align:center;background-color:#464646;border-radius:4px}#wpadminbar .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}#wpadminbar .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#464646}#wpadminbar .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#464646}#wpadminbar .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#464646}#wpadminbar .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#464646}#wpadminbar .tooltip.in{opacity:1;filter:alpha(opacity=100)}#wpadminbar .tooltip-inner{line-height:20px;text-align:left}
+67 -21
View File
@@ -1,9 +1,9 @@
/* ======================================================================== /* ========================================================================
* Bootstrap: tooltip.js v3.3.4 * Bootstrap: tooltip.js v3.3.7
* http://getbootstrap.com/javascript/#tooltip * http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame * Inspired by the original jQuery.tipsy by Jason Frame
* ======================================================================== * ========================================================================
* Copyright 2011-2015 Twitter, Inc. * Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */ * ======================================================================== */
@@ -21,11 +21,12 @@
this.timeout = null this.timeout = null
this.hoverState = null this.hoverState = null
this.$element = null this.$element = null
this.inState = null
this.init('tooltip', element, options) this.init('tooltip', element, options)
} }
Tooltip.VERSION = '3.3.4' Tooltip.VERSION = '3.3.7'
Tooltip.TRANSITION_DURATION = 150 Tooltip.TRANSITION_DURATION = 150
@@ -50,7 +51,8 @@
this.type = type this.type = type
this.$element = $(element) this.$element = $(element)
this.options = this.getOptions(options) this.options = this.getOptions(options)
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport) this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
this.inState = { click: false, hover: false, focus: false }
if (this.$element[0] instanceof document.constructor && !this.options.selector) { if (this.$element[0] instanceof document.constructor && !this.options.selector) {
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
@@ -109,16 +111,20 @@
var self = obj instanceof this.constructor ? var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type) obj : $(obj.currentTarget).data('bs.' + this.type)
if (self && self.$tip && self.$tip.is(':visible')) {
self.hoverState = 'in'
return
}
if (!self) { if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self) $(obj.currentTarget).data('bs.' + this.type, self)
} }
if (obj instanceof $.Event) {
self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
}
if (self.tip().hasClass('in') || self.hoverState == 'in') {
self.hoverState = 'in'
return
}
clearTimeout(self.timeout) clearTimeout(self.timeout)
self.hoverState = 'in' self.hoverState = 'in'
@@ -130,6 +136,14 @@
}, self.options.delay.show) }, self.options.delay.show)
} }
Tooltip.prototype.isInStateTrue = function () {
for (var key in this.inState) {
if (this.inState[key]) return true
}
return false
}
Tooltip.prototype.leave = function (obj) { Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ? var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget).data('bs.' + this.type) obj : $(obj.currentTarget).data('bs.' + this.type)
@@ -139,6 +153,12 @@
$(obj.currentTarget).data('bs.' + this.type, self) $(obj.currentTarget).data('bs.' + this.type, self)
} }
if (obj instanceof $.Event) {
self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
}
if (self.isInStateTrue()) return
clearTimeout(self.timeout) clearTimeout(self.timeout)
self.hoverState = 'out' self.hoverState = 'out'
@@ -185,6 +205,7 @@
.data('bs.' + this.type, this) .data('bs.' + this.type, this)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
this.$element.trigger('inserted.bs.' + this.type)
var pos = this.getPosition() var pos = this.getPosition()
var actualWidth = $tip[0].offsetWidth var actualWidth = $tip[0].offsetWidth
@@ -192,13 +213,12 @@
if (autoPlace) { if (autoPlace) {
var orgPlacement = placement var orgPlacement = placement
var $container = this.options.container ? $(this.options.container) : this.$element.parent() var viewportDim = this.getPosition(this.$viewport)
var containerDim = this.getPosition($container)
placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' : placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
placement placement
$tip $tip
@@ -239,8 +259,8 @@
if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0 if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop offset.top += marginTop
offset.left = offset.left + marginLeft offset.left += marginLeft
// $.fn.offset doesn't round pixel values // $.fn.offset doesn't round pixel values
// so we use setOffset directly with our own function B-0 // so we use setOffset directly with our own function B-0
@@ -297,9 +317,11 @@
function complete() { function complete() {
if (that.hoverState != 'in') $tip.detach() if (that.hoverState != 'in') $tip.detach()
if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
that.$element that.$element
.removeAttr('aria-describedby') .removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type) .trigger('hidden.bs.' + that.type)
}
callback && callback() callback && callback()
} }
@@ -322,7 +344,7 @@
Tooltip.prototype.fixTitle = function () { Tooltip.prototype.fixTitle = function () {
var $e = this.$element var $e = this.$element
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') { if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '') $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
} }
} }
@@ -342,7 +364,10 @@
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
} }
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() var isSvg = window.SVGElement && el instanceof window.SVGElement
// Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
// See https://github.com/twbs/bootstrap/issues/20280
var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
@@ -377,7 +402,7 @@
var rightEdgeOffset = pos.left + viewportPadding + actualWidth var rightEdgeOffset = pos.left + viewportPadding + actualWidth
if (leftEdgeOffset < viewportDimensions.left) { // left overflow if (leftEdgeOffset < viewportDimensions.left) { // left overflow
delta.left = viewportDimensions.left - leftEdgeOffset delta.left = viewportDimensions.left - leftEdgeOffset
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
} }
} }
@@ -403,7 +428,13 @@
} }
Tooltip.prototype.tip = function () { Tooltip.prototype.tip = function () {
return (this.$tip = this.$tip || $(this.options.template)) if (!this.$tip) {
this.$tip = $(this.options.template)
if (this.$tip.length != 1) {
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
}
}
return this.$tip
} }
Tooltip.prototype.arrow = function () { Tooltip.prototype.arrow = function () {
@@ -432,14 +463,27 @@
} }
} }
if (e) {
self.inState.click = !self.inState.click
if (self.isInStateTrue()) self.enter(self)
else self.leave(self)
} else {
self.tip().hasClass('in') ? self.leave(self) : self.enter(self) self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
} }
}
Tooltip.prototype.destroy = function () { Tooltip.prototype.destroy = function () {
var that = this var that = this
clearTimeout(this.timeout) clearTimeout(this.timeout)
this.hide(function () { this.hide(function () {
that.$element.off('.' + that.type).removeData('bs.' + that.type) that.$element.off('.' + that.type).removeData('bs.' + that.type)
if (that.$tip) {
that.$tip.detach()
}
that.$tip = null
that.$arrow = null
that.$viewport = null
that.$element = null
}) })
} }
@@ -475,6 +519,7 @@
}(jQuery); }(jQuery);
jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict(); jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict();
jQuery(document).ready(function () { jQuery(document).ready(function () {
@@ -485,3 +530,4 @@ jQuery(document).ready(function () {
animation: false animation: false
}); });
}); });
+6 -5
View File
@@ -1,5 +1,6 @@
+function(t){'use strict';var e=function(t,e){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.t$=null;this.init('tooltip',t,e)};e.VERSION='3.3.4';e.TRANSITION_DURATION=150;e.DEFAULTS={animation:!0,placement:'top',selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:!1,container:!1,viewport:{selector:'body',padding:0}};e.prototype.init=function(e,i,s){this.enabled=!0;this.type=e;this.t$=t(i);this.options=this.getOptions(s);this.o$=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport);if(this.t$[0]instanceof document.constructor&&!this.options.selector){throw new Error('`selector` option must be specified when initializing '+this.type+' on the window.document object!')};var r=this.options.trigger.split(' ');for(var n=r.length;n--;){var o=r[n];if(o=='click'){this.t$.on('click.'+this.type,this.options.selector,t.proxy(this.toggle,this))} +function(t){'use strict';var e=function(t,e){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init('tooltip',t,e)};e.VERSION='3.3.7';e.TRANSITION_DURATION=150;e.DEFAULTS={animation:!0,placement:'top',selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:!1,container:!1,viewport:{selector:'body',padding:0}};e.prototype.init=function(e,i,o){this.enabled=!0;this.type=e;this.$element=t(i);this.options=this.getOptions(o);this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):(this.options.viewport.selector||this.options.viewport));this.inState={click:!1,hover:!1,focus:!1};if(this.$element[0]instanceof document.constructor&&!this.options.selector){throw new Error('`selector` option must be specified when initializing '+this.type+' on the window.document object!')};var r=this.options.trigger.split(' ');for(var s=r.length;s--;){var n=r[s];if(n=='click'){this.$element.on('click.'+this.type,this.options.selector,t.proxy(this.toggle,this))}
else if(o!='manual'){var a=o=='hover'?'mouseenter':'focusin',l=o=='hover'?'mouseleave':'focusout';this.t$.on(a+'.'+this.type,this.options.selector,t.proxy(this.enter,this));this.t$.on(l+'.'+this.type,this.options.selector,t.proxy(this.leave,this))}};this.options.selector?(this.i$=t.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()};e.prototype.getDefaults=function(){return e.DEFAULTS};e.prototype.getOptions=function(e){e=t.extend({},this.getDefaults(),this.t$.data(),e);if(e.delay&&typeof e.delay=='number'){e.delay={show:e.delay,hide:e.delay}};return e};e.prototype.getDelegateOptions=function(){var e={};var i=this.getDefaults();this.i$&&t.each(this.i$,function(t,o){if(i[t]!=o)e[t]=o});return e};e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data('bs.'+this.type);if(i&&i.e$&&i.e$.is(':visible')){i.hoverState='in';return};if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)};clearTimeout(i.timeout);i.hoverState='in';if(!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){if(i.hoverState=='in')i.show()},i.options.delay.show)};e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data('bs.'+this.type);if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)};clearTimeout(i.timeout);i.hoverState='out';if(!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){if(i.hoverState=='out')i.hide()},i.options.delay.hide)};e.prototype.show=function(){var u=t.Event('show.bs.'+this.type);if(this.hasContent()&&this.enabled){this.t$.trigger(u);var d=t.contains(this.t$[0].ownerDocument.documentElement,this.t$[0]);if(u.isDefaultPrevented()||!d)return;var s=this,o=this.tip(),c=this.getUID(this.type);this.setContent();o.attr('id',c);this.t$.attr('aria-describedby',c);if(this.options.animation)o.addClass('fade');var i=typeof this.options.placement=='function'?this.options.placement.call(this,o[0],this.t$[0]):this.options.placement,f=/\s?auto?\s?/i,h=f.test(i);if(h)i=i.replace(f,'')||'top';o.detach().css({top:0,left:0,display:'block'}).addClass(i).data('bs.'+this.type,this);this.options.container?o.appendTo(this.options.container):o.insertAfter(this.t$);var n=this.getPosition(),a=o[0].offsetWidth,l=o[0].offsetHeight;if(h){var g=i,y=this.options.container?t(this.options.container):this.t$.parent(),r=this.getPosition(y);i=i=='bottom'&&n.bottom+l>r.bottom?'top':i=='top'&&n.top-l<r.top?'bottom':i=='right'&&n.right+a>r.width?'left':i=='left'&&n.left-a<r.left?'right':i;o.removeClass(g).addClass(i)};var v=this.getCalculatedOffset(i,n,a,l);this.applyPlacement(v,i);var p=function(){var t=s.hoverState;s.t$.trigger('shown.bs.'+s.type);s.hoverState=null;if(t=='out')s.leave(s)};t.support.transition&&this.e$.hasClass('fade')?o.one('bsTransitionEnd',p).emulateTransitionEnd(e.TRANSITION_DURATION):p()}};e.prototype.applyPlacement=function(e,o){var i=this.tip(),u=i[0].offsetWidth,p=i[0].offsetHeight,r=parseInt(i.css('margin-top'),10),l=parseInt(i.css('margin-left'),10);if(isNaN(r))r=0;if(isNaN(l))l=0;e.top=e.top+r;e.left=e.left+l;t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0);i.addClass('in');var h=i[0].offsetWidth,n=i[0].offsetHeight;if(o=='top'&&n!=p){e.top=e.top+p-n};var s=this.getViewportAdjustedDelta(o,e,h,n);if(s.left)e.left+=s.left;else e.top+=s.top;var a=/top|bottom/.test(o),f=a?s.left*2-u+h:s.top*2-p+n,c=a?'offsetWidth':'offsetHeight';i.offset(e);this.replaceArrow(f,i[0][c],a)};e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?'left':'top',50*(1-t/e)+'%').css(i?'top':'left','')};e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find('.tooltip-inner')[this.options.html?'html':'text'](e);t.removeClass('fade in top bottom left right')};e.prototype.hide=function(i){var s=this,o=t(this.e$),r=t.Event('hide.bs.'+this.type);function n(){if(s.hoverState!='in')o.detach();s.t$.removeAttr('aria-describedby').trigger('hidden.bs.'+s.type);i&&i()};this.t$.trigger(r);if(r.isDefaultPrevented())return;o.removeClass('in');t.support.transition&&o.hasClass('fade')?o.one('bsTransitionEnd',n).emulateTransitionEnd(e.TRANSITION_DURATION):n();this.hoverState=null;return this};e.prototype.fixTitle=function(){var t=this.t$;if(t.attr('title')||typeof(t.attr('data-original-title'))!='string'){t.attr('data-original-title',t.attr('title')||'').attr('title','')}};e.prototype.hasContent=function(){return this.getTitle()};e.prototype.getPosition=function(e){e=e||this.t$;var s=e[0],o=s.tagName=='BODY',i=s.getBoundingClientRect();if(i.width==null){i=t.extend({},i,{width:i.right-i.left,height:i.bottom-i.top})};var n=o?{top:0,left:0}:e.offset();var a={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()};var r=o?{width:t(window).width(),height:t(window).height()}:null;retuLine truncated else if(n!='manual'){var l=n=='hover'?'mouseenter':'focusin',a=n=='hover'?'mouseleave':'focusout';this.$element.on(l+'.'+this.type,this.options.selector,t.proxy(this.enter,this));this.$element.on(a+'.'+this.type,this.options.selector,t.proxy(this.leave,this))}};this.options.selector?(this._options=t.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()};e.prototype.getDefaults=function(){return e.DEFAULTS};e.prototype.getOptions=function(e){e=t.extend({},this.getDefaults(),this.$element.data(),e);if(e.delay&&typeof e.delay=='number'){e.delay={show:e.delay,hide:e.delay}};return e};e.prototype.getDelegateOptions=function(){var e={};var i=this.getDefaults();this._options&&t.each(this._options,function(t,o){if(i[t]!=o)e[t]=o});return e};e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data('bs.'+this.type);if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)};if(e instanceof t.Event){i.inState[e.type=='focusin'?'focus':'hover']=!0};if(i.tip().hasClass('in')||i.hoverState=='in'){i.hoverState='in';return};clearTimeout(i.timeout);i.hoverState='in';if(!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){if(i.hoverState=='in')i.show()},i.options.delay.show)};e.prototype.isInStateTrue=function(){for(var t in this.inState){if(this.inState[t])return!0};return!1};e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data('bs.'+this.type);if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)};if(e instanceof t.Event){i.inState[e.type=='focusout'?'focus':'hover']=!1};if(i.isInStateTrue())return;clearTimeout(i.timeout);i.hoverState='out';if(!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){if(i.hoverState=='out')i.hide()},i.options.delay.hide)};e.prototype.show=function(){var c=t.Event('show.bs.'+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(c);var v=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(c.isDefaultPrevented()||!v)return;var n=this,o=this.tip(),u=this.getUID(this.type);this.setContent();o.attr('id',u);this.$element.attr('aria-describedby',u);if(this.options.animation)o.addClass('fade');var i=typeof this.options.placement=='function'?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,h=/\s?auto?\s?/i,f=h.test(i);if(f)i=i.replace(h,'')||'top';o.detach().css({top:0,left:0,display:'block'}).addClass(i).data('bs.'+this.type,this);this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element);this.$element.trigger('inserted.bs.'+this.type);var s=this.getPosition(),l=o[0].offsetWidth,a=o[0].offsetHeight;if(f){var m=i,r=this.getPosition(this.$viewport);i=i=='bottom'&&s.bottom+a>r.bottom?'top':i=='top'&&s.top-a<r.top?'bottom':i=='right'&&s.right+l>r.width?'left':i=='left'&&s.left-l<r.left?'right':i;o.removeClass(m).addClass(i)};var d=this.getCalculatedOffset(i,s,l,a);this.applyPlacement(d,i);var p=function(){var t=n.hoverState;n.$element.trigger('shown.bs.'+n.type);n.hoverState=null;if(t=='out')n.leave(n)};t.support.transition&&this.$tip.hasClass('fade')?o.one('bsTransitionEnd',p).emulateTransitionEnd(e.TRANSITION_DURATION):p()}};e.prototype.applyPlacement=function(e,o){var i=this.tip(),c=i[0].offsetWidth,l=i[0].offsetHeight,a=parseInt(i.css('margin-top'),10),p=parseInt(i.css('margin-left'),10);if(isNaN(a))a=0;if(isNaN(p))p=0;e.top+=a;e.left+=p;t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0);i.addClass('in');var h=i[0].offsetWidth,s=i[0].offsetHeight;if(o=='top'&&s!=l){e.top=e.top+l-s};var n=this.getViewportAdjustedDelta(o,e,h,s);if(n.left)e.left+=n.left;else e.top+=n.top;var r=/top|bottom/.test(o),f=r?n.left*2-c+h:n.top*2-l+s,u=r?'offsetWidth':'offsetHeight';i.offset(e);this.replaceArrow(f,i[0][u],r)};e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?'left':'top',50*(1-t/e)+'%').css(i?'top':'left','')};e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find('.tooltip-inner')[this.options.html?'html':'text'](e);t.removeClass('fade in top bottom left right')};e.prototype.hide=function(i){var o=this,n=t(this.$tip),s=t.Event('hide.bs.'+this.type);function r(){if(o.hoverState!='in')n.detach();if(o.$element){o.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+o.type)};i&&i()};this.$element.trigger(s);if(s.isDefaultPrevented())return;n.removeClass('in');t.support.transition&&n.hasClass('fade')?n.one('bsTransitionEnd',r).emulateTransitionEnd(e.TRANSITION_DURATION):r();this.hoverState=null;return this};e.prototype.fixTitle=function(){var t=this.$element;if(t.attr('title')||typeof t.attr('data-original-title')!='string'){t.attr('data-original-title',t.attr('title')||'').attr('title','')}};e.prototype.hasContent=function(){return this.getTLine truncated
else if(r>e.top+e.height){o.top=e.top+e.height-r}} else if(h>e.top+e.height){o.top=e.top+e.height-h}}
else{var p=i.left-s,a=i.left+s+n;if(p<e.left){o.left=e.left-p} else{var l=i.left-s,a=i.left+s+n;if(l<e.left){o.left=e.left-l}
else if(a>e.width){o.left=e.left+e.width-a}};return o};e.prototype.getTitle=function(){var i,e=this.t$,t=this.options;i=e.attr('data-original-title')||(typeof t.title=='function'?t.title.call(e[0]):t.title);return i};e.prototype.getUID=function(t){do t+=~~(Math.random()*1000000);while(document.getElementById(t))return t};e.prototype.tip=function(){return(this.e$=this.e$||t(this.options.template))};e.prototype.arrow=function(){return(this.s$=this.s$||this.tip().find('.tooltip-arrow'))};e.prototype.enable=function(){this.enabled=!0};e.prototype.disable=function(){this.enabled=!1};e.prototype.toggleEnabled=function(){this.enabled=!this.enabled};e.prototype.toggle=function(e){var i=this;if(e){i=t(e.currentTarget).data('bs.'+this.type);if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)}};i.tip().hasClass('in')?i.leave(i):i.enter(i)};e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout);this.hide(function(){t.t$.off('.'+t.type).removeData('bs.'+t.type)})};function i(i){return this.each(function(){var s=t(this),o=s.data('bs.tooltip'),n=typeof i=='object'&&i;if(!o&&/destroy|hide/.test(i))return;if(!o)s.data('bs.tooltip',(o=new e(this,n)));if(typeof i=='string')o[i]()})};var o=t.fn.tooltip;t.fn.tooltip=i;t.fn.tooltip.Constructor=e;t.fn.tooltip.noConflict=function(){t.fn.tooltip=o;return this}}(jQuery);jQuery.fn.lapstooltip=jQuery.fn.tooltip.noConflict();jQuery(document).ready(function(){jQuery('.laps-timeline .event').lapstooltip({container:'#wpadminbar',placement:'bottom',html:!0,animation:!1})}); else if(a>e.right){o.left=e.left+e.width-a}};return o};e.prototype.getTitle=function(){var e,i=this.$element,t=this.options;e=i.attr('data-original-title')||(typeof t.title=='function'?t.title.call(i[0]):t.title);return e};e.prototype.getUID=function(t){do t+=~~(Math.random()*1000000);while(document.getElementById(t))return t};e.prototype.tip=function(){if(!this.$tip){this.$tip=t(this.options.template);if(this.$tip.length!=1){throw new Error(this.type+' `template` option must consist of exactly 1 top-level element!')}};return this.$tip};e.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))};e.prototype.enable=function(){this.enabled=!0};e.prototype.disable=function(){this.enabled=!1};e.prototype.toggleEnabled=function(){this.enabled=!this.enabled};e.prototype.toggle=function(e){var i=this;if(e){i=t(e.currentTarget).data('bs.'+this.type);if(!i){i=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data('bs.'+this.type,i)}};if(e){i.inState.click=!i.inState.click;if(i.isInStateTrue())i.enter(i);else i.leave(i)}
else{i.tip().hasClass('in')?i.leave(i):i.enter(i)}};e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout);this.hide(function(){t.$element.off('.'+t.type).removeData('bs.'+t.type);if(t.$tip){t.$tip.detach()};t.$tip=null;t.$arrow=null;t.$viewport=null;t.$element=null})};function o(i){return this.each(function(){var n=t(this),o=n.data('bs.tooltip'),s=typeof i=='object'&&i;if(!o&&/destroy|hide/.test(i))return;if(!o)n.data('bs.tooltip',(o=new e(this,s)));if(typeof i=='string')o[i]()})};var i=t.fn.tooltip;t.fn.tooltip=o;t.fn.tooltip.Constructor=e;t.fn.tooltip.noConflict=function(){t.fn.tooltip=i;return this}}(jQuery);jQuery.fn.lapstooltip=jQuery.fn.tooltip.noConflict();jQuery(document).ready(function(){jQuery('.laps-timeline .event').lapstooltip({container:'#wpadminbar',placement:'bottom',html:!0,animation:!1})});
+1 -1
View File
@@ -4,7 +4,7 @@ Plugin Name: Laps
Plugin URI: https://github.com/Rarst/laps Plugin URI: https://github.com/Rarst/laps
Description: Light WordPress profiler. Description: Light WordPress profiler.
Author: Andrey "Rarst" Savchenko Author: Andrey "Rarst" Savchenko
Version: 1.3.2 Version: 1.4
Author URI: http://www.rarst.net/ Author URI: http://www.rarst.net/
Text Domain: laps Text Domain: laps
Domain Path: /lang Domain Path: /lang
+7 -1
View File
@@ -248,13 +248,19 @@ class Laps {
$last_query_end = 0; $last_query_end = 0;
$last_offset = 0; $last_offset = 0;
$last_duration = 0; $last_duration = 0;
$category = 'query';
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
foreach ( $wpdb->queries as $key => $query ) { foreach ( $wpdb->queries as $key => $query ) {
$query_start = isset( self::$query_starts[ $key ] ) ? self::$query_starts[ $key ] : $last_query_end; $query_start = isset( self::$query_starts[ $key ] ) ? self::$query_starts[ $key ] : $last_query_end;
list( $sql, $duration, $trace ) = $query; list( $sql, $duration, $trace ) = $query;
$sql = trim( $sql );
$category = 'query-read';
if ( 0 === stripos( $sql, 'INSERT' ) || 0 === stripos( $sql, 'UPDATE' ) ) {
$category = 'query-write';
}
$duration *= 1000; $duration *= 1000;
$last_query_end = $query_start + $duration; $last_query_end = $query_start + $duration;
$offset = round( ( $query_start - $start ) / $total * 100, 2 ); $offset = round( ( $query_start - $start ) / $total * 100, 2 );
@@ -1,6 +1,6 @@
<?php <?php
class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template class __Mustache_797f2a84b9a5a7b601644494da75d61e extends Mustache_Template
{ {
private $lambdaHelper; private $lambdaHelper;
@@ -8,35 +8,39 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
{ {
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context); $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = ''; $buffer = '';
$newContext = array(); $blocksContext = array();
$buffer .= $indent . '<div class="laps-timeline"> $buffer .= $indent . '<div class="laps-timeline">
'; ';
// 'events' section // 'events' section
$value = $context->find('events'); $value = $context->find('events');
$buffer .= $this->section83708baddd3627fe4d26675ddf7eaeb5($context, $indent, $value); $buffer .= $this->section940385acb9865793d8943db356869c18($context, $indent, $value);
$buffer .= $indent . '</div> $buffer .= $indent . '</div>
'; ';
$buffer .= $indent . ' $buffer .= $indent . '
'; ';
// 'savequeries' section // 'savequeries' section
$value = $context->find('savequeries'); $value = $context->find('savequeries');
$buffer .= $this->section9756eb1d93d100052bdb80ee49b09ad6($context, $indent, $value); $buffer .= $this->sectionB93c1beb6bc5c41326a972381b0dd94a($context, $indent, $value);
$buffer .= $indent . ' $buffer .= $indent . '
'; ';
// 'savehttp' section // 'savehttp' section
$value = $context->find('savehttp'); $value = $context->find('savehttp');
$buffer .= $this->section3669ef98d4f6390c8df9645c96a328ee($context, $indent, $value); $buffer .= $this->section238f05e38d8d133266503e545e18de7e($context, $indent, $value);
return $buffer; return $buffer;
} }
private function section83708baddd3627fe4d26675ddf7eaeb5(Mustache_Context $context, $indent, $value) private function section940385acb9865793d8943db356869c18(Mustache_Context $context, $indent, $value)
{ {
$buffer = ''; $buffer = '';
$blocksContext = array();
if (!is_string($value) && is_callable($value)) { if (!is_string($value) && is_callable($value)) {
$source = ' $source = '
<div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{name}} - {{duration}} ms - {{memory}} MB</span>
</div>
'; ';
$result = call_user_func($value, $source, $this->lambdaHelper); $result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) { if (strpos($result, '{{') === false) {
@@ -52,24 +56,37 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
$context->push($value); $context->push($value);
$buffer .= $indent . ' <div class="event event-'; $buffer .= $indent . ' <div class="event event-';
$value = $this->resolveValue($context->find('category'), $context, $indent); $value = $this->resolveValue($context->find('category'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '" data-toggle="tooltip" title="'; $buffer .= '" data-toggle="tooltip" title="';
$value = $this->resolveValue($context->find('name'), $context, $indent); $value = $this->resolveValue($context->find('name'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' - '; $buffer .= ' - ';
$value = $this->resolveValue($context->find('duration'), $context, $indent); $value = $this->resolveValue($context->find('duration'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' ms - '; $buffer .= ' ms - ';
$value = $this->resolveValue($context->find('memory'), $context, $indent); $value = $this->resolveValue($context->find('memory'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' MB" style="width:'; $buffer .= ' MB" style="width:';
$value = $this->resolveValue($context->find('width'), $context, $indent); $value = $this->resolveValue($context->find('width'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%; left:'; $buffer .= '%; left:';
$value = $this->resolveValue($context->find('offset'), $context, $indent); $value = $this->resolveValue($context->find('offset'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%;"></div> $buffer .= '%;">
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' - ';
$value = $this->resolveValue($context->find('duration'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' ms - ';
$value = $this->resolveValue($context->find('memory'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' MB</span>
';
$buffer .= $indent . ' </div>
'; ';
$context->pop(); $context->pop();
} }
@@ -78,12 +95,16 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
return $buffer; return $buffer;
} }
private function section8dd7d0439d6fbb51dfb44aaa94780d5c(Mustache_Context $context, $indent, $value) private function section372053fedd826e7e297c29f607930cbc(Mustache_Context $context, $indent, $value)
{ {
$buffer = ''; $buffer = '';
$blocksContext = array();
if (!is_string($value) && is_callable($value)) { if (!is_string($value) && is_callable($value)) {
$source = ' $source = '
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{sql}}</span>
</div>
'; ';
$result = call_user_func($value, $source, $this->lambdaHelper); $result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) { if (strpos($result, '{{') === false) {
@@ -99,18 +120,25 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
$context->push($value); $context->push($value);
$buffer .= $indent . ' <div class="event event-'; $buffer .= $indent . ' <div class="event event-';
$value = $this->resolveValue($context->find('category'), $context, $indent); $value = $this->resolveValue($context->find('category'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '" title="'; $buffer .= '" title="';
$value = $this->resolveValue($context->find('sql'), $context, $indent); $value = $this->resolveValue($context->find('sql'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '" style="width:'; $buffer .= '" style="width:';
$value = $this->resolveValue($context->find('width'), $context, $indent); $value = $this->resolveValue($context->find('width'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%; left:'; $buffer .= '%; left:';
$value = $this->resolveValue($context->find('offset'), $context, $indent); $value = $this->resolveValue($context->find('offset'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%;"></div> $buffer .= '%;">
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('sql'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '</span>
';
$buffer .= $indent . ' </div>
'; ';
$context->pop(); $context->pop();
} }
@@ -119,14 +147,18 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
return $buffer; return $buffer;
} }
private function section9756eb1d93d100052bdb80ee49b09ad6(Mustache_Context $context, $indent, $value) private function sectionB93c1beb6bc5c41326a972381b0dd94a(Mustache_Context $context, $indent, $value)
{ {
$buffer = ''; $buffer = '';
$blocksContext = array();
if (!is_string($value) && is_callable($value)) { if (!is_string($value) && is_callable($value)) {
$source = ' $source = '
<div class="laps-timeline"> <div class="laps-timeline">
{{#queries}} {{#queries}}
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{sql}}</span>
</div>
{{/queries}} {{/queries}}
</div> </div>
'; ';
@@ -147,7 +179,7 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
'; ';
// 'queries' section // 'queries' section
$value = $context->find('queries'); $value = $context->find('queries');
$buffer .= $this->section8dd7d0439d6fbb51dfb44aaa94780d5c($context, $indent, $value); $buffer .= $this->section372053fedd826e7e297c29f607930cbc($context, $indent, $value);
$buffer .= $indent . '</div> $buffer .= $indent . '</div>
'; ';
$context->pop(); $context->pop();
@@ -157,12 +189,16 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
return $buffer; return $buffer;
} }
private function sectionFb9cb3f90496dc38ba05f46e0ac2ad5d(Mustache_Context $context, $indent, $value) private function section26362c0132f6d74333e6154005595603(Mustache_Context $context, $indent, $value)
{ {
$buffer = ''; $buffer = '';
$blocksContext = array();
if (!is_string($value) && is_callable($value)) { if (!is_string($value) && is_callable($value)) {
$source = ' $source = '
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{name}} - {{duration}} ms</span>
</div>
'; ';
$result = call_user_func($value, $source, $this->lambdaHelper); $result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) { if (strpos($result, '{{') === false) {
@@ -178,21 +214,31 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
$context->push($value); $context->push($value);
$buffer .= $indent . ' <div class="event event-'; $buffer .= $indent . ' <div class="event event-';
$value = $this->resolveValue($context->find('category'), $context, $indent); $value = $this->resolveValue($context->find('category'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '" title="'; $buffer .= '" title="';
$value = $this->resolveValue($context->find('name'), $context, $indent); $value = $this->resolveValue($context->find('name'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' - '; $buffer .= ' - ';
$value = $this->resolveValue($context->find('duration'), $context, $indent); $value = $this->resolveValue($context->find('duration'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' ms" style="width:'; $buffer .= ' ms" style="width:';
$value = $this->resolveValue($context->find('width'), $context, $indent); $value = $this->resolveValue($context->find('width'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%; left:'; $buffer .= '%; left:';
$value = $this->resolveValue($context->find('offset'), $context, $indent); $value = $this->resolveValue($context->find('offset'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8'); $buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= '%;"></div> $buffer .= '%;">
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' - ';
$value = $this->resolveValue($context->find('duration'), $context);
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
$buffer .= ' ms</span>
';
$buffer .= $indent . ' </div>
'; ';
$context->pop(); $context->pop();
} }
@@ -201,14 +247,18 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
return $buffer; return $buffer;
} }
private function section3669ef98d4f6390c8df9645c96a328ee(Mustache_Context $context, $indent, $value) private function section238f05e38d8d133266503e545e18de7e(Mustache_Context $context, $indent, $value)
{ {
$buffer = ''; $buffer = '';
$blocksContext = array();
if (!is_string($value) && is_callable($value)) { if (!is_string($value) && is_callable($value)) {
$source = ' $source = '
<div class="laps-timeline"> <div class="laps-timeline">
{{#http}} {{#http}}
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{name}} - {{duration}} ms</span>
</div>
{{/http}} {{/http}}
</div> </div>
'; ';
@@ -229,7 +279,7 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
'; ';
// 'http' section // 'http' section
$value = $context->find('http'); $value = $context->find('http');
$buffer .= $this->sectionFb9cb3f90496dc38ba05f46e0ac2ad5d($context, $indent, $value); $buffer .= $this->section26362c0132f6d74333e6154005595603($context, $indent, $value);
$buffer .= $indent . '</div> $buffer .= $indent . '</div>
'; ';
$context->pop(); $context->pop();
@@ -238,4 +288,5 @@ class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
return $buffer; return $buffer;
} }
} }
+9 -3
View File
@@ -1,13 +1,17 @@
<div class="laps-timeline"> <div class="laps-timeline">
{{#events}} {{#events}}
<div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{name}} - {{duration}} ms - {{memory}} MB</span>
</div>
{{/events}} {{/events}}
</div> </div>
{{#savequeries}} {{#savequeries}}
<div class="laps-timeline"> <div class="laps-timeline">
{{#queries}} {{#queries}}
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{sql}}</span>
</div>
{{/queries}} {{/queries}}
</div> </div>
{{/savequeries}} {{/savequeries}}
@@ -15,7 +19,9 @@
{{#savehttp}} {{#savehttp}}
<div class="laps-timeline"> <div class="laps-timeline">
{{#http}} {{#http}}
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;"></div> <div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;">
<span class="sr-only">{{name}} - {{duration}} ms</span>
</div>
{{/http}} {{/http}}
</div> </div>
{{/savehttp}} {{/savehttp}}