mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Added assets + dependencies
This commit is contained in:
39
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.css
vendored
Executable file
39
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.css
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
div.alphabet {
|
||||
position: relative;
|
||||
display: table;
|
||||
width: 100%;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
div.alphabet span {
|
||||
display: table-cell;
|
||||
color: #3174c7;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
width: 3.5%
|
||||
}
|
||||
|
||||
div.alphabet span:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.alphabet span.active {
|
||||
color: black;
|
||||
}
|
||||
|
||||
div.alphabet span.empty {
|
||||
color: red;
|
||||
}
|
||||
|
||||
div.alphabetInfo {
|
||||
display: block;
|
||||
position: absolute;
|
||||
background-color: #111;
|
||||
border-radius: 3px;
|
||||
color: white;
|
||||
top: 2em;
|
||||
height: 1.8em;
|
||||
padding-top: 0.4em;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
}
|
162
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.js
vendored
Executable file
162
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.js
vendored
Executable file
@@ -0,0 +1,162 @@
|
||||
/*! AlphabetSearch for DataTables v1.0.0
|
||||
* 2014 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @summary AlphabetSearch
|
||||
* @description Show an set of alphabet buttons alongside a table providing
|
||||
* search input options
|
||||
* @version 1.0.0
|
||||
* @file dataTables.alphabetSearch.js
|
||||
* @author SpryMedia Ltd (www.sprymedia.co.uk)
|
||||
* @contact www.sprymedia.co.uk/contact
|
||||
* @copyright Copyright 2014 SpryMedia Ltd.
|
||||
*
|
||||
* License MIT - http://datatables.net/license/mit
|
||||
*
|
||||
* For more detailed information please see:
|
||||
* http://datatables.net/blog/2014-09-22
|
||||
*/
|
||||
(function(){
|
||||
|
||||
|
||||
// Search function
|
||||
$.fn.dataTable.Api.register( 'alphabetSearch()', function ( searchTerm ) {
|
||||
this.iterator( 'table', function ( context ) {
|
||||
context.alphabetSearch = searchTerm;
|
||||
} );
|
||||
|
||||
return this;
|
||||
} );
|
||||
|
||||
// Recalculate the alphabet display for updated data
|
||||
$.fn.dataTable.Api.register( 'alphabetSearch.recalc()', function ( searchTerm ) {
|
||||
this.iterator( 'table', function ( context ) {
|
||||
draw(
|
||||
new $.fn.dataTable.Api( context ),
|
||||
$('div.alphabet', this.table().container())
|
||||
);
|
||||
} );
|
||||
|
||||
return this;
|
||||
} );
|
||||
|
||||
|
||||
// Search plug-in
|
||||
$.fn.dataTable.ext.search.push( function ( context, searchData ) {
|
||||
// Ensure that there is a search applied to this table before running it
|
||||
if ( ! context.alphabetSearch ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( searchData[0].charAt(0) === context.alphabetSearch ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} );
|
||||
|
||||
|
||||
// Private support methods
|
||||
function bin ( data ) {
|
||||
var letter, bins = {};
|
||||
|
||||
for ( var i=0, ien=data.length ; i<ien ; i++ ) {
|
||||
letter = data[i].charAt(0).toUpperCase();
|
||||
|
||||
if ( bins[letter] ) {
|
||||
bins[letter]++;
|
||||
}
|
||||
else {
|
||||
bins[letter] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return bins;
|
||||
}
|
||||
|
||||
function draw ( table, alphabet )
|
||||
{
|
||||
alphabet.empty();
|
||||
alphabet.append( 'Search: ' );
|
||||
|
||||
var columnData = table.column(0).data();
|
||||
var bins = bin( columnData );
|
||||
|
||||
$('<span class="clear active"/>')
|
||||
.data( 'letter', '' )
|
||||
.data( 'match-count', columnData.length )
|
||||
.html( 'None' )
|
||||
.appendTo( alphabet );
|
||||
|
||||
for ( var i=0 ; i<26 ; i++ ) {
|
||||
var letter = String.fromCharCode( 65 + i );
|
||||
|
||||
$('<span/>')
|
||||
.data( 'letter', letter )
|
||||
.data( 'match-count', bins[letter] || 0 )
|
||||
.addClass( ! bins[letter] ? 'empty' : '' )
|
||||
.html( letter )
|
||||
.appendTo( alphabet );
|
||||
}
|
||||
|
||||
$('<div class="alphabetInfo"></div>')
|
||||
.appendTo( alphabet );
|
||||
}
|
||||
|
||||
|
||||
$.fn.dataTable.AlphabetSearch = function ( context ) {
|
||||
var table = new $.fn.dataTable.Api( context );
|
||||
var alphabet = $('<div class="alphabet"/>');
|
||||
|
||||
draw( table, alphabet );
|
||||
|
||||
// Trigger a search
|
||||
alphabet.on( 'click', 'span', function () {
|
||||
alphabet.find( '.active' ).removeClass( 'active' );
|
||||
$(this).addClass( 'active' );
|
||||
|
||||
table
|
||||
.alphabetSearch( $(this).data('letter') )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
// Mouse events to show helper information
|
||||
alphabet
|
||||
.on( 'mouseenter', 'span', function () {
|
||||
alphabet
|
||||
.find('div.alphabetInfo')
|
||||
.css( {
|
||||
opacity: 1,
|
||||
left: $(this).position().left,
|
||||
width: $(this).width()
|
||||
} )
|
||||
.html( $(this).data('match-count') );
|
||||
} )
|
||||
.on( 'mouseleave', 'span', function () {
|
||||
alphabet
|
||||
.find('div.alphabetInfo')
|
||||
.css('opacity', 0);
|
||||
} );
|
||||
|
||||
// API method to get the alphabet container node
|
||||
this.node = function () {
|
||||
return alphabet;
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.DataTable.AlphabetSearch = $.fn.dataTable.AlphabetSearch;
|
||||
|
||||
|
||||
// Register a search plug-in
|
||||
$.fn.dataTable.ext.feature.push( {
|
||||
fnInit: function ( settings ) {
|
||||
var search = new $.fn.dataTable.AlphabetSearch( settings );
|
||||
return search.node();
|
||||
},
|
||||
cFeature: 'A'
|
||||
} );
|
||||
|
||||
|
||||
}());
|
||||
|
8
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.min.js
vendored
Executable file
8
bower_components/datatables-plugins/features/alphabetSearch/dataTables.alphabetSearch.min.js
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
AlphabetSearch for DataTables v1.0.0
|
||||
2014 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(){function f(b,c){c.empty();c.append("Search: ");for(var a=b.column(0).data(),d,e={},g=0,f=a.length;g<f;g++)d=a[g].charAt(0).toUpperCase(),e[d]?e[d]++:e[d]=1;$('<span class="clear active"/>').data("letter","").data("match-count",a.length).html("None").appendTo(c);for(a=0;26>a;a++)d=String.fromCharCode(65+a),$("<span/>").data("letter",d).data("match-count",e[d]||0).addClass(!e[d]?"empty":"").html(d).appendTo(c);$('<div class="alphabetInfo"></div>').appendTo(c)}$.fn.dataTable.Api.register("alphabetSearch()",
|
||||
function(b){this.iterator("table",function(c){c.alphabetSearch=b});return this});$.fn.dataTable.Api.register("alphabetSearch.recalc()",function(){this.iterator("table",function(b){f(new $.fn.dataTable.Api(b),$("div.alphabet",this.table().container()))});return this});$.fn.dataTable.ext.search.push(function(b,c){return!b.alphabetSearch||c[0].charAt(0)===b.alphabetSearch?!0:!1});$.fn.dataTable.AlphabetSearch=function(b){var c=new $.fn.dataTable.Api(b),a=$('<div class="alphabet"/>');f(c,a);a.on("click",
|
||||
"span",function(){a.find(".active").removeClass("active");$(this).addClass("active");c.alphabetSearch($(this).data("letter")).draw()});a.on("mouseenter","span",function(){a.find("div.alphabetInfo").css({opacity:1,left:$(this).position().left,width:$(this).width()}).html($(this).data("match-count"))}).on("mouseleave","span",function(){a.find("div.alphabetInfo").css("opacity",0)});this.node=function(){return a}};$.fn.DataTable.AlphabetSearch=$.fn.dataTable.AlphabetSearch;$.fn.dataTable.ext.feature.push({fnInit:function(b){return(new $.fn.dataTable.AlphabetSearch(b)).node()},
|
||||
cFeature:"A"})})();
|
Reference in New Issue
Block a user