2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

!!! NEW ADMIN PANEL layout + required js and css libraries

modified functions/functions.xhtml.php file prepared for upcoming admin pages changes
This commit is contained in:
Alex
2015-02-12 00:00:05 +03:00
parent bdda1af5f3
commit dadad5ed63
28 changed files with 9338 additions and 101 deletions

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

265
include/basket.js/dist/basket.js vendored Normal file
View File

@@ -0,0 +1,265 @@
/*!
* basket.js
* v0.5.1 - 2014-08-16
* http://addyosmani.github.com/basket.js
* (c) Addy Osmani; License
* Created by: Addy Osmani, Sindre Sorhus, Andrée Hansson, Mat Scales
* Contributors: Ironsjp, Mathias Bynens, Rick Waldron, Felipe Morais
* Uses rsvp.js, https://github.com/tildeio/rsvp.js
*/(function( window, document ) {
'use strict';
var head = document.head || document.getElementsByTagName('head')[0];
var storagePrefix = 'basket-';
var defaultExpiration = 5000;
var addLocalStorage = function( key, storeObj ) {
try {
localStorage.setItem( storagePrefix + key, JSON.stringify( storeObj ) );
return true;
} catch( e ) {
if ( e.name.toUpperCase().indexOf('QUOTA') >= 0 ) {
var item;
var tempScripts = [];
for ( item in localStorage ) {
if ( item.indexOf( storagePrefix ) === 0 ) {
tempScripts.push( JSON.parse( localStorage[ item ] ) );
}
}
if ( tempScripts.length ) {
tempScripts.sort(function( a, b ) {
return a.stamp - b.stamp;
});
basket.remove( tempScripts[ 0 ].key );
return addLocalStorage( key, storeObj );
} else {
// no files to remove. Larger than available quota
return;
}
} else {
// some other error
return;
}
}
};
var getUrl = function( url ) {
var promise = new RSVP.Promise( function( resolve, reject ){
var xhr = new XMLHttpRequest();
xhr.open( 'GET', url );
xhr.onreadystatechange = function() {
if ( xhr.readyState === 4 ) {
if( xhr.status === 200 ) {
resolve( {
content: xhr.responseText,
type: xhr.getResponseHeader('content-type')
} );
} else {
reject( new Error( xhr.statusText ) );
}
}
};
// By default XHRs never timeout, and even Chrome doesn't implement the
// spec for xhr.timeout. So we do it ourselves.
setTimeout( function () {
if( xhr.readyState < 4 ) {
xhr.abort();
}
}, basket.timeout );
xhr.send();
});
return promise;
};
var saveUrl = function( obj ) {
return getUrl( obj.url ).then( function( result ) {
var storeObj = wrapStoreData( obj, result );
if (!obj.skipCache) {
addLocalStorage( obj.key , storeObj );
}
return storeObj;
});
};
var wrapStoreData = function( obj, data ) {
var now = +new Date();
obj.data = data.content;
obj.originalType = data.type;
obj.type = obj.type || data.type;
obj.skipCache = obj.skipCache || false;
obj.stamp = now;
obj.expire = now + ( ( obj.expire || defaultExpiration ) * 60 * 60 * 1000 );
return obj;
};
var isCacheValid = function(source, obj) {
return !source ||
source.expire - +new Date() < 0 ||
obj.unique !== source.unique ||
(basket.isValidItem && !basket.isValidItem(source, obj));
};
var handleStackObject = function( obj ) {
var source, promise, shouldFetch;
if ( !obj.url ) {
return;
}
obj.key = ( obj.key || obj.url );
source = basket.get( obj.key );
obj.execute = obj.execute !== false;
shouldFetch = isCacheValid(source, obj);
if( obj.live || shouldFetch ) {
if ( obj.unique ) {
// set parameter to prevent browser cache
obj.url += ( ( obj.url.indexOf('?') > 0 ) ? '&' : '?' ) + 'basket-unique=' + obj.unique;
}
promise = saveUrl( obj );
if( obj.live && !shouldFetch ) {
promise = promise
.then( function( result ) {
// If we succeed, just return the value
// RSVP doesn't have a .fail convenience method
return result;
}, function() {
return source;
});
}
} else {
source.type = obj.type || source.originalType;
promise = new RSVP.Promise( function( resolve ){
resolve( source );
});
}
return promise;
};
var injectScript = function( obj ) {
var script = document.createElement('script');
script.defer = true;
// Have to use .text, since we support IE8,
// which won't allow appending to a script
script.text = obj.data;
head.appendChild( script );
};
var handlers = {
'default': injectScript
};
var execute = function( obj ) {
if( obj.type && handlers[ obj.type ] ) {
return handlers[ obj.type ]( obj );
}
return handlers['default']( obj ); // 'default' is a reserved word
};
var performActions = function( resources ) {
resources.map( function( obj ) {
if( obj.execute ) {
execute( obj );
}
return obj;
} );
};
var fetch = function() {
var i, l, promises = [];
for ( i = 0, l = arguments.length; i < l; i++ ) {
promises.push( handleStackObject( arguments[ i ] ) );
}
return RSVP.all( promises );
};
var thenRequire = function() {
var resources = fetch.apply( null, arguments );
var promise = this.then( function() {
return resources;
}).then( performActions );
promise.thenRequire = thenRequire;
return promise;
};
window.basket = {
require: function() {
var promise = fetch.apply( null, arguments ).then( performActions );
promise.thenRequire = thenRequire;
return promise;
},
remove: function( key ) {
localStorage.removeItem( storagePrefix + key );
return this;
},
get: function( key ) {
var item = localStorage.getItem( storagePrefix + key );
try {
return JSON.parse( item || 'false' );
} catch( e ) {
return false;
}
},
clear: function( expired ) {
var item, key;
var now = +new Date();
for ( item in localStorage ) {
key = item.split( storagePrefix )[ 1 ];
if ( key && ( !expired || this.get( key ).expire <= now ) ) {
this.remove( key );
}
}
return this;
},
isValidItem: null,
timeout: 5000,
addHandler: function( types, handler ) {
if( !Array.isArray( types ) ) {
types = [ types ];
}
types.forEach( function( type ) {
handlers[ type ] = handler;
});
},
removeHandler: function( types ) {
basket.addHandler( types, undefined );
}
};
// delete expired keys
basket.clear( true );
})( this, document );

11
include/basket.js/dist/basket.min.js vendored Normal file
View File

@@ -0,0 +1,11 @@
/*!
* basket.js
* v0.5.1 - 2014-08-16
* http://addyosmani.github.com/basket.js
* (c) Addy Osmani; License
* Created by: Addy Osmani, Sindre Sorhus, Andrée Hansson, Mat Scales
* Contributors: Ironsjp, Mathias Bynens, Rick Waldron, Felipe Morais
* Uses rsvp.js, https://github.com/tildeio/rsvp.js
*/
!function(a,b){"use strict";var c=b.head||b.getElementsByTagName("head")[0],d="basket-",e=5e3,f=function(a,b){try{return localStorage.setItem(d+a,JSON.stringify(b)),!0}catch(c){if(c.name.toUpperCase().indexOf("QUOTA")>=0){var e,g=[];for(e in localStorage)0===e.indexOf(d)&&g.push(JSON.parse(localStorage[e]));return g.length?(g.sort(function(a,b){return a.stamp-b.stamp}),basket.remove(g[0].key),f(a,b)):void 0}return}},g=function(a){var b=new RSVP.Promise(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.onreadystatechange=function(){4===d.readyState&&(200===d.status?b({content:d.responseText,type:d.getResponseHeader("content-type")}):c(new Error(d.statusText)))},setTimeout(function(){d.readyState<4&&d.abort()},basket.timeout),d.send()});return b},h=function(a){return g(a.url).then(function(b){var c=i(a,b);return a.skipCache||f(a.key,c),c})},i=function(a,b){var c=+new Date;return a.data=b.content,a.originalType=b.type,a.type=a.type||b.type,a.skipCache=a.skipCache||!1,a.stamp=c,a.expire=c+60*(a.expire||e)*60*1e3,a},j=function(a,b){return!a||a.expire-+new Date<0||b.unique!==a.unique||basket.isValidItem&&!basket.isValidItem(a,b)},k=function(a){var b,c,d;if(a.url)return a.key=a.key||a.url,b=basket.get(a.key),a.execute=a.execute!==!1,d=j(b,a),a.live||d?(a.unique&&(a.url+=(a.url.indexOf("?")>0?"&":"?")+"basket-unique="+a.unique),c=h(a),a.live&&!d&&(c=c.then(function(a){return a},function(){return b}))):(b.type=a.type||b.originalType,c=new RSVP.Promise(function(a){a(b)})),c},l=function(a){var d=b.createElement("script");d.defer=!0,d.text=a.data,c.appendChild(d)},m={"default":l},n=function(a){return a.type&&m[a.type]?m[a.type](a):m["default"](a)},o=function(a){a.map(function(a){return a.execute&&n(a),a})},p=function(){var a,b,c=[];for(a=0,b=arguments.length;b>a;a++)c.push(k(arguments[a]));return RSVP.all(c)},q=function(){var a=p.apply(null,arguments),b=this.then(function(){return a}).then(o);return b.thenRequire=q,b};a.basket={require:function(){var a=p.apply(null,arguments).then(o);return a.thenRequire=q,a},remove:function(a){return localStorage.removeItem(d+a),this},get:function(a){var b=localStorage.getItem(d+a);try{return JSON.parse(b||"false")}catch(c){return!1}},clear:function(a){var b,c,e=+new Date;for(b in localStorage)c=b.split(d)[1],c&&(!a||this.get(c).expire<=e)&&this.remove(c);return this},isValidItem:null,timeout:5e3,addHandler:function(a,b){Array.isArray(a)||(a=[a]),a.forEach(function(a){m[a]=b})},removeHandler:function(a){basket.addHandler(a,void 0)}},basket.clear(!0)}(this,document);
//# sourceMappingURL=basket.min.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"basket.min.js","sources":["basket.js"],"names":["window","document","head","getElementsByTagName","storagePrefix","defaultExpiration","addLocalStorage","key","storeObj","localStorage","setItem","JSON","stringify","e","name","toUpperCase","indexOf","item","tempScripts","push","parse","length","sort","a","b","stamp","basket","remove","getUrl","url","promise","RSVP","Promise","resolve","reject","xhr","XMLHttpRequest","open","onreadystatechange","readyState","status","content","responseText","type","getResponseHeader","Error","statusText","setTimeout","abort","timeout","send","saveUrl","obj","then","result","wrapStoreData","skipCache","data","now","Date","originalType","expire","isCacheValid","source","unique","isValidItem","handleStackObject","shouldFetch","get","execute","live","injectScript","script","createElement","defer","text","appendChild","handlers","default","performActions","resources","map","fetch","i","l","promises","arguments","all","thenRequire","apply","this","require","removeItem","getItem","clear","expired","split","addHandler","types","handler","Array","isArray","forEach","removeHandler","undefined"],"mappings":";;;;;;;;;CAQE,SAAWA,EAAQC,GACpB,YAEA,IAAIC,GAAOD,EAASC,MAAQD,EAASE,qBAAqB,QAAQ,GAC9DC,EAAgB,UAChBC,EAAoB,IAEpBC,EAAkB,SAAUC,EAAKC,GACpC,IAEC,MADAC,cAAaC,QAASN,EAAgBG,EAAKI,KAAKC,UAAWJ,KACpD,EACN,MAAOK,GACR,GAAKA,EAAEC,KAAKC,cAAcC,QAAQ,UAAY,EAAI,CACjD,GAAIC,GACAC,IAEJ,KAAMD,IAAQR,cAC0B,IAAlCQ,EAAKD,QAASZ,IAClBc,EAAYC,KAAMR,KAAKS,MAAOX,aAAcQ,IAI9C,OAAKC,GAAYG,QAChBH,EAAYI,KAAK,SAAUC,EAAGC,GAC7B,MAAOD,GAAEE,MAAQD,EAAEC,QAGpBC,OAAOC,OAAQT,EAAa,GAAIX,KAEzBD,EAAiBC,EAAKC,IAI7B,OAKD,SAMCoB,EAAS,SAAUC,GACtB,GAAIC,GAAU,GAAIC,MAA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SAAU7D,GACd,GAAIU,GAAOR,aAAaoF,QAASzF,EAAgBG,EACjD,KACC,MAAOI,MAAKS,MAAOH,GAAQ,SAC1B,MAAOJ,GACR,OAAO,IAITiF,MAAO,SAAUC,GAChB,GAAI9E,GAAMV,EACNmD,GAAO,GAAIC,KAEf,KAAM1C,IAAQR,cACbF,EAAMU,EAAK+E,MAAO5F,GAAiB,GAC9BG,KAAUwF,GAAWL,KAAKtB,IAAK7D,GAAMsD,QAAUH,IACnDgC,KAAK/D,OAAQpB,EAIf,OAAOmF,OAGRzB,YAAa,KAEbhB,QAAS,IAETgD,WAAY,SAAUC,EAAOC,GACvBC,MAAMC,QAASH,KACnBA,GAAUA,IAEXA,EAAMI,QAAS,SAAU3D,GACxBkC,EAAUlC,GAASwD,KAIrBI,cAAe,SAAUL,GACxBxE,OAAOuE,WAAYC,EAAOM,UAK5B9E,OAAOoE,OAAO,IAEXJ,KAAMzF"}

1
include/basket.js/dist/basket.min.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"dist/basket.min.js","sources":["dist/basket.js"],"names":["window","document","head","getElementsByTagName","storagePrefix","defaultExpiration","addLocalStorage","key","storeObj","localStorage","setItem","JSON","stringify","e","name","toUpperCase","indexOf","item","tempScripts","push","parse","length","sort","a","b","stamp","basket","remove","getUrl","url","promise","RSVP","Promise","resolve","reject","xhr","XMLHttpRequest","open","onreadystatechange","readyState","status","content","responseText","type","getResponseHeader","Error","statusText","send","saveUrl","obj","then","result","wrapStoreData","data","now","Date","originalType","expire","isCacheValid","source","unique","isValidItem","handleStackObject","shouldFetch","get","execute","live","injectScript","script","createElement","defer","text","appendChild","handlers","default","performActions","resources","map","fetch","i","l","promises","arguments","all","thenRequire","apply","this","require","removeItem","getItem","clear","expired","split","timeout","addHandler","types","handler","Array","isArray","forEach","removeHandler","undefined"],"mappings":";;;;;;;;;CAQE,SAAWA,EAAQC,GACpB,YAEA,IAAIC,GAAOD,EAASC,MAAQD,EAASE,qBAAqB,QAAQ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KAAM2C,EAAmBoB,UAAWH,IAG9C,OAAOhD,MAAKoD,IAAKF,IAGdG,EAAc,WACjB,GAAIR,GAAYE,EAAMO,MAAO,KAAMH,WAC/BpD,EAAUwD,KAAKpC,KAAM,WACxB,MAAO0B,KACL1B,KAAMyB,EAET,OADA7C,GAAQsD,YAAcA,EACftD,EAGR9B,GAAO0B,QACN6D,QAAS,WACR,GAAIzD,GAAUgD,EAAMO,MAAO,KAAMH,WAAYhC,KAAMyB,EAGnD,OADA7C,GAAQsD,YAAcA,EACftD,GAGRH,OAAQ,SAAUpB,GAEjB,MADAE,cAAa+E,WAAYpF,EAAgBG,GAClC+E,MAGRtB,IAAK,SAAUzD,GACd,GAAIU,GAAOR,aAAagF,QAASrF,EAAgBG,EACjD,KACC,MAAOI,MAAKS,MAAOH,GAAQ,SAC1B,MAAOJ,GACR,OAAO,IAIT6E,MAAO,SAAUC,GAChB,GAAI1E,GAAMV,EACN+C,GAAO,GAAIC,KAEf,KAAMtC,IAAQR,cACbF,EAAMU,EAAK2E,MAAOxF,GAAiB,GAC9BG,KAAUoF,GAAWL,KAAKtB,IAAKzD,GAAMkD,QAAUH,IACnDgC,KAAK3D,OAAQpB,EAIf,OAAO+E,OAGRzB,YAAa,KAEbgC,QAAS,IAETC,WAAY,SAAUC,EAAOC,GACvBC,MAAMC,QAASH,KACnBA,GAAUA,IAEXA,EAAMI,QAAS,SAAUxD,GACxB8B,EAAU9B,GAASqD,KAIrBI,cAAe,SAAUL,GACxBrE,OAAOoE,WAAYC,EAAOM,UAK5B3E,OAAOgE,OAAO,IAEXJ,KAAMrF"}

21
include/basket.js/license Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Basket.js team
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,36 @@
/**
* Custom styles for BDT - Bootstrap Data Tables
**/
.bdt thead th {
cursor: pointer;
}
/*
.bdt .sort-icon {
width: 10px;
display: inline-block;
padding-left: 5px;
} */
#table-footer {
margin-bottom: 15px;
margin-top: 10px;
min-height:35px;
}
#table-footer a, #table-footer button {
outline: none;
}
#table-footer .form-horizontal .control-label {
text-align: left;
margin: 0 15px;
}
#table-footer .pagination {
margin: 0 15px;
}
#table-footer .pagination li:not(.active) {
cursor: pointer;
}

View File

@@ -0,0 +1 @@
.bdt thead th{cursor:pointer}.bdt .sort-icon{width:10px;display:inline-block;padding-left:5px}#table-footer{margin-bottom:15px}#table-footer a,#table-footer button{outline:0}#table-footer .form-horizontal .control-label{text-align:left;margin:0 15px}#table-footer .pagination{margin:0 15px}#table-footer .pagination li:not(.active){cursor:pointer}

View File

@@ -0,0 +1,447 @@
/**
* @license MIT
* @license http://opensource.org/licenses/MIT Massachusetts Institute of Technology
* @copyright 2014 Patric Gutersohn
* @author Patric Gutersohn
* @example index.html BDT in action.
* @link http://bdt.gutersohn.biz Documentation
* @version 1.0.0
*
* @summary BDT - Bootstrap Data Tables
* @description sorting, paginating and search for bootstrap tables
*/
(function ($) {
"use strict";
/**
* @type {number}
*/
var actualPage = 1;
/**
* @type {number}
*/
var pageCount = 0;
/**
* @type {number}
*/
var pageRowCount = 0;
/**
* @type {string}
*/
var pages = 'Тоtal pages';
/**
* @type {object}
*/
var obj = null;
/**
* @type {boolean}
*/
var activeSearch = false;
/**
* @type {string}
*/
var arrowUp = ' ';
/**
* @type {string}
*/
var arrowDown = ' ';
$.fn.bdt = function (options, callback) {
var settings = $.extend({
pageRowCount: 50,
arrowDown: 'fa-arrow-down text-primary fa-lg',
arrowUp: 'fa-arrow-up text-primary fa-lg'
}, options);
/**
* @type {object}
*/
var tableBody = null;
return this.each(function () {
obj = $(this).addClass('bdt');
tableBody = obj.find("tbody");
pageRowCount = settings.pageRowCount;
arrowDown = settings.arrowDown;
arrowUp = settings.arrowUp;
/**
* search input field
*/
obj.before(
$('<form/>')
.addClass('float-left')
.attr('role', 'form')
.attr('style', 'width:30%;')
.append(
$('<div/>')
.addClass('form-group')
.append(
$('<input/>')
.addClass('form-control')
.attr('id', 'search')
.attr('placeholder', 'Type to Search here ...' )
)
)
);
/**
* select field for changing row per page
*/
obj.after(
$('<div/>')
.attr('id', 'table-footer')
.append(
$('<div/>')
.addClass('pull-left')
.append(
$('<form/>')
.addClass('form-horizontal')
.attr('id', 'page-rows-form')
.append($('<label/>')
.addClass('pull-left control-label')
.text('Rows per Page:')
)
.append(
$('<div/>')
.addClass('pull-left')
.append(
$('<select/>')
.addClass('form-control')
.append(
$('<option>', {
value: 25,
text: 25
})
)
.append(
$('<option>', {
value: 50,
text: 50,
selected: 'selected'
})
)
.append(
$('<option>', {
value: 100,
text: 100
})
)
.append(
$('<option>', {
value: 200,
text: 200
})
)
.append(
$('<option>', {
value: 500,
text: 500
})
)
)
)
)
)
);
if (tableBody.children('tr').length > pageRowCount) {
setPageCount(tableBody);
addPages();
paginate(tableBody, actualPage);
}
searchTable(tableBody);
sortColumn(obj, tableBody);
$('body').on('click', '.pagination li', function (event) {
var listItem;
if ($(event.target).is("a")) {
listItem = $(event.target).parent();
} else {
listItem = $(event.target).parent().parent();
}
var page = listItem.data('page');
if (!listItem.hasClass("disabled") && !listItem.hasClass("active")) {
paginate(tableBody, page);
}
});
$('#page-rows-form').on('change', function () {
var options = $(this).find('select');
pageRowCount = options.val();
setPageCount(tableBody);
addPages();
paginate(tableBody, 1);
});
});
/**
* the main part of this function is out of this thread http://stackoverflow.com/questions/3160277/jquery-table-sort
* @author James Padolsey http://james.padolsey.com
* @link http://jsfiddle.net/spetnik/gFzCk/1953/
* @param obj
*/
function sortColumn(obj) {
var table = obj;
var oldIndex = 0;
obj
.find('thead th')
.append(
$('<span class="pull-right"/>')
// .addClass('')
.append(
$('<i class=" "/>')
.addClass('fa sort-icon')
)
)
//.wrapInner('<p class="sort-element "/>')
.wrapInner('<div class=" "/>')
.each(function () {
var th = $(this);
var thIndex = th.index();
var inverse = false;
var addOrRemove = true;
th.click(function () {
if($(this).find('.sort-icon').hasClass(arrowDown)) {
$(this)
.find('.sort-icon')
.removeClass( arrowDown )
.addClass(arrowUp);
} else {
$(this)
.find('.sort-icon')
.removeClass( arrowUp )
.addClass(arrowDown);
}
if(oldIndex != thIndex) {
obj.find('.sort-icon').removeClass(arrowDown);
obj.find('.sort-icon').removeClass(arrowUp);
$(this)
.find('.sort-icon')
.toggleClass( arrowDown, addOrRemove );
}
table.find('td').filter(function () {
return $(this).index() === thIndex;
}).sortElements(function (a, b) {
return $.text([a]) > $.text([b]) ?
inverse ? -1 : 1
: inverse ? 1 : -1;
}, function () {
// parentNode is the element we want to move
return this.parentNode;
});
inverse = !inverse;
oldIndex = thIndex;
});
});
}
/**
* create li elements for pages
*/
function addPages() {
$('#table-nav').remove();
pages = $('<ul/>');
$.each(new Array(pageCount), function (index) {
var additonalClass = '';
var page = $();
if ((index + 1) == 1) {
additonalClass = 'active';
}
pages
.append($('<li/>')
.addClass(additonalClass)
.data('page', (index + 1))
.append(
$('<a/>')
.text(index + 1)
)
);
});
/**
* pagination, with pages and previous and next link
*/
$('#table-footer')
.addClass('form-group')
.append(
$('<nav/>')
.addClass('pull-right')
.attr('id', 'table-nav')
.append(
pages
.addClass('pagination pull-right')
.prepend(
$('<li/>')
.addClass('disabled')
.data('page', 'previous')
.append(
$('<a href="#" />')
.append(
$('<span/>')
.attr('aria-hidden', 'true')
.html('&laquo;')
)
.append(
$('<span/>')
.addClass('sr-only')
.text('Previous')
)
)
)
.append(
$('<li/>')
.addClass('disabled')
.data('page', 'next')
.append(
$('<a href="#" />')
.append(
$('<span/>')
.attr('aria-hidden', 'true')
.html('&raquo;')
)
.append(
$('<span/>')
.addClass('sr-only')
.text('Next')
)
)
)
)
);
}
/**
*
* @param tableBody
*/
function searchTable(tableBody) {
$("#search").on("keyup", function () {
$.each(tableBody.find("tr"), function () {
var text = $(this)
.text()
.replace(/ /g, '')
.replace(/(\r\n|\n|\r)/gm, "");
var searchTerm = $("#search").val();
if (text.toLowerCase().indexOf(searchTerm.toLowerCase()) == -1) {
$(this)
.hide()
.removeClass('search-item');
} else {
$(this)
.show()
.addClass('search-item');
}
if (searchTerm != '') {
activeSearch = true;
} else {
activeSearch = false;
}
});
setPageCount(tableBody);
addPages();
paginate(tableBody, 1);
});
}
/**
*
* @param tableBody
*/
function setPageCount(tableBody) {
if (activeSearch) {
pageCount = Math.round(tableBody.children('.search-item').length / pageRowCount);
} else {
pageCount = Math.round(tableBody.children('tr').length / pageRowCount);
}
if (pageCount == 0) {
pageCount = 1;
}
}
/**
*
* @param tableBody
* @param page
*/
function paginate(tableBody, page) {
if (page == 'next') {
page = actualPage + 1;
} else if (page == 'previous') {
page = actualPage - 1;
}
actualPage = page;
var rows = (activeSearch ? tableBody.find(".search-item") : tableBody.find("tr"));
var endRow = (pageRowCount * page);
var startRow = (endRow - pageRowCount);
var pagination = $('.pagination');
rows
.hide();
rows
.slice(startRow, endRow)
.show();
pagination
.find('li')
.removeClass('active disabled');
pagination
.find('li:eq(' + page + ')')
.addClass('active');
if (page == 1) {
pagination
.find('li:first')
.addClass('disabled');
} else if (page == pageCount) {
pagination
.find('li:last')
.addClass('disabled');
}
}
}
}(jQuery));

View File

@@ -0,0 +1,13 @@
/**
* @license MIT
* @license http://opensource.org/licenses/MIT Massachusetts Institute of Technology
* @copyright 2014 Patric Gutersohn
* @author Patric Gutersohn
* @example index.html BDT in action.
* @link http://bdt.gutersohn.biz Documentation
* @version 1.0.0
*
* @summary BDT - Bootstrap Data Tables
* @description sorting, paginating and search for bootstrap tables
*/
(function(e){"use strict";var t=1;var n=0;var r=0;var i="";var s=null;var o=false;var u="";var a="";e.fn.bdt=function(f,l){function p(t){var n=t;var r=0;t.find("thead th").wrapInner('<span class="sort-element"/>').append(e("<span/>").addClass("sort-icon fa")).each(function(){var i=e(this);var s=i.index();var o=false;var f=true;i.click(function(){if(e(this).find(".sort-icon").hasClass(a)){e(this).find(".sort-icon").removeClass(a).addClass(u)}else{e(this).find(".sort-icon").removeClass(u).addClass(a)}if(r!=s){t.find(".sort-icon").removeClass(a);t.find(".sort-icon").removeClass(u);e(this).find(".sort-icon").toggleClass(a,f)}n.find("td").filter(function(){return e(this).index()===s}).sortElements(function(t,n){return e.text([t])>e.text([n])?o?-1:1:o?1:-1},function(){return this.parentNode});o=!o;r=s})})}function d(){e("#table-nav").remove();i=e("<ul/>");e.each(new Array(n),function(t){var n="";var r=e();if(t+1==1){n="active"}i.append(e("<li/>").addClass(n).data("page",t+1).append(e("<a/>").text(t+1)))});e("#table-footer").addClass("row").append(e("<nav/>").addClass("pull-right").attr("id","table-nav").append(i.addClass("pagination pull-right").prepend(e("<li/>").addClass("disabled").data("page","previous").append(e('<a href="#" />').append(e("<span/>").attr("aria-hidden","true").html("&laquo;")).append(e("<span/>").addClass("sr-only").text("Previous")))).append(e("<li/>").addClass("disabled").data("page","next").append(e('<a href="#" />').append(e("<span/>").attr("aria-hidden","true").html("&raquo;")).append(e("<span/>").addClass("sr-only").text("Next"))))))}function v(t){e("#search").on("keyup",function(){e.each(t.find("tr"),function(){var t=e(this).text().replace(/ /g,"").replace(/(\r\n|\n|\r)/gm,"");var n=e("#search").val();if(t.toLowerCase().indexOf(n.toLowerCase())==-1){e(this).hide().removeClass("search-item")}else{e(this).show().addClass("search-item")}if(n!=""){o=true}else{o=false}});m(t);d();g(t,1)})}function m(e){if(o){n=Math.round(e.children(".search-item").length/r)}else{n=Math.round(e.children("tr").length/r)}if(n==0){n=1}}function g(i,s){if(s=="next"){s=t+1}else if(s=="previous"){s=t-1}t=s;var u=o?i.find(".search-item"):i.find("tr");var a=r*s;var f=a-r;var l=e(".pagination");u.hide();u.slice(f,a).show();l.find("li").removeClass("active disabled");l.find("li:eq("+s+")").addClass("active");if(s==1){l.find("li:first").addClass("disabled")}else if(s==n){l.find("li:last").addClass("disabled")}}var c=e.extend({pageRowCount:10,arrowDown:"fa-angle-down",arrowUp:"fa-angle-up"},f);var h=null;return this.each(function(){s=e(this).addClass("bdt");h=s.find("tbody");r=c.pageRowCount;a=c.arrowDown;u=c.arrowUp;s.before(e("<form/>").addClass("pull-right").attr("role","form").append(e("<div/>").addClass("form-group").append(e("<input/>").addClass("form-control").attr("id","search").attr("placeholder","Search..."))));s.after(e("<div/>").attr("id","table-footer").append(e("<div/>").addClass("pull-left").append(e("<form/>").addClass("form-horizontal").attr("id","page-rows-form").append(e("<label/>").addClass("pull-left control-label").text("Entries per Page:")).append(e("<div/>").addClass("pull-left").append(e("<select/>").addClass("form-control").append(e("<option>",{value:5,text:5})).append(e("<option>",{value:10,text:10,selected:"selected"})).append(e("<option>",{value:15,text:15})).append(e("<option>",{value:20,text:20})).append(e("<option>",{value:25,text:25})))))));if(h.children("tr").length>r){m(h);d();g(h,t)}v(h);p(s,h);e("body").on("click",".pagination li",function(t){var n;if(e(t.target).is("a")){n=e(t.target).parent()}else{n=e(t.target).parent().parent()}var r=n.data("page");if(!n.hasClass("disabled")&&!n.hasClass("active")){g(h,r)}});e("#page-rows-form").on("change",function(){var t=e(this).find("select");r=t.val();m(h);d();g(h,1)})})}})(jQuery)

View File

@@ -0,0 +1,69 @@
/**
* jQuery.fn.sortElements
* --------------
* @author James Padolsey (http://james.padolsey.com)
* @version 0.11
* @updated 18-MAR-2010
* --------------
* @param Function comparator:
* Exactly the same behaviour as [1,2,3].sort(comparator)
*
* @param Function getSortable
* A function that should return the element that is
* to be sorted. The comparator will run on the
* current collection, but you may want the actual
* resulting sort to occur on a parent or another
* associated element.
*
* E.g. $('td').sortElements(comparator, function(){
* return this.parentNode;
* })
*
* The <td>'s parent (<tr>) will be sorted instead
* of the <td> itself.
*/
jQuery.fn.sortElements = (function(){
var sort = [].sort;
return function(comparator, getSortable) {
getSortable = getSortable || function(){return this;};
var placements = this.map(function(){
var sortElement = getSortable.call(this),
parentNode = sortElement.parentNode,
// Since the element itself will change position, we have
// to have some way of storing it's original position in
// the DOM. The easiest way is to have a 'flag' node:
nextSibling = parentNode.insertBefore(
document.createTextNode(''),
sortElement.nextSibling
);
return function() {
if (parentNode === this) {
throw new Error(
"You can't sort elements if any one is a descendant of another."
);
}
// Insert before flag:
parentNode.insertBefore(this, nextSibling);
// Remove flag:
parentNode.removeChild(nextSibling);
};
});
return sort.call(this, comparator).each(function(i){
placements[i].call(getSortable.call(this));
});
};
})();

View File

@@ -0,0 +1,195 @@
/* ========================================================================
* bootstrap-switch - v3.3.0
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
.bootstrap-switch {
display: inline-block;
direction: ltr;
cursor: pointer;
border-radius: 4px;
border: 1px solid;
border-color: #cccccc;
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
vertical-align: middle;
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.bootstrap-switch .bootstrap-switch-container {
display: inline-block;
top: 0;
border-radius: 4px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
display: inline-block !important;
height: 100%;
padding: 6px 12px;
font-size: 14px;
line-height: 20px;
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off {
text-align: center;
z-index: 1;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
color: #fff;
background: #428bca;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
color: #fff;
background: #5bc0de;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
color: #fff;
background: #5cb85c;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
background: #f0ad4e;
color: #fff;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
color: #fff;
background: #d9534f;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
color: #000;
background: #eeeeee;
}
.bootstrap-switch .bootstrap-switch-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
color: #333333;
background: #ffffff;
}
.bootstrap-switch .bootstrap-switch-handle-on {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch .bootstrap-switch-handle-off {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch input[type='radio'],
.bootstrap-switch input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
z-index: -1;
}
.bootstrap-switch input[type='radio'].form-control,
.bootstrap-switch input[type='checkbox'].form-control {
height: auto;
}
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
padding: 6px 16px;
font-size: 18px;
line-height: 1.33;
}
.bootstrap-switch.bootstrap-switch-disabled,
.bootstrap-switch.bootstrap-switch-readonly,
.bootstrap-switch.bootstrap-switch-indeterminate {
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
-webkit-transition: margin-left 0.5s;
transition: margin-left 0.5s;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-focused {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,698 @@
/* ========================================================================
* bootstrap-switch - v3.3.0
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
(function() {
var __slice = [].slice;
(function($, window) {
"use strict";
var BootstrapSwitch;
BootstrapSwitch = (function() {
function BootstrapSwitch(element, options) {
var initInterval;
if (options == null) {
options = {};
}
this.$element = $(element);
this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
state: this.$element.is(":checked"),
size: this.$element.data("size"),
animate: this.$element.data("animate"),
disabled: this.$element.is(":disabled"),
readonly: this.$element.is("[readonly]"),
indeterminate: this.$element.data("indeterminate"),
inverse: this.$element.data("inverse"),
radioAllOff: this.$element.data("radio-all-off"),
onColor: this.$element.data("on-color"),
offColor: this.$element.data("off-color"),
onText: this.$element.data("on-text"),
offText: this.$element.data("off-text"),
labelText: this.$element.data("label-text"),
handleWidth: this.$element.data("handle-width"),
labelWidth: this.$element.data("label-width"),
baseClass: this.$element.data("base-class"),
wrapperClass: this.$element.data("wrapper-class")
}, options);
this.$wrapper = $("<div>", {
"class": (function(_this) {
return function() {
var classes;
classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
classes.push(_this.options.state ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
if (_this.options.size != null) {
classes.push("" + _this.options.baseClass + "-" + _this.options.size);
}
if (_this.options.disabled) {
classes.push("" + _this.options.baseClass + "-disabled");
}
if (_this.options.readonly) {
classes.push("" + _this.options.baseClass + "-readonly");
}
if (_this.options.indeterminate) {
classes.push("" + _this.options.baseClass + "-indeterminate");
}
if (_this.options.inverse) {
classes.push("" + _this.options.baseClass + "-inverse");
}
if (_this.$element.attr("id")) {
classes.push("" + _this.options.baseClass + "-id-" + (_this.$element.attr("id")));
}
return classes.join(" ");
};
})(this)()
});
this.$container = $("<div>", {
"class": "" + this.options.baseClass + "-container"
});
this.$on = $("<span>", {
html: this.options.onText,
"class": "" + this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
});
this.$off = $("<span>", {
html: this.options.offText,
"class": "" + this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
});
this.$label = $("<span>", {
html: this.options.labelText,
"class": "" + this.options.baseClass + "-label"
});
this.$element.on("init.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onInit.apply(element, arguments);
};
})(this));
this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onSwitchChange.apply(element, arguments);
};
})(this));
this.$container = this.$element.wrap(this.$container).parent();
this.$wrapper = this.$container.wrap(this.$wrapper).parent();
this.$element.before(this.options.inverse ? this.$off : this.$on).before(this.$label).before(this.options.inverse ? this.$on : this.$off);
if (this.options.indeterminate) {
this.$element.prop("indeterminate", true);
}
initInterval = window.setInterval((function(_this) {
return function() {
if (_this.$wrapper.is(":visible")) {
_this._width();
_this._containerPosition(null, function() {
if (_this.options.animate) {
return _this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
});
return window.clearInterval(initInterval);
}
};
})(this), 50);
this._elementHandlers();
this._handleHandlers();
this._labelHandlers();
this._formHandler();
this._externalLabelHandler();
this.$element.trigger("init.bootstrapSwitch");
}
BootstrapSwitch.prototype._constructor = BootstrapSwitch;
BootstrapSwitch.prototype.state = function(value, skip) {
if (typeof value === "undefined") {
return this.options.state;
}
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.state && !this.options.radioAllOff && this.$element.is(":radio")) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
}
value = !!value;
this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
return this.$element;
};
BootstrapSwitch.prototype.toggleState = function(skip) {
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
return this.state(true);
} else {
return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
}
};
BootstrapSwitch.prototype.size = function(value) {
if (typeof value === "undefined") {
return this.options.size;
}
if (this.options.size != null) {
this.$wrapper.removeClass("" + this.options.baseClass + "-" + this.options.size);
}
if (value) {
this.$wrapper.addClass("" + this.options.baseClass + "-" + value);
}
this._width();
this._containerPosition();
this.options.size = value;
return this.$element;
};
BootstrapSwitch.prototype.animate = function(value) {
if (typeof value === "undefined") {
return this.options.animate;
}
value = !!value;
if (value === this.options.animate) {
return this.$element;
}
return this.toggleAnimate();
};
BootstrapSwitch.prototype.toggleAnimate = function() {
this.options.animate = !this.options.animate;
this.$wrapper.toggleClass("" + this.options.baseClass + "-animate");
return this.$element;
};
BootstrapSwitch.prototype.disabled = function(value) {
if (typeof value === "undefined") {
return this.options.disabled;
}
value = !!value;
if (value === this.options.disabled) {
return this.$element;
}
return this.toggleDisabled();
};
BootstrapSwitch.prototype.toggleDisabled = function() {
this.options.disabled = !this.options.disabled;
this.$element.prop("disabled", this.options.disabled);
this.$wrapper.toggleClass("" + this.options.baseClass + "-disabled");
return this.$element;
};
BootstrapSwitch.prototype.readonly = function(value) {
if (typeof value === "undefined") {
return this.options.readonly;
}
value = !!value;
if (value === this.options.readonly) {
return this.$element;
}
return this.toggleReadonly();
};
BootstrapSwitch.prototype.toggleReadonly = function() {
this.options.readonly = !this.options.readonly;
this.$element.prop("readonly", this.options.readonly);
this.$wrapper.toggleClass("" + this.options.baseClass + "-readonly");
return this.$element;
};
BootstrapSwitch.prototype.indeterminate = function(value) {
if (typeof value === "undefined") {
return this.options.indeterminate;
}
value = !!value;
if (value === this.options.indeterminate) {
return this.$element;
}
return this.toggleIndeterminate();
};
BootstrapSwitch.prototype.toggleIndeterminate = function() {
this.options.indeterminate = !this.options.indeterminate;
this.$element.prop("indeterminate", this.options.indeterminate);
this.$wrapper.toggleClass("" + this.options.baseClass + "-indeterminate");
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.inverse = function(value) {
if (typeof value === "undefined") {
return this.options.inverse;
}
value = !!value;
if (value === this.options.inverse) {
return this.$element;
}
return this.toggleInverse();
};
BootstrapSwitch.prototype.toggleInverse = function() {
var $off, $on;
this.$wrapper.toggleClass("" + this.options.baseClass + "-inverse");
$on = this.$on.clone(true);
$off = this.$off.clone(true);
this.$on.replaceWith($off);
this.$off.replaceWith($on);
this.$on = $off;
this.$off = $on;
this.options.inverse = !this.options.inverse;
return this.$element;
};
BootstrapSwitch.prototype.onColor = function(value) {
var color;
color = this.options.onColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$on.removeClass("" + this.options.baseClass + "-" + color);
}
this.$on.addClass("" + this.options.baseClass + "-" + value);
this.options.onColor = value;
return this.$element;
};
BootstrapSwitch.prototype.offColor = function(value) {
var color;
color = this.options.offColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$off.removeClass("" + this.options.baseClass + "-" + color);
}
this.$off.addClass("" + this.options.baseClass + "-" + value);
this.options.offColor = value;
return this.$element;
};
BootstrapSwitch.prototype.onText = function(value) {
if (typeof value === "undefined") {
return this.options.onText;
}
this.$on.html(value);
this._width();
this._containerPosition();
this.options.onText = value;
return this.$element;
};
BootstrapSwitch.prototype.offText = function(value) {
if (typeof value === "undefined") {
return this.options.offText;
}
this.$off.html(value);
this._width();
this._containerPosition();
this.options.offText = value;
return this.$element;
};
BootstrapSwitch.prototype.labelText = function(value) {
if (typeof value === "undefined") {
return this.options.labelText;
}
this.$label.html(value);
this._width();
this.options.labelText = value;
return this.$element;
};
BootstrapSwitch.prototype.handleWidth = function(value) {
if (typeof value === "undefined") {
return this.options.handleWidth;
}
this.options.handleWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.labelWidth = function(value) {
if (typeof value === "undefined") {
return this.options.labelWidth;
}
this.options.labelWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.baseClass = function(value) {
return this.options.baseClass;
};
BootstrapSwitch.prototype.wrapperClass = function(value) {
if (typeof value === "undefined") {
return this.options.wrapperClass;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.wrapperClass;
}
this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
this.$wrapper.addClass(this._getClasses(value).join(" "));
this.options.wrapperClass = value;
return this.$element;
};
BootstrapSwitch.prototype.radioAllOff = function(value) {
if (typeof value === "undefined") {
return this.options.radioAllOff;
}
value = !!value;
if (value === this.options.radioAllOff) {
return this.$element;
}
this.options.radioAllOff = value;
return this.$element;
};
BootstrapSwitch.prototype.onInit = function(value) {
if (typeof value === "undefined") {
return this.options.onInit;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onInit;
}
this.options.onInit = value;
return this.$element;
};
BootstrapSwitch.prototype.onSwitchChange = function(value) {
if (typeof value === "undefined") {
return this.options.onSwitchChange;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
}
this.options.onSwitchChange = value;
return this.$element;
};
BootstrapSwitch.prototype.destroy = function() {
var $form;
$form = this.$element.closest("form");
if ($form.length) {
$form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
}
this.$container.children().not(this.$element).remove();
this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
return this.$element;
};
BootstrapSwitch.prototype._width = function() {
var $handles, handleWidth;
$handles = this.$on.add(this.$off);
$handles.add(this.$label).css("width", "");
handleWidth = this.options.handleWidth === "auto" ? Math.max(this.$on.width(), this.$off.width()) : this.options.handleWidth;
$handles.width(handleWidth);
this.$label.width((function(_this) {
return function(index, width) {
if (_this.options.labelWidth !== "auto") {
return _this.options.labelWidth;
}
if (width < handleWidth) {
return handleWidth;
} else {
return width;
}
};
})(this));
this._handleWidth = this.$on.outerWidth();
this._labelWidth = this.$label.outerWidth();
this.$container.width((this._handleWidth * 2) + this._labelWidth);
return this.$wrapper.width(this._handleWidth + this._labelWidth);
};
BootstrapSwitch.prototype._containerPosition = function(state, callback) {
if (state == null) {
state = this.options.state;
}
this.$container.css("margin-left", (function(_this) {
return function() {
var values;
values = [0, "-" + _this._handleWidth + "px"];
if (_this.options.indeterminate) {
return "-" + (_this._handleWidth / 2) + "px";
}
if (state) {
if (_this.options.inverse) {
return values[1];
} else {
return values[0];
}
} else {
if (_this.options.inverse) {
return values[0];
} else {
return values[1];
}
}
};
})(this));
if (!callback) {
return;
}
return setTimeout(function() {
return callback();
}, 50);
};
BootstrapSwitch.prototype._elementHandlers = function() {
return this.$element.on({
"change.bootstrapSwitch": (function(_this) {
return function(e, skip) {
var state;
e.preventDefault();
e.stopImmediatePropagation();
state = _this.$element.is(":checked");
_this._containerPosition(state);
if (state === _this.options.state) {
return;
}
_this.options.state = state;
_this.$wrapper.toggleClass("" + _this.options.baseClass + "-off").toggleClass("" + _this.options.baseClass + "-on");
if (!skip) {
if (_this.$element.is(":radio")) {
$("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
}
}
return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
};
})(this),
"focus.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.addClass("" + _this.options.baseClass + "-focused");
};
})(this),
"blur.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.removeClass("" + _this.options.baseClass + "-focused");
};
})(this),
"keydown.bootstrapSwitch": (function(_this) {
return function(e) {
if (!e.which || _this.options.disabled || _this.options.readonly) {
return;
}
switch (e.which) {
case 37:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(false);
case 39:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(true);
}
};
})(this)
});
};
BootstrapSwitch.prototype._handleHandlers = function() {
this.$on.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(false);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
return this.$off.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(true);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
};
BootstrapSwitch.prototype._labelHandlers = function() {
return this.$label.on({
"mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
return function(e) {
if (_this._dragStart || _this.options.disabled || _this.options.readonly) {
return;
}
e.preventDefault();
e.stopPropagation();
_this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
if (_this.options.animate) {
_this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
}
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this),
"mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
return function(e) {
var difference;
if (_this._dragStart == null) {
return;
}
e.preventDefault();
difference = (e.pageX || e.originalEvent.touches[0].pageX) - _this._dragStart;
if (difference < -_this._handleWidth || difference > 0) {
return;
}
_this._dragEnd = difference;
return _this.$container.css("margin-left", "" + _this._dragEnd + "px");
};
})(this),
"mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
return function(e) {
var state;
if (!_this._dragStart) {
return;
}
e.preventDefault();
if (_this.options.animate) {
_this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
if (_this._dragEnd) {
state = _this._dragEnd > -(_this._handleWidth / 2);
_this._dragEnd = false;
_this.state(_this.options.inverse ? !state : state);
} else {
_this.state(!_this.options.state);
}
return _this._dragStart = false;
};
})(this),
"mouseleave.bootstrapSwitch": (function(_this) {
return function(e) {
return _this.$label.trigger("mouseup.bootstrapSwitch");
};
})(this)
});
};
BootstrapSwitch.prototype._externalLabelHandler = function() {
var $externalLabel;
$externalLabel = this.$element.closest("label");
return $externalLabel.on("click", (function(_this) {
return function(event) {
event.preventDefault();
event.stopImmediatePropagation();
if (event.target === $externalLabel[0]) {
return _this.toggleState();
}
};
})(this));
};
BootstrapSwitch.prototype._formHandler = function() {
var $form;
$form = this.$element.closest("form");
if ($form.data("bootstrap-switch")) {
return;
}
return $form.on("reset.bootstrapSwitch", function() {
return window.setTimeout(function() {
return $form.find("input").filter(function() {
return $(this).data("bootstrap-switch");
}).each(function() {
return $(this).bootstrapSwitch("state", this.checked);
});
}, 1);
}).data("bootstrap-switch", true);
};
BootstrapSwitch.prototype._getClasses = function(classes) {
var c, cls, _i, _len;
if (!$.isArray(classes)) {
return ["" + this.options.baseClass + "-" + classes];
}
cls = [];
for (_i = 0, _len = classes.length; _i < _len; _i++) {
c = classes[_i];
cls.push("" + this.options.baseClass + "-" + c);
}
return cls;
};
return BootstrapSwitch;
})();
$.fn.bootstrapSwitch = function() {
var args, option, ret;
option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
ret = this;
this.each(function() {
var $this, data;
$this = $(this);
data = $this.data("bootstrap-switch");
if (!data) {
$this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
}
if (typeof option === "string") {
return ret = data[option].apply(data, args);
}
});
return ret;
};
$.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
return $.fn.bootstrapSwitch.defaults = {
state: true,
size: null,
animate: true,
disabled: false,
readonly: false,
indeterminate: false,
inverse: false,
radioAllOff: false,
onColor: "primary",
offColor: "default",
onText: "ON",
offText: "OFF",
labelText: "&nbsp;",
handleWidth: "auto",
labelWidth: "auto",
baseClass: "bootstrap-switch",
wrapperClass: "wrapper",
onInit: function() {},
onSwitchChange: function() {}
};
})(window.jQuery, window);
}).call(this);

File diff suppressed because one or more lines are too long

9
include/rsvp-latest.min.js vendored Normal file

File diff suppressed because one or more lines are too long