Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a00b11f78a | ||
|
|
32f300af7f | ||
|
|
a3572063d2 | ||
|
|
e8f8e9a4b6 | ||
|
|
cf44efbe64 | ||
|
|
2289923666 | ||
|
|
b82cd35cf8 | ||
|
|
8e441c935f | ||
|
|
7dfea751f5 | ||
|
|
a3cc36b661 | ||
|
|
47caf94cfe | ||
|
|
d8298b1700 | ||
|
|
5072bbbaad | ||
|
|
b32d60dfce | ||
|
|
c593e1e925 | ||
|
|
112c14fde3 | ||
|
|
df40e389ad | ||
|
|
fb7b2f025a | ||
|
|
b87ce58f4a | ||
|
|
424fb74b29 | ||
|
|
5ed687499f | ||
|
|
1db8318edb | ||
|
|
edb804d35f | ||
|
|
ce265e6dd2 | ||
|
|
f3438de84b | ||
|
|
d0d70fddaf | ||
|
|
48424c2b4c | ||
|
|
b3be169798 | ||
|
|
5a33c9329b | ||
|
|
6fda82d443 | ||
|
|
c912f263a2 | ||
|
|
6c75879465 | ||
|
|
db87114e3f | ||
|
|
6c7b6d6195 | ||
|
|
40fd25490b | ||
|
|
f2f3c4f474 | ||
|
|
59bc49bd56 | ||
|
|
234ed808aa | ||
|
|
b5161c2955 | ||
|
|
4cdf206de9 | ||
|
|
1d87865377 | ||
|
|
283f8632df | ||
|
|
eac2ab5fad | ||
|
|
26df4f5579 | ||
|
|
83972fdb69 | ||
|
|
e42787ec16 | ||
|
|
174b171cdd | ||
|
|
2a6c9339d3 | ||
|
|
103e0c36f5 | ||
|
|
0e48a61157 | ||
|
|
68f8ae42e9 | ||
|
|
f8fa008ec7 | ||
|
|
b0d376ea8c |
No files matched your search
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
vendor
|
/vendor
|
||||||
composer.lock
|
/release
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 1.3.1
|
||||||
|
|
||||||
|
- fixed crash on event stop without matching start
|
||||||
|
|
||||||
|
## 1.3
|
||||||
|
|
||||||
|
- implemented minified assets
|
||||||
|
- implemented pre-cached template
|
||||||
|
- fixed crash with upcoming Hybrid Core v3
|
||||||
|
- implemented release build command
|
||||||
|
- split plugins_loaded hook into separate event
|
||||||
|
- added WP SEO event
|
||||||
|
|
||||||
|
## 1.2.1
|
||||||
|
|
||||||
|
- disabled tooltip animation to fix JS errors and UI disappearing from under cursor
|
||||||
|
|
||||||
|
## 1.2
|
||||||
|
|
||||||
|
- merged RP with additional core events in admin
|
||||||
|
- implemented (ballpark) toolbar event
|
||||||
|
- fixed issue with event offsets in timelines
|
||||||
|
|
||||||
|
## 1.1
|
||||||
|
|
||||||
|
- added SQL timeline
|
||||||
|
- added HTTP timeline
|
||||||
|
- switched tooltips implementation to Bootstrap script
|
||||||
|
|
||||||
|
## 1.0
|
||||||
|
|
||||||
|
- Initial public release
|
||||||
+46
-68
@@ -1,68 +1,46 @@
|
|||||||
# Description
|
# Laps — light WordPress profiler
|
||||||
|
|
||||||
Laps is light WordPress profiler (in a plugin), which aims to be:
|

|
||||||
|
|
||||||
- always on and zero click (just hover on toolbar entry) away
|
Laps is light WordPress profiler (in a plugin), which aims to be:
|
||||||
- quick indicator of what hogs page in general or right now
|
|
||||||
|
- always on and zero click (just hover on toolbar entry) away
|
||||||
It is no match or replacement for *real* profiler, but is friendly and cute.
|
- quick indicator of what hogs page in general or right now
|
||||||
|
|
||||||
Out of the box Laps supports common stage of WordPress page life cycle:
|
It is no match or replacement for *real* profiler, but is friendly and cute.
|
||||||
|
|
||||||
- plugins load
|
Out of the box Laps supports common stage of WordPress page life cycle:
|
||||||
- themes load
|
|
||||||
- core init
|
- plugins load
|
||||||
- main loop
|
- themes load
|
||||||
|
- core init
|
||||||
And some of third party hooks conventions for themes using:
|
- main loop
|
||||||
|
|
||||||
- Theme Hook Alliance
|
And some of third party hooks conventions for themes using:
|
||||||
- Hybrid
|
|
||||||
- Genesis
|
- [Theme Hook Alliance](http://zamoose.github.io/themehookalliance/)
|
||||||
- Thematic
|
- [Hybrid](http://themehybrid.com/)
|
||||||
|
- [Genesis](http://my.studiopress.com/themes/genesis/)
|
||||||
There are also additional optional timelines, displaying:
|
- [Thematic](http://thematictheme.com/)
|
||||||
|
|
||||||
- SQL queries (with `SAVEQUERIES` constant enabled)
|
There are also additional optional timelines, displaying:
|
||||||
- HTTP requests performed
|
|
||||||
|
- SQL queries (with [`SAVEQUERIES` constant](http://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis) enabled)
|
||||||
# Screenshot
|
- HTTP requests performed
|
||||||
|
|
||||||

|
## Installation
|
||||||
|
|
||||||
# Installation
|
Download plugin archive from [releases section](https://github.com/Rarst/laps/releases).
|
||||||
|
|
||||||
Laps is a Composer package and can be installed in plugin directory via:
|
Or install in plugin directory via [Composer](https://getcomposer.org/):
|
||||||
|
|
||||||
composer create-project rarst/laps --no-dev
|
composer create-project rarst/laps --no-dev
|
||||||
|
|
||||||
# Frequently Asked Questions
|
## License Info
|
||||||
|
|
||||||
None... Yet.
|
Laps own code is licensed under MIT and it makes use of code from:
|
||||||
|
|
||||||
# Changelog
|
- Composer Installers (MIT)
|
||||||
|
- Symfony Stopwatch (MIT)
|
||||||
## 1.2
|
- Mustache.php (MIT)
|
||||||
|
- Twitter Bootstrap (MIT)
|
||||||
- merged RP with additional core events in admin
|
|
||||||
- implemented (ballpark) toolbar event
|
|
||||||
- fixed issue with event offsets in timelines
|
|
||||||
|
|
||||||
## 1.1
|
|
||||||
|
|
||||||
- added SQL timeline
|
|
||||||
- added HTTP timeline
|
|
||||||
- switched tooltips implementation to Bootstrap script
|
|
||||||
|
|
||||||
## 1.0
|
|
||||||
|
|
||||||
- Initial public release
|
|
||||||
|
|
||||||
# License Info
|
|
||||||
|
|
||||||
Laps own code is licensed under MIT and it makes use of code from:
|
|
||||||
|
|
||||||
- Composer (MIT)
|
|
||||||
- Symfony Stopwatch (MIT)
|
|
||||||
- Mustache.php (MIT)
|
|
||||||
- Twitter Bootstrap (Apache License 2.0)
|
|
||||||
+158
@@ -0,0 +1,158 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is project's console commands configuration for Robo task runner.
|
||||||
|
*
|
||||||
|
* @see http://robo.li/
|
||||||
|
*/
|
||||||
|
class RoboFile extends \Robo\Tasks {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Watches for changes.
|
||||||
|
*/
|
||||||
|
public function watch() {
|
||||||
|
|
||||||
|
$this->taskWatch()
|
||||||
|
->monitor( [ 'css/variables.less', 'css/laps.less' ], function () {
|
||||||
|
$this->makeCss();
|
||||||
|
} )
|
||||||
|
->monitor( 'js/source.js', function () {
|
||||||
|
$this->makeJs();
|
||||||
|
} )
|
||||||
|
->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiles all assets.
|
||||||
|
*/
|
||||||
|
public function makeAll() {
|
||||||
|
|
||||||
|
$this->makeCss();
|
||||||
|
$this->makeJs();
|
||||||
|
$this->makeMustache();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiles plugin's css file from less.
|
||||||
|
*/
|
||||||
|
public function makeCss() {
|
||||||
|
|
||||||
|
$this->taskExec( 'lessc css/laps.less css/laps.css --source-map=css/laps.css.map' )->run();
|
||||||
|
|
||||||
|
$this->taskMinify( 'css/laps.css' )
|
||||||
|
->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates plugin's script file.
|
||||||
|
*/
|
||||||
|
public function makeJs() {
|
||||||
|
|
||||||
|
$this->taskConcat( [
|
||||||
|
'vendor/twbs/bootstrap/js/tooltip.js',
|
||||||
|
'js/source.js',
|
||||||
|
] )
|
||||||
|
->to( 'js/laps.js' )
|
||||||
|
->run();
|
||||||
|
|
||||||
|
$this->taskMinify( 'js/laps.js' )
|
||||||
|
->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiles plugin's mustache template
|
||||||
|
*/
|
||||||
|
public function makeMustache() {
|
||||||
|
$dir = __DIR__ . '/views/cache';
|
||||||
|
$this->_cleanDir( $dir );
|
||||||
|
|
||||||
|
$mustache = new \Mustache_Engine(
|
||||||
|
array(
|
||||||
|
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/views' ),
|
||||||
|
'cache' => $dir,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$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.
|
||||||
|
*
|
||||||
|
* @param string $version Version string.
|
||||||
|
*/
|
||||||
|
public function versionSet( $version ) {
|
||||||
|
|
||||||
|
$this->taskReplaceInFile( 'laps.php' )
|
||||||
|
->regex( '|^Version:.*$|m' )
|
||||||
|
->to( 'Version: ' . $version )
|
||||||
|
->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 ) {
|
||||||
|
$zipArchive->addFile( $file->getRealPath(), 'laps/' . $file->getRelativePathname() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! $zipArchive->status === ZIPARCHIVE::ER_OK ) {
|
||||||
|
echo "Failed to write files to zip\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$zipArchive->close();
|
||||||
|
|
||||||
|
$this->taskDeleteDir( 'release/laps' )->run();
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-3
@@ -3,7 +3,7 @@
|
|||||||
"description": "Light WordPress profiler.",
|
"description": "Light WordPress profiler.",
|
||||||
"keywords" : ["wordpress", "performance"],
|
"keywords" : ["wordpress", "performance"],
|
||||||
"type" : "wordpress-plugin",
|
"type" : "wordpress-plugin",
|
||||||
"homepage" : "https://bitbucket.org/Rarst/laps",
|
"homepage" : "https://github.com/Rarst/laps",
|
||||||
"license" : "MIT",
|
"license" : "MIT",
|
||||||
"authors" : [
|
"authors" : [
|
||||||
{
|
{
|
||||||
@@ -13,8 +13,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support" : {
|
"support" : {
|
||||||
"issues": "https://bitbucket.org/Rarst/laps/issues",
|
"issues": "https://github.com/Rarst/laps/issues"
|
||||||
"source": "https://bitbucket.org/Rarst/laps/src"
|
|
||||||
},
|
},
|
||||||
"autoload" : {
|
"autoload" : {
|
||||||
"classmap": ["src/"]
|
"classmap": ["src/"]
|
||||||
@@ -23,5 +22,8 @@
|
|||||||
"composer/installers": "~1.0",
|
"composer/installers": "~1.0",
|
||||||
"symfony/stopwatch" : "~2.4",
|
"symfony/stopwatch" : "~2.4",
|
||||||
"mustache/mustache" : "~2.4"
|
"mustache/mustache" : "~2.4"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"twbs/bootstrap": "~3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+260
@@ -0,0 +1,260 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"hash": "7495421e8df337988c9906e05aab637b",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "composer/installers",
|
||||||
|
"version": "v1.0.21",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/composer/installers.git",
|
||||||
|
"reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/composer/installers/zipball/d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
|
||||||
|
"reference": "d64e23fce42a4063d63262b19b8e7c0f3b5e4c45",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"replace": {
|
||||||
|
"roundcube/plugin-installer": "*",
|
||||||
|
"shama/baton": "*"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/composer": "1.0.*@dev",
|
||||||
|
"phpunit/phpunit": "4.1.*"
|
||||||
|
},
|
||||||
|
"type": "composer-installer",
|
||||||
|
"extra": {
|
||||||
|
"class": "Composer\\Installers\\Installer",
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Composer\\Installers\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Kyle Robinson Young",
|
||||||
|
"email": "kyle@dontkry.com",
|
||||||
|
"homepage": "https://github.com/shama"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A multi-framework Composer library installer",
|
||||||
|
"homepage": "http://composer.github.com/installers/",
|
||||||
|
"keywords": [
|
||||||
|
"Craft",
|
||||||
|
"Dolibarr",
|
||||||
|
"Hurad",
|
||||||
|
"MODX Evo",
|
||||||
|
"OXID",
|
||||||
|
"SMF",
|
||||||
|
"Thelia",
|
||||||
|
"WolfCMS",
|
||||||
|
"agl",
|
||||||
|
"aimeos",
|
||||||
|
"annotatecms",
|
||||||
|
"bitrix",
|
||||||
|
"cakephp",
|
||||||
|
"chef",
|
||||||
|
"codeigniter",
|
||||||
|
"concrete5",
|
||||||
|
"croogo",
|
||||||
|
"dokuwiki",
|
||||||
|
"drupal",
|
||||||
|
"elgg",
|
||||||
|
"fuelphp",
|
||||||
|
"grav",
|
||||||
|
"installer",
|
||||||
|
"joomla",
|
||||||
|
"kohana",
|
||||||
|
"laravel",
|
||||||
|
"lithium",
|
||||||
|
"magento",
|
||||||
|
"mako",
|
||||||
|
"mediawiki",
|
||||||
|
"modulework",
|
||||||
|
"moodle",
|
||||||
|
"phpbb",
|
||||||
|
"piwik",
|
||||||
|
"ppi",
|
||||||
|
"puppet",
|
||||||
|
"roundcube",
|
||||||
|
"shopware",
|
||||||
|
"silverstripe",
|
||||||
|
"symfony",
|
||||||
|
"typo3",
|
||||||
|
"wordpress",
|
||||||
|
"zend",
|
||||||
|
"zikula"
|
||||||
|
],
|
||||||
|
"time": "2015-02-18 17:17:01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mustache/mustache",
|
||||||
|
"version": "v2.8.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/bobthecow/mustache.php.git",
|
||||||
|
"reference": "64c28cc73e01d5edcef7de8cb2b16782615f648a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/64c28cc73e01d5edcef7de8cb2b16782615f648a",
|
||||||
|
"reference": "64c28cc73e01d5edcef7de8cb2b16782615f648a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.2.4"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fabpot/php-cs-fixer": "~1.6",
|
||||||
|
"phpunit/phpunit": "~3.7|~4.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Mustache": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Justin Hileman",
|
||||||
|
"email": "justin@justinhileman.info",
|
||||||
|
"homepage": "http://justinhileman.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A Mustache implementation in PHP.",
|
||||||
|
"homepage": "https://github.com/bobthecow/mustache.php",
|
||||||
|
"keywords": [
|
||||||
|
"mustache",
|
||||||
|
"templating"
|
||||||
|
],
|
||||||
|
"time": "2015-04-01 06:37:33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/stopwatch",
|
||||||
|
"version": "v2.7.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/Stopwatch.git",
|
||||||
|
"reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/7702945bceddc0e1f744519abb8a2baeb94bd5ce",
|
||||||
|
"reference": "7702945bceddc0e1f744519abb8a2baeb94bd5ce",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.9"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/phpunit-bridge": "~2.7"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.7-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Stopwatch\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony Stopwatch Component",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"time": "2015-05-02 15:21:08"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [
|
||||||
|
{
|
||||||
|
"name": "twbs/bootstrap",
|
||||||
|
"version": "v3.3.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/twbs/bootstrap.git",
|
||||||
|
"reference": "a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f",
|
||||||
|
"reference": "a10eb60bc0b07b747fa0c4ebd8821eb7307bd07f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"replace": {
|
||||||
|
"twitter/bootstrap": "self.version"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.3.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Jacob Thornton",
|
||||||
|
"email": "jacobthornton@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Mark Otto",
|
||||||
|
"email": "markdotto@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
|
||||||
|
"homepage": "http://getbootstrap.com",
|
||||||
|
"keywords": [
|
||||||
|
"JS",
|
||||||
|
"css",
|
||||||
|
"framework",
|
||||||
|
"front-end",
|
||||||
|
"less",
|
||||||
|
"mobile-first",
|
||||||
|
"responsive",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
|
"time": "2015-03-16 15:44:41"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": [],
|
||||||
|
"platform-dev": []
|
||||||
|
}
|
||||||
+17
-8
@@ -19,24 +19,27 @@
|
|||||||
#wpadminbar .laps-timeline {
|
#wpadminbar .laps-timeline {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin: 6px 0;
|
margin-bottom: 20px;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
-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);
|
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||||
|
margin: 6px 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
#wpadminbar .laps-timeline .event {
|
#wpadminbar .laps-timeline .event {
|
||||||
float: left;
|
float: left;
|
||||||
width: 0%;
|
width: 0%;
|
||||||
height: 20px;
|
height: 100%;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #fff;
|
line-height: 20px;
|
||||||
|
color: #ffffff;
|
||||||
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);
|
||||||
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;
|
-webkit-transition: width 0.6s ease;
|
||||||
|
-o-transition: width 0.6s ease;
|
||||||
transition: width 0.6s ease;
|
transition: width 0.6s ease;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-left: 1px solid #f5f5f5;
|
border-left: 1px solid #f5f5f5;
|
||||||
@@ -61,8 +64,9 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100000;
|
z-index: 100000;
|
||||||
display: block;
|
display: block;
|
||||||
visibility: visible;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
filter: alpha(opacity=0);
|
filter: alpha(opacity=0);
|
||||||
@@ -112,13 +116,15 @@
|
|||||||
}
|
}
|
||||||
#wpadminbar .tooltip.top-left .tooltip-arrow {
|
#wpadminbar .tooltip.top-left .tooltip-arrow {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 5px;
|
right: 5px;
|
||||||
|
margin-bottom: -5px;
|
||||||
border-width: 5px 5px 0;
|
border-width: 5px 5px 0;
|
||||||
border-top-color: #464646;
|
border-top-color: #464646;
|
||||||
}
|
}
|
||||||
#wpadminbar .tooltip.top-right .tooltip-arrow {
|
#wpadminbar .tooltip.top-right .tooltip-arrow {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 5px;
|
left: 5px;
|
||||||
|
margin-bottom: -5px;
|
||||||
border-width: 5px 5px 0;
|
border-width: 5px 5px 0;
|
||||||
border-top-color: #464646;
|
border-top-color: #464646;
|
||||||
}
|
}
|
||||||
@@ -145,13 +151,15 @@
|
|||||||
}
|
}
|
||||||
#wpadminbar .tooltip.bottom-left .tooltip-arrow {
|
#wpadminbar .tooltip.bottom-left .tooltip-arrow {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 5px;
|
right: 5px;
|
||||||
|
margin-top: -5px;
|
||||||
border-width: 0 5px 5px;
|
border-width: 0 5px 5px;
|
||||||
border-bottom-color: #464646;
|
border-bottom-color: #464646;
|
||||||
}
|
}
|
||||||
#wpadminbar .tooltip.bottom-right .tooltip-arrow {
|
#wpadminbar .tooltip.bottom-right .tooltip-arrow {
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 5px;
|
left: 5px;
|
||||||
|
margin-top: -5px;
|
||||||
border-width: 0 5px 5px;
|
border-width: 0 5px 5px;
|
||||||
border-bottom-color: #464646;
|
border-bottom-color: #464646;
|
||||||
}
|
}
|
||||||
@@ -163,3 +171,4 @@
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
/*# sourceMappingURL=laps.css.map */
|
||||||
@@ -0,0 +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"}
|
||||||
+33
-47
@@ -1,5 +1,7 @@
|
|||||||
|
@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 "variables.less";
|
@import "variables.less";
|
||||||
@import "mixins.less";
|
|
||||||
|
|
||||||
#wpadminbar {
|
#wpadminbar {
|
||||||
|
|
||||||
@@ -7,9 +9,9 @@
|
|||||||
|
|
||||||
.ab-sub-wrapper {
|
.ab-sub-wrapper {
|
||||||
min-width: 90%;
|
min-width: 90%;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 5%;
|
left: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ab-submenu {
|
.ab-submenu {
|
||||||
@@ -31,51 +33,35 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.laps-timeline {
|
.laps-timeline {
|
||||||
overflow: hidden;
|
.progress;
|
||||||
height: 20px;
|
margin: 6px 0;
|
||||||
margin: 6px 0;
|
|
||||||
background-color: @timeline-bg;
|
|
||||||
border-radius: 4px;
|
|
||||||
.box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
|
|
||||||
position: relative;
|
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 {
|
||||||
|
background-color: @event-info-color;
|
||||||
|
}
|
||||||
|
.event-http {
|
||||||
|
background-color: @event-warning-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.laps-timeline .event {
|
@import "../vendor/twbs/bootstrap/less/tooltip.less";
|
||||||
float: left;
|
|
||||||
width: 0%;
|
|
||||||
height: 20px;
|
|
||||||
font-size: @font-size-small;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
background-color: @event-info-color;
|
|
||||||
.box-shadow(inset 0 -1px 0 rgba(0, 0, 0, .15));
|
|
||||||
.transition(width .6s ease);
|
|
||||||
position: absolute; // disable stacking at start
|
|
||||||
border-left: 1px solid @timeline-bg;
|
|
||||||
min-width: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.laps-timeline .event-theme {
|
|
||||||
background-color: @event-theme-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.laps-timeline .event-plugin {
|
|
||||||
background-color: @event-plugin-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.laps-timeline .event-core {
|
|
||||||
background-color: @event-core-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.laps-timeline .event-query {
|
|
||||||
background-color: @event-info-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.laps-timeline .event-http {
|
|
||||||
background-color: @event-warning-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
@import "tooltip.less";
|
|
||||||
|
|
||||||
.tooltip.in {
|
.tooltip.in {
|
||||||
.opacity(1);
|
.opacity(1);
|
||||||
@@ -83,7 +69,7 @@
|
|||||||
|
|
||||||
.tooltip-inner {
|
.tooltip-inner {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vendored
+1
@@ -0,0 +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}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
.transition(@transition) {
|
|
||||||
-webkit-transition: @transition;
|
|
||||||
transition: @transition;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box-shadow(@shadow) {
|
|
||||||
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
|
|
||||||
box-shadow: @shadow;
|
|
||||||
}
|
|
||||||
|
|
||||||
.opacity(@opacity) {
|
|
||||||
opacity: @opacity;
|
|
||||||
// IE8 filter
|
|
||||||
@opacity-ie: (@opacity * 100);
|
|
||||||
filter: ~"alpha(opacity=@{opacity-ie})";
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
//
|
|
||||||
// Tooltips
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Base class
|
|
||||||
.tooltip {
|
|
||||||
position: absolute;
|
|
||||||
z-index: @zindex-tooltip;
|
|
||||||
display: block;
|
|
||||||
visibility: visible;
|
|
||||||
font-size: @font-size-small;
|
|
||||||
line-height: 1.4;
|
|
||||||
.opacity(0);
|
|
||||||
|
|
||||||
&.in { .opacity(.9); }
|
|
||||||
&.top { margin-top: -3px; padding: @tooltip-arrow-width 0; }
|
|
||||||
&.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; }
|
|
||||||
&.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; }
|
|
||||||
&.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wrapper for the tooltip content
|
|
||||||
.tooltip-inner {
|
|
||||||
max-width: @tooltip-max-width;
|
|
||||||
padding: 3px 8px;
|
|
||||||
color: @tooltip-color;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: @tooltip-bg;
|
|
||||||
border-radius: @border-radius-base;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Arrows
|
|
||||||
.tooltip-arrow {
|
|
||||||
position: absolute;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-color: transparent;
|
|
||||||
border-style: solid;
|
|
||||||
}
|
|
||||||
.tooltip {
|
|
||||||
&.top .tooltip-arrow {
|
|
||||||
bottom: 0;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -@tooltip-arrow-width;
|
|
||||||
border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
|
|
||||||
border-top-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.top-left .tooltip-arrow {
|
|
||||||
bottom: 0;
|
|
||||||
left: @tooltip-arrow-width;
|
|
||||||
border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
|
|
||||||
border-top-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.top-right .tooltip-arrow {
|
|
||||||
bottom: 0;
|
|
||||||
right: @tooltip-arrow-width;
|
|
||||||
border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
|
|
||||||
border-top-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.right .tooltip-arrow {
|
|
||||||
top: 50%;
|
|
||||||
left: 0;
|
|
||||||
margin-top: -@tooltip-arrow-width;
|
|
||||||
border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;
|
|
||||||
border-right-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.left .tooltip-arrow {
|
|
||||||
top: 50%;
|
|
||||||
right: 0;
|
|
||||||
margin-top: -@tooltip-arrow-width;
|
|
||||||
border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;
|
|
||||||
border-left-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.bottom .tooltip-arrow {
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: -@tooltip-arrow-width;
|
|
||||||
border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
|
|
||||||
border-bottom-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.bottom-left .tooltip-arrow {
|
|
||||||
top: 0;
|
|
||||||
left: @tooltip-arrow-width;
|
|
||||||
border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
|
|
||||||
border-bottom-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
&.bottom-right .tooltip-arrow {
|
|
||||||
top: 0;
|
|
||||||
right: @tooltip-arrow-width;
|
|
||||||
border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
|
|
||||||
border-bottom-color: @tooltip-arrow-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
@font-size-small: 12px;
|
@font-size-small: 12px;
|
||||||
|
@line-height-computed: 20px;
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
@timeline-bg: #f5f5f5;
|
@timeline-bg: #f5f5f5;
|
||||||
@@ -7,6 +8,8 @@
|
|||||||
@event-core-color: #f0ad4e;
|
@event-core-color: #f0ad4e;
|
||||||
@event-info-color: #5bc0de;
|
@event-info-color: #5bc0de;
|
||||||
@event-warning-color: #d9534f;
|
@event-warning-color: #d9534f;
|
||||||
|
@progress-bg: @timeline-bg;
|
||||||
|
@progress-bar-bg: @event-info-color;
|
||||||
|
|
||||||
// because admin bar is 99999
|
// because admin bar is 99999
|
||||||
@zindex-tooltip: 100000;
|
@zindex-tooltip: 100000;
|
||||||
|
|||||||
+487
@@ -0,0 +1,487 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: tooltip.js v3.3.4
|
||||||
|
* http://getbootstrap.com/javascript/#tooltip
|
||||||
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2015 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
|
// ===============================
|
||||||
|
|
||||||
|
var Tooltip = function (element, options) {
|
||||||
|
this.type = null
|
||||||
|
this.options = null
|
||||||
|
this.enabled = null
|
||||||
|
this.timeout = null
|
||||||
|
this.hoverState = null
|
||||||
|
this.$element = null
|
||||||
|
|
||||||
|
this.init('tooltip', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.VERSION = '3.3.4'
|
||||||
|
|
||||||
|
Tooltip.TRANSITION_DURATION = 150
|
||||||
|
|
||||||
|
Tooltip.DEFAULTS = {
|
||||||
|
animation: true,
|
||||||
|
placement: 'top',
|
||||||
|
selector: false,
|
||||||
|
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
||||||
|
trigger: 'hover focus',
|
||||||
|
title: '',
|
||||||
|
delay: 0,
|
||||||
|
html: false,
|
||||||
|
container: false,
|
||||||
|
viewport: {
|
||||||
|
selector: 'body',
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.init = function (type, element, options) {
|
||||||
|
this.enabled = true
|
||||||
|
this.type = type
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = this.getOptions(options)
|
||||||
|
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
||||||
|
|
||||||
|
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 triggers = this.options.trigger.split(' ')
|
||||||
|
|
||||||
|
for (var i = triggers.length; i--;) {
|
||||||
|
var trigger = triggers[i]
|
||||||
|
|
||||||
|
if (trigger == 'click') {
|
||||||
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (trigger != 'manual') {
|
||||||
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
||||||
|
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
||||||
|
|
||||||
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.options.selector ?
|
||||||
|
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||||
|
this.fixTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDefaults = function () {
|
||||||
|
return Tooltip.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getOptions = function (options) {
|
||||||
|
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||||
|
|
||||||
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
|
options.delay = {
|
||||||
|
show: options.delay,
|
||||||
|
hide: options.delay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
|
var options = {}
|
||||||
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
|
this._options && $.each(this._options, function (key, value) {
|
||||||
|
if (defaults[key] != value) options[key] = value
|
||||||
|
})
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enter = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
||||||
|
|
||||||
|
if (self && self.$tip && self.$tip.is(':visible')) {
|
||||||
|
self.hoverState = 'in'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self) {
|
||||||
|
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
||||||
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'in'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'in') self.show()
|
||||||
|
}, self.options.delay.show)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.leave = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
||||||
|
|
||||||
|
if (!self) {
|
||||||
|
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
||||||
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'out'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'out') self.hide()
|
||||||
|
}, self.options.delay.hide)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.show = function () {
|
||||||
|
var e = $.Event('show.bs.' + this.type)
|
||||||
|
|
||||||
|
if (this.hasContent() && this.enabled) {
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
|
||||||
|
if (e.isDefaultPrevented() || !inDom) return
|
||||||
|
var that = this
|
||||||
|
|
||||||
|
var $tip = this.tip()
|
||||||
|
|
||||||
|
var tipId = this.getUID(this.type)
|
||||||
|
|
||||||
|
this.setContent()
|
||||||
|
$tip.attr('id', tipId)
|
||||||
|
this.$element.attr('aria-describedby', tipId)
|
||||||
|
|
||||||
|
if (this.options.animation) $tip.addClass('fade')
|
||||||
|
|
||||||
|
var placement = typeof this.options.placement == 'function' ?
|
||||||
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
|
this.options.placement
|
||||||
|
|
||||||
|
var autoToken = /\s?auto?\s?/i
|
||||||
|
var autoPlace = autoToken.test(placement)
|
||||||
|
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.detach()
|
||||||
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
|
.addClass(placement)
|
||||||
|
.data('bs.' + this.type, this)
|
||||||
|
|
||||||
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||||
|
|
||||||
|
var pos = this.getPosition()
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (autoPlace) {
|
||||||
|
var orgPlacement = placement
|
||||||
|
var $container = this.options.container ? $(this.options.container) : this.$element.parent()
|
||||||
|
var containerDim = this.getPosition($container)
|
||||||
|
|
||||||
|
placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' :
|
||||||
|
placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' :
|
||||||
|
placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' :
|
||||||
|
placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' :
|
||||||
|
placement
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.removeClass(orgPlacement)
|
||||||
|
.addClass(placement)
|
||||||
|
}
|
||||||
|
|
||||||
|
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
||||||
|
|
||||||
|
this.applyPlacement(calculatedOffset, placement)
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
var prevHoverState = that.hoverState
|
||||||
|
that.$element.trigger('shown.bs.' + that.type)
|
||||||
|
that.hoverState = null
|
||||||
|
|
||||||
|
if (prevHoverState == 'out') that.leave(that)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one('bsTransitionEnd', complete)
|
||||||
|
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
||||||
|
complete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var width = $tip[0].offsetWidth
|
||||||
|
var height = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
// manually read margins because getBoundingClientRect includes difference
|
||||||
|
var marginTop = parseInt($tip.css('margin-top'), 10)
|
||||||
|
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||||
|
|
||||||
|
// we must check for NaN for ie 8/9
|
||||||
|
if (isNaN(marginTop)) marginTop = 0
|
||||||
|
if (isNaN(marginLeft)) marginLeft = 0
|
||||||
|
|
||||||
|
offset.top = offset.top + marginTop
|
||||||
|
offset.left = offset.left + marginLeft
|
||||||
|
|
||||||
|
// $.fn.offset doesn't round pixel values
|
||||||
|
// so we use setOffset directly with our own function B-0
|
||||||
|
$.offset.setOffset($tip[0], $.extend({
|
||||||
|
using: function (props) {
|
||||||
|
$tip.css({
|
||||||
|
top: Math.round(props.top),
|
||||||
|
left: Math.round(props.left)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, offset), 0)
|
||||||
|
|
||||||
|
$tip.addClass('in')
|
||||||
|
|
||||||
|
// check to see if placing tip in new offset caused the tip to resize itself
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
||||||
|
|
||||||
|
if (delta.left) offset.left += delta.left
|
||||||
|
else offset.top += delta.top
|
||||||
|
|
||||||
|
var isVertical = /top|bottom/.test(placement)
|
||||||
|
var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
||||||
|
var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
|
||||||
|
|
||||||
|
$tip.offset(offset)
|
||||||
|
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
|
||||||
|
this.arrow()
|
||||||
|
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
|
||||||
|
.css(isVertical ? 'top' : 'left', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
|
||||||
|
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.removeClass('fade in top bottom left right')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hide = function (callback) {
|
||||||
|
var that = this
|
||||||
|
var $tip = $(this.$tip)
|
||||||
|
var e = $.Event('hide.bs.' + this.type)
|
||||||
|
|
||||||
|
function complete() {
|
||||||
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
|
that.$element
|
||||||
|
.removeAttr('aria-describedby')
|
||||||
|
.trigger('hidden.bs.' + that.type)
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$tip.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && $tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one('bsTransitionEnd', complete)
|
||||||
|
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
||||||
|
complete()
|
||||||
|
|
||||||
|
this.hoverState = null
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.fixTitle = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
|
||||||
|
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hasContent = function () {
|
||||||
|
return this.getTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getPosition = function ($element) {
|
||||||
|
$element = $element || this.$element
|
||||||
|
|
||||||
|
var el = $element[0]
|
||||||
|
var isBody = el.tagName == 'BODY'
|
||||||
|
|
||||||
|
var elRect = el.getBoundingClientRect()
|
||||||
|
if (elRect.width == null) {
|
||||||
|
// 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 })
|
||||||
|
}
|
||||||
|
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
||||||
|
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
||||||
|
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
|
||||||
|
|
||||||
|
return $.extend({}, elRect, scroll, outerDims, elOffset)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||||
|
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
var delta = { top: 0, left: 0 }
|
||||||
|
if (!this.$viewport) return delta
|
||||||
|
|
||||||
|
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
||||||
|
var viewportDimensions = this.getPosition(this.$viewport)
|
||||||
|
|
||||||
|
if (/right|left/.test(placement)) {
|
||||||
|
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
||||||
|
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
||||||
|
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
||||||
|
delta.top = viewportDimensions.top - topEdgeOffset
|
||||||
|
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
||||||
|
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var leftEdgeOffset = pos.left - viewportPadding
|
||||||
|
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
||||||
|
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
||||||
|
delta.left = viewportDimensions.left - leftEdgeOffset
|
||||||
|
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
|
||||||
|
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return delta
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getTitle = function () {
|
||||||
|
var title
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
title = $e.attr('data-original-title')
|
||||||
|
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||||
|
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getUID = function (prefix) {
|
||||||
|
do prefix += ~~(Math.random() * 1000000)
|
||||||
|
while (document.getElementById(prefix))
|
||||||
|
return prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.tip = function () {
|
||||||
|
return (this.$tip = this.$tip || $(this.options.template))
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.arrow = function () {
|
||||||
|
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enable = function () {
|
||||||
|
this.enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.disable = function () {
|
||||||
|
this.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggleEnabled = function () {
|
||||||
|
this.enabled = !this.enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggle = function (e) {
|
||||||
|
var self = this
|
||||||
|
if (e) {
|
||||||
|
self = $(e.currentTarget).data('bs.' + this.type)
|
||||||
|
if (!self) {
|
||||||
|
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
||||||
|
$(e.currentTarget).data('bs.' + this.type, self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.destroy = function () {
|
||||||
|
var that = this
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
this.hide(function () {
|
||||||
|
that.$element.off('.' + that.type).removeData('bs.' + that.type)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
function Plugin(option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tooltip')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data && /destroy|hide/.test(option)) return
|
||||||
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.tooltip
|
||||||
|
|
||||||
|
$.fn.tooltip = Plugin
|
||||||
|
$.fn.tooltip.Constructor = Tooltip
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.tooltip.noConflict = function () {
|
||||||
|
$.fn.tooltip = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
||||||
|
|
||||||
|
jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict();
|
||||||
|
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
jQuery(".laps-timeline .event").lapstooltip({
|
||||||
|
container: '#wpadminbar',
|
||||||
|
placement: 'bottom',
|
||||||
|
html : true,
|
||||||
|
animation: false
|
||||||
|
});
|
||||||
|
});
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
+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))}
|
||||||
|
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(r>e.top+e.height){o.top=e.top+e.height-r}}
|
||||||
|
else{var p=i.left-s,a=i.left+s+n;if(p<e.left){o.left=e.left-p}
|
||||||
|
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})});
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
jQuery.fn.lapstooltip = jQuery.fn.tooltip.noConflict();
|
||||||
|
|
||||||
|
jQuery(document).ready(function () {
|
||||||
|
jQuery(".laps-timeline .event").lapstooltip({
|
||||||
|
container: '#wpadminbar',
|
||||||
|
placement: 'bottom',
|
||||||
|
html : true,
|
||||||
|
animation: false
|
||||||
|
});
|
||||||
|
});
|
||||||
-387
@@ -1,387 +0,0 @@
|
|||||||
/* ========================================================================
|
|
||||||
* Bootstrap: tooltip.js v3.0.2
|
|
||||||
* http://getbootstrap.com/javascript/#tooltip
|
|
||||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
|
||||||
* ========================================================================
|
|
||||||
* Copyright 2013 Twitter, Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* ======================================================================== */
|
|
||||||
|
|
||||||
// modified to use lapstooltip as name
|
|
||||||
|
|
||||||
+function ($) { "use strict";
|
|
||||||
|
|
||||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
|
||||||
// ===============================
|
|
||||||
|
|
||||||
var Tooltip = function (element, options) {
|
|
||||||
this.type =
|
|
||||||
this.options =
|
|
||||||
this.enabled =
|
|
||||||
this.timeout =
|
|
||||||
this.hoverState =
|
|
||||||
this.$element = null
|
|
||||||
|
|
||||||
this.init('lapstooltip', element, options)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.DEFAULTS = {
|
|
||||||
animation: true
|
|
||||||
, placement: 'top'
|
|
||||||
, selector: false
|
|
||||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
|
||||||
, trigger: 'hover focus'
|
|
||||||
, title: ''
|
|
||||||
, delay: 0
|
|
||||||
, html: false
|
|
||||||
, container: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.init = function (type, element, options) {
|
|
||||||
this.enabled = true
|
|
||||||
this.type = type
|
|
||||||
this.$element = $(element)
|
|
||||||
this.options = this.getOptions(options)
|
|
||||||
|
|
||||||
var triggers = this.options.trigger.split(' ')
|
|
||||||
|
|
||||||
for (var i = triggers.length; i--;) {
|
|
||||||
var trigger = triggers[i]
|
|
||||||
|
|
||||||
if (trigger == 'click') {
|
|
||||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
|
||||||
} else if (trigger != 'manual') {
|
|
||||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
|
||||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
|
||||||
|
|
||||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
|
||||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.options.selector ?
|
|
||||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
|
||||||
this.fixTitle()
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getDefaults = function () {
|
|
||||||
return Tooltip.DEFAULTS
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getOptions = function (options) {
|
|
||||||
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
|
||||||
|
|
||||||
if (options.delay && typeof options.delay == 'number') {
|
|
||||||
options.delay = {
|
|
||||||
show: options.delay
|
|
||||||
, hide: options.delay
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return options
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getDelegateOptions = function () {
|
|
||||||
var options = {}
|
|
||||||
var defaults = this.getDefaults()
|
|
||||||
|
|
||||||
this._options && $.each(this._options, function (key, value) {
|
|
||||||
if (defaults[key] != value) options[key] = value
|
|
||||||
})
|
|
||||||
|
|
||||||
return options
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.enter = function (obj) {
|
|
||||||
var self = obj instanceof this.constructor ?
|
|
||||||
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
|
||||||
|
|
||||||
clearTimeout(self.timeout)
|
|
||||||
|
|
||||||
self.hoverState = 'in'
|
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
|
||||||
|
|
||||||
self.timeout = setTimeout(function () {
|
|
||||||
if (self.hoverState == 'in') self.show()
|
|
||||||
}, self.options.delay.show)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.leave = function (obj) {
|
|
||||||
var self = obj instanceof this.constructor ?
|
|
||||||
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
|
||||||
|
|
||||||
clearTimeout(self.timeout)
|
|
||||||
|
|
||||||
self.hoverState = 'out'
|
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
|
||||||
|
|
||||||
self.timeout = setTimeout(function () {
|
|
||||||
if (self.hoverState == 'out') self.hide()
|
|
||||||
}, self.options.delay.hide)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.show = function () {
|
|
||||||
var e = $.Event('show.bs.'+ this.type)
|
|
||||||
|
|
||||||
if (this.hasContent() && this.enabled) {
|
|
||||||
this.$element.trigger(e)
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
var $tip = this.tip()
|
|
||||||
|
|
||||||
this.setContent()
|
|
||||||
|
|
||||||
if (this.options.animation) $tip.addClass('fade')
|
|
||||||
|
|
||||||
var placement = typeof this.options.placement == 'function' ?
|
|
||||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
|
||||||
this.options.placement
|
|
||||||
|
|
||||||
var autoToken = /\s?auto?\s?/i
|
|
||||||
var autoPlace = autoToken.test(placement)
|
|
||||||
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
|
||||||
|
|
||||||
$tip
|
|
||||||
.detach()
|
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
|
||||||
.addClass(placement)
|
|
||||||
|
|
||||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
|
||||||
|
|
||||||
var pos = this.getPosition()
|
|
||||||
var actualWidth = $tip[0].offsetWidth
|
|
||||||
var actualHeight = $tip[0].offsetHeight
|
|
||||||
|
|
||||||
if (autoPlace) {
|
|
||||||
var $parent = this.$element.parent()
|
|
||||||
|
|
||||||
var orgPlacement = placement
|
|
||||||
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
|
||||||
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
|
||||||
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
|
||||||
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
|
||||||
|
|
||||||
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
|
||||||
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
|
||||||
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
|
||||||
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
|
||||||
placement
|
|
||||||
|
|
||||||
$tip
|
|
||||||
.removeClass(orgPlacement)
|
|
||||||
.addClass(placement)
|
|
||||||
}
|
|
||||||
|
|
||||||
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
|
||||||
|
|
||||||
this.applyPlacement(calculatedOffset, placement)
|
|
||||||
this.$element.trigger('shown.bs.' + this.type)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.applyPlacement = function(offset, placement) {
|
|
||||||
var replace
|
|
||||||
var $tip = this.tip()
|
|
||||||
var width = $tip[0].offsetWidth
|
|
||||||
var height = $tip[0].offsetHeight
|
|
||||||
|
|
||||||
// manually read margins because getBoundingClientRect includes difference
|
|
||||||
var marginTop = parseInt($tip.css('margin-top'), 10)
|
|
||||||
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
|
||||||
|
|
||||||
// we must check for NaN for ie 8/9
|
|
||||||
if (isNaN(marginTop)) marginTop = 0
|
|
||||||
if (isNaN(marginLeft)) marginLeft = 0
|
|
||||||
|
|
||||||
offset.top = offset.top + marginTop
|
|
||||||
offset.left = offset.left + marginLeft
|
|
||||||
|
|
||||||
$tip
|
|
||||||
.offset(offset)
|
|
||||||
.addClass('in')
|
|
||||||
|
|
||||||
// check to see if placing tip in new offset caused the tip to resize itself
|
|
||||||
var actualWidth = $tip[0].offsetWidth
|
|
||||||
var actualHeight = $tip[0].offsetHeight
|
|
||||||
|
|
||||||
if (placement == 'top' && actualHeight != height) {
|
|
||||||
replace = true
|
|
||||||
offset.top = offset.top + height - actualHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
if (/bottom|top/.test(placement)) {
|
|
||||||
var delta = 0
|
|
||||||
|
|
||||||
if (offset.left < 0) {
|
|
||||||
delta = offset.left * -2
|
|
||||||
offset.left = 0
|
|
||||||
|
|
||||||
$tip.offset(offset)
|
|
||||||
|
|
||||||
actualWidth = $tip[0].offsetWidth
|
|
||||||
actualHeight = $tip[0].offsetHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
|
||||||
} else {
|
|
||||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (replace) $tip.offset(offset)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
|
|
||||||
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.setContent = function () {
|
|
||||||
var $tip = this.tip()
|
|
||||||
var title = this.getTitle()
|
|
||||||
|
|
||||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
|
||||||
$tip.removeClass('fade in top bottom left right')
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.hide = function () {
|
|
||||||
var that = this
|
|
||||||
var $tip = this.tip()
|
|
||||||
var e = $.Event('hide.bs.' + this.type)
|
|
||||||
|
|
||||||
function complete() {
|
|
||||||
if (that.hoverState != 'in') $tip.detach()
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$element.trigger(e)
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$tip.removeClass('in')
|
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
|
||||||
$tip
|
|
||||||
.one($.support.transition.end, complete)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
complete()
|
|
||||||
|
|
||||||
this.$element.trigger('hidden.bs.' + this.type)
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.fixTitle = function () {
|
|
||||||
var $e = this.$element
|
|
||||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
|
||||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.hasContent = function () {
|
|
||||||
return this.getTitle()
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getPosition = function () {
|
|
||||||
var el = this.$element[0]
|
|
||||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
|
||||||
width: el.offsetWidth
|
|
||||||
, height: el.offsetHeight
|
|
||||||
}, this.$element.offset())
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
|
||||||
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
|
||||||
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
|
||||||
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
|
||||||
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getTitle = function () {
|
|
||||||
var title
|
|
||||||
var $e = this.$element
|
|
||||||
var o = this.options
|
|
||||||
|
|
||||||
title = $e.attr('data-original-title')
|
|
||||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
|
||||||
|
|
||||||
return title
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.tip = function () {
|
|
||||||
return this.$tip = this.$tip || $(this.options.template)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.arrow = function () {
|
|
||||||
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.validate = function () {
|
|
||||||
if (!this.$element[0].parentNode) {
|
|
||||||
this.hide()
|
|
||||||
this.$element = null
|
|
||||||
this.options = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.enable = function () {
|
|
||||||
this.enabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.disable = function () {
|
|
||||||
this.enabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.toggleEnabled = function () {
|
|
||||||
this.enabled = !this.enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.toggle = function (e) {
|
|
||||||
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
|
||||||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.destroy = function () {
|
|
||||||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TOOLTIP PLUGIN DEFINITION
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
var old = $.fn.lapstooltip
|
|
||||||
|
|
||||||
$.fn.lapstooltip = function (option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.lapstooltip')
|
|
||||||
var options = typeof option == 'object' && option
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.lapstooltip', (data = new Tooltip(this, options)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
$.fn.lapstooltip.Constructor = Tooltip
|
|
||||||
|
|
||||||
|
|
||||||
// TOOLTIP NO CONFLICT
|
|
||||||
// ===================
|
|
||||||
|
|
||||||
$.fn.lapstooltip.noConflict = function () {
|
|
||||||
$.fn.lapstooltip = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
}(jQuery);
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Plugin Name: Laps
|
Plugin Name: Laps
|
||||||
Plugin URI: https://bitbucket.org/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.1
|
Version: 1.3
|
||||||
Author URI: http://www.rarst.net/
|
Author URI: http://www.rarst.net/
|
||||||
Text Domain: laps
|
Text Domain: laps
|
||||||
Domain Path: /lang
|
Domain Path: /lang
|
||||||
@@ -29,7 +29,8 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|||||||
DEALINGS IN THE SOFTWARE.
|
DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) )
|
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
|
}
|
||||||
|
|
||||||
Rarst\Laps\Laps::on_load();
|
Rarst\Laps\Laps::on_load();
|
||||||
@@ -14,12 +14,23 @@ class Core_Events extends Laps_Events {
|
|||||||
|
|
||||||
$stops = array();
|
$stops = array();
|
||||||
|
|
||||||
$stops['plugins_loaded'][20] = array(
|
$stops['plugins_loaded'][ - 2 ] = array(
|
||||||
'action' => 'stop',
|
'action' => 'stop',
|
||||||
'event' => 'Plugins Load',
|
'event' => 'Plugins Load',
|
||||||
'category' => 'plugin',
|
'category' => 'plugin',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$stops['plugins_loaded'][ - 1 ] = array(
|
||||||
|
'event' => 'Plugins Loaded Hook',
|
||||||
|
'category' => 'plugin',
|
||||||
|
);
|
||||||
|
|
||||||
|
$stops['plugins_loaded'][20] = array(
|
||||||
|
'action' => 'stop',
|
||||||
|
'event' => 'Plugins Loaded Hook',
|
||||||
|
'category' => 'plugin',
|
||||||
|
);
|
||||||
|
|
||||||
$stops['setup_theme'][0] = array(
|
$stops['setup_theme'][0] = array(
|
||||||
'event' => 'Themes Load',
|
'event' => 'Themes Load',
|
||||||
'category' => 'theme',
|
'category' => 'theme',
|
||||||
@@ -92,4 +103,4 @@ class Core_Events extends Laps_Events {
|
|||||||
|
|
||||||
return $stops;
|
return $stops;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,4 +37,4 @@ abstract class Laps_Events {
|
|||||||
* @return array()
|
* @return array()
|
||||||
*/
|
*/
|
||||||
abstract protected function get_events();
|
abstract protected function get_events();
|
||||||
}
|
}
|
||||||
@@ -59,4 +59,4 @@ class Genesis_Events extends Laps_Events {
|
|||||||
|
|
||||||
return $events;
|
return $events;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ class Hybrid_Events extends Laps_Events {
|
|||||||
*/
|
*/
|
||||||
protected function is_applicable() {
|
protected function is_applicable() {
|
||||||
|
|
||||||
return defined( 'HYBRID_VERSION' );
|
return defined( 'HYBRID_VERSION' ) && function_exists( 'hybrid_get_prefix' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,4 +56,4 @@ class Hybrid_Events extends Laps_Events {
|
|||||||
|
|
||||||
return $events;
|
return $events;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+32
-49
@@ -72,7 +72,7 @@ class Laps {
|
|||||||
|
|
||||||
if ( false !== $key && $key > 0 ) {
|
if ( false !== $key && $key > 0 ) {
|
||||||
|
|
||||||
unset( $plugins[$key] );
|
unset( $plugins[ $key ] );
|
||||||
array_unshift( $plugins, $plugin );
|
array_unshift( $plugins, $plugin );
|
||||||
$plugins = array_values( $plugins );
|
$plugins = array_values( $plugins );
|
||||||
}
|
}
|
||||||
@@ -92,16 +92,20 @@ class Laps {
|
|||||||
global $wp_filter;
|
global $wp_filter;
|
||||||
|
|
||||||
$filter = current_filter();
|
$filter = current_filter();
|
||||||
$priority = key( $wp_filter[$filter] );
|
$priority = key( $wp_filter[ $filter ] );
|
||||||
|
|
||||||
$event = wp_parse_args(
|
$event = wp_parse_args(
|
||||||
self::$events[$filter][$priority],
|
self::$events[ $filter ][ $priority ],
|
||||||
array(
|
array(
|
||||||
'action' => 'start',
|
'action' => 'start',
|
||||||
'category' => null,
|
'category' => null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( 'stop' === $event['action'] && ! self::$stopwatch->isStarted( $event['event'] ) ) {
|
||||||
|
return $input;
|
||||||
|
}
|
||||||
|
|
||||||
self::$stopwatch->$event['action']( $event['event'], $event['category'] );
|
self::$stopwatch->$event['action']( $event['event'], $event['category'] );
|
||||||
|
|
||||||
return $input;
|
return $input;
|
||||||
@@ -119,7 +123,7 @@ class Laps {
|
|||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
if ( empty( self::$query_starts ) && ! empty( $wpdb->queries ) ) {
|
if ( empty( self::$query_starts ) && ! empty( $wpdb->queries ) ) {
|
||||||
self::$query_starts[count( $wpdb->queries )] = microtime( true ) * 1000;
|
self::$query_starts[ count( $wpdb->queries ) ] = microtime( true ) * 1000;
|
||||||
} else {
|
} else {
|
||||||
self::$query_starts[] = microtime( true ) * 1000;
|
self::$query_starts[] = microtime( true ) * 1000;
|
||||||
}
|
}
|
||||||
@@ -162,13 +166,13 @@ class Laps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When theme is done possibly add theme-specific events.
|
* When theme is done possibly add vendor-specific events.
|
||||||
*/
|
*/
|
||||||
static function after_setup_theme() {
|
static function after_setup_theme() {
|
||||||
|
|
||||||
foreach ( array( 'THA', 'Hybrid', 'Genesis', 'Thematic' ) as $theme ) {
|
foreach ( array( 'THA', 'Hybrid', 'Genesis', 'Thematic', 'Yoast' ) as $vendor ) {
|
||||||
|
|
||||||
$class = "Rarst\\Laps\\{$theme}_Events";
|
$class = "Rarst\\Laps\\{$vendor}_Events";
|
||||||
/** @var Laps_Events $events */
|
/** @var Laps_Events $events */
|
||||||
$events = new $class;
|
$events = new $class;
|
||||||
self::add_events( $events->get() );
|
self::add_events( $events->get() );
|
||||||
@@ -180,36 +184,20 @@ class Laps {
|
|||||||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
||||||
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
|
||||||
add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 100 );
|
add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 100 );
|
||||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'print_footer_scripts' ), 11 );
|
|
||||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'print_footer_scripts' ), 11 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function enqueue_scripts() {
|
static function enqueue_scripts() {
|
||||||
|
|
||||||
wp_register_script( 'laps-tooltip', plugins_url( 'js/tooltip.js', __DIR__ ), array( 'jquery' ), '3.0.2', true );
|
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||||
wp_register_style( 'laps', plugins_url( 'css/laps.css', __DIR__ ) );
|
wp_register_script( 'laps', plugins_url( "js/laps{$suffix}.js", __DIR__ ), array( 'jquery' ), '3.3.1', true );
|
||||||
|
wp_register_style( 'laps', plugins_url( "css/laps{$suffix}.css", __DIR__ ) );
|
||||||
|
|
||||||
if ( is_admin_bar_showing() ) {
|
if ( is_admin_bar_showing() ) {
|
||||||
wp_enqueue_script( 'laps-tooltip' );
|
wp_enqueue_script( 'laps' );
|
||||||
wp_enqueue_style( 'laps' );
|
wp_enqueue_style( 'laps' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static function print_footer_scripts() {
|
|
||||||
|
|
||||||
if ( wp_script_is( 'laps-tooltip', 'done' ) ) {
|
|
||||||
?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
jQuery(document).ready(function () {
|
|
||||||
jQuery(".laps-timeline .event").lapstooltip({
|
|
||||||
container: '#wpadminbar', placement: 'bottom', html: true
|
|
||||||
// , trigger: 'click'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script><?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render interface and add to the toolbar.
|
* Render interface and add to the toolbar.
|
||||||
*
|
*
|
||||||
@@ -226,6 +214,7 @@ class Laps {
|
|||||||
$mustache = new \Mustache_Engine(
|
$mustache = new \Mustache_Engine(
|
||||||
array(
|
array(
|
||||||
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
|
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
|
||||||
|
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/views/cache' ),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -245,7 +234,7 @@ class Laps {
|
|||||||
$width = round( $duration / $total * 100, 2 );
|
$width = round( $duration / $total * 100, 2 );
|
||||||
$category = $event->getCategory();
|
$category = $event->getCategory();
|
||||||
|
|
||||||
if ( 'http' == $category ) {
|
if ( 'http' === $category ) {
|
||||||
$http_data[] = compact( 'name', 'offset', 'duration', 'width', 'category' );
|
$http_data[] = compact( 'name', 'offset', 'duration', 'width', 'category' );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -264,20 +253,20 @@ class Laps {
|
|||||||
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;
|
||||||
$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 );
|
||||||
|
|
||||||
// if query is indistinguishably close to previous then stack it
|
// if query is indistinguishably close to previous then stack it
|
||||||
if ( $offset == $last_offset ) {
|
if ( $offset === $last_offset ) {
|
||||||
$key = count( $query_data ) - 1;
|
$key = count( $query_data ) - 1;
|
||||||
$query_data[$key]['sql'] .= '<br />' . $sql;
|
$query_data[ $key ]['sql'] .= '<br />' . $sql;
|
||||||
|
|
||||||
$last_duration += $duration;
|
$last_duration += $duration;
|
||||||
$width = round( $last_duration / $total * 100, 2 );
|
$width = round( $last_duration / $total * 100, 2 );
|
||||||
$query_data[$key]['width'] = $width;
|
$query_data[ $key ]['width'] = $width;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -290,8 +279,6 @@ class Laps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// !d( self::$query_starts, $wpdb->queries, $query_data );
|
|
||||||
|
|
||||||
$html = $mustache->render(
|
$html = $mustache->render(
|
||||||
'laps',
|
'laps',
|
||||||
array(
|
array(
|
||||||
@@ -303,19 +290,15 @@ class Laps {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$wp_admin_bar->add_node(
|
$wp_admin_bar->add_node( array(
|
||||||
array(
|
'id' => 'laps',
|
||||||
'id' => 'laps',
|
'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ),
|
||||||
'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ),
|
) );
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$wp_admin_bar->add_node(
|
$wp_admin_bar->add_node( array(
|
||||||
array(
|
'id' => 'laps_output',
|
||||||
'id' => 'laps_output',
|
'parent' => 'laps',
|
||||||
'parent' => 'laps',
|
'meta' => array( 'html' => $html ),
|
||||||
'meta' => array( 'html' => $html ),
|
) );
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
namespace Rarst\Laps;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements read-only filesystem cache
|
||||||
|
*/
|
||||||
|
class Mustache_Cache_FrozenCache extends \Mustache_Cache_FilesystemCache {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cache and load a compiled Mustache_Template class.
|
||||||
|
*
|
||||||
|
* @param string $key
|
||||||
|
* @param string $value
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function cache( $key, $value ) {
|
||||||
|
|
||||||
|
$this->log(
|
||||||
|
\Mustache_Logger::WARNING,
|
||||||
|
'Read only cache file missing, evaluating "{className}" class at runtime',
|
||||||
|
array( 'className' => $key )
|
||||||
|
);
|
||||||
|
|
||||||
|
eval( '?>' . $value );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,4 +48,4 @@ class THA_Events extends Laps_Events {
|
|||||||
|
|
||||||
return $events;
|
return $events;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,4 +59,4 @@ class Thematic_Events extends Laps_Events {
|
|||||||
|
|
||||||
return $events;
|
return $events;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Rarst\Laps;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Events for Yoast plugins
|
||||||
|
*/
|
||||||
|
class Yoast_Events extends Laps_Events {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function is_applicable() {
|
||||||
|
|
||||||
|
return class_exists( 'WPSEO_Frontend' );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function get_events() {
|
||||||
|
|
||||||
|
$stops = array();
|
||||||
|
|
||||||
|
$stops['wpseo_head'][1] = array(
|
||||||
|
'event' => 'WP SEO head hook',
|
||||||
|
'category' => 'plugin',
|
||||||
|
);
|
||||||
|
|
||||||
|
$stops['wpseo_head'][100] = array(
|
||||||
|
'action' => 'stop',
|
||||||
|
'event' => 'WP SEO head hook',
|
||||||
|
'category' => 'plugin',
|
||||||
|
);
|
||||||
|
|
||||||
|
return $stops;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,241 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class __Mustache_37c708633787b0bcaf1bd7b4adc8b13a extends Mustache_Template
|
||||||
|
{
|
||||||
|
private $lambdaHelper;
|
||||||
|
|
||||||
|
public function renderInternal(Mustache_Context $context, $indent = '')
|
||||||
|
{
|
||||||
|
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
|
||||||
|
$buffer = '';
|
||||||
|
$newContext = array();
|
||||||
|
|
||||||
|
$buffer .= $indent . '<div class="laps-timeline">
|
||||||
|
';
|
||||||
|
// 'events' section
|
||||||
|
$value = $context->find('events');
|
||||||
|
$buffer .= $this->section83708baddd3627fe4d26675ddf7eaeb5($context, $indent, $value);
|
||||||
|
$buffer .= $indent . '</div>
|
||||||
|
';
|
||||||
|
$buffer .= $indent . '
|
||||||
|
';
|
||||||
|
// 'savequeries' section
|
||||||
|
$value = $context->find('savequeries');
|
||||||
|
$buffer .= $this->section9756eb1d93d100052bdb80ee49b09ad6($context, $indent, $value);
|
||||||
|
$buffer .= $indent . '
|
||||||
|
';
|
||||||
|
// 'savehttp' section
|
||||||
|
$value = $context->find('savehttp');
|
||||||
|
$buffer .= $this->section3669ef98d4f6390c8df9645c96a328ee($context, $indent, $value);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function section83708baddd3627fe4d26675ddf7eaeb5(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . ' <div class="event event-';
|
||||||
|
$value = $this->resolveValue($context->find('category'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" data-toggle="tooltip" title="';
|
||||||
|
$value = $this->resolveValue($context->find('name'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= ' - ';
|
||||||
|
$value = $this->resolveValue($context->find('duration'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= ' ms - ';
|
||||||
|
$value = $this->resolveValue($context->find('memory'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= ' MB" style="width:';
|
||||||
|
$value = $this->resolveValue($context->find('width'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%; left:';
|
||||||
|
$value = $this->resolveValue($context->find('offset'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%;"></div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function section8dd7d0439d6fbb51dfb44aaa94780d5c(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . ' <div class="event event-';
|
||||||
|
$value = $this->resolveValue($context->find('category'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" title="';
|
||||||
|
$value = $this->resolveValue($context->find('sql'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" style="width:';
|
||||||
|
$value = $this->resolveValue($context->find('width'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%; left:';
|
||||||
|
$value = $this->resolveValue($context->find('offset'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%;"></div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function section9756eb1d93d100052bdb80ee49b09ad6(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="laps-timeline">
|
||||||
|
{{#queries}}
|
||||||
|
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
|
{{/queries}}
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . '<div class="laps-timeline">
|
||||||
|
';
|
||||||
|
// 'queries' section
|
||||||
|
$value = $context->find('queries');
|
||||||
|
$buffer .= $this->section8dd7d0439d6fbb51dfb44aaa94780d5c($context, $indent, $value);
|
||||||
|
$buffer .= $indent . '</div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sectionFb9cb3f90496dc38ba05f46e0ac2ad5d(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . ' <div class="event event-';
|
||||||
|
$value = $this->resolveValue($context->find('category'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" title="';
|
||||||
|
$value = $this->resolveValue($context->find('name'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= ' - ';
|
||||||
|
$value = $this->resolveValue($context->find('duration'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= ' ms" style="width:';
|
||||||
|
$value = $this->resolveValue($context->find('width'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%; left:';
|
||||||
|
$value = $this->resolveValue($context->find('offset'), $context, $indent);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%;"></div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function section3669ef98d4f6390c8df9645c96a328ee(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="laps-timeline">
|
||||||
|
{{#http}}
|
||||||
|
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
|
{{/http}}
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . '<div class="laps-timeline">
|
||||||
|
';
|
||||||
|
// 'http' section
|
||||||
|
$value = $context->find('http');
|
||||||
|
$buffer .= $this->sectionFb9cb3f90496dc38ba05f46e0ac2ad5d($context, $indent, $value);
|
||||||
|
$buffer .= $indent . '</div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user