Adjusted structure for PDS skeleton.
This commit is contained in:
1 parent
4238509861
commit
d92a778d10
17 files changed
+270
-418
No files matched your search
@@ -22,8 +22,8 @@ class Asset_Manager {
|
||||
public function enqueue_scripts() {
|
||||
|
||||
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||
wp_register_script( 'laps', plugins_url( "js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
|
||||
wp_register_style( 'laps', plugins_url( "css/laps{$suffix}.css", dirname( __DIR__ ) ) );
|
||||
wp_register_script( 'laps', plugins_url( "public/js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
|
||||
wp_register_style( 'laps', plugins_url( "public/css/laps{$suffix}.css", dirname( __DIR__ ) ) );
|
||||
|
||||
if ( is_admin_bar_showing() ) {
|
||||
wp_enqueue_script( 'laps' );
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ class Plugin extends Container {
|
||||
|
||||
$laps['mustache'] = function () {
|
||||
return new \Mustache_Engine( [
|
||||
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
|
||||
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/views/cache' ),
|
||||
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/src/mustache' ),
|
||||
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/src/mustache/cache' ),
|
||||
] );
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
class __Mustache_a04731de0bb9e043ecde3814b3a901bb extends Mustache_Template
|
||||
{
|
||||
private $lambdaHelper;
|
||||
|
||||
public function renderInternal(Mustache_Context $context, $indent = '')
|
||||
{
|
||||
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
|
||||
$buffer = '';
|
||||
|
||||
// 'timelines' section
|
||||
$value = $context->find('timelines');
|
||||
$buffer .= $this->sectionAdac57c50f147efcda3ea1c17e7a6c61($context, $indent, $value);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
private function section9f1840fed1e29fb14453f0ea2bfe30ad(Mustache_Context $context, $indent, $value)
|
||||
{
|
||||
$buffer = '';
|
||||
|
||||
if (!is_string($value) && is_callable($value)) {
|
||||
$source = '
|
||||
<div class="event event-{{category}}" data-toggle="tooltip" title="{{description}}" style="width:{{width}}%; left:{{offset}}%;">
|
||||
<span class="sr-only">{{description}}</span>
|
||||
</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);
|
||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||
$buffer .= '" data-toggle="tooltip" title="';
|
||||
$value = $this->resolveValue($context->find('description'), $context);
|
||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||
$buffer .= '" style="width:';
|
||||
$value = $this->resolveValue($context->find('width'), $context);
|
||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||
$buffer .= '%; left:';
|
||||
$value = $this->resolveValue($context->find('offset'), $context);
|
||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||
$buffer .= '%;">
|
||||
';
|
||||
$buffer .= $indent . ' <span class="sr-only">';
|
||||
$value = $this->resolveValue($context->find('description'), $context);
|
||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||
$buffer .= '</span>
|
||||
';
|
||||
$buffer .= $indent . ' </div>
|
||||
';
|
||||
$context->pop();
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
private function sectionAdac57c50f147efcda3ea1c17e7a6c61(Mustache_Context $context, $indent, $value)
|
||||
{
|
||||
$buffer = '';
|
||||
|
||||
if (!is_string($value) && is_callable($value)) {
|
||||
$source = '
|
||||
<div class="laps-timeline">
|
||||
{{#.}}
|
||||
<div class="event event-{{category}}" data-toggle="tooltip" title="{{description}}" style="width:{{width}}%; left:{{offset}}%;">
|
||||
<span class="sr-only">{{description}}</span>
|
||||
</div>
|
||||
{{/.}}
|
||||
</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">
|
||||
';
|
||||
// '.' section
|
||||
$value = $context->last('.');
|
||||
$buffer .= $this->section9f1840fed1e29fb14453f0ea2bfe30ad($context, $indent, $value);
|
||||
$buffer .= $indent . ' </div>
|
||||
';
|
||||
$context->pop();
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{#timelines}}
|
||||
<div class="laps-timeline">
|
||||
{{#.}}
|
||||
<div class="event event-{{category}}" data-toggle="tooltip" title="{{description}}" style="width:{{width}}%; left:{{offset}}%;">
|
||||
<span class="sr-only">{{description}}</span>
|
||||
</div>
|
||||
{{/.}}
|
||||
</div>
|
||||
{{/timelines}}
|
||||
Reference in new issue
Block a user