restored dashboard from usable
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# v1.3.0
|
||||
## 08/25/2015
|
||||
|
||||
1. [](#improved)
|
||||
* Added blueprints for Grav Admin plugin
|
||||
|
||||
# v1.2.0
|
||||
## 06/16/2015
|
||||
|
||||
1. [](#improved)
|
||||
* Updated to featherlight 1.3.2
|
||||
* Added Gallery support
|
||||
|
||||
# v1.1.0
|
||||
## 03/24/2015
|
||||
|
||||
1. [](#improved)
|
||||
* Updated to featherlight 1.2.3
|
||||
* Added 'root' option to configure where featherlight is added
|
||||
* Added reference for to load jQuery if needed
|
||||
|
||||
# v1.0.3
|
||||
## 02/19/2015
|
||||
|
||||
1. [](#improved)
|
||||
* README improvements
|
||||
|
||||
# v1.0.2
|
||||
## 11/30/2014
|
||||
|
||||
1. [](#new)
|
||||
* ChangeLog started...
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Grav
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,107 @@
|
||||
# Grav Featherlight Plugin
|
||||
|
||||

|
||||
|
||||
`featherlight` is a simple [Grav](http://github.com/getgrav/grav) plugin that adds **lightbox** functionality via the jQuery plugin [Featherlight.js](http://noelboss.github.io/featherlight/).
|
||||
|
||||
# Installation
|
||||
|
||||
Installing the Featherlight plugin can be done in one of two ways. Our GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.
|
||||
|
||||
## GPM Installation (Preferred)
|
||||
|
||||
The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type:
|
||||
|
||||
bin/gpm install featherlight
|
||||
|
||||
This will install the Featherlight plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/featherlight`.
|
||||
|
||||
## Manual Installation
|
||||
|
||||
To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `featherlight`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-featherlight) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
|
||||
|
||||
You should now have all the plugin files under
|
||||
|
||||
/your/site/grav/user/plugins/featherlight
|
||||
|
||||
>> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav) to function
|
||||
|
||||
# Usage
|
||||
|
||||
To best understand how Featherlight works, you should read through the original project [documentation](https://github.com/noelboss/featherlight/#installation).
|
||||
|
||||
## Configuration
|
||||
|
||||
Featherlight is **enabled** but **not active** by default. You can change this behavior by setting `active: true` in the plugin's configuration. Simply copy the `user/plugins/featherlight/featherlight.yaml` into `user/config/plugins/featherlight.yaml` and make your modifications.
|
||||
|
||||
```
|
||||
enabled: true # global enable/disable the entire plugin
|
||||
active: false # if the plugin is active and JS/CSS should be loaded
|
||||
openSpeed: 250 # open speed in ms
|
||||
closeSpeed: 250 # close speed in ms
|
||||
closeOnClick: background # background|anywhere|false
|
||||
closeOnEsc: true # true|false on hitting Esc key
|
||||
root: body # where to append featherlights
|
||||
```
|
||||
|
||||
You can also override any default setings from the page headers:
|
||||
|
||||
eg:
|
||||
|
||||
---
|
||||
title: Sample Code With Custom Settings
|
||||
featherlight:
|
||||
active: true
|
||||
openSpeed: 100
|
||||
closeSpeed: 100
|
||||
---
|
||||
|
||||
|
||||
You can also enable globally in the `yaml`, but disable featherlighting for a particular page:
|
||||
|
||||
---
|
||||
title: Sample Code with Featherlight disabled
|
||||
featherlight:
|
||||
active: false
|
||||
---
|
||||
|
||||
## Implementing a lightbox with Featherlight
|
||||
|
||||
To implement a lightbox using Featherlight in Grav, you must output the proper HTML output. Luckily Grav already takes care of this for you if you are using Grav media files.
|
||||
|
||||
In markdown this could look something like:
|
||||
|
||||
```
|
||||

|
||||
```
|
||||
|
||||
In Twig this could look like:
|
||||
|
||||
```
|
||||
{{ page.media['sample-image.jpg'].lightbox(1024,768).cropResize(200,200).html('Sample Image') }}
|
||||
```
|
||||
|
||||
More details can be found in the [Grav documentation for Media functionality](http://learn.getgrav.org/content/media).
|
||||
|
||||
# Updating
|
||||
|
||||
As development for the Featherlight plugin continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating Featherlight is easy, and can be done through Grav's GPM system, as well as manually.
|
||||
|
||||
## GPM Update (Preferred)
|
||||
|
||||
The simplest way to update this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:
|
||||
|
||||
bin/gpm update featherlight
|
||||
|
||||
This command will check your Grav install to see if your Featherlight plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type `y` and hit enter. The plugin will automatically update and clear Grav's cache.
|
||||
|
||||
## Manual Update
|
||||
|
||||
Manually updating Featherlight is pretty simple. Here is what you will need to do to get this done:
|
||||
|
||||
* Delete the `your/site/user/plugins/featherlight` directory.
|
||||
* Download the new version of the Featherlight plugin from either [GitHub](https://github.com/getgrav/grav-plugin-featherlight) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
|
||||
* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `featherlight`.
|
||||
* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.
|
||||
|
||||
> Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/plugins`) will remain intact.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 557 KiB |
@@ -0,0 +1,93 @@
|
||||
name: Featherlight
|
||||
version: 1.3.0
|
||||
description: "Featherlight is a simple [Grav](http://github.com/getgrav/grav) plugin that adds **lightbox** functionality via the jQuery plugin [Featherlight.js](http://noelboss.github.io/featherlight/)."
|
||||
icon: file-photo-o
|
||||
author:
|
||||
name: Team Grav
|
||||
email: devs@getgrav.org
|
||||
url: http://getgrav.org
|
||||
homepage: https://github.com/getgrav/grav-plugin-featherlight
|
||||
keywords: featherlight, plugin, code, lightbox
|
||||
bugs: https://github.com/getgrav/grav-plugin-featherlight/issues
|
||||
license: MIT
|
||||
|
||||
form:
|
||||
validation: strict
|
||||
fields:
|
||||
enabled:
|
||||
type: toggle
|
||||
label: Plugin Status
|
||||
hightlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: Enabled
|
||||
0: Disabled
|
||||
validate:
|
||||
type: bool
|
||||
|
||||
active:
|
||||
type: toggle
|
||||
label: Active
|
||||
hightlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: Enabled
|
||||
0: Disabled
|
||||
validate:
|
||||
type: bool
|
||||
help: Activate on all pages. You can override this setting on a page basis
|
||||
|
||||
gallery:
|
||||
type: toggle
|
||||
label: Gallery
|
||||
hightlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: Enabled
|
||||
0: Disabled
|
||||
validate:
|
||||
type: bool
|
||||
help: Enable/disable the lightbox gallery extension
|
||||
|
||||
openSpeed:
|
||||
type: text
|
||||
size: medium
|
||||
label: Open Speed
|
||||
default: '250'
|
||||
help: Open Speed in ms
|
||||
|
||||
closeSpeed:
|
||||
type: text
|
||||
size: medium
|
||||
label: Close Speed
|
||||
default: '250'
|
||||
help: Close Speed in ms
|
||||
|
||||
closeOnClick:
|
||||
type: select
|
||||
size: medium
|
||||
classes: fancy
|
||||
label: Close on Click
|
||||
options:
|
||||
background: background
|
||||
anywhere: anywhere
|
||||
'false': 'false'
|
||||
|
||||
closeOnEsc:
|
||||
type: toggle
|
||||
label: Close on Esc
|
||||
hightlight: 1
|
||||
default: 0
|
||||
options:
|
||||
1: Enabled
|
||||
0: Disabled
|
||||
validate:
|
||||
type: bool
|
||||
help: Close the lightbox on hitting the Esc key
|
||||
|
||||
root:
|
||||
type: text
|
||||
size: medium
|
||||
label: Root
|
||||
default: 'body'
|
||||
help: Where to append featherlights
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Featherlight Gallery – an extension for the ultra slim jQuery lightbox
|
||||
* Version 1.3.2 - http://noelboss.github.io/featherlight/
|
||||
*
|
||||
* Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
|
||||
* MIT Licensed.
|
||||
**/
|
||||
@media all{.featherlight-next,.featherlight-previous{display:block;position:absolute;top:25px;right:25px;bottom:0;left:80%;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:0 0}.featherlight-previous{left:25px;right:80%}.featherlight-next:hover,.featherlight-previous:hover{background:rgba(255,255,255,.25)}.featherlight-next span,.featherlight-previous span{display:none;position:absolute;top:50%;left:5%;width:82%;text-align:center;font-size:80px;line-height:80px;margin-top:-40px;text-shadow:0 0 5px #fff;color:#fff;font-style:normal;font-weight:400}.featherlight-next span{right:5%;left:auto}.featherlight-next:hover span,.featherlight-previous:hover span{display:inline-block}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous{display:none}}@media only screen and (max-device-width:1024px){.featherlight-next:hover,.featherlight-previous:hover{background:0 0}.featherlight-next span,.featherlight-previous span{display:block}}@media only screen and (max-width:1024px){.featherlight-next,.featherlight-previous{top:10px;right:10px;left:85%}.featherlight-previous{left:10px;right:85%}.featherlight-next span,.featherlight-previous span{margin-top:-30px;font-size:40px}}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Featherlight – ultra slim jQuery lightbox
|
||||
* Version 1.3.2 - http://noelboss.github.io/featherlight/
|
||||
*
|
||||
* Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
|
||||
* MIT Licensed.
|
||||
**/
|
||||
@media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:0 0}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;min-width:30%;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight iframe{border:none}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:10px;margin-right:10px;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace Grav\Plugin;
|
||||
|
||||
use \Grav\Common\Plugin;
|
||||
use \Grav\Common\Grav;
|
||||
use \Grav\Common\Page\Page;
|
||||
|
||||
class FeatherlightPlugin extends Plugin
|
||||
{
|
||||
protected $active = false;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [
|
||||
'onPluginsInitialized' => ['onPluginsInitialized', 0]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize configuration
|
||||
*/
|
||||
public function onPluginsInitialized()
|
||||
{
|
||||
if ($this->isAdmin()) {
|
||||
$this->active = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->enable([
|
||||
'onPageInitialized' => ['onPageInitialized', 0]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize configuration
|
||||
*/
|
||||
public function onPageInitialized()
|
||||
{
|
||||
$defaults = (array) $this->config->get('plugins.featherlight');
|
||||
|
||||
/** @var Page $page */
|
||||
$page = $this->grav['page'];
|
||||
if (isset($page->header()->featherlight)) {
|
||||
$this->config->set('plugins.featherlight', array_merge($defaults, $page->header()->featherlight));
|
||||
}
|
||||
|
||||
// take the old legacy `lightbox: true` setting into account
|
||||
if (isset($page->header()->lightbox) && $page->header()->lightbox == true) {
|
||||
$legacy = true;
|
||||
} else {
|
||||
$legacy = false;
|
||||
}
|
||||
|
||||
$this->active = $this->config->get('plugins.featherlight.active') || $legacy;
|
||||
|
||||
if ($this->active) {
|
||||
$this->enable([
|
||||
'onTwigSiteVariables' => ['onTwigSiteVariables', 0]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* if enabled on this page, load the JS + CSS theme.
|
||||
*/
|
||||
public function onTwigSiteVariables()
|
||||
{
|
||||
$config = $this->config->get('plugins.featherlight');
|
||||
|
||||
if ($config['gallery']) {
|
||||
$init = "$(document).ready(function(){
|
||||
$('a[rel=\"lightbox\"]').featherlightGallery({
|
||||
openSpeed: {$config['openSpeed']},
|
||||
closeSpeed: {$config['closeSpeed']},
|
||||
closeOnClick: '{$config['closeOnClick']}',
|
||||
root: '{$config['root']}'
|
||||
});
|
||||
});";
|
||||
$this->grav['assets']
|
||||
->addCss('plugin://featherlight/css/featherlight.min.css')
|
||||
->addCss('plugin://featherlight/css/featherlight.gallery.min.css')
|
||||
->add('jquery', 101)
|
||||
->addJs('plugin://featherlight/js/featherlight.min.js')
|
||||
->addJs('plugin://featherlight/js/featherlight.gallery.min.js')
|
||||
->addInlineJs($init);
|
||||
} else {
|
||||
$init = "$(document).ready(function() {
|
||||
$('a[rel=\"lightbox\"]').featherlight({
|
||||
openSpeed: {$config['openSpeed']},
|
||||
closeSpeed: {$config['closeSpeed']},
|
||||
closeOnClick: '{$config['closeOnClick']}',
|
||||
root: '{$config['root']}'
|
||||
});
|
||||
});";
|
||||
$this->grav['assets']
|
||||
->addCss('plugin://featherlight/css/featherlight.min.css')
|
||||
->add('jquery', 101)
|
||||
->addJs('plugin://featherlight/js/featherlight.min.js')
|
||||
->addInlineJs($init);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
enabled: true # global enable/disable the entire plugin
|
||||
active: false # if the plugin is active and JS/CSS should be loaded
|
||||
gallery: false # enable/disable the gallery extension
|
||||
openSpeed: 250 # open speed in ms
|
||||
closeSpeed: 250 # close speed in ms
|
||||
closeOnClick: background # background|anywhere|false
|
||||
closeOnEsc: true # true|false on hitting Esc key
|
||||
root: body # where to append featherlights
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"project":"grav-plugin-featherlight",
|
||||
"platforms":{
|
||||
"grav":{
|
||||
"nodes":{
|
||||
"plugin":[
|
||||
{
|
||||
"source":"/",
|
||||
"destination":"/user/plugins/featherlight"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Featherlight Gallery – an extension for the ultra slim jQuery lightbox
|
||||
* Version 1.3.2 - http://noelboss.github.io/featherlight/
|
||||
*
|
||||
* Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
|
||||
* MIT Licensed.
|
||||
**/
|
||||
(function(d){function e(a,c){if(this instanceof e)d.featherlight.apply(this,arguments),this.chainCallbacks(k);else{var b=new e(d.extend({$source:a,$currentTarget:a.first()},c));b.open();return b}}var f=function(a){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+a)};if("undefined"===typeof d)return f("Too much lightness, Featherlight needs jQuery.");if(!d.featherlight)return f("Load the featherlight plugin before the gallery plugin");var h="ontouchstart"in document.documentElement,l=d.event&&d.event.special.swipeleft&&d,m=window.Hammer&&function(a){a=new window.Hammer.Manager(a[0]);a.add(new window.Hammer.Swipe);return a},g=h&&(l||m);h&&!g&&f("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var k={afterClose:function(a,c){this.$instance.off("next."+this.namespace+" previous."+this.namespace);this._swiper&&(this._swiper.off("swipeleft",this._swipeleft).off("swiperight",this._swiperight),this._swiper=null);return a(c)},beforeOpen:function(a,c){var b=this;b.$instance.on("next."+b.namespace+" previous."+b.namespace,function(a){a="next"===a.type?1:-1;b.navigateTo(b.currentNavigation()+a)});g?b._swiper=g(b.$instance).on("swipeleft",b._swipeleft=function(){b.$instance.trigger("next")}).on("swiperight",b._swiperight=function(){b.$instance.trigger("previous")}):b.$instance.find("."+b.namespace+"-content").append(b.createNavigation("previous")).append(b.createNavigation("next"));return a(c)},onKeyUp:function(a,c){var b={37:"previous",39:"next"}[c.keyCode];return b?(this.$instance.trigger(b),!1):a(c)}};d.featherlight.extend(e,{autoBind:"[data-featherlight-gallery]"});d.extend(e.prototype,{previousIcon:"◀",nextIcon:"▶",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){f("images is deprecated, please use slides instead");return this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(a){var c=this,b=c.slides(),e=b.length,f=c.$instance.find("."+c.namespace+"-inner");c.$currentTarget=b.eq((a%e+e)%e);c.beforeContent();return d.when(c.getContent(),f.fadeTo(c.galleryFadeOut,.2)).always(function(a){c.setContent(a);c.afterContent();a.fadeTo(c.galleryFadeIn,1)})},createNavigation:function(a){var c=this;return d('<span title="'+a+'" class="'+this.namespace+"-"+a+'"><span>'+this[a+"Icon"]+"</span></span>").click(function(){d(this).trigger(a+"."+c.namespace)})}});d.featherlightGallery=e;d.fn.featherlightGallery=function(a){return e.attach(this,a)};d(document).ready(function(){e._onReady()})})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user