fix: move `build directory to resources/shop`

This commit is contained in:
Valentin Lab
2025-10-04 10:00:24 +02:00
parent 34fc1c33bf
commit 7a189abf0b
93 changed files with 26 additions and 25 deletions

View File

@@ -0,0 +1,41 @@
{
"sEmptyTable": "Keine Daten in der Tabelle vorhanden",
"sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen",
"sInfoEmpty": "Keine Daten vorhanden",
"sInfoFiltered": "(gefiltert von _MAX_ Einträgen)",
"sInfoPostFix": "",
"sInfoThousands": ".",
"sLengthMenu": "_MENU_ Einträge anzeigen",
"sLoadingRecords": "Wird geladen ..",
"sProcessing": "Bitte warten ..",
"sSearch": "Suchen",
"sZeroRecords": "Keine Einträge vorhanden",
"oPaginate": {
"sFirst": "Erste",
"sPrevious": "Zurück",
"sNext": "Nächste",
"sLast": "Letzte"
},
"oAria": {
"sSortAscending": ": aktivieren, um Spalte aufsteigend zu sortieren",
"sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren"
},
"select": {
"rows": {
"_": "%d Zeilen ausgewählt",
"0": "",
"1": "1 Zeile ausgewählt"
}
},
"buttons": {
"print": "Drucken",
"colvis": "Spalten",
"copy": "Kopieren",
"copyTitle": "In Zwischenablage kopieren",
"copyKeys": "Taste <i>ctrl</i> oder <i>\u2318</i> + <i>C</i> um Tabelle<br>in Zwischenspeicher zu kopieren.<br><br>Um abzubrechen die Nachricht anklicken oder Escape drücken.",
"copySuccess": {
"_": "%d Zeilen kopiert",
"1": "1 Zeile kopiert"
}
}
}

View File

@@ -0,0 +1,23 @@
{
"sEmptyTable": "No data available in table",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "Show _MENU_ entries",
"sLoadingRecords": "Loading...",
"sProcessing": "Processing...",
"sSearch": "Search:",
"sZeroRecords": "No matching records found",
"oPaginate": {
"sFirst": "First",
"sLast": "Last",
"sNext": "Next",
"sPrevious": "Previous"
},
"oAria": {
"sSortAscending": ": activate to sort column ascending",
"sSortDescending": ": activate to sort column descending"
}
}

View File

@@ -0,0 +1,29 @@
{
"sProcessing": "Traitement en cours...",
"sSearch": "Rechercher&nbsp;:",
"sLengthMenu": "Afficher _MENU_ &eacute;l&eacute;ments",
"sInfo": "Affichage de l'&eacute;l&eacute;ment _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
"sInfoEmpty": "Affichage de l'&eacute;l&eacute;ment 0 &agrave; 0 sur 0 &eacute;l&eacute;ment",
"sInfoFiltered": "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
"sInfoPostFix": "",
"sLoadingRecords": "Chargement en cours...",
"sZeroRecords": "Aucun &eacute;l&eacute;ment &agrave; afficher",
"sEmptyTable": "Aucune donn&eacute;e disponible dans le tableau",
"oPaginate": {
"sFirst": "Premier",
"sPrevious": "Pr&eacute;c&eacute;dent",
"sNext": "Suivant",
"sLast": "Dernier"
},
"oAria": {
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
"sSortDescending": ": activer pour trier la colonne par ordre d&eacute;croissant"
},
"select": {
"rows": {
"_": "%d lignes s&eacute;lectionn&eacute;es",
"0": "Aucune ligne s&eacute;lectionn&eacute;e",
"1": "1 ligne s&eacute;lectionn&eacute;e"
}
}
}

View File

@@ -0,0 +1,23 @@
{
"sEmptyTable": "Nessun dato presente nella tabella",
"sInfo": "Vista da _START_ a _END_ di _TOTAL_ elementi",
"sInfoEmpty": "Vista da 0 a 0 di 0 elementi",
"sInfoFiltered": "(filtrati da _MAX_ elementi totali)",
"sInfoPostFix": "",
"sInfoThousands": ".",
"sLengthMenu": "Visualizza _MENU_ elementi",
"sLoadingRecords": "Caricamento...",
"sProcessing": "Elaborazione...",
"sSearch": "Cerca:",
"sZeroRecords": "La ricerca non ha portato alcun risultato.",
"oPaginate": {
"sFirst": "Inizio",
"sPrevious": "Precedente",
"sNext": "Successivo",
"sLast": "Fine"
},
"oAria": {
"sSortAscending": ": attiva per ordinare la colonna in ordine crescente",
"sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
}
}

View File

@@ -0,0 +1,23 @@
{
"sEmptyTable": "テーブルにデータがありません",
"sInfo": " _TOTAL_ 件中 _START_ から _END_ まで表示",
"sInfoEmpty": " 0 件中 0 から 0 まで表示",
"sInfoFiltered": "(全 _MAX_ 件より抽出)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "_MENU_ 件表示",
"sLoadingRecords": "読み込み中...",
"sProcessing": "処理中...",
"sSearch": "検索:",
"sZeroRecords": "一致するレコードがありません",
"oPaginate": {
"sFirst": "先頭",
"sLast": "最終",
"sNext": "次",
"sPrevious": "前"
},
"oAria": {
"sSortAscending": ": 列を昇順に並べ替えるにはアクティブにする",
"sSortDescending": ": 列を降順に並べ替えるにはアクティブにする"
}
}

View File

@@ -0,0 +1,28 @@
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla =(",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate": {
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria": {
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
},
"buttons": {
"copy": "Copiar",
"colvis": "Visibilidad"
}
}

View File

@@ -0,0 +1,37 @@
# Google Place Autocomplete
This sample code show you how to quickly use the Places Autocomplete javascript
API from Google.
[See demo right now](http://lewagon.github.io/google-place-autocomplete)
## Code
Look at the [index.html](index.html) file, you'll see a very standard form.
The input with id `user_input_autocomplete_address` is very important as it
is bound to an `autocomplete` object in the `autocomplete.js` code.
The code you see is not dependent on jQuery, also the `initializeAutocomplete`
method has to be called when `google` is ready, not just when the DOM is ready.
## API Key
In order to get a lot of requests for free to the API, you need to create a
new project under the [Google API Console](https://code.google.com/apis/console).
For this project, enable the Google Maps Javascript API v3:
![](readme-images/enable-api.png)
Then, for this project, create a new "Browser Key", the one you'll put in the
`index.html` file when calling the `https://maps.googleapis.com/maps/api/js` script.
![](readme-images/create-new-browser-key.png)
Make sure to specify referers so that **only you** can use this key! Remember,
you API calls are limited per day.
![](readme-images/key-referers.png)
## Documentation
[Full Reference](https://developers.google.com/maps/documentation/javascript/places-autocomplete)

View File

@@ -0,0 +1,27 @@
function initializeAutocomplete(id) {
var element = document.getElementById(id);
if (element) {
var autocomplete = new google.maps.places.Autocomplete(element, { types: ['geocode'] });
google.maps.event.addListener(autocomplete, 'place_changed', onPlaceChanged);
}
}
function onPlaceChanged() {
var place = this.getPlace();
// console.log(place); // Uncomment this line to view the full object returned by Google API.
for (var i in place.address_components) {
var component = place.address_components[i];
for (var j in component.types) { // Some types are ["country", "political"]
var type_element = document.getElementById(component.types[j]);
if (type_element) {
type_element.value = component.long_name;
}
}
}
}
google.maps.event.addDomListener(window, 'load', function() {
initializeAutocomplete('user_input_autocomplete_address');
});

View File

@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Google Place Autocomplete</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<h1>Google Place Autocomplete exemple</h1>
<a href="https://github.com/lewagon/google-place-autocomplete">Source</a>
<hr>
<form role="form" class="form-horizontal">
<fieldset>
<div class="form-group">
<label class="col-sm-4 control-label">Address</label>
<div class="col-sm-8">
<input id="user_input_autocomplete_address" name="user_input_autocomplete_address"
class="form-control" placeholder="Start typing your address...">
</div>
</div>
</fieldset>
<fieldset class="disabled">
<div class="form-group">
<label class="col-sm-4 control-label"><code>street_number</code></label>
<div class="col-sm-8">
<input id="street_number" name="street_number" disabled="true" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><code>route</code></label>
<div class="col-sm-8">
<input id="route" name="route" disabled="true" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><code>locality</code></label>
<div class="col-sm-8">
<input id="locality" name="locality" disabled="true" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><code>administrative_area_level_1</code></label>
<div class="col-sm-8">
<input id="administrative_area_level_1" name="administrative_area_level_1" disabled="true" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><code>postal_code</code></label>
<div class="col-sm-8">
<input id="postal_code" name="postal_code" disabled="true" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><code>country</code></label>
<div class="col-sm-8">
<input id="country" name="country" disabled="true" class="form-control">
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
<!-- Include Google Maps JS API -->
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?libraries=places&amp;key=AIzaSyDANjx3bosEtIyzJaoWs50Wnt6nt_1rmxU "></script>
<!-- Custom JS code to bind to Autocomplete API -->
<script type="text/javascript" src="autocomplete.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -0,0 +1,241 @@
(function($){
var Captions = function(el, opts) {
var _this = this,
$this = $(el),
$el = $this.clone(),
href = $this.attr('href'),
$target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
_overlay_css = {};
if ( ! $target.length )
{
$target = $this.next(opts.data_selector);
}
if ($target.length) {
this.set_from_attr(el, opts);
$wrap = $('<div class="drop-panel" />',{position: 'relative', 'z-index': 1, display: 'block', overflow: 'hidden'})
.append($el)
.append($target);
$this.replaceWith($wrap);
$target.hide();
$wrap.css({ 'position':'relative', 'overflow':'hidden', display: 'block', padding:'2px' });
if (opts.find_image && $this.not('img'))
{
var img = $wrap.find('img'),
w = img.width(),
h = img.height();
}
else {
var w = $wrap.outerWidth(),
h = $wrap.outerHeight();
}
var overlay_w = opts.width || w,
overlay_h = opts.height || h;
$target.css({ 'width':overlay_w, 'height':overlay_h, 'position':'absolute', 'z-index':33, overflow: 'hidden' });
var _overlay_css = {};
if (opts.overlay_bg) {
_overlay_css.background = opts.overlay_bg;
}
if (opts.overlay_opacity<1) {
_overlay_css.opacity = opts.overlay_opacity;
}
// CSS: Overlay X Position
_overlay_css.left = (opts.overlay_x == 'left')
? 0
: (opts.overlay_x == 'right')
? w-overlay_w
: (w - overlay_w) / 2 + 'px';
// CSS: Overlay Y Position
_overlay_css.top = (opts.overlay_y == 'top')
? 0
: (opts.overlay_y == 'bottom')
? h-overlay_h
: (h - overlay_h) / 2 + 'px';
// CSS: Apply rules
$target.css(_overlay_css);
// slide effect
if (opts.effect=='slide') {
var slide_css = {};
switch (opts.direction) {
case 'top':
slide_css.top = '-'+overlay_h+'px';
break;
case 'bottom':
slide_css.top = h+'px';
break;
case 'left':
slide_css.left = '-'+overlay_w+'px';
break;
case 'right':
default:
slide_css.left = w+'px';
break;
}
// Apply Slide rules
$target.css('z-index',opts.zindex+1).css(slide_css);
// Hover events
$wrap.hover(function(){
$target.show().stop(true, true).animate({ 'top': _overlay_css.top, 'left': _overlay_css.left }, +opts.speed, opts.onshow());
}, function(){
$target.show().stop(true, true).animate(slide_css, +opts.speed, opts.onhide());
});
// fade effect
} else if (opts.effect=='fade') {
$target.css('z-index',opts.zindex+1).hide();
$wrap.hover(function () {
$target.stop(true, true).fadeIn(+opts.speed, opts.onshow());
}, function () {
$target.stop(true, true).fadeOut(+opts.speed, opts.onhide());
});
// just show/hide
} else {
$target.css('z-index',opts.zindex+1).hide();
$wrap.hover(function () {
$target.show(0, opts.onshow());
}, function () {
$target.hide(0, opts.onhide());
});
}
}
};
Captions.prototype = {
constructor: Captions,
set_from_attr: function(el, opt){
var cfg={},
attrs=el.attributes,
l=attrs.length;
for (var i=0; i<l; i++)
{
attr = attrs.item(i);
if (/cap-/i.test(attr.nodeName))
{
opt[attr.nodeName.replace('cap-', '')] = attr.nodeValue;
}
}
}
};
$.fn.hcaptions = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('captions')
, options = $.extend({}, $.fn.hcaptions.defaults, $this.data(), typeof option == 'object' && option);
if (!data) $this.data('captions', (data = new Captions(this, options)));
if (typeof option == 'string') data[option]();
});
};
$.fn.hcaptions.defaults = {
/**
* Selector for caption content
* @type {String}
*/
data_selector: '.cap-overlay',
/**
* Overlay width
* @default full width
* @type {Number}
*/
width: 0,
/**
* Overlay height
* @type {Number}
*/
height: 0,
/**
* Horizontal position for the overlay
* @options [center, left, right]
* @type {String}
*/
overlay_x: 'center',
/**
* Vertical position for the overlay
* @options [center, top, bottom]
* @type {String}
*/
overlay_y: 'center',
/**
* Background css for overlay
* @type {String}
*/
overlay_bg: '',
/**
* Opacity of overlay
* @type {Number}
*/
overlay_opacity: 1,
/**
* Effect of overlay
* @options [fade, slide, show/hide]
* @type {String}
*/
effect: 'slide',
/**
* Animation speed in ms
* @type {Number}
*/
speed: 400,
/**
* Direction of overlay
* @options [top, bottom, right, left]
* @type {String}
*/
direction: 'top',
/**
* Z-Index Base
* @type {Number}
*/
zindex: 2,
find_image: false,
/**
* On show callback
* @return {[type]} [description]
*/
onshow: function(){},
/**
* On hide callback
* @return {[type]} [description]
*/
onhide: function(){}
};
})(jQuery);

View File

@@ -0,0 +1,487 @@
.tool-container, .tool-item, .btn-toolbar {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.btn-toolbar {
background: #364347;
width: 20px;
height: 20px;
text-align: center;
padding: 10px;
border-radius: 6px;
display: block;
transition: none;
}
.btn-toolbar > i {
color: #02baf2;
font-size: 16px;
}
.btn-toolbar:hover {
background: #02baf2;
cursor: pointer;
}
.btn-toolbar:hover > i {
color: white;
}
.btn-toolbar-primary {
background-color: #009dcd;
}
.btn-toolbar-primary.pressed {
background-color: #02baf2;
}
.btn-toolbar-primary:hover {
background-color: #02baf2;
}
.btn-toolbar-primary > i {
color: white;
}
.btn-toolbar-danger {
background-color: #cc0000;
}
.btn-toolbar-danger.pressed {
background-color: #f84545;
}
.btn-toolbar-danger:hover {
background-color: #f84545;
}
.btn-toolbar-danger > i {
color: white;
}
.btn-toolbar-warning {
background-color: #f3bc65;
}
.btn-toolbar-warning.pressed {
background-color: #fad46b;
}
.btn-toolbar-warning:hover {
background-color: #fad46b;
}
.btn-toolbar-warning > i {
color: white;
}
.btn-toolbar-info {
background-color: #e96300;
}
.btn-toolbar-info.pressed {
background-color: #f58410;
}
.btn-toolbar-info:hover {
background-color: #f58410;
}
.btn-toolbar-info > i {
color: white;
}
.btn-toolbar-success {
background-color: #28948c;
}
.btn-toolbar-success.pressed {
background-color: #3eb5ac;
}
.btn-toolbar-success:hover {
background-color: #3eb5ac;
}
.btn-toolbar-success > i {
color: white;
}
.btn-toolbar-info-o {
background-color: #9175bd;
}
.btn-toolbar-info-o.pressed {
background-color: #a88cd5;
}
.btn-toolbar-info-o:hover {
background-color: #a88cd5;
}
.btn-toolbar-info-o > i {
color: white;
}
.btn-toolbar-light {
background-color: #b2c6cd;
}
.btn-toolbar-light.pressed {
background-color: #d6e1e5;
}
.btn-toolbar-light:hover {
background-color: #d6e1e5;
}
.btn-toolbar-light > i {
color: white;
}
.btn-toolbar-dark {
background-color: #364347;
}
.btn-toolbar-dark.pressed {
background-color: #5e696d;
}
.btn-toolbar-dark:hover {
background-color: #5e696d;
}
.btn-toolbar-dark > i {
color: white;
}
.tool-container {
background-color: #5e696d;
background-size: 100% 100%;
border-radius: 6px;
position: absolute;
}
.tool-container.tool-top,
.tool-container.tool-bottom {
height: 40px;
border-bottom: 0px solid #beb8b8;
}
.tool-container.tool-top .tool-item,
.tool-container.tool-bottom .tool-item {
float: left;
border-right: 0;
border-left: 0;
}
.tool-item {
height: 100%;
display: block;
width: 20px;
height: 20px;
text-align: center;
padding: 10px;
transition: none;
}
.tool-item > .fa {
color: #b2c6cd;
}
.tool-item.selected,
.tool-item:hover {
background: #02baf2;
}
.tool-item.selected > .fa,
.tool-item:hover > .fa {
color: white;
}
.tool-top .tool-item:first-child:hover,
.tool-bottom .tool-item:first-child:hover {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
.tool-top .tool-item:last-child:hover,
.tool-bottom .tool-item:last-child:hover {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.tool-vertical-top .tool-item:first-child:hover,
.tool-vertical-bottom .tool-item:first-child:hover,
.tool-right .tool-item:first-child:hover,
.tool-left .tool-item:first-child:hover {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.tool-vertical-top .tool-item:last-child:hover,
.tool-vertical-bottom .tool-item:last-child:hover,
.tool-right .tool-item:last-child:hover,
.tool-left .tool-item:last-child:hover {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.tool-container .arrow {
width: 0;
height: 0;
position: absolute;
border-width: 7px;
border-style: solid;
}
.tool-container.tool-top .arrow {
border-color: #5e696d transparent transparent;
left: 50%;
bottom: -14px;
margin-left: -7px;
}
.tool-container.tool-bottom .arrow {
border-color: transparent transparent #5e696d;
left: 50%;
top: -14px;
margin-left: -7px;
}
.tool-container.tool-left .arrow {
border-color: transparent transparent transparent #5e696d;
top: 50%;
right: -14px;
margin-top: -7px;
}
.tool-container.tool-right .arrow {
border-color: transparent #5e696d transparent transparent;
top: 50%;
left: -14px;
margin-top: -7px;
}
.toolbar-primary {
background-color: #02baf2;
}
.toolbar-primary.tool-top .arrow {
border-color: #02baf2 transparent transparent;
}
.toolbar-primary.tool-bottom .arrow {
border-color: transparent transparent #02baf2;
}
.toolbar-primary.tool-left .arrow {
border-color: transparent transparent transparent #02baf2;
}
.toolbar-primary.tool-right .arrow {
border-color: transparent #02baf2 transparent transparent;
}
.toolbar-primary .tool-item > .fa {
color: white;
}
.toolbar-primary .tool-item.selected,
.toolbar-primary .tool-item:hover {
background: #009dcd;
color: white;
}
.toolbar-danger {
background-color: #f84545;
}
.toolbar-danger.tool-top .arrow {
border-color: #f84545 transparent transparent;
}
.toolbar-danger.tool-bottom .arrow {
border-color: transparent transparent #f84545;
}
.toolbar-danger.tool-left .arrow {
border-color: transparent transparent transparent #f84545;
}
.toolbar-danger.tool-right .arrow {
border-color: transparent #f84545 transparent transparent;
}
.toolbar-danger .tool-item > .fa {
color: white;
}
.toolbar-danger .tool-item.selected,
.toolbar-danger .tool-item:hover {
background: #cc0000;
color: white;
}
.toolbar-warning {
background-color: #f3bc65;
}
.toolbar-warning.tool-top .arrow {
border-color: #f3bc65 transparent transparent;
}
.toolbar-warning.tool-bottom .arrow {
border-color: transparent transparent #f3bc65;
}
.toolbar-warning.tool-left .arrow {
border-color: transparent transparent transparent #f3bc65;
}
.toolbar-warning.tool-right .arrow {
border-color: transparent #f3bc65 transparent transparent;
}
.toolbar-warning .tool-item > .fa {
color: white;
}
.toolbar-warning .tool-item.selected,
.toolbar-warning .tool-item:hover {
background: #fad46b;
color: white;
}
.toolbar-info {
background-color: #e96300;
}
.toolbar-info.tool-top .arrow {
border-color: #e96300 transparent transparent;
}
.toolbar-info.tool-bottom .arrow {
border-color: transparent transparent #e96300;
}
.toolbar-info.tool-left .arrow {
border-color: transparent transparent transparent #e96300;
}
.toolbar-info.tool-right .arrow {
border-color: transparent #e96300 transparent transparent;
}
.toolbar-info .tool-item > .fa {
color: white;
}
.toolbar-info .tool-item.selected,
.toolbar-info .tool-item:hover {
background: #f58410;
color: white;
}
.toolbar-success {
background-color: #28948c;
}
.toolbar-success.tool-top .arrow {
border-color: #28948c transparent transparent;
}
.toolbar-success.tool-bottom .arrow {
border-color: transparent transparent #28948c;
}
.toolbar-success.tool-left .arrow {
border-color: transparent transparent transparent #28948c;
}
.toolbar-success.tool-right .arrow {
border-color: transparent #28948c transparent transparent;
}
.toolbar-success .tool-item > .fa {
color: white;
}
.toolbar-success .tool-item.selected,
.toolbar-success .tool-item:hover {
background: #3eb5ac;
color: white;
}
.toolbar-info-o {
background-color: #9175bd;
}
.toolbar-info-o.tool-top .arrow {
border-color: #9175bd transparent transparent;
}
.toolbar-info-o.tool-bottom .arrow {
border-color: transparent transparent #9175bd;
}
.toolbar-info-o.tool-left .arrow {
border-color: transparent transparent transparent #9175bd;
}
.toolbar-info-o.tool-right .arrow {
border-color: transparent #9175bd transparent transparent;
}
.toolbar-info-o .tool-item > .fa {
color: white;
}
.toolbar-info-o .tool-item.selected,
.toolbar-info-o .tool-item:hover {
background: #a88cd5;
color: white;
}
.toolbar-light {
background-color: #b2c6cd;
}
.toolbar-light.tool-top .arrow {
border-color: #b2c6cd transparent transparent;
}
.toolbar-light.tool-bottom .arrow {
border-color: transparent transparent #b2c6cd;
}
.toolbar-light.tool-left .arrow {
border-color: transparent transparent transparent #b2c6cd;
}
.toolbar-light.tool-right .arrow {
border-color: transparent #b2c6cd transparent transparent;
}
.toolbar-light .tool-item > .fa {
color: white;
}
.toolbar-light .tool-item.selected,
.toolbar-light .tool-item:hover {
background: #d6e1e5;
color: white;
}
.toolbar-dark {
background-color: #364347;
}
.toolbar-dark.tool-top .arrow {
border-color: #364347 transparent transparent;
}
.toolbar-dark.tool-bottom .arrow {
border-color: transparent transparent #364347;
}
.toolbar-dark.tool-left .arrow {
border-color: transparent transparent transparent #364347;
}
.toolbar-dark.tool-right .arrow {
border-color: transparent #364347 transparent transparent;
}
.toolbar-dark .tool-item > .fa {
color: white;
}
.toolbar-dark .tool-item.selected,
.toolbar-dark .tool-item:hover {
background: #5e696d;
color: white;
}
.animate-standard {
-webkit-animation: standardAnimate 0.3s 1 ease;
}
.animate-flyin {
-webkit-animation: rotateAnimate 0.5s 1 ease;
}
.animate-grow {
-webkit-animation: growAnimate 0.4s 1 ease;
}
.animate-flip {
-webkit-animation: flipAnimate 0.4s 1 ease;
}
.animate-bounce {
-webkit-animation: bounceAnimate 0.4s 1 ease-out;
}
@-webkit-keyframes rotateAnimate {
from {
transform: rotate(180deg) translate(-120px);
opacity: 0;
}
to {
transform: rotate(0deg) translate(0px);
opacity: 1;
}
}
@-webkit-keyframes standardAnimate {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0px);
opacity: 1;
}
}
@-webkit-keyframes growAnimate {
0% {
transform: scale(0) translateY(40px);
opacity: 0;
}
70% {
transform: scale(1.5) translate(0px);
}
100% {
transform: scale(1) translate(0px);
opacity: 1;
}
}
@-webkit-keyframes rotate2Animate {
from {
transform: rotate(-90deg);
transform-origin: 0% 100%;
opacity: 0;
}
to {
transform: rotate(0deg);
opacity: 1;
}
}
@-webkit-keyframes flipAnimate {
from {
transform: rotate3d(2, 2, 2, 180deg);
opacity: 0;
}
to {
transform: rotate3d(0, 0, 0, 0deg);
opacity: 1;
}
}
@-webkit-keyframes bounceAnimate {
0% {
transform: translateY(40px);
opacity: 0;
}
30% {
transform: translateY(-40px);
}
70% {
transform: translateY(20px);
}
100% {
transform: translateY(0px);
opacity: 1;
}
}
.hidden {
display: none;
}

View File

@@ -0,0 +1,307 @@
/**
* Toolbar.js
*
* @fileoverview jQuery plugin that creates tooltip style toolbars.
* @link http://paulkinzett.github.com/toolbar/
* @author Paul Kinzett (http://kinzett.co.nz/)
* @version 1.1.0
* @requires jQuery 1.7+
*
* @license jQuery Toolbar Plugin v1.1.0
* http://paulkinzett.github.com/toolbar/
* Copyright 2013 - 2015 Paul Kinzett (http://kinzett.co.nz/)
* Released under the MIT license.
* <https://raw.github.com/paulkinzett/toolbar/master/LICENSE.txt>
*/
if ( typeof Object.create !== 'function' ) {
Object.create = function( obj ) {
function F() {}
F.prototype = obj;
return new F();
};
}
(function( $, window, document, undefined ) {
var ToolBar = {
init: function( options, elem ) {
var self = this;
self.elem = elem;
self.$elem = $( elem );
self.options = $.extend( {}, $.fn.toolbar.options, options );
self.metadata = self.$elem.data();
self.overrideOptions();
self.toolbar = $('<div class="tool-container" />')
.addClass('tool-'+self.options.position)
.addClass('toolbar-'+self.options.style)
.append('<div class="tool-items" />')
.append('<div class="arrow" />')
.appendTo('body')
.css('opacity', 0)
.hide();
self.toolbar_arrow = self.toolbar.find('.arrow');
self.initializeToolbar();
},
overrideOptions: function() {
var self = this;
$.each( self.options, function( $option ) {
if (typeof(self.$elem.data('toolbar-'+$option)) != "undefined") {
self.options[$option] = self.$elem.data('toolbar-'+$option);
}
});
},
initializeToolbar: function() {
var self = this;
self.populateContent();
self.setTrigger();
self.toolbarWidth = self.toolbar.width();
},
setTrigger: function() {
var self = this;
if (self.options.event != 'click') {
var moveTime;
function decideTimeout () {
if (self.$elem.hasClass('pressed')) {
moveTime = setTimeout(function() {
self.hide();
}, 150);
} else {
clearTimeout(moveTime);
};
};
self.$elem.on({
mouseenter: function(event) {
if (self.$elem.hasClass('pressed')) {
clearTimeout(moveTime);
} else {
self.show();
}
}
});
self.$elem.parent().on({
mouseleave: function(event){ decideTimeout(); }
});
$('.tool-container').on({
mouseenter: function(event){ clearTimeout(moveTime); },
mouseleave: function(event){ decideTimeout(); }
});
}
if (self.options.event == 'click') {
self.$elem.on('click', function(event) {
event.preventDefault();
if(self.$elem.hasClass('pressed')) {
self.hide();
} else {
self.show();
}
});
if (self.options.hideOnClick) {
$('html').on("click.toolbar", function ( event ) {
if (event.target != self.elem &&
self.$elem.has(event.target).length === 0 &&
self.toolbar.has(event.target).length === 0 &&
self.toolbar.is(":visible")) {
self.hide();
}
});
}
}
if (self.options.hover) {
var moveTime;
function decideTimeout () {
if (self.$elem.hasClass('pressed')) {
moveTime = setTimeout(function() {
self.hide();
}, 150);
} else {
clearTimeout(moveTime);
};
};
self.$elem.on({
mouseenter: function(event) {
if (self.$elem.hasClass('pressed')) {
clearTimeout(moveTime);
} else {
self.show();
}
}
});
self.$elem.parent().on({
mouseleave: function(event){ decideTimeout(); }
});
$('.tool-container').on({
mouseenter: function(event){ clearTimeout(moveTime); },
mouseleave: function(event){ decideTimeout(); }
});
}
$(window).resize(function( event ) {
event.stopPropagation();
if ( self.toolbar.is(":visible") ) {
self.toolbarCss = self.getCoordinates(self.options.position, 20);
self.collisionDetection();
self.toolbar.css( self.toolbarCss );
self.toolbar_arrow.css( self.arrowCss );
}
});
},
populateContent: function() {
var self = this;
var location = self.toolbar.find('.tool-items');
var content = $(self.options.content).clone( true ).find('a').addClass('tool-item');
location.html(content);
location.find('.tool-item').on('click', function(event) {
event.preventDefault();
self.$elem.trigger('toolbarItemClick', this);
});
},
calculatePosition: function() {
var self = this;
self.arrowCss = {};
self.toolbarCss = self.getCoordinates(self.options.position, self.options.adjustment);
self.toolbarCss.position = 'absolute';
self.toolbarCss.zIndex = self.options.zIndex;
self.collisionDetection();
self.toolbar.css(self.toolbarCss);
self.toolbar_arrow.css(self.arrowCss);
},
getCoordinates: function( position, adjustment ) {
var self = this;
self.coordinates = self.$elem.offset();
if (self.options.adjustment && self.options.adjustment[self.options.position]) {
adjustment = self.options.adjustment[self.options.position] + adjustment;
}
switch(self.options.position) {
case 'top':
return {
left: self.coordinates.left-(self.toolbar.width()/2)+(self.$elem.outerWidth()/2),
top: self.coordinates.top-self.$elem.outerHeight()-adjustment,
right: 'auto'
};
case 'left':
return {
left: self.coordinates.left-(self.toolbar.width()/2)-(self.$elem.outerWidth()/2)-adjustment,
top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
right: 'auto'
};
case 'right':
return {
left: self.coordinates.left+(self.toolbar.width()/2)+(self.$elem.outerWidth()/2)+adjustment,
top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
right: 'auto'
};
case 'bottom':
return {
left: self.coordinates.left-(self.toolbar.width()/2)+(self.$elem.outerWidth()/2),
top: self.coordinates.top+self.$elem.outerHeight()+adjustment,
right: 'auto'
};
}
},
collisionDetection: function() {
var self = this;
var edgeOffset = 20;
if(self.options.position == 'top' || self.options.position == 'bottom') {
self.arrowCss = {left: '50%', right: '50%'};
if( self.toolbarCss.left < edgeOffset ) {
self.toolbarCss.left = edgeOffset;
self.arrowCss.left = self.$elem.offset().left + self.$elem.width()/2-(edgeOffset);
}
else if(($(window).width() - (self.toolbarCss.left + self.toolbarWidth)) < edgeOffset) {
self.toolbarCss.right = edgeOffset;
self.toolbarCss.left = 'auto';
self.arrowCss.left = 'auto';
self.arrowCss.right = ($(window).width()-self.$elem.offset().left)-(self.$elem.width()/2)-(edgeOffset)-5;
}
}
},
show: function() {
var self = this;
self.$elem.addClass('pressed');
self.calculatePosition();
self.toolbar.show().css({'opacity': 1}).addClass('animate-'+self.options.animation);
self.$elem.trigger('toolbarShown');
},
hide: function() {
var self = this;
var animation = {'opacity': 0};
self.$elem.removeClass('pressed');
switch(self.options.position) {
case 'top':
animation.top = '+=20';
break;
case 'left':
animation.left = '+=20';
break;
case 'right':
animation.left = '-=20';
break;
case 'bottom':
animation.top = '-=20';
break;
}
self.toolbar.animate(animation, 200, function() {
self.toolbar.hide();
});
self.$elem.trigger('toolbarHidden');
},
getToolbarElement: function () {
return this.toolbar.find('.tool-items');
}
};
$.fn.toolbar = function( options ) {
if ($.isPlainObject( options )) {
return this.each(function() {
var toolbarObj = Object.create( ToolBar );
toolbarObj.init( options, this );
$(this).data('toolbarObj', toolbarObj);
});
} else if ( typeof options === 'string' && options.indexOf('_') !== 0 ) {
var toolbarObj = $(this).data('toolbarObj');
var method = toolbarObj[options];
return method.apply(toolbarObj, $.makeArray(arguments).slice(1));
}
};
$.fn.toolbar.options = {
content: '#myContent',
position: 'top',
hideOnClick: false,
zIndex: 120,
hover: false,
style: 'default',
animation: 'standard',
adjustment: 10
};
}) ( jQuery, window, document );