Reorganized folders to try to clean up the root folder a bit

This commit is contained in:
Nabeel Shahzad 2017-12-14 10:38:10 -06:00
parent 40aab22901
commit aa57ab515f
708 changed files with 101315 additions and 89 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ storage/*.sqlite
.env.*.php
.env.php
.env
.env.php
.vagrant
#Homestead.yaml
Homestead.json

View File

@ -39,7 +39,7 @@
</properties>
</component>
<component name="ProjectPlainTextFileTypeManager">
<file url="file://$PROJECT_DIR$/database/seeds/dev.yml" />
<file url="file://$PROJECT_DIR$/app/Database/seeds/dev.yml" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3">
<output url="file://$PROJECT_DIR$/out" />

View File

@ -38,15 +38,16 @@ install: build
.PHONY: update
update: build
@php composer.phar dump-autoload
@php composer.phar update --no-interaction
@php artisan migrate
@echo "Done!"
.PHONY: reset
reset: clean
@php composer.phar dump-autoload
@php artisan database:create --reset
@php artisan migrate:refresh --seed
@make update
.PHONY: tests
tests: test

View File

@ -35,7 +35,7 @@ class Kernel extends ConsoleKernel
*/
protected function commands()
{
require base_path('routes/console.php');
require app_path('Routes/console.php');
$this->load(__DIR__ . '/Commands');
}
}

View File

@ -52,7 +52,7 @@ class RouteServiceProvider extends ServiceProvider
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
require base_path('routes/web.php');
require app_path('Routes/web.php');
});
}
@ -74,7 +74,7 @@ class RouteServiceProvider extends ServiceProvider
'prefix' => 'api',
'as' => 'api.',
], function ($router) {
require base_path('routes/api.php');
require app_path('Routes/api.php');
});
}
}

View File

@ -32,4 +32,4 @@ Route::group([
Auth::routes();
Route::get('/logout', 'Auth\LoginController@logout')->name('logout');
require base_path('routes/admin.php');
require app_path('Routes/admin.php');

View File

@ -19,6 +19,9 @@ $app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);
#$app->loadEnvironmentFrom('.env.php');
$app->useDatabasePath(realpath(__DIR__.'/../app/Database'));
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces

View File

@ -59,7 +59,7 @@
},
"autoload": {
"classmap": [
"database"
"app/Database"
],
"files": [
"app/helpers.php"

88
composer.lock generated
View File

@ -427,7 +427,7 @@
"Doctrine\\DBAL\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -750,7 +750,7 @@
"Egulias\\EmailValidator\\": "EmailValidator"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -796,7 +796,7 @@
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -856,7 +856,7 @@
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -914,7 +914,7 @@
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -969,7 +969,7 @@
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -1031,7 +1031,7 @@
"Hashids\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -1138,7 +1138,7 @@
"InfyOm\\AdminLTETemplates\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -1199,7 +1199,7 @@
"src/helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -1249,7 +1249,7 @@
"Jackiedo\\Timezonelist\\": "src/Jackiedo/Timezonelist"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -1495,7 +1495,7 @@
"Illuminate\\": "src/Illuminate/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2024,7 +2024,7 @@
"Cron\\": "src/Cron/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2073,7 +2073,7 @@
"src/DeepCopy/deep_copy.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2117,7 +2117,7 @@
"VaCentral\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2211,7 +2211,7 @@
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@ -2644,7 +2644,7 @@
]
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2797,7 +2797,7 @@
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -2915,7 +2915,7 @@
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@ -3056,7 +3056,7 @@
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@ -3137,7 +3137,7 @@
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@ -3260,7 +3260,7 @@
"Prettus\\Repository\\": "src/Prettus/Repository/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -3863,7 +3863,7 @@
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@ -4438,7 +4438,7 @@
"src/helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -4621,7 +4621,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -4730,7 +4730,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -4898,7 +4898,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -4952,7 +4952,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5040,7 +5040,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5241,7 +5241,7 @@
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5298,7 +5298,7 @@
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5357,7 +5357,7 @@
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5409,7 +5409,7 @@
"Symfony\\Polyfill\\Util\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5464,7 +5464,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5521,7 +5521,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5604,7 +5604,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5688,7 +5688,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5756,7 +5756,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -5821,7 +5821,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -6014,7 +6014,7 @@
"Tivie\\OS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"APACHE 2.0"
],
@ -6235,7 +6235,7 @@
"Webpatser\\Uuid": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -6364,7 +6364,7 @@
"src/helper.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -6421,7 +6421,7 @@
"Zend\\Diactoros\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
@ -6715,7 +6715,7 @@
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],
@ -7107,7 +7107,7 @@
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"notification-url": "http://packagist.org/downloads/",
"license": [
"MIT"
],

View File

@ -7,7 +7,6 @@
<sourceFolder url="file://$MODULE_DIR$/modules" isTestSource="false" packagePrefix="Modules\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/public/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-ide-helper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/bpocallaghan/generators" />

View File

@ -0,0 +1,111 @@
(function ($, DataTable) {
"use strict";
var _buildUrl = function(dt, action) {
var url = dt.ajax.url() || '';
var params = dt.ajax.params();
params.action = action;
return url + '?' + $.param(params);
};
DataTable.ext.buttons.excel = {
className: 'buttons-excel',
text: function (dt) {
return '<i class="fa fa-file-excel-o"></i> ' + dt.i18n('buttons.excel', 'Excel');
},
action: function (e, dt, button, config) {
var url = _buildUrl(dt, 'excel');
window.location = url;
}
};
DataTable.ext.buttons.export = {
extend: 'collection',
className: 'buttons-export',
text: function (dt) {
return '<i class="fa fa-download"></i> ' + dt.i18n('buttons.export', 'Export') + '&nbsp;<span class="caret"/>';
},
buttons: ['csv', 'excel', 'pdf']
};
DataTable.ext.buttons.csv = {
className: 'buttons-csv',
text: function (dt) {
return '<i class="fa fa-file-excel-o"></i> ' + dt.i18n('buttons.csv', 'CSV');
},
action: function (e, dt, button, config) {
var url = _buildUrl(dt, 'csv');
window.location = url;
}
};
DataTable.ext.buttons.pdf = {
className: 'buttons-pdf',
text: function (dt) {
return '<i class="fa fa-file-pdf-o"></i> ' + dt.i18n('buttons.pdf', 'PDF');
},
action: function (e, dt, button, config) {
var url = _buildUrl(dt, 'pdf');
window.location = url;
}
};
DataTable.ext.buttons.print = {
className: 'buttons-print',
text: function (dt) {
return '<i class="fa fa-print"></i> ' + dt.i18n('buttons.print', 'Print');
},
action: function (e, dt, button, config) {
var url = _buildUrl(dt, 'print');
window.location = url;
}
};
DataTable.ext.buttons.reset = {
className: 'buttons-reset',
text: function (dt) {
return '<i class="fa fa-undo"></i> ' + dt.i18n('buttons.reset', 'Reset');
},
action: function (e, dt, button, config) {
dt.search('').draw();
}
};
DataTable.ext.buttons.reload = {
className: 'buttons-reload',
text: function (dt) {
return '<i class="fa fa-refresh"></i> ' + dt.i18n('buttons.reload', 'Reload');
},
action: function (e, dt, button, config) {
dt.draw(false);
}
};
DataTable.ext.buttons.create = {
className: 'buttons-create',
text: function (dt) {
return '<i class="fa fa-plus"></i> ' + dt.i18n('buttons.create', 'Create');
},
action: function (e, dt, button, config) {
window.location = window.location.href.replace(/\/+$/, "") + '/create';
}
};
})(jQuery, jQuery.fn.dataTable);

View File

@ -0,0 +1,35 @@
{
"name": "popper.js",
"description": "A kickass library to manage your poppers",
"main": "dist/umd/popper.js",
"authors": [
"Contributors (https://github.com/FezVrasta/popper.js/graphs/contributors)"
],
"license": "MIT",
"keywords": [
"popperjs",
"component",
"drop",
"tooltip",
"popover",
"position",
"attached"
],
"homepage": "https://popper.js.org",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
],
"version": "1.12.6",
"_release": "1.12.6",
"_resolution": {
"type": "version",
"tag": "v1.12.6",
"commit": "ef87c99e389a304fa00e85d6372bf8cb596b9de8"
},
"_source": "https://github.com/FezVrasta/popper.js.git",
"_target": "^1.12.0",
"_originalSource": "popper.js"
}

View File

@ -0,0 +1,5 @@
# Changelog moved!
You can find the releases history with the relative changes visiting the dedicated GitHub page:
https://github.com/FezVrasta/popper.js/releases

View File

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at federico.zivolo@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -0,0 +1,55 @@
# Contributing to Popper.js
## Report bugs
If you find a bug, please, try to isolate the specific case and provide a fiddle on CodePen or JSFiddle to make it easy to reproduce the problem and help others finding a solution.
You can use [this CodePen](http://codepen.io/FezVrasta/pen/wGqJEz) which already includes Popper.js.
If your issue is not about a bug, please make sure to consider posting on StackOverflow instead.
Feature requests are welcome!
## Setup
Then run `npm install` or `yarn` to install the needed dependencies.
## Developing
## Adopt an issue
All the issues, if not assigned to someone, can be adopted by anyone. Just make sure to comment on the issue to let know
other users about your intention to work on it.
Also, remember to comment again in case you end up abandoning the issue.
Each issue has a `DIFFICULTY` label to help you pick the one with the difficulty level adapt to you.
Additionally, check out the `PRIORITY` label to see which issues should take precedence over the others. If possible, prefer issues with an higher priority, but if you want to adopt an issue with lower priority, it's not a problem!
Issues with `NEEDS: CI test` need a PR that integrates a test in the test suite to reproduce the bug, this is very useful because it allows other developers to try to fix the bug having a feedback.
## Test
We develop following a test driven development approach.
We have a karma + jasmine environment to unit test Popper.js
Feel free to add tests to the `/tests` folder, any JavaScript file in that folder will be executed as test.
To run tests:
```bash
npm run test:dev # watch
npm run test # single run
```
## Build
To create a new release run:
```js
npm run build:popper # popper.js
npm run build:tooltip # tooltip.js
npm run build # both
```
The files will be automatically minified and copied in the `build` directory.
**Note:** never commit builds! We take care to compile the source code when we release a new version.

View File

@ -0,0 +1,25 @@
The MIT License (MIT)
=====================
Copyright © 2016 Federico Zivolo and contributors
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.

View File

@ -0,0 +1,84 @@
# Projects using Popper.js
Popper.js aims to be a foundation block to build powerful libraries on top of it.
In this page we try to collect a list of libraries built with it:
# Integration in frameworks and view libraries
You can easily use Popper.js inside your application written using one of the
most common frameworks or view libraries thank to the following projects.
> We are looking for awesome libraries to integrate Popper.js into other
frameworks and libraries.
> Have you written an integration library for your favourite framework? Let us know!
## React
### [react-popper](https://github.com/souporserious/react-popper)
React wrapper around Popper.js.
### [ak-layer](https://www.npmjs.com/package/ak-layer)
React wrapper around Popper.js, maintained by [Atlassian](https://www.atlassian.com/).
## Angular
### [ngx-popper](https://github.com/MrFrankel/ngx-popper)
Angular wrapper for Popper.js
## AngularJS
### [angular-popper](https://www.npmjs.com/package/angular-popper)
This component is in alpha base, you can contribute to it!
## Vue.js
The Vue.js situation is particular, there are several UI frameworks that use
Popper.js internally, but only few "basic" components that let you use Popper.js with it.
### [vue-popper-component](https://github.com/antongorodezkiy/vue-popper-component)
Simple Vue.js component for Popper.js.
### [vue-popperjs](https://github.com/RobinCK/vue-popper)
VueJS 2.x popover component based [popper.js](https://popper.js.org/)
### [vue-directive-tooltip](https://www.npmjs.com/package/vue-directive-tooltip)
Vue.js tooltip directive (based on Popper.js)
## Ember.js
### [ember-popper](https://github.com/kybishop/ember-popper)
An Ember-centric wrapper around Popper.js.
## Preact and Inferno
### [react-popper](https://github.com/souporserious/react-popper)
It is developed for React but it works fine with both Preact and Inferno if
you alias `react` and `react-dom` to `preact-compat` or `inferno-compat`.
# Other projects
### [Tippy.js](https://atomiks.github.io/tippyjs/)
A lightweight, pure JavaScript tooltip library.
-----------
For an always updated list of projects using Popper.js, please visit:
- [npmjs.com depended list](https://www.npmjs.com/browse/depended/popper.js)
- [NPM-Graph list](https://npm-graph.com/NpmPackage/popper.js)
### Want to see your library or project in this page?
Fork this repository, edit this page and send a Pull Request!

219
public/assets/vendor/popper.js/README.md vendored Normal file
View File

@ -0,0 +1,219 @@
<!-- IGNORE THE HTML BLOCK BELOW, THE INTERESTING PART IS AFTER IT -->
<h1 align="center">Popper.js</h1>
<p align="center">
<strong>A library used to position poppers in web applications.</strong>
</p>
<p align="center">
<a href="https://travis-ci.org/FezVrasta/popper.js/branches" target="_blank"><img src="https://travis-ci.org/FezVrasta/popper.js.svg?branch=master" alt="Build Status"/></a>
<img src="http://img.badgesize.io/https://unpkg.com/popper.js/dist/popper.min.js?compression=gzip" alt="Stable Release Size"/>
<a href="https://www.bithound.io/github/FezVrasta/popper.js"><img src="https://www.bithound.io/github/FezVrasta/popper.js/badges/score.svg" alt="bitHound Overall Score"></a>
<a href="https://codeclimate.com/github/FezVrasta/popper.js/coverage"><img src="https://codeclimate.com/github/FezVrasta/popper.js/badges/coverage.svg" alt="Istanbul Code Coverage"/></a>
<a href="https://gitter.im/FezVrasta/popper.js" target="_blank"><img src="https://img.shields.io/gitter/room/nwjs/nw.js.svg" alt="Get support or discuss"/></a>
<br />
<a href="https://saucelabs.com/u/popperjs" target="_blank"><img src="https://badges.herokuapp.com/browsers?labels=none&googlechrome=latest&firefox=latest&microsoftedge=latest&iexplore=11,10&safari=latest&iphone=latest" alt="SauceLabs Reports"/></a>
</p>
<img src="https://raw.githubusercontent.com/FezVrasta/popper.js/master/popperjs.png" align="right" width=250 />
<!-- 🚨 HEY! HERE BEGINS THE INTERESTING STUFF 🚨 -->
## Wut? Poppers?
A popper is an element on the screen which "pops out" from the natural flow of your application.
Common examples of poppers are tooltips, popovers and drop-downs.
## So, yet another tooltip library?
Well, basically, **no**.
Popper.js is a **positioning engine**, its purpose is to calculate the position of an element
to make it possible to position it near a given reference element.
The engine is completely modular and most of its features are implemented as **modifiers**
(similar to middlewares or plugins).
The whole code base is written in ES2015 and its features are automatically tested on real browsers thanks to [SauceLabs](https://saucelabs.com/) and [TravisCI](https://travis-ci.org/).
Popper.js has zero dependencies. No jQuery, no LoDash, nothing.
It's used by big companies like [Twitter in Bootstrap v4](https://getbootstrap.com/), [Microsoft in WebClipper](https://github.com/OneNoteDev/WebClipper) and [Atlassian in AtlasKit](https://aui-cdn.atlassian.com/atlaskit/registry/).
### Popper.js
This is the engine, the library that computes and, optionally, applies the styles to
the poppers.
Some of the key points are:
- Position elements keeping them in their original DOM context (doesn't mess with your DOM!);
- Allows to export the computed informations to integrate with React and other view libraries;
- Supports Shadow DOM elements;
- Completely customizable thanks to the modifiers based structure;
Visit our [project page](https://fezvrasta.github.io/popper.js) to see a lot of examples of what you can do with Popper.js!
Find [the documentation here](docs/_includes/popper-documentation.md).
### Tooltip.js
Since lots of users just need a simple way to integrate powerful tooltips in their projects,
we created **Tooltip.js**.
It's a small library that makes it easy to automatically create tooltips using as engine Popper.js.
Its API is almost identical to the famous tooltip system of Bootstrap, in this way it will be
easy to integrate it in your projects.
The tooltips generated by Tooltip.js are accessible thanks to the `aria` tags.
Find [the documentation here](docs/_includes/tooltip-documentation.md).
## Installation
Popper.js is available on the following package managers and CDNs:
| Source | |
|:-------|:---------------------------------------------------------------------------------|
| npm | `npm install popper.js --save` |
| yarn | `yarn add popper.js` |
| NuGet | `PM> Install-Package popper.js` |
| Bower | `bower install popper.js --save` |
| unpkg | [`https://unpkg.com/popper.js`](https://unpkg.com/popper.js) |
| cdnjs | [`https://cdnjs.com/libraries/popper.js`](https://cdnjs.com/libraries/popper.js) |
Tooltip.js as well:
| Source | |
|:-------|:---------------------------------------------------------------------------------|
| npm | `npm install tooltip.js --save` |
| yarn | `yarn add tooltip.js` |
| Bower* | `bower install tooltip.js=https://unpkg.com/tooltip.js --save` |
| unpkg | [`https://unpkg.com/tooltip.js`](https://unpkg.com/tooltip.js) |
| cdnjs | [`https://cdnjs.com/libraries/popper.js`](https://cdnjs.com/libraries/popper.js) |
\*: Bower isn't officially supported, it can be used to install Tooltip.js only trough the unpkg.com CDN. This method has the limitation of not being able to define a specific version of the library. Bower and Popper.js suggests to use npm or Yarn for your projects.
For more info, [read the related issue](https://github.com/FezVrasta/popper.js/issues/390).
### Dist targets
Popper.js is currently shipped with 3 targets in mind: UMD, ESM and ESNext.
- UMD - Universal Module Definition: AMD, RequireJS and globals;
- ESM - ES Modules: For webpack/Rollup or browser supporting the spec;
- ESNext: Available in `dist/`, can be used with webpack and `babel-preset-env`;
Make sure to use the right one for your needs. If you want to import it with a `<script>` tag, use UMD.
## Usage
Given an existing popper DOM node, ask Popper.js to position it near its button
```js
var reference = document.querySelector('.my-button');
var popper = document.querySelector('.my-popper');
var anotherPopper = new Popper(
reference,
popper,
{
// popper options here
}
);
```
### Callbacks
Popper.js supports two kinds of callbacks, the `onCreate` callback is called after
the popper has been initalized. The `onUpdate` one is called on any subsequent update.
```js
const reference = document.querySelector('.my-button');
const popper = document.querySelector('.my-popper');
new Popper(reference, popper, {
onCreate: (data) => {
// data is an object containing all the informations computed
// by Popper.js and used to style the popper and its arrow
// The complete description is available in Popper.js documentation
},
onUpdate: (data) => {
// same as `onCreate` but called on subsequent updates
}
});
```
### Writing your own modifiers
Popper.js is based on a "plugin-like" architecture, most of its features are fully encapsulated "modifiers".
A modifier is a function that is called each time Popper.js needs to compute the position of the popper. For this reason, modifiers should be very performant to avoid bottlenecks.
To learn how to create a modifier, [read the modifiers documentation](docs/_includes/popper-documentation.md#modifiers--object)
### React, Vue.js, Angular, AngularJS, Ember.js (etc...) integration
Integrating 3rd party libraries in React or other libraries can be a pain because
they usually alter the DOM and drive the libraries crazy.
Popper.js limits all its DOM modifications inside the `applyStyle` modifier,
you can simply disable it and manually apply the popper coordinates using
your library of choice.
For a comprehensive list of libraries that let you use Popper.js into existing
frameworks, visit the [MENTIONS](MENTIONS.md) page.
Alternatively, you may even override your own `applyStyles` with your custom one and
integrate Popper.js by yourself!
```js
function applyReactStyle(data) {
// export data in your framework and use its content to apply the style to your popper
};
const reference = document.querySelector('.my-button');
const popper = document.querySelector('.my-popper');
new Popper(reference, popper, {
modifiers: {
applyStyle: { enabled: false },
applyReactStyle: {
enabled: true,
fn: applyReactStyle,
order: 800,
},
},
});
```
### Migration from Popper.js v0
Since the API changed, we prepared some migration instructions to make it easy to upgrade to
Popper.js v1.
https://github.com/FezVrasta/popper.js/issues/62
Feel free to comment inside the issue if you have any questions.
### Performances
Popper.js is very performant. It usually takes 0.5ms to compute a popper's position (on an iMac with 3.5G GHz Intel Core i5).
This means that it will not cause any [jank](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/anatomy-of-jank), leading to a smooth user experience.
## Notes
### Libraries using Popper.js
The aim of Popper.js is to provide a stable and powerful positioning engine ready to
be used in 3rd party libraries.
Visit the [MENTIONS](MENTIONS.md) page for an updated list of projects.
### Credits
I want to thank some friends and projects for the work they did:
- [@AndreaScn](https://github.com/AndreaScn) for his work on the GitHub Page and the manual testing he did during the development;
- [@vampolo](https://github.com/vampolo) for the original idea and for the name of the library;
- [Sysdig](https://github.com/Draios) for all the awesome things I learned during these years that made it possible for me to write this library;
- [Tether.js](http://github.hubspot.com/tether/) for having inspired me in writing a positioning library ready for the real world;
- [The Contributors](https://github.com/FezVrasta/popper.js/graphs/contributors) for their much appreciated Pull Requests and bug reports;
- **you** for the star you'll give to this project and for being so awesome to give this project a try 🙂
### Copyright and license
Code and documentation copyright 2016 **Federico Zivolo**. Code released under the [MIT license](LICENSE.md). Docs released under Creative Commons.

View File

@ -0,0 +1,25 @@
{
"name": "popper.js",
"description": "A kickass library to manage your poppers",
"main": "dist/umd/popper.js",
"authors": [
"Contributors (https://github.com/FezVrasta/popper.js/graphs/contributors)"
],
"license": "MIT",
"keywords": [
"popperjs",
"component",
"drop",
"tooltip",
"popover",
"position",
"attached"
],
"homepage": "https://popper.js.org",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
popper.js.org

View File

@ -0,0 +1,63 @@
Creative Commons Attribution 3.0 Unported
http://creativecommons.org/licenses/by/3.0/
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
1. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
2. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
3. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
4. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
5. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
6. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
7. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
8. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
9. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
1. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
2. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
3. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
4. to Distribute and Publicly Perform Adaptations.
5.
For the avoidance of doubt:
1. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
2. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
3. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
1. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
2. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
3. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
1. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
2. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
6. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -0,0 +1,52 @@
Spectral by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
A big, modern, blocky affair with a mobile-style menu, fully responsive styling,
and an assortment of pre-styled elements. So, pretty much what you were expecting
-- except, of course, for how it's put together, specifically:
- It's built on Skel 3*, a leaner, more modular rewrite of my responsive framework.
(* = still in development as of this writing)
- It uses flexbox*, which eliminates all kinds of terrible hacks and clunky layout
stopgaps (like CSS grid systems).
(* = not supported on IE8/9, but non-flexbox fallbacks are included)
- It uses Sass* a lot more intelligently, thanks in part to several new mixins
and functions I've been working on (as well as a few by @HugoGiraudel).
(* = still entirely optional if you prefer vanilla CSS :)
- A ton of other stuff.
In short, Spectral's the culmination of several new things I'm working on/trying out,
so please, let me know what you think :)
Demo images* courtesy of Unsplash, a radtastic collection of CC0 (public domain) images
you can use for pretty much whatever.
(* = not included)
AJ
n33.co @n33co dribbble.com/n33
Credits:
Demo Images:
Unsplash (unsplash.com)
Icons:
Font Awesome (fortawesome.github.com/Font-Awesome)
Other:
jQuery (jquery.com)
html5shiv.js (@afarkas @jdalton @jon_neal @rem)
background-size polyfill (github.com/louisremi)
Misc. Sass functions (@HugoGiraudel)
Respond.js (j.mp/respondjs)
Skel (skel.io)

View File

@ -0,0 +1,62 @@
# Welcome to Jekyll!
#
# Site settings
title: Popper.js
encoding: utf-8
description: A kickass library<br> used to manage poppers in web applications<br><a href="https://medium.com/@FezVrasta/popper-js-v1-5e8b3acd888c" target="_blank">Now much more powerful!</a>
owner: Federico Zivolo & contributors # or company name
first_published: 2016 # if migrating another site, the year of your first publish
email: federico.zivolo@gmail.com
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://popper.js.org" # the base hostname & protocol for your site
github: https://github.com/FezVrasta/popper.js
social:
twitter: https://twitter.com/FezVr4sta
github: https://github.com/FezVrasta
medium: https://medium.com/@FezVrasta
linkedin-square: https://linkedin.com/in/FezVrasta
#email: /contact/
#flickr:
#instagram:
#youtube-square:
#spotify:
#stack-overflow:
#vimeo:
#reddit:
#stubleupon:
#delicious:
#pied-piper:
#digg:
#soundcloud:
#deviantart:
#angellist:
#tumblr-square:
#stackexchange:
#weibo:
#trello:
#foursquare:
#linux:
#bitbucket-square:
#vk:
#slack:
#vine:
#weixin:
#yelp:
#skyatlas:
#leanpub:
#connectdevelop:
#ils:
#forumbee:
#tripadvisor:
#amazon:
# Build settings
markdown: kramdown
#sass:
# style: compressed
kramdown:
parse_block_html: true
parse_span_html: true
html_to_native: true

View File

@ -0,0 +1,13 @@
<h2 id="example10" tabindex="0">Popper on your side!</h2>
<p id="example10Title">
What are you waiting for? Select a popper from that dropdown.<br />
Placing poppers around elements is just that easy!
</p>
<div id="example10code">
{% highlight javascript %}
var popper = new Popper(referenceElement, onPopper, {
placement: 'position'
});
{% endhighlight %}
</div>

View File

@ -0,0 +1,78 @@
<div class="rel" id="example10reference1">
<p class="bold">Hey!</p>
<p class="thin">Choose where to put your popper!</p>
<select id="example10positionSelector">
<option value="top">Top</option>
<option value="right">Right</option>
<option value="bottom">Bottom</option>
<option value="left">Left</option>
</select>
</div>
<div class="popper" width="200" id="example10popper1">
<p class="bold">Popper on <b id="example10currentPosition" class="currentPosition"></b></p>
<div class="popper__arrow" x-arrow></div>
</div>
<style>
#example10positionSelector {
margin-top: 1em;
}
@media (max-width: 460px) {
#example10popper1 {
max-width: 100px;
}
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function(){
var index = 0;
var popper;
var code = $('#example10code').html();
$('#example10positionSelector').on('change', attachPopper).trigger('change');
// Stop autoflip popper when the user click on the dropdown
$('#example10positionSelector').on('click', function() {
clearInterval(autoPopperFunctionTimer);
});
var autoPopperFunctionTimer = setInterval(function() {
if (index === 0) {
$('#example10positionSelector').val('top');
$('#example10positionSelector').trigger('change');
index++;
} else if (index === 1) {
$('#example10positionSelector').val('right');
$('#example10positionSelector').trigger('change');
index++;
} else if (index === 2) {
$('#example10positionSelector').val('bottom');
$('#example10positionSelector').trigger('change');
index++;
} else {
$('#example10positionSelector').val('left');
$('#example10positionSelector').trigger('change');
index = 0;
}
}, 4000);
function attachPopper(evt) {
position = evt.target.value;
//Position of the popper
$('#example10code').html(code.replace('position', position));
$('.currentPosition').text(position);
popper && popper.destroy();
popper = new Popper(example10reference1, example10popper1, {
placement: position,
boundariesElement: example10reference1.parentNode
});
}
});
</script>

View File

@ -0,0 +1,13 @@
<h2 id="example10" tabindex="0"></h2>
<p id="example10Title">
The available placements are the same you are used to with Popper.js:
</p>
<div id="example10code">
{% highlight javascript %}
new Tooltip(referenceElement, {
placement: 'top', // or bottom, left, right, and variations
title: "Top"
});
{% endhighlight %}
</div>

View File

@ -0,0 +1,30 @@
<div class="rel" id="example10treference1">
<p class="bold">It just works</p>
<p class="thin">Hover me to see 4 tooltips!</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var index = 0;
var popper;
new Tooltip(document.getElementById("example10treference1"), {
placement: "top",
title: "Top",
});
new Tooltip(document.getElementById("example10treference1"), {
placement: "right",
title: "Right",
});
new Tooltip(document.getElementById("example10treference1"), {
placement: "bottom",
title: "Bottom",
});
new Tooltip(document.getElementById("example10treference1"), {
placement: "left",
title: "Left",
});
});
</script>

View File

@ -0,0 +1,18 @@
<h2 id="example3" tabindex="0">Custom flip behavior</h2>
<p>
Try dragging the reference element on the left side, its popper will move on its bottom edge.
Then, try to move the reference element on the bottom left corner, it will move on its top edge.
</p>
{% highlight javascript %}
var popper = new Popper(referenceElement, onLeftPopper, {
placement: 'left',
modifiers: {
flip: {
behavior: ['left', 'bottom', 'top']
},
preventOverflow: {
boundariesElement: container,
},
},
});
{% endhighlight %}

View File

@ -0,0 +1,54 @@
<div class="rel" id="example3reference1">
<p class="bold">Drag me</p>
<p class="thin">on the edges</p>
</div>
<div class="popper" id="example3popper1">
<p class="bold">Flipping popper</p>
<p class="thin">which never flips to right</p>
<div class="popper__arrow" x-arrow></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var example3popper1inst = new Popper(example3reference1, example3popper1, {
placement: 'left',
modifiers: {
flip: {
behavior: ['left', 'bottom', 'top'],
},
preventOverflow: {
boundariesElement: example3reference1.parentNode,
},
}
});
interact('#example3reference1').draggable({
restrict: {
restriction: "parent",
endOnly: true,
elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
},
onmove: dragMoveListener
});
var x = 0, y = 0;
function dragMoveListener (event) {
target = event.target,
// keep the dragged position in the data-x/data-y attributes
x += event.dx,
y += event.dy;
// translate the element
target.style.top = y + 'px';
target.style.left = x + 'px'
example3popper1inst.update();
}
}, false);
</script>
<style>
#example3reference1:hover {
background: rgba(255,255,255,0.2);
}
</style>

View File

@ -0,0 +1,14 @@
<h2 id="example20" tabindex="0"></h2>
<p id="example20Title">
You can show, hide or toggle a tooltip programmatically:
</p>
<div id="example10code">
{% highlight javascript %}
const instance = new Tooltip(referenceElement, {
title: "Hey there",
trigger: "click",
});
instance.show();
{% endhighlight %}
</div>

View File

@ -0,0 +1,18 @@
<div class="rel" id="example20treference1" style="width: 40%">
<p class="bold">Manually triggered</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var index = 0;
var popper;
var instance = new Tooltip(document.getElementById("example20treference1"), {
title: "Hey there",
trigger: "click",
});
instance.show();
});
</script>

View File

@ -0,0 +1,10 @@
<h2 id="example2" tabindex="0">Popper on scrolling container</h2>
<p>
In this example we have a relative div which contains a div with <code>overflow: scroll</code>.<br>
Inside it, there are our popper and reference elements.
</p>
{% highlight javascript %}
var popper = new Popper(referenceElement, onLeftPopper, {
placement: 'left',
});
{% endhighlight %}

View File

@ -0,0 +1,44 @@
<div class="example2__fake-body nano">
<div class="nano-content">
<div class="example2__scrol-box">
<div class="rel" id="example2reference1">
<p class="bold">Scroll me</p>
<p class="thin">up and down</p>
</div>
<div class="popper" id="example2popper1">
<p class="bold">I follow it</p>
<p class="thin">staying between boundaries</p>
<div class="popper__arrow" x-arrow></div>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var fakeBody = document.querySelector('.example2__fake-body');
$('.nano').nanoScroller({ scrollTop: fakeBody.clientHeight / 2 });
setTimeout(function() {
var pop1 = new Popper(example2reference1, example2popper1, {
placement: 'left',
});
}, 1000);
}, false);
</script>
<style>
.example2__fake-body {
overflow-x: scroll;
height: 450px;
flex: 1;
}
.example2__scrol-box {
height: 200%;
display: flex;
align-content: center;
align-items: center;
}
</style>

View File

@ -0,0 +1,14 @@
<h2 id="example4" tabindex="0">Shifted poppers</h2>
<p>
Shift your poppers on start or end of its reference element side.
</p>
{% highlight javascript %}
var shiftStart = new Popper(referenceElement, shiftStartPopper, {
placement: 'left-start',
});
var shiftEnd = new Popper(referenceElement, shiftEndPopper, {
placement: 'bottom-end',
});
{% endhighlight %}

View File

@ -0,0 +1,38 @@
<div class="rel" id="example4reference1">
<p class="bold">Reference</p>
</div>
<div class="popper" id="example4popper1">
<p class="bold">Shifted popper</p>
<p class="thin">on start</p>
<div class="popper__arrow" x-arrow></div>
</div>
<div class="popper" id="example4popper2">
<p class="bold">Shifted popper</p>
<p class="thin">on end</p>
<div class="popper__arrow" x-arrow></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var shiftStart = new Popper(example4reference1, example4popper1, {
placement: 'left-start',
});
var shiftEnd = new Popper(example4reference1, example4popper2, {
placement: 'bottom-end',
});
}, false);
</script>
<style>
#example4popper1,
#example4popper2 {
width: 100px;
}
#example4popper1 {
height: 150px;
}
</style>

View File

@ -0,0 +1,11 @@
<h2 id="example5" tabindex="0">Viewport boundaries</h2>
<p>
By default, poppers use as boundaries the page viewport.<br>
Scroll the page to see the popper flip when hits the page viewport margins.
</p>
{% highlight javascript %}
var popper = new Popper(referenceElement, onBottomPopper, {
placement: 'bottom'
});
{% endhighlight %}

View File

@ -0,0 +1,18 @@
<div class="rel" id="example5reference1">
<p class="bold">Pop</p>
<p class="thin">on the bottom</p>
</div>
<div class="popper" id="example5popper1">
<p class="bold">Popper on bottom</p>
<p class="thin">Flips when hits viewport</p>
<div class="popper__arrow" x-arrow></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function(){
var pop1 = new Popper(example5reference1, example5popper1, {
placement: 'bottom'
});
}, false);
</script>

View File

@ -0,0 +1,27 @@
<!-- Footer -->
<footer id="footer">
<ul class="icons">
{% for socloc in site.social %}
{% if socloc[1] %}
{% if socloc[0] == 'email' %}
<li><a target="_blank" href="{{ socloc[1] }}" class="icon fa-envelope-o"
><span class="label">E-mail</span></a></li>
{% else %}
<li><a target="_blank" href="{{ socloc[1] }}" class="icon fa-{{ socloc[0] }}"
><span class="label">{{ socloc[0] }}</span></a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
<ul class="copyright">
<li>&copy; {% assign thisyear = site.time | date: "%Y" %}
{% if site.first_published %}
{% capture diff %}{{ site.first_published | minus:thisyear }}{% endcapture %}
{% if diff contains '-' %}{{ site.first_published }},{% endif %}
{% endif %}
{{ thisyear }}
{% if site.owner %}{{ site.owner }}{% else %}{{ site.title }}{% endif %}</li>
<li>Design: <a href="http://html5up.net" target="_blank">HTML5 UP</a></li>
<li>Built with: <a href="http://jekyllrb.com" target="_blank">Jekyll</a></li>
</ul>
</footer>

View File

@ -0,0 +1,29 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines }}{% endif %}">
<!--[if lte IE 8]><script src="{{ "/js/ie/html5shiv.js" | prepend: site.baseurl }}"></script><![endif]-->
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="stylesheet" href="{{ '/css/main.css' | prepend: site.baseurl }}">
<!--[if lte IE 8]><link rel="stylesheet" href="{{ "/css/ie8.css" | prepend: site.baseurl }}" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="{{ "/css/ie9.css" | prepend: site.baseurl }}" /><![endif]-->
<script>
if (window.location.href.indexOf('github.io/popper.js') !== -1) {
window.location.href = "{{site.url}}" + "{{page.url}}"
}
</script>
<meta property="og:title" content="{{ site.title | escape }}">
<meta property="og:description" content="{{ site.description | strip_html | strip_newlines }}">
<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<meta property="og:image" content="{{ '/images/logo.png' | prepend: site.baseurl | prepend: site.url }}">
<!-- favicon -->
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" href="favicon.ico">
</head>

View File

@ -0,0 +1,28 @@
<!-- Header -->
<header id="header"{% if page.layout == 'landing' %} class="alt"{% endif %}>
<h1 id="header-title" >
<a href="{{ site.baseurl }}/index.html">{{ site.title }}</a>
</h1>
<nav id="nav">
<ul>
<li class="special">
<a href="#menu" class="menuToggle"><span>Menu</span></a>
<div id="menu">
<ul>
<li><a href="index.html">Home</a></li>
{% for my_page in site.pages %}
{% if my_page.title %}
<li><a href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a></li>
{% endif %}
{% endfor %}
<li><a href="{{ site.github }}" class="icon fa-github"> GitHub</a></li>
</ul>
</div>
</li>
</ul>
</nav>
<div class="popper" style="width: auto; height: 50px;" id="title-popper">
<iframe src="//ghbtns.com/github-btn.html?user=FezVrasta&amp;repo=popper.js&amp;type=star&amp;count=true&amp;size=large" style="height: 30px;width: 145px;"></iframe>
<div class="popper__arrow" x-arrow></div>
</div>
</header>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/interact.js/1.2.6/interact.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.scrollex.min.js"></script>
<script src="js/jquery.scrolly.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/util.js"></script>
<script src="https://platform.twitter.com/widgets.js"></script>
<!--[if lte IE 8]><script src="js/ie/respond.min.js"></script><![endif]-->
<script src="https://unpkg.com/popper.js@^1"></script>
<script src="https://unpkg.com/tooltip.js@^1"></script>
<script src="js/jquery.nanoscroller.js"></script>
<script>
$('h1[id], h2[id], h3[id], h4[id], h5[id]').each(function(i, el) {
var name = $(el).prev().find('a[name]:not([href])').attr('name');
if (!name) {
name = $(el).attr('id');
$(el).attr('id', '');
$(el).prepend('<a name="' + name + '"></a>')
}
$(el).wrap('<a class="anchor-wrapper" href="#' + name + '"></a>')
$(el).append('<i class="fa fa-link link-anchor" />');
});
</script>
<script src="js/main.js"></script>

View File

@ -0,0 +1,84 @@
<a name="Tooltip"></a>
## Tooltip
**Kind**: global class
* [Tooltip](#Tooltip)
* [new Tooltip(reference, options)](#new_Tooltip_new)
* _instance_
* [.show()](#Tooltip+show)
* [.hide()](#Tooltip+hide)
* [.dispose()](#Tooltip+dispose)
* [.toggle()](#Tooltip+toggle)
* _static_
* [.PlacementFunction](#Tooltip.PlacementFunction) ⇒ <code>String</code>
* [.TitleFunction](#Tooltip.TitleFunction) ⇒ <code>String</code>
<a name="new_Tooltip_new"></a>
### new Tooltip(reference, options)
Create a new Tooltip.js instance
**Returns**: <code>Object</code> - instance - The generated tooltip instance
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| reference | <code>HTMLElement</code> | | The DOM node used as reference of the tooltip (it can be a jQuery element). |
| options | <code>Object</code> | | |
| options.placement | <code>String</code> | <code>bottom</code> | Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -end), left(-start, -end)` |
| options.container | <code>HTMLElement</code> \| <code>String</code> \| <code>false</code> | <code>false</code> | Append the tooltip to a specific element. |
| options.delay | <code>Number</code> \| <code>Object</code> | <code>0</code> | Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type. If a number is supplied, delay is applied to both hide/show. Object structure is: `{ show: 500, hide: 100 }` |
| options.html | <code>Boolean</code> | <code>false</code> | Insert HTML into the tooltip. If false, the content will inserted with `innerText`. |
| options.placement | <code>String</code> \| <code>PlacementFunction</code> | <code>&#x27;top&#x27;</code> | One of the allowed placements, or a function returning one of them. |
| [options.template] | <code>String</code> | <code>&#x27;&lt;div class=&quot;tooltip&quot; role=&quot;tooltip&quot;&gt;&lt;div class=&quot;tooltip-arrow&quot;&gt;&lt;/div&gt;&lt;div class=&quot;tooltip-inner&quot;&gt;&lt;/div&gt;&lt;/div&gt;&#x27;</code> | Base HTML to used when creating the tooltip. The tooltip's `title` will be injected into the `.tooltip-inner` or `.tooltip__inner`. `.tooltip-arrow` or `.tooltip__arrow` will become the tooltip's arrow. The outermost wrapper element should have the `.tooltip` class. |
| options.title | <code>String</code> \| <code>HTMLElement</code> \| <code>TitleFunction</code> | <code>&#x27;&#x27;</code> | Default title value if `title` attribute isn't present. |
| [options.trigger] | <code>String</code> | <code>&#x27;hover focus&#x27;</code> | How tooltip is triggered - click, hover, focus, manual. You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger. |
| options.boundariesElement | <code>HTMLElement</code> | | The element used as boundaries for the tooltip. For more information refer to Popper.js' [boundariesElement docs](https://popper.js.org/popper-documentation.html) |
| options.offset | <code>Number</code> \| <code>String</code> | <code>0</code> | Offset of the tooltip relative to its reference. For more information refer to Popper.js' [offset docs](https://popper.js.org/popper-documentation.html) |
| options.popperOptions | <code>Object</code> | <code>{}</code> | Popper options, will be passed directly to popper instance. For more information refer to Popper.js' [options docs](https://popper.js.org/popper-documentation.html) |
<a name="Tooltip+show"></a>
### tooltip.show()
Reveals an element's tooltip. This is considered a "manual" triggering of the tooltip.
Tooltips with zero-length titles are never displayed.
**Kind**: instance method of [<code>Tooltip</code>](#Tooltip)
<a name="Tooltip+hide"></a>
### tooltip.hide()
Hides an elements tooltip. This is considered a “manual” triggering of the tooltip.
**Kind**: instance method of [<code>Tooltip</code>](#Tooltip)
<a name="Tooltip+dispose"></a>
### tooltip.dispose()
Hides and destroys an elements tooltip.
**Kind**: instance method of [<code>Tooltip</code>](#Tooltip)
<a name="Tooltip+toggle"></a>
### tooltip.toggle()
Toggles an elements tooltip. This is considered a “manual” triggering of the tooltip.
**Kind**: instance method of [<code>Tooltip</code>](#Tooltip)
<a name="Tooltip.PlacementFunction"></a>
### Tooltip.PlacementFunction ⇒ <code>String</code>
Placement function, its context is the Tooltip instance.
**Kind**: static typedef of [<code>Tooltip</code>](#Tooltip)
**Returns**: <code>String</code> - placement - One of the allowed placement options.
| Param | Type | Description |
| --- | --- | --- |
| tooltip | <code>HTMLElement</code> | tooltip DOM node. |
| reference | <code>HTMLElement</code> | reference DOM node. |
<a name="Tooltip.TitleFunction"></a>
### Tooltip.TitleFunction ⇒ <code>String</code>
Title function, its context is the Tooltip instance.
**Kind**: static typedef of [<code>Tooltip</code>](#Tooltip)
**Returns**: <code>String</code> - placement - The desired title.

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<!--
Original Design: Spectral by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
Jekyll build mod
-->
<html>
{% include head.html %}
<body>
<!-- Page Wrapper -->
<div id="page-wrapper">
{% include header.html %}
{{ content }}
{% include footer.html %}
{% include scripts.html %}
</div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<!--
Original Design: Spectral by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
Jekyll build mod
-->
<html>
{% include head.html %}
<body class="landing">
<script>window.document.body.classList.add('is-loading');</script>
<!-- Page Wrapper -->
<div id="page-wrapper">
{% include header.html %}
{{ content }}
{% include footer.html %}
{% include scripts.html %}
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
---
layout: default
---
<article id="main" class="page-layout">
<header>
<h2>#{{ page.title }}</h2>
<p>{{ page.description }}</p>
</header>
<section class="wrapper style5">
<div class="inner">
{{ content }}
</div>
</section>
</article>

View File

@ -0,0 +1,13 @@
---
layout: default
---
<article id="main" class="page-layout">
<header>
<h2>{{ page.title }}</h2>
<p>{{ page.description }}</p>
</header>
{{ content }}
</article>

View File

@ -0,0 +1,17 @@
---
layout: default
---
<article id="main" class="page-layout">
<header>
<h2>{{ page.title }}</h2>
<p>{{ page.description }}</p>
</header>
<section class="wrapper style5">
<div class="inner">
{{ content }}
</div>
</section>
</article>

Some files were not shown because too many files have changed in this diff Show More