integarting admin dashboard

This commit is contained in:
UronShrestha
2024-07-12 12:51:02 +05:45
parent 2510de390a
commit 1550ab5d30
1758 changed files with 313760 additions and 10 deletions

View File

@ -0,0 +1,171 @@
/*
* Rounded Rectangle Extension for Bar Charts and Horizontal Bar Charts
* Tested with Charts.js 2.7.0
*/
Chart.elements.Rectangle.prototype.draw = function() {
var ctx = this._chart.ctx;
var vm = this._view;
var left, right, top, bottom, signX, signY, borderSkipped, radius;
var borderWidth = vm.borderWidth;
// If radius is less than 0 or is large enough to cause drawing errors a max
// radius is imposed. If cornerRadius is not defined set it to 0.
var cornerRadius = this._chart.config.options.cornerRadius;
if(cornerRadius < 0){ cornerRadius = 0; }
if(typeof cornerRadius == 'undefined'){ cornerRadius = 0; }
if (!vm.horizontal) {
// bar
left = vm.x - vm.width / 2;
right = vm.x + vm.width / 2;
top = vm.y;
bottom = vm.base;
signX = 1;
signY = bottom > top? 1: -1;
borderSkipped = vm.borderSkipped || 'bottom';
} else {
// horizontal bar
left = vm.base;
right = vm.x;
top = vm.y - vm.height / 2;
bottom = vm.y + vm.height / 2;
signX = right > left? 1: -1;
signY = 1;
borderSkipped = vm.borderSkipped || 'left';
}
// Canvas doesn't allow us to stroke inside the width so we can
// adjust the sizes to fit if we're setting a stroke on the line
if (borderWidth) {
// borderWidth shold be less than bar width and bar height.
var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));
borderWidth = borderWidth > barSize? barSize: borderWidth;
var halfStroke = borderWidth / 2;
// Adjust borderWidth when bar top position is near vm.base(zero).
var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0);
var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0);
var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0);
var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0);
// not become a vertical line?
if (borderLeft !== borderRight) {
top = borderTop;
bottom = borderBottom;
}
// not become a horizontal line?
if (borderTop !== borderBottom) {
left = borderLeft;
right = borderRight;
}
}
ctx.beginPath();
ctx.fillStyle = vm.backgroundColor;
ctx.strokeStyle = vm.borderColor;
ctx.lineWidth = borderWidth;
// Corner points, from bottom-left to bottom-right clockwise
// | 1 2 |
// | 0 3 |
var corners = [
[left, bottom],
[left, top],
[right, top],
[right, bottom]
];
// Find first (starting) corner with fallback to 'bottom'
var borders = ['bottom', 'left', 'top', 'right'];
var startCorner = borders.indexOf(borderSkipped, 0);
if (startCorner === -1) {
startCorner = 0;
}
function cornerAt(index) {
return corners[(startCorner + index) % 4];
}
// Draw rectangle from 'startCorner'
var corner = cornerAt(0);
ctx.moveTo(corner[0], corner[1]);
for (var i = 1; i < 4; i++) {
corner = cornerAt(i);
nextCornerId = i+1;
if(nextCornerId == 4){
nextCornerId = 0
}
nextCorner = cornerAt(nextCornerId);
width = corners[2][0] - corners[1][0];
height = corners[0][1] - corners[1][1];
x = corners[1][0];
y = corners[1][1];
var radius = cornerRadius;
// Fix radius being too large
if(radius > Math.abs(height)/2){
radius = Math.floor(Math.abs(height)/2);
}
if(radius > Math.abs(width)/2){
radius = Math.floor(Math.abs(width)/2);
}
if(height < 0){
// Negative values in a standard bar chart
x_tl = x; x_tr = x+width;
y_tl = y+height; y_tr = y+height;
x_bl = x; x_br = x+width;
y_bl = y; y_br = y;
// Draw
ctx.moveTo(x_bl+radius, y_bl);
ctx.lineTo(x_br-radius, y_br);
ctx.quadraticCurveTo(x_br, y_br, x_br, y_br-radius);
ctx.lineTo(x_tr, y_tr+radius);
ctx.quadraticCurveTo(x_tr, y_tr, x_tr-radius, y_tr);
ctx.lineTo(x_tl+radius, y_tl);
ctx.quadraticCurveTo(x_tl, y_tl, x_tl, y_tl+radius);
ctx.lineTo(x_bl, y_bl-radius);
ctx.quadraticCurveTo(x_bl, y_bl, x_bl+radius, y_bl);
}else if(width < 0){
// Negative values in a horizontal bar chart
x_tl = x+width; x_tr = x;
y_tl= y; y_tr = y;
x_bl = x+width; x_br = x;
y_bl = y+height; y_br = y+height;
// Draw
ctx.moveTo(x_bl+radius, y_bl);
ctx.lineTo(x_br-radius, y_br);
ctx.quadraticCurveTo(x_br, y_br, x_br, y_br-radius);
ctx.lineTo(x_tr, y_tr+radius);
ctx.quadraticCurveTo(x_tr, y_tr, x_tr-radius, y_tr);
ctx.lineTo(x_tl+radius, y_tl);
ctx.quadraticCurveTo(x_tl, y_tl, x_tl, y_tl+radius);
ctx.lineTo(x_bl, y_bl-radius);
ctx.quadraticCurveTo(x_bl, y_bl, x_bl+radius, y_bl);
}else{
//Positive Value
ctx.moveTo(x + radius, y);
ctx.lineTo(x + width - radius, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
ctx.lineTo(x + width, y + height - radius);
ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
ctx.lineTo(x + radius, y + height);
ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
ctx.lineTo(x, y + radius);
ctx.quadraticCurveTo(x, y, x + radius, y);
}
}
ctx.fill();
if (borderWidth) {
ctx.stroke();
}
};

View File

@ -0,0 +1,7 @@
(function($) {
'use strict';
var editor = ace.edit("aceExample");
editor.setTheme("ace/theme/chaos");
editor.getSession().setMode("ace/mode/javascript");
document.getElementById('aceExample').style.fontSize = '1rem';
})(jQuery);

View File

@ -0,0 +1,102 @@
(function($) {
showSwal = function(type) {
'use strict';
if (type === 'basic') {
swal({
text: 'Any fool can use a computer',
button: {
text: "OK",
value: true,
visible: true,
className: "btn btn-primary"
}
})
} else if (type === 'title-and-text') {
swal({
title: 'Read the alert!',
text: 'Click OK to close this alert',
button: {
text: "OK",
value: true,
visible: true,
className: "btn btn-primary"
}
})
} else if (type === 'success-message') {
swal({
title: 'Congratulations!',
text: 'You entered the correct answer',
icon: 'success',
button: {
text: "Continue",
value: true,
visible: true,
className: "btn btn-primary"
}
})
} else if (type === 'auto-close') {
swal({
title: 'Auto close alert!',
text: 'I will close in 2 seconds.',
timer: 2000,
button: false
}).then(
function() {},
// handling the promise rejection
function(dismiss) {
if (dismiss === 'timer') {
console.log('I was closed by the timer')
}
}
)
} else if (type === 'warning-message-and-cancel') {
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3f51b5',
cancelButtonColor: '#ff4081',
confirmButtonText: 'Great ',
buttons: {
cancel: {
text: "Cancel",
value: null,
visible: true,
className: "btn btn-danger",
closeModal: true,
},
confirm: {
text: "OK",
value: true,
visible: true,
className: "btn btn-primary",
closeModal: true
}
}
})
} else if (type === 'custom-html') {
swal({
content: {
element: "input",
attributes: {
placeholder: "Type your password",
type: "password",
class: 'form-control'
},
},
button: {
text: "OK",
value: true,
visible: true,
className: "btn btn-primary"
}
})
}
}
})(jQuery);

View File

@ -0,0 +1,21 @@
(function($) {
'use strict';
$(function() {
$('#show').avgrund({
height: 500,
holderClass: 'custom',
showClose: true,
showCloseText: 'x',
onBlurContainer: '.container-scroller',
template: '<p>So implement your design and place content here! If you want to close modal, please hit "Esc", click somewhere on the screen or use special button.</p>' +
'<div>' +
'<a href="http://twitter.com/voronianski" target="_blank" class="twitter btn btn-twitter btn-block">Twitter</a>' +
'<a href="http://dribbble.com/voronianski" target="_blank" class="dribble btn btn-dribbble btn-block">Dribbble</a>' +
'</div>' +
'<div class="text-center mt-4">' +
'<a href="#" target="_blank" class="btn btn-success mr-2">Great!</a>' +
'<a href="#" target="_blank" class="btn btn-light">Cancel</a>' +
'</div>'
});
})
})(jQuery);

66
public/Dashboard/js/bootstrap-table.js vendored Normal file
View File

@ -0,0 +1,66 @@
(function($) {
'use strict';
function monthSorter(a, b) {
if (a.month < b.month) return -1;
if (a.month > b.month) return 1;
return 0;
}
function buildTable($el, cells, rows) {
var i, j, row,
columns = [],
data = [];
for (i = 0; i < cells; i++) {
columns.push({
field: 'field' + i,
title: 'Cell' + i
});
}
for (i = 0; i < rows; i++) {
row = {};
for (j = 0; j < cells; j++) {
row['field' + j] = 'Row-' + i + '-' + j;
}
data.push(row);
}
$el.bootstrapTable('destroy').bootstrapTable({
columns: columns,
data: data
});
}
$(function() {
buildTable($('#table'), 50, 50);
});
function actionFormatter(value, row, index) {
return [
'<a class="like" href="javascript:void(0)" title="Like">',
'<i class="glyphicon glyphicon-heart"></i>',
'</a>',
'<a class="edit ml10" href="javascript:void(0)" title="Edit">',
'<i class="glyphicon glyphicon-edit"></i>',
'</a>',
'<a class="remove ml10" href="javascript:void(0)" title="Remove">',
'<i class="glyphicon glyphicon-remove"></i>',
'</a>'
].join('');
}
window.actionEvents = {
'click .like': function(e, value, row, index) {
alert('You click like icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .edit': function(e, value, row, index) {
alert('You click edit icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
},
'click .remove': function(e, value, row, index) {
alert('You click remove icon, row: ' + JSON.stringify(row));
console.log(value, row, index);
}
};
})(jQuery);

View File

@ -0,0 +1,31 @@
(function($) {
'use strict';
$('#defaultconfig').maxlength({
warningClass: "badge mt-1 badge-success",
limitReachedClass: "badge mt-1 badge-danger"
});
$('#defaultconfig-2').maxlength({
alwaysShow: true,
threshold: 20,
warningClass: "badge mt-1 badge-success",
limitReachedClass: "badge mt-1 badge-danger"
});
$('#defaultconfig-3').maxlength({
alwaysShow: true,
threshold: 10,
warningClass: "badge mt-1 badge-success",
limitReachedClass: "badge mt-1 badge-danger",
separator: ' of ',
preText: 'You have ',
postText: ' chars remaining.',
validate: true
});
$('#maxlength-textarea').maxlength({
alwaysShow: true,
warningClass: "badge mt-1 badge-success",
limitReachedClass: "badge mt-1 badge-danger"
});
})(jQuery);

218
public/Dashboard/js/c3.js Normal file
View File

@ -0,0 +1,218 @@
(function($) {
'use strict';
var c3LineChart = c3.generate({
bindto: '#c3-line-chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
},
color: {
pattern: ['rgba(88,216,163,1)', 'rgba(237,28,36,0.6)', 'rgba(4,189,254,0.6)']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
}
});
setTimeout(function() {
c3LineChart.load({
columns: [
['data1', 230, 190, 300, 500, 300, 400]
]
});
}, 1000);
setTimeout(function() {
c3LineChart.load({
columns: [
['data3', 130, 150, 200, 300, 200, 100]
]
});
}, 1500);
setTimeout(function() {
c3LineChart.unload({
ids: 'data1'
});
}, 2000);
var c3SplineChart = c3.generate({
bindto: '#c3-spline-chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 50]
],
type: 'spline'
},
color: {
pattern: ['rgba(88,216,163,1)', 'rgba(237,28,36,0.6)', 'rgba(4,189,254,0.6)']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
}
});
var c3BarChart = c3.generate({
bindto: '#c3-bar-chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 130, 100, 140, 200, 150, 50]
],
type: 'bar'
},
color: {
pattern: ['rgba(88,216,163,1)', 'rgba(4,189,254,0.6)', 'rgba(237,28,36,0.6)']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
},
bar: {
width: {
ratio: 0.7 // this makes bar width 50% of length between ticks
}
}
});
setTimeout(function() {
c3BarChart.load({
columns: [
['data3', 130, -150, 200, 300, -200, 100]
]
});
}, 1000);
var c3StepChart = c3.generate({
bindto: '#c3-step-chart',
data: {
columns: [
['data1', 300, 350, 300, 0, 0, 100],
['data2', 130, 100, 140, 200, 150, 50]
],
types: {
data1: 'step',
data2: 'area-step'
}
},
color: {
pattern: ['rgba(88,216,163,1)', 'rgba(4,189,254,0.6)', 'rgba(237,28,36,0.6)']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
}
});
var c3PieChart = c3.generate({
bindto: '#c3-pie-chart',
data: {
// iris data from R
columns: [
['data1', 30],
['data2', 120],
],
type: 'pie',
onclick: function(d, i) {
console.log("onclick", d, i);
},
onmouseover: function(d, i) {
console.log("onmouseover", d, i);
},
onmouseout: function(d, i) {
console.log("onmouseout", d, i);
}
},
color: {
pattern: ['#6153F9', '#8E97FC', '#A7B3FD']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
}
});
setTimeout(function() {
c3PieChart.load({
columns: [
["Income", 0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.4, 0.4, 0.3, 0.3, 0.3, 0.2, 0.4, 0.2, 0.5, 0.2, 0.2, 0.4, 0.2, 0.2, 0.2, 0.2, 0.4, 0.1, 0.2, 0.2, 0.2, 0.2, 0.1, 0.2, 0.2, 0.3, 0.3, 0.2, 0.6, 0.4, 0.3, 0.2, 0.2, 0.2, 0.2],
["Outcome", 1.4, 1.5, 1.5, 1.3, 1.5, 1.3, 1.6, 1.0, 1.3, 1.4, 1.0, 1.5, 1.0, 1.4, 1.3, 1.4, 1.5, 1.0, 1.5, 1.1, 1.8, 1.3, 1.5, 1.2, 1.3, 1.4, 1.4, 1.7, 1.5, 1.0, 1.1, 1.0, 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2, 1.4, 1.2, 1.0, 1.3, 1.2, 1.3, 1.3, 1.1, 1.3],
["Revenue", 2.5, 1.9, 2.1, 1.8, 2.2, 2.1, 1.7, 1.8, 1.8, 2.5, 2.0, 1.9, 2.1, 2.0, 2.4, 2.3, 1.8, 2.2, 2.3, 1.5, 2.3, 2.0, 2.0, 1.8, 2.1, 1.8, 1.8, 1.8, 2.1, 1.6, 1.9, 2.0, 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9, 2.3, 2.5, 2.3, 1.9, 2.0, 2.3, 1.8],
]
});
}, 1500);
setTimeout(function() {
c3PieChart.unload({
ids: 'data1'
});
c3PieChart.unload({
ids: 'data2'
});
}, 2500);
var c3DonutChart = c3.generate({
bindto: '#c3-donut-chart',
data: {
columns: [
['data1', 30],
['data2', 120],
],
type: 'donut',
onclick: function(d, i) {
console.log("onclick", d, i);
},
onmouseover: function(d, i) {
console.log("onmouseover", d, i);
},
onmouseout: function(d, i) {
console.log("onmouseout", d, i);
}
},
color: {
pattern: ['rgba(88,216,163,1)', 'rgba(4,189,254,0.6)', 'rgba(237,28,36,0.6)']
},
padding: {
top: 0,
right: 0,
bottom: 30,
left: 0,
},
donut: {
title: "Iris Petal Width"
}
});
setTimeout(function() {
c3DonutChart.load({
columns: [
["setosa", 0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0.2, 0.2, 0.1, 0.1, 0.2, 0.4, 0.4, 0.3, 0.3, 0.3, 0.2, 0.4, 0.2, 0.5, 0.2, 0.2, 0.4, 0.2, 0.2, 0.2, 0.2, 0.4, 0.1, 0.2, 0.2, 0.2, 0.2, 0.1, 0.2, 0.2, 0.3, 0.3, 0.2, 0.6, 0.4, 0.3, 0.2, 0.2, 0.2, 0.2],
["versicolor", 1.4, 1.5, 1.5, 1.3, 1.5, 1.3, 1.6, 1.0, 1.3, 1.4, 1.0, 1.5, 1.0, 1.4, 1.3, 1.4, 1.5, 1.0, 1.5, 1.1, 1.8, 1.3, 1.5, 1.2, 1.3, 1.4, 1.4, 1.7, 1.5, 1.0, 1.1, 1.0, 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2, 1.4, 1.2, 1.0, 1.3, 1.2, 1.3, 1.3, 1.1, 1.3],
["virginica", 2.5, 1.9, 2.1, 1.8, 2.2, 2.1, 1.7, 1.8, 1.8, 2.5, 2.0, 1.9, 2.1, 2.0, 2.4, 2.3, 1.8, 2.2, 2.3, 1.5, 2.3, 2.0, 2.0, 1.8, 2.1, 1.8, 1.8, 1.8, 2.1, 1.6, 1.9, 2.0, 2.2, 1.5, 1.4, 2.3, 2.4, 1.8, 1.8, 2.1, 2.4, 2.3, 1.9, 2.3, 2.5, 2.3, 1.9, 2.0, 2.3, 1.8],
]
});
}, 1500);
setTimeout(function() {
c3DonutChart.unload({
ids: 'data1'
});
c3DonutChart.unload({
ids: 'data2'
});
}, 2500);
})(jQuery);

View File

@ -0,0 +1,73 @@
(function($) {
'use strict';
$(function() {
if ($('#calendar').length) {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultDate: '2017-07-12',
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [{
title: 'All Day Event',
start: '2017-07-08'
},
{
title: 'Long Event',
start: '2017-07-01',
end: '2017-07-07'
},
{
id: 999,
title: 'Repeating Event',
start: '2017-07-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2017-07-16T16:00:00'
},
{
title: 'Conference',
start: '2017-07-11',
end: '2017-07-13'
},
{
title: 'Meeting',
start: '2017-07-12T10:30:00',
end: '2017-07-12T12:30:00'
},
{
title: 'Lunch',
start: '2017-07-12T12:00:00'
},
{
title: 'Meeting',
start: '2017-07-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2017-07-12T17:30:00'
},
{
title: 'Dinner',
start: '2017-07-12T20:00:00'
},
{
title: 'Birthday Party',
start: '2017-07-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2017-07-28'
}
]
})
}
});
})(jQuery);

View File

@ -0,0 +1,352 @@
$(function() {
/* ChartJS
* -------
* Data and config for chartjs
*/
'use strict';
var data = {
labels: ["2013", "2014", "2014", "2015", "2016", "2017"],
datasets: [{
label: '# of Votes',
data: [10, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1,
fill: false
}]
};
var multiLineData = {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: 'Dataset 1',
data: [12, 19, 3, 5, 2, 3],
borderColor: [
'#587ce4'
],
borderWidth: 2,
fill: false
},
{
label: 'Dataset 2',
data: [5, 23, 7, 12, 42, 23],
borderColor: [
'#ede190'
],
borderWidth: 2,
fill: false
},
{
label: 'Dataset 3',
data: [15, 10, 21, 32, 12, 33],
borderColor: [
'#f44252'
],
borderWidth: 2,
fill: false
}
]
};
var options = {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
},
legend: {
display: false
},
elements: {
point: {
radius: 0
}
}
};
var doughnutPieData = {
datasets: [{
data: [30, 40, 30],
backgroundColor: [
'rgba(255, 99, 132, 0.5)',
'rgba(54, 162, 235, 0.5)',
'rgba(255, 206, 86, 0.5)',
'rgba(75, 192, 192, 0.5)',
'rgba(153, 102, 255, 0.5)',
'rgba(255, 159, 64, 0.5)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
}],
// These labels appear in the legend and in the tooltips when hovering different arcs
labels: [
'Pink',
'Blue',
'Yellow',
]
};
var doughnutPieOptions = {
responsive: true,
animation: {
animateScale: true,
animateRotate: true
}
};
var areaData = {
labels: ["2013", "2014", "2015", "2016", "2017"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1,
fill: true, // 3: no fill
}]
};
var areaOptions = {
plugins: {
filler: {
propagate: true
}
}
}
var multiAreaData = {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [{
label: 'Facebook',
data: [8, 11, 13, 15, 12, 13, 16, 15, 13, 19, 11, 14],
borderColor: ['rgba(255, 99, 132, 0.5)'],
backgroundColor: ['rgba(255, 99, 132, 0.5)'],
borderWidth: 1,
fill: true
},
{
label: 'Twitter',
data: [7, 17, 12, 16, 14, 18, 16, 12, 15, 11, 13, 9],
borderColor: ['rgba(54, 162, 235, 0.5)'],
backgroundColor: ['rgba(54, 162, 235, 0.5)'],
borderWidth: 1,
fill: true
},
{
label: 'Linkedin',
data: [6, 14, 16, 20, 12, 18, 15, 12, 17, 19, 15, 11],
borderColor: ['rgba(255, 206, 86, 0.5)'],
backgroundColor: ['rgba(255, 206, 86, 0.5)'],
borderWidth: 1,
fill: true
}
]
};
var multiAreaOptions = {
plugins: {
filler: {
propagate: true
}
},
elements: {
point: {
radius: 0
}
},
scales: {
xAxes: [{
gridLines: {
display: false
}
}],
yAxes: [{
gridLines: {
display: false
}
}]
}
}
var scatterChartData = {
datasets: [{
label: 'First Dataset',
data: [{
x: -10,
y: 0
},
{
x: 0,
y: 3
},
{
x: -25,
y: 5
},
{
x: 40,
y: 5
}
],
backgroundColor: [
'rgba(255, 99, 132, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)'
],
borderWidth: 1
},
{
label: 'Second Dataset',
data: [{
x: 10,
y: 5
},
{
x: 20,
y: -30
},
{
x: -25,
y: 15
},
{
x: -10,
y: 5
}
],
backgroundColor: [
'rgba(54, 162, 235, 0.2)',
],
borderColor: [
'rgba(54, 162, 235, 1)',
],
borderWidth: 1
}
]
}
var scatterChartOptions = {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
}
// Get context with jQuery - using jQuery's .get() method.
if ($("#barChart").length) {
var barChartCanvas = $("#barChart").get(0).getContext("2d");
// This will get the first returned node in the jQuery collection.
var barChart = new Chart(barChartCanvas, {
type: 'bar',
data: data,
options: options
});
}
if ($("#lineChart").length) {
var lineChartCanvas = $("#lineChart").get(0).getContext("2d");
var lineChart = new Chart(lineChartCanvas, {
type: 'line',
data: data,
options: options
});
}
if ($("#linechart-multi").length) {
var multiLineCanvas = $("#linechart-multi").get(0).getContext("2d");
var lineChart = new Chart(multiLineCanvas, {
type: 'line',
data: multiLineData,
options: options
});
}
if ($("#areachart-multi").length) {
var multiAreaCanvas = $("#areachart-multi").get(0).getContext("2d");
var multiAreaChart = new Chart(multiAreaCanvas, {
type: 'line',
data: multiAreaData,
options: multiAreaOptions
});
}
if ($("#doughnutChart").length) {
var doughnutChartCanvas = $("#doughnutChart").get(0).getContext("2d");
var doughnutChart = new Chart(doughnutChartCanvas, {
type: 'doughnut',
data: doughnutPieData,
options: doughnutPieOptions
});
}
if ($("#pieChart").length) {
var pieChartCanvas = $("#pieChart").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas, {
type: 'pie',
data: doughnutPieData,
options: doughnutPieOptions
});
}
if ($("#areaChart").length) {
var areaChartCanvas = $("#areaChart").get(0).getContext("2d");
var areaChart = new Chart(areaChartCanvas, {
type: 'line',
data: areaData,
options: areaOptions
});
}
if ($("#scatterChart").length) {
var scatterChartCanvas = $("#scatterChart").get(0).getContext("2d");
var scatterChart = new Chart(scatterChartCanvas, {
type: 'scatter',
data: scatterChartData,
options: scatterChartOptions
});
}
if ($("#browserTrafficChart").length) {
var doughnutChartCanvas = $("#browserTrafficChart").get(0).getContext("2d");
var doughnutChart = new Chart(doughnutChartCanvas, {
type: 'doughnut',
data: browserTrafficData,
options: doughnutPieOptions
});
}
});

View File

@ -0,0 +1,217 @@
(function($) {
//simple line
'use strict';
if ($('#ct-chart-line').length) {
new Chartist.Line('#ct-chart-line', {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
series: [
[12, 9, 7, 8, 5],
[2, 1, 3.5, 7, 3],
[1, 3, 4, 5, 6]
]
}, {
fullWidth: true,
chartPadding: {
right: 40
}
});
}
//Line scatterer
var times = function(n) {
return Array.apply(null, new Array(n));
};
var data = times(52).map(Math.random).reduce(function(data, rnd, index) {
data.labels.push(index + 1);
for (var i = 0; i < data.series.length; i++) {
data.series[i].push(Math.random() * 100)
}
return data;
}, {
labels: [],
series: times(4).map(function() {
return new Array()
})
});
var options = {
showLine: false,
axisX: {
labelInterpolationFnc: function(value, index) {
return index % 13 === 0 ? 'W' + value : null;
}
}
};
var responsiveOptions = [
['screen and (min-width: 640px)', {
axisX: {
labelInterpolationFnc: function(value, index) {
return index % 4 === 0 ? 'W' + value : null;
}
}
}]
];
if ($('#ct-chart-line-scatterer').length) {
new Chartist.Line('#ct-chart-line-scatterer', data, options, responsiveOptions);
}
//Stacked bar Chart
if ($('#ct-chart-stacked-bar').length) {
new Chartist.Bar('#ct-chart-stacked-bar', {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
series: [
['800000', '1200000', '1400000', '1300000'],
['200000', '400000', '500000', '300000'],
['100000', '200000', '400000', '600000'],
['400000', '600000', '200000', '0000']
]
}, {
stackBars: true,
axisY: {
labelInterpolationFnc: function(value) {
return (value / 1000) + 'k';
}
}
}).on('draw', function(data) {
if (data.type === 'bar') {
data.element.attr({
style: 'stroke-width: 30px'
});
}
});
}
//Horizontal bar chart
if ($('#ct-chart-horizontal-bar').length) {
new Chartist.Bar('#ct-chart-horizontal-bar', {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
series: [
[5, 4, 3, 7, 5, 10, 3],
[3, 2, 9, 5, 4, 6, 4],
[2, 6, 7, 1, 3, 5, 9],
[2, 6, 7, 1, 3, 5, 19],
]
}, {
seriesBarDistance: 10,
reverseData: true,
horizontalBars: true,
axisY: {
offset: 20
},
axisX: {
labelOffset: {
x: 0,
y: 6
},
},
chartPadding: {
left: 20,
bottom: 20
}
});
}
//Pie
if ($('#ct-chart-pie').length) {
var data = {
series: [5, 3, 4]
};
var sum = function(a, b) {
return a + b
};
new Chartist.Pie('#ct-chart-pie', data, {
labelInterpolationFnc: function(value) {
return Math.round(value / data.series.reduce(sum) * 100) + '%';
}
});
}
//Donut
var labels = ['safari', 'chrome', 'explorer', 'firefox'];
var data = {
series: [20, 40, 10, 30]
};
if ($('#ct-chart-donut').length) {
new Chartist.Pie('#ct-chart-donut', data, {
donut: true,
donutWidth: 60,
donutSolid: true,
startAngle: 270,
showLabel: true,
labelInterpolationFnc: function(value, index) {
var percentage = Math.round(value / data.series.reduce(sum) * 100) + '%';
return labels[index] + ' ' + percentage;
}
});
}
//Dashboard Tickets Chart
if ($('#ct-chart-dash-barChart').length) {
new Chartist.Bar('#ct-chart-dash-barChart', {
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
series: [
[300, 140, 230, 140],
[323, 529, 644, 230],
[734, 539, 624, 334],
]
}, {
stackBars: true,
axisY: {
labelInterpolationFnc: function(value) {
return (value / 100) + 'k';
}
}
}).on('draw', function(data) {
if (data.type === 'bar') {
data.element.attr({
style: 'stroke-width: 50px'
});
}
});
}
//dashboard staked bar chart
if ($('#ct-chart-vartical-stacked-bar').length) {
new Chartist.Bar('#ct-chart-vartical-stacked-bar', {
labels: ['J', 'F', 'M', 'A', 'M', 'J', 'A'],
series: [{
"name": "Income",
"data": [8, 4, 6, 3, 7, 3, 8]
},
{
"name": "Outcome",
"data": [2, 7, 4, 8, 4, 6, 1]
},
{
"name": "Revenue",
"data": [4, 3, 3, 6, 7, 2, 4]
}
]
}, {
seriesBarDistance: 10,
reverseData: true,
horizontalBars: false,
height: '280px',
fullWidth: true,
chartPadding: {
top: 30,
left: 0,
right: 0,
bottom: 0
},
plugins: [
Chartist.plugins.legend()
]
});
}
})(jQuery);

View File

@ -0,0 +1,8 @@
(function($) {
'use strict';
if ($(".circle-progress-1").length) {
$('.circle-progress-1').circleProgress({}).on('circle-animation-progress', function(event, progress, stepValue) {
$(this).find('.value').html(Math.round(100 * stepValue.toFixed(2).substr(1)) + '<i>%</i>');
});
}
})(jQuery);

View File

@ -0,0 +1,10 @@
(function($) {
'use strict';
var clipboard = new ClipboardJS('.btn-clipboard');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
})(jQuery);

View File

@ -0,0 +1,121 @@
(function($) {
'use strict';
if ($('textarea[name=code-editable]').length) {
var editableCodeMirror = CodeMirror.fromTextArea(document.getElementById('code-editable'), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true
});
}
if ($('#code-readonly').length) {
var readOnlyCodeMirror = CodeMirror.fromTextArea(document.getElementById('code-readonly'), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true,
readOnly: "true"
});
}
if ($('#cm-js-mode').length) {
var cm = CodeMirror(document.getElementById("cm-js-mode"), {
mode: "javascript",
lineNumbers: true
});
}
//Use this method of there are multiple codes with same properties
if ($('.multiple-codes').length) {
var code_type = '';
var editorTextarea = $('.multiple-codes');
for (var i = 0; i < editorTextarea.length; i++) {
$(editorTextarea[i]).attr('id', 'code-' + i);
CodeMirror.fromTextArea(document.getElementById('code-' + i), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true,
readOnly: "true",
maxHighlightLength: 0,
workDelay: 0
});
}
}
//Use this method of there are multiple codes with same properties in shell mode
if ($('.shell-mode').length) {
var code_type = '';
var shellEditor = $('.shell-mode');
for (var i = 0; i < shellEditor.length; i++) {
$(shellEditor[i]).attr('id', 'code-' + i);
CodeMirror.fromTextArea(document.getElementById('code-' + i), {
mode: "shell",
theme: "ambiance",
readOnly: "true",
maxHighlightLength: 0,
workDelay: 0
});
}
}
if ($('#ace_html').length) {
$(function() {
var editor = ace.edit("ace_html");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/html");
document.getElementById('ace_html');
});
}
if ($('#ace_javaScript').length) {
$(function() {
var editor = ace.edit("ace_javaScript");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
document.getElementById('aceExample');
});
}
if ($('#ace_json').length) {
$(function() {
var editor = ace.edit("ace_json");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/json");
document.getElementById('ace_json');
});
}
if ($('#ace_css').length) {
$(function() {
var editor = ace.edit("ace_css");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/css");
document.getElementById('ace_css');
});
}
if ($('#ace_scss').length) {
$(function() {
var editor = ace.edit("ace_scss");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/scss");
document.getElementById('ace_scss');
});
}
if ($('#ace_php').length) {
$(function() {
var editor = ace.edit("ace_php");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/php");
document.getElementById('ace_php');
});
}
if ($('#ace_ruby').length) {
$(function() {
var editor = ace.edit("ace_ruby");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/ruby");
document.getElementById('ace_ruby');
});
}
if ($('#ace_coffee').length) {
$(function() {
var editor = ace.edit("ace_coffee");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/coffee");
document.getElementById('ace_coffee');
});
}
})(jQuery);

View File

@ -0,0 +1,51 @@
(function($) {
'use strict';
if ($('textarea[name=code-editable]').length) {
var editableCodeMirror = CodeMirror.fromTextArea(document.getElementById('code-editable'), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true
});
}
if ($('#code-readonly').length) {
var readOnlyCodeMirror = CodeMirror.fromTextArea(document.getElementById('code-readonly'), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true,
readOnly: "nocursor"
});
}
//Use this method of there are multiple codes with same properties
if ($('.multiple-codes').length) {
var code_type = '';
var editorTextarea = $('.multiple-codes');
for (var i = 0; i < editorTextarea.length; i++) {
$(editorTextarea[i]).attr('id', 'code-' + i);
CodeMirror.fromTextArea(document.getElementById('code-' + i), {
mode: "javascript",
theme: "ambiance",
lineNumbers: true,
readOnly: "nocursor",
maxHighlightLength: 0,
workDelay: 0
});
}
}
//Use this method of there are multiple codes with same properties in shell mode
if ($('.shell-mode').length) {
var code_type = '';
var shellEditor = $('.shell-mode');
for (var i = 0; i < shellEditor.length; i++) {
$(shellEditor[i]).attr('id', 'code-' + i);
CodeMirror.fromTextArea(document.getElementById('code-' + i), {
mode: "shell",
theme: "ambiance",
readOnly: "nocursor",
maxHighlightLength: 0,
workDelay: 0
});
}
}
})(jQuery);

View File

@ -0,0 +1,240 @@
(function($) {
'use strict';
$.contextMenu({
selector: '#context-menu-simple',
callback: function(key, options) {},
items: {
"edit": {
name: "Edit",
icon: "edit"
},
"cut": {
name: "Cut",
icon: "cut"
},
copy: {
name: "Copy",
icon: "copy"
},
"paste": {
name: "Paste",
icon: "paste"
},
"delete": {
name: "Delete",
icon: "delete"
},
"sep1": "---------",
"quit": {
name: "Quit",
icon: function() {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$.contextMenu({
selector: '#context-menu-access',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Edit",
icon: "edit",
accesskey: "e"
},
"cut": {
name: "Cut",
icon: "cut",
accesskey: "c"
},
// first unused character is taken (here: o)
"copy": {
name: "Copy",
icon: "copy",
accesskey: "c o p y"
},
// words are truncated to their first letter (here: p)
"paste": {
name: "Paste",
icon: "paste",
accesskey: "cool paste"
},
"delete": {
name: "Delete",
icon: "delete"
},
"sep1": "---------",
"quit": {
name: "Quit",
icon: function($element, key, item) {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$.contextMenu({
selector: '#context-menu-open',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Closing on Click",
icon: "edit",
callback: function() {
return true;
}
},
"cut": {
name: "Open after Click",
icon: "cut",
callback: function() {
return false;
}
}
}
});
$.contextMenu({
selector: '#context-menu-multi',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
"name": "Edit",
"icon": "edit"
},
"cut": {
"name": "Cut",
"icon": "cut"
},
"sep1": "---------",
"quit": {
"name": "Quit",
"icon": "quit"
},
"sep2": "---------",
"fold1": {
"name": "Sub group",
"items": {
"fold1-key1": {
"name": "Foo bar"
},
"fold2": {
"name": "Sub group 2",
"items": {
"fold2-key1": {
"name": "alpha"
},
"fold2-key2": {
"name": "bravo"
},
"fold2-key3": {
"name": "charlie"
}
}
},
"fold1-key3": {
"name": "delta"
}
}
},
"fold1a": {
"name": "Other group",
"items": {
"fold1a-key1": {
"name": "echo"
},
"fold1a-key2": {
"name": "foxtrot"
},
"fold1a-key3": {
"name": "golf"
}
}
}
}
});
$.contextMenu({
selector: '#context-menu-hover',
trigger: 'hover',
delay: 500,
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Edit",
icon: "edit"
},
"cut": {
name: "Cut",
icon: "cut"
},
"copy": {
name: "Copy",
icon: "copy"
},
"paste": {
name: "Paste",
icon: "paste"
},
"delete": {
name: "Delete",
icon: "delete"
},
"sep1": "---------",
"quit": {
name: "Quit",
icon: function($element, key, item) {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$.contextMenu({
selector: '#context-menu-hover-autohide',
trigger: 'hover',
delay: 500,
autoHide: true,
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {
name: "Edit",
icon: "edit"
},
"cut": {
name: "Cut",
icon: "cut"
},
"copy": {
name: "Copy",
icon: "copy"
},
"paste": {
name: "Paste",
icon: "paste"
},
"delete": {
name: "Delete",
icon: "delete"
},
"sep1": "---------",
"quit": {
name: "Quit",
icon: function($element, key, item) {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
})(jQuery);

View File

@ -0,0 +1,6 @@
(function($) {
'use strict';
$('#cropperExample').cropper({
aspectRatio: 16 / 9
});
})(jQuery);

View File

@ -0,0 +1,681 @@
(function($) {
'use strict';
$(function() {
if ($("#order-chart").length) {
var areaData = {
labels: ["10","","","20","","","30","","","40","","", "50","","", "60","","","70"],
datasets: [
{
data: [200, 480, 700, 600, 620, 350, 380, 350, 850, "600", "650", "350", "590", "350", "620", "500", "990", "780", "650"],
borderColor: [
'#4747A1'
],
borderWidth: 2,
fill: false,
label: "Orders"
},
{
data: [400, 450, 410, 500, 480, 600, 450, 550, 460, "560", "450", "700", "450", "640", "550", "650", "400", "850", "800"],
borderColor: [
'#F09397'
],
borderWidth: 2,
fill: false,
label: "Downloads"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
plugins: {
filler: {
propagate: false
}
},
scales: {
xAxes: [{
display: true,
ticks: {
display: true,
padding: 10,
fontColor:"#6C7383"
},
gridLines: {
display: false,
drawBorder: false,
color: 'transparent',
zeroLineColor: '#eeeeee'
}
}],
yAxes: [{
display: true,
ticks: {
display: true,
autoSkip: false,
maxRotation: 0,
stepSize: 200,
min: 200,
max: 1200,
padding: 18,
fontColor:"#6C7383"
},
gridLines: {
display: true,
color:"#f2f2f2",
drawBorder: false
}
}]
},
legend: {
display: false
},
tooltips: {
enabled: true
},
elements: {
line: {
tension: .35
},
point: {
radius: 0
}
}
}
var revenueChartCanvas = $("#order-chart").get(0).getContext("2d");
var revenueChart = new Chart(revenueChartCanvas, {
type: 'line',
data: areaData,
options: areaOptions
});
}
if ($("#order-chart-dark").length) {
var areaData = {
labels: ["10","","","20","","","30","","","40","","", "50","","", "60","","","70"],
datasets: [
{
data: [200, 480, 700, 600, 620, 350, 380, 350, 850, "600", "650", "350", "590", "350", "620", "500", "990", "780", "650"],
borderColor: [
'#4747A1'
],
borderWidth: 2,
fill: false,
label: "Orders"
},
{
data: [400, 450, 410, 500, 480, 600, 450, 550, 460, "560", "450", "700", "450", "640", "550", "650", "400", "850", "800"],
borderColor: [
'#F09397'
],
borderWidth: 2,
fill: false,
label: "Downloads"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
plugins: {
filler: {
propagate: false
}
},
scales: {
xAxes: [{
display: true,
ticks: {
display: true,
padding: 10,
fontColor:"#fff"
},
gridLines: {
display: false,
drawBorder: false,
color: 'transparent',
zeroLineColor: '#575757'
}
}],
yAxes: [{
display: true,
ticks: {
display: true,
autoSkip: false,
maxRotation: 0,
stepSize: 200,
min: 200,
max: 1200,
padding: 18,
fontColor:"#fff"
},
gridLines: {
display: true,
color:"#575757",
drawBorder: false
}
}]
},
legend: {
display: false
},
tooltips: {
enabled: true
},
elements: {
line: {
tension: .35
},
point: {
radius: 0
}
}
}
var revenueChartCanvas = $("#order-chart-dark").get(0).getContext("2d");
var revenueChart = new Chart(revenueChartCanvas, {
type: 'line',
data: areaData,
options: areaOptions
});
}
if ($("#sales-chart").length) {
var SalesChartCanvas = $("#sales-chart").get(0).getContext("2d");
var SalesChart = new Chart(SalesChartCanvas, {
type: 'bar',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May"],
datasets: [{
label: 'Offline Sales',
data: [480, 230, 470, 210, 330],
backgroundColor: '#98BDFF'
},
{
label: 'Online Sales',
data: [400, 340, 550, 480, 170],
backgroundColor: '#4B49AC'
}
]
},
options: {
cornerRadius: 5,
responsive: true,
maintainAspectRatio: true,
layout: {
padding: {
left: 0,
right: 0,
top: 20,
bottom: 0
}
},
scales: {
yAxes: [{
display: true,
gridLines: {
display: true,
drawBorder: false,
color: "#F2F2F2"
},
ticks: {
display: true,
min: 0,
max: 560,
callback: function(value, index, values) {
return value + '$' ;
},
autoSkip: true,
maxTicksLimit: 10,
fontColor:"#6C7383"
}
}],
xAxes: [{
stacked: false,
ticks: {
beginAtZero: true,
fontColor: "#6C7383"
},
gridLines: {
color: "rgba(0, 0, 0, 0)",
display: false
},
barPercentage: 1
}]
},
legend: {
display: false
},
elements: {
point: {
radius: 0
}
}
},
});
document.getElementById('sales-legend').innerHTML = SalesChart.generateLegend();
}
if ($("#sales-chart-dark").length) {
var SalesChartCanvas = $("#sales-chart-dark").get(0).getContext("2d");
var SalesChart = new Chart(SalesChartCanvas, {
type: 'bar',
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May"],
datasets: [{
label: 'Offline Sales',
data: [480, 230, 470, 210, 330],
backgroundColor: '#98BDFF'
},
{
label: 'Online Sales',
data: [400, 340, 550, 480, 170],
backgroundColor: '#4B49AC'
}
]
},
options: {
cornerRadius: 5,
responsive: true,
maintainAspectRatio: true,
layout: {
padding: {
left: 0,
right: 0,
top: 20,
bottom: 0
}
},
scales: {
yAxes: [{
display: true,
gridLines: {
display: true,
drawBorder: false,
color: "#575757"
},
ticks: {
display: true,
min: 0,
max: 500,
callback: function(value, index, values) {
return value + '$' ;
},
autoSkip: true,
maxTicksLimit: 10,
fontColor:"#F0F0F0"
}
}],
xAxes: [{
stacked: false,
ticks: {
beginAtZero: true,
fontColor: "#F0F0F0"
},
gridLines: {
color: "#575757",
display: false
},
barPercentage: 1
}]
},
legend: {
display: false
},
elements: {
point: {
radius: 0
}
}
},
});
document.getElementById('sales-legend').innerHTML = SalesChart.generateLegend();
}
if ($("#north-america-chart").length) {
var areaData = {
labels: ["Jan", "Feb", "Mar"],
datasets: [{
data: [100, 50, 50],
backgroundColor: [
"#4B49AC","#FFC100", "#248AFD",
],
borderColor: "rgba(0,0,0,0)"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
segmentShowStroke: false,
cutoutPercentage: 78,
elements: {
arc: {
borderWidth: 4
}
},
legend: {
display: false
},
tooltips: {
enabled: true
},
legendCallback: function(chart) {
var text = [];
text.push('<div class="report-chart">');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[0] + '"></div><p class="mb-0">Offline sales</p></div>');
text.push('<p class="mb-0">88333</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[1] + '"></div><p class="mb-0">Online sales</p></div>');
text.push('<p class="mb-0">66093</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[2] + '"></div><p class="mb-0">Returns</p></div>');
text.push('<p class="mb-0">39836</p>');
text.push('</div>');
text.push('</div>');
return text.join("");
},
}
var northAmericaChartPlugins = {
beforeDraw: function(chart) {
var width = chart.chart.width,
height = chart.chart.height,
ctx = chart.chart.ctx;
ctx.restore();
var fontSize = 3.125;
ctx.font = "500 " + fontSize + "em sans-serif";
ctx.textBaseline = "middle";
ctx.fillStyle = "#13381B";
var text = "90",
textX = Math.round((width - ctx.measureText(text).width) / 2),
textY = height / 2;
ctx.fillText(text, textX, textY);
ctx.save();
}
}
var northAmericaChartCanvas = $("#north-america-chart").get(0).getContext("2d");
var northAmericaChart = new Chart(northAmericaChartCanvas, {
type: 'doughnut',
data: areaData,
options: areaOptions,
plugins: northAmericaChartPlugins
});
document.getElementById('north-america-legend').innerHTML = northAmericaChart.generateLegend();
}
if ($("#north-america-chart-dark").length) {
var areaData = {
labels: ["Jan", "Feb", "Mar"],
datasets: [{
data: [100, 50, 50],
backgroundColor: [
"#4B49AC","#FFC100", "#248AFD",
],
borderColor: "rgba(0,0,0,0)"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
segmentShowStroke: false,
cutoutPercentage: 78,
elements: {
arc: {
borderWidth: 4
}
},
legend: {
display: false
},
tooltips: {
enabled: true
},
legendCallback: function(chart) {
var text = [];
text.push('<div class="report-chart">');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[0] + '"></div><p class="mb-0">Offline sales</p></div>');
text.push('<p class="mb-0">88333</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[1] + '"></div><p class="mb-0">Online sales</p></div>');
text.push('<p class="mb-0">66093</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[2] + '"></div><p class="mb-0">Returns</p></div>');
text.push('<p class="mb-0">39836</p>');
text.push('</div>');
text.push('</div>');
return text.join("");
},
}
var northAmericaChartPlugins = {
beforeDraw: function(chart) {
var width = chart.chart.width,
height = chart.chart.height,
ctx = chart.chart.ctx;
ctx.restore();
var fontSize = 3.125;
ctx.font = "500 " + fontSize + "em sans-serif";
ctx.textBaseline = "middle";
ctx.fillStyle = "#fff";
var text = "90",
textX = Math.round((width - ctx.measureText(text).width) / 2),
textY = height / 2;
ctx.fillText(text, textX, textY);
ctx.save();
}
}
var northAmericaChartCanvas = $("#north-america-chart-dark").get(0).getContext("2d");
var northAmericaChart = new Chart(northAmericaChartCanvas, {
type: 'doughnut',
data: areaData,
options: areaOptions,
plugins: northAmericaChartPlugins
});
document.getElementById('north-america-legend').innerHTML = northAmericaChart.generateLegend();
}
if ($("#south-america-chart").length) {
var areaData = {
labels: ["Jan", "Feb", "Mar"],
datasets: [{
data: [60, 70, 70],
backgroundColor: [
"#4B49AC","#FFC100", "#248AFD",
],
borderColor: "rgba(0,0,0,0)"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
segmentShowStroke: false,
cutoutPercentage: 78,
elements: {
arc: {
borderWidth: 4
}
},
legend: {
display: false
},
tooltips: {
enabled: true
},
legendCallback: function(chart) {
var text = [];
text.push('<div class="report-chart">');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[0] + '"></div><p class="mb-0">Offline sales</p></div>');
text.push('<p class="mb-0">495343</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[1] + '"></div><p class="mb-0">Online sales</p></div>');
text.push('<p class="mb-0">630983</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[2] + '"></div><p class="mb-0">Returns</p></div>');
text.push('<p class="mb-0">290831</p>');
text.push('</div>');
text.push('</div>');
return text.join("");
},
}
var southAmericaChartPlugins = {
beforeDraw: function(chart) {
var width = chart.chart.width,
height = chart.chart.height,
ctx = chart.chart.ctx;
ctx.restore();
var fontSize = 3.125;
ctx.font = "600 " + fontSize + "em sans-serif";
ctx.textBaseline = "middle";
ctx.fillStyle = "#000";
var text = "76",
textX = Math.round((width - ctx.measureText(text).width) / 2),
textY = height / 2;
ctx.fillText(text, textX, textY);
ctx.save();
}
}
var southAmericaChartCanvas = $("#south-america-chart").get(0).getContext("2d");
var southAmericaChart = new Chart(southAmericaChartCanvas, {
type: 'doughnut',
data: areaData,
options: areaOptions,
plugins: southAmericaChartPlugins
});
document.getElementById('south-america-legend').innerHTML = southAmericaChart.generateLegend();
}
if ($("#south-america-chart-dark").length) {
var areaData = {
labels: ["Jan", "Feb", "Mar"],
datasets: [{
data: [60, 70, 70],
backgroundColor: [
"#4B49AC","#FFC100", "#248AFD",
],
borderColor: "rgba(0,0,0,0)"
}
]
};
var areaOptions = {
responsive: true,
maintainAspectRatio: true,
segmentShowStroke: false,
cutoutPercentage: 78,
elements: {
arc: {
borderWidth: 4
}
},
legend: {
display: false
},
tooltips: {
enabled: true
},
legendCallback: function(chart) {
var text = [];
text.push('<div class="report-chart">');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[0] + '"></div><p class="mb-0">Offline sales</p></div>');
text.push('<p class="mb-0">495343</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[1] + '"></div><p class="mb-0">Online sales</p></div>');
text.push('<p class="mb-0">630983</p>');
text.push('</div>');
text.push('<div class="d-flex justify-content-between mx-4 mx-xl-5 mt-3"><div class="d-flex align-items-center"><div class="mr-3" style="width:20px; height:20px; border-radius: 50%; background-color: ' + chart.data.datasets[0].backgroundColor[2] + '"></div><p class="mb-0">Returns</p></div>');
text.push('<p class="mb-0">290831</p>');
text.push('</div>');
text.push('</div>');
return text.join("");
},
}
var southAmericaChartPlugins = {
beforeDraw: function(chart) {
var width = chart.chart.width,
height = chart.chart.height,
ctx = chart.chart.ctx;
ctx.restore();
var fontSize = 3.125;
ctx.font = "600 " + fontSize + "em sans-serif";
ctx.textBaseline = "middle";
ctx.fillStyle = "#fff";
var text = "76",
textX = Math.round((width - ctx.measureText(text).width) / 2),
textY = height / 2;
ctx.fillText(text, textX, textY);
ctx.save();
}
}
var southAmericaChartCanvas = $("#south-america-chart-dark").get(0).getContext("2d");
var southAmericaChart = new Chart(southAmericaChartCanvas, {
type: 'doughnut',
data: areaData,
options: areaOptions,
plugins: southAmericaChartPlugins
});
document.getElementById('south-america-legend').innerHTML = southAmericaChart.generateLegend();
}
function format ( d ) {
// `d` is the original data object for the row
return '<table cellpadding="5" cellspacing="0" border="0" style="width:100%;">'+
'<tr class="expanded-row">'+
'<td colspan="8" class="row-bg"><div><div class="d-flex justify-content-between"><div class="cell-hilighted"><div class="d-flex mb-2"><div class="mr-2 min-width-cell"><p>Policy start date</p><h6>25/04/2020</h6></div><div class="min-width-cell"><p>Policy end date</p><h6>24/04/2021</h6></div></div><div class="d-flex"><div class="mr-2 min-width-cell"><p>Sum insured</p><h5>$26,000</h5></div><div class="min-width-cell"><p>Premium</p><h5>$1200</h5></div></div></div><div class="expanded-table-normal-cell"><div class="mr-2 mb-4"><p>Quote no.</p><h6>Incs234</h6></div><div class="mr-2"><p>Vehicle Reg. No.</p><h6>KL-65-A-7004</h6></div></div><div class="expanded-table-normal-cell"><div class="mr-2 mb-4"><p>Policy number</p><h6>Incsq123456</h6></div><div class="mr-2"><p>Policy number</p><h6>Incsq123456</h6></div></div><div class="expanded-table-normal-cell"><div class="mr-2 mb-3 d-flex"><div class="highlighted-alpha"> A</div><div><p>Agent / Broker</p><h6>Abcd Enterprices</h6></div></div><div class="mr-2 d-flex"> <img src="../../images/faces/face5.jpg" alt="profile"/><div><p>Policy holder Name & ID Number</p><h6>Phillip Harris / 1234567</h6></div></div></div><div class="expanded-table-normal-cell"><div class="mr-2 mb-4"><p>Branch</p><h6>Koramangala, Bangalore</h6></div></div><div class="expanded-table-normal-cell"><div class="mr-2 mb-4"><p>Channel</p><h6>Online</h6></div></div></div></div></td>'
'</tr>'+
'</table>';
}
var table = $('#example').DataTable( {
"ajax": "js/data.txt",
"columns": [
{ "data": "Quote" },
{ "data": "Product" },
{ "data": "Business" },
{ "data": "Policy" },
{ "data": "Premium" },
{ "data": "Status" },
{ "data": "Updated" },
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
}
],
"order": [[1, 'asc']],
"paging": false,
"ordering": true,
"info": false,
"filter": false,
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0
}],
select: {
style: 'os',
selector: 'td:first-child'
}
} );
$('#example tbody').on('click', 'td.details-control', function () {
var tr = $(this).closest('tr');
var row = table.row( tr );
if ( row.child.isShown() ) {
// This row is already open - close it
row.child.hide();
tr.removeClass('shown');
}
else {
// Open this row
row.child( format(row.data()) ).show();
tr.addClass('shown');
}
} );
});
})(jQuery);

View File

@ -0,0 +1,25 @@
(function($) {
'use strict';
$(function() {
$('#order-listing').DataTable({
"aLengthMenu": [
[5, 10, 15, -1],
[5, 10, 15, "All"]
],
"iDisplayLength": 10,
"language": {
search: ""
}
});
$('#order-listing').each(function() {
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable.closest('.dataTables_wrapper').find('div[id$=_filter] input');
search_input.attr('placeholder', 'Search');
search_input.removeClass('form-control-sm');
// LENGTH - Inline-Form control
var length_sel = datatable.closest('.dataTables_wrapper').find('div[id$=_length] select');
length_sel.removeClass('form-control-sm');
});
});
})(jQuery);

View File

@ -0,0 +1,97 @@
{
"data": [
{
"id": "1",
"Quote": "Incs234",
"Product": "Car insurance",
"Business": "Business type 1",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "In progress",
"Updated": "25/04/2020"
},{
"id": "2",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Active",
"Updated": "25/04/2020"
},{
"id": "3",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Expired",
"Updated": "25/04/2020"
},{
"id": "4",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "In progress",
"Updated": "25/04/2020"
},{
"id": "5",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Active",
"Updated": "25/04/2020"
},{
"id": "6",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Active",
"Updated": "25/04/2020"
},{
"id": "7",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Active",
"Updated": "25/04/2020"
},{
"id": "8",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Expired",
"Updated": "25/04/2020"
},{
"id": "9",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "Active",
"Updated": "25/04/2020"
},{
"id": "10",
"Quote": "Incs235",
"Product": "Car insurance",
"Business": "Business type 2",
"Policy": "Jesse Thomas",
"Premium": "$1200",
"Status": "In progress",
"Updated": "25/04/2020"
}
]
}

View File

@ -0,0 +1,38 @@
/*!
Copyright 2015-2019 SpryMedia Ltd.
This source file is free software, available under the following license:
MIT license - http://datatables.net/license/mit
This source file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
For details please refer to: http://www.datatables.net/extensions/select
Select for DataTables 1.3.1
2015-2019 SpryMedia Ltd - datatables.net/license/mit
*/
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return f(k,window,document)}):"object"===typeof exports?module.exports=function(k,p){k||(k=window);p&&p.fn.dataTable||(p=require("datatables.net")(k,p).$);return f(p,k,k.document)}:f(jQuery,window,document)})(function(f,k,p,h){function z(a,b,c){var d=function(c,b){if(c>b){var d=b;b=c;c=d}var e=!1;return a.columns(":visible").indexes().filter(function(a){a===c&&(e=!0);return a===b?(e=!1,!0):e})};var e=
function(c,b){var d=a.rows({search:"applied"}).indexes();if(d.indexOf(c)>d.indexOf(b)){var e=b;b=c;c=e}var f=!1;return d.filter(function(a){a===c&&(f=!0);return a===b?(f=!1,!0):f})};a.cells({selected:!0}).any()||c?(d=d(c.column,b.column),c=e(c.row,b.row)):(d=d(0,b.column),c=e(0,b.row));c=a.cells(c,d).flatten();a.cells(b,{selected:!0}).any()?a.cells(c).deselect():a.cells(c).select()}function v(a){var b=a.settings()[0]._select.selector;f(a.table().container()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",
b).off("click.dtSelect",b);f("body").off("click.dtSelect"+a.table().node().id.replace(/[^a-zA-Z0-9\-_]/g,"-"))}function A(a){var b=f(a.table().container()),c=a.settings()[0],d=c._select.selector,e;b.on("mousedown.dtSelect",d,function(a){if(a.shiftKey||a.metaKey||a.ctrlKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1});k.getSelection&&(e=k.getSelection())}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(c){var b=
a.select.items();if(e){var d=k.getSelection();if((!d.anchorNode||f(d.anchorNode).closest("table")[0]===a.table().node())&&d!==e)return}d=a.settings()[0];var l=f.trim(a.settings()[0].oClasses.sWrapper).replace(/ +/g,".");if(f(c.target).closest("div."+l)[0]==a.table().container()&&(l=a.cell(f(c.target).closest("td, th")),l.any())){var g=f.Event("user-select.dt");m(a,g,[b,l,c]);g.isDefaultPrevented()||(g=l.index(),"row"===b?(b=g.row,w(c,a,d,"row",b)):"column"===b?(b=l.index().column,w(c,a,d,"column",
b)):"cell"===b&&(b=l.index(),w(c,a,d,"cell",b)),d._select_lastCell=g)}});f("body").on("click.dtSelect"+a.table().node().id.replace(/[^a-zA-Z0-9\-_]/g,"-"),function(b){!c._select.blurable||f(b.target).parents().filter(a.table().container()).length||0===f(b.target).parents("html").length||f(b.target).parents("div.DTE").length||r(c,!0)})}function m(a,b,c,d){if(!d||a.flatten().length)"string"===typeof b&&(b+=".dt"),c.unshift(a),f(a.table().node()).trigger(b,c)}function B(a){var b=a.settings()[0];if(b._select.info&&
b.aanFeatures.i&&"api"!==a.select.style()){var c=a.rows({selected:!0}).flatten().length,d=a.columns({selected:!0}).flatten().length,e=a.cells({selected:!0}).flatten().length,l=function(b,c,d){b.append(f('<span class="select-item"/>').append(a.i18n("select."+c+"s",{_:"%d "+c+"s selected",0:"",1:"1 "+c+" selected"},d)))};f.each(b.aanFeatures.i,function(b,a){a=f(a);b=f('<span class="select-info"/>');l(b,"row",c);l(b,"column",d);l(b,"cell",e);var g=a.children("span.select-info");g.length&&g.remove();
""!==b.text()&&a.append(b)})}}function D(a){var b=new g.Api(a);a.aoRowCreatedCallback.push({fn:function(b,d,e){d=a.aoData[e];d._select_selected&&f(b).addClass(a._select.className);b=0;for(e=a.aoColumns.length;b<e;b++)(a.aoColumns[b]._select_selected||d._selected_cells&&d._selected_cells[b])&&f(d.anCells[b]).addClass(a._select.className)},sName:"select-deferRender"});b.on("preXhr.dt.dtSelect",function(){var a=b.rows({selected:!0}).ids(!0).filter(function(b){return b!==h}),d=b.cells({selected:!0}).eq(0).map(function(a){var c=
b.row(a.row).id(!0);return c?{row:c,column:a.column}:h}).filter(function(b){return b!==h});b.one("draw.dt.dtSelect",function(){b.rows(a).select();d.any()&&d.each(function(a){b.cells(a.row,a.column).select()})})});b.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){B(b)});b.on("destroy.dtSelect",function(){v(b);b.off(".dtSelect")})}function C(a,b,c,d){var e=a[b+"s"]({search:"applied"}).indexes();d=f.inArray(d,e);var g=f.inArray(c,e);if(a[b+"s"]({selected:!0}).any()||
-1!==d){if(d>g){var u=g;g=d;d=u}e.splice(g+1,e.length);e.splice(0,d)}else e.splice(f.inArray(c,e)+1,e.length);a[b](c,{selected:!0}).any()?(e.splice(f.inArray(c,e),1),a[b+"s"](e).deselect()):a[b+"s"](e).select()}function r(a,b){if(b||"single"===a._select.style)a=new g.Api(a),a.rows({selected:!0}).deselect(),a.columns({selected:!0}).deselect(),a.cells({selected:!0}).deselect()}function w(a,b,c,d,e){var f=b.select.style(),g=b.select.toggleable(),h=b[d](e,{selected:!0}).any();if(!h||g)"os"===f?a.ctrlKey||
a.metaKey?b[d](e).select(!h):a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):(a=b[d+"s"]({selected:!0}),h&&1===a.flatten().length?b[d](e).deselect():(a.deselect(),b[d](e).select())):"multi+shift"==f?a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):b[d](e).select(!h):b[d](e).select(!h)}function t(a,b){return function(c){return c.i18n("buttons."+a,b)}}function x(a){a=a._eventNamespace;
return"draw.dt.DT"+a+" select.dt.DT"+a+" deselect.dt.DT"+a}function E(a,b){return-1!==f.inArray("rows",b.limitTo)&&a.rows({selected:!0}).any()||-1!==f.inArray("columns",b.limitTo)&&a.columns({selected:!0}).any()||-1!==f.inArray("cells",b.limitTo)&&a.cells({selected:!0}).any()?!0:!1}var g=f.fn.dataTable;g.select={};g.select.version="1.3.1";g.select.init=function(a){var b=a.settings()[0],c=b.oInit.select,d=g.defaults.select;c=c===h?d:c;d="row";var e="api",l=!1,u=!0,k=!0,m="td, th",p="selected",n=!1;
b._select={};!0===c?(e="os",n=!0):"string"===typeof c?(e=c,n=!0):f.isPlainObject(c)&&(c.blurable!==h&&(l=c.blurable),c.toggleable!==h&&(u=c.toggleable),c.info!==h&&(k=c.info),c.items!==h&&(d=c.items),e=c.style!==h?c.style:"os",n=!0,c.selector!==h&&(m=c.selector),c.className!==h&&(p=c.className));a.select.selector(m);a.select.items(d);a.select.style(e);a.select.blurable(l);a.select.toggleable(u);a.select.info(k);b._select.className=p;f.fn.dataTable.ext.order["select-checkbox"]=function(b,a){return this.api().column(a,
{order:"index"}).nodes().map(function(a){return"row"===b._select.items?f(a).parent().hasClass(b._select.className):"cell"===b._select.items?f(a).hasClass(b._select.className):!1})};!n&&f(a.table().node()).hasClass("selectable")&&a.select.style("os")};f.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(a,b){g.ext.selector[b.type].push(function(a,d,e){d=d.selected;var c=[];if(!0!==d&&!1!==d)return e;for(var f=0,g=e.length;f<g;f++){var h=a[b.prop][e[f]];(!0===d&&!0===h._select_selected||
!1===d&&!h._select_selected)&&c.push(e[f])}return c})});g.ext.selector.cell.push(function(a,b,c){b=b.selected;var d=[];if(b===h)return c;for(var e=0,f=c.length;e<f;e++){var g=a.aoData[c[e].row];(!0===b&&g._selected_cells&&!0===g._selected_cells[c[e].column]||!(!1!==b||g._selected_cells&&g._selected_cells[c[e].column]))&&d.push(c[e])}return d});var n=g.Api.register,q=g.Api.registerPlural;n("select()",function(){return this.iterator("table",function(a){g.select.init(new g.Api(a))})});n("select.blurable()",
function(a){return a===h?this.context[0]._select.blurable:this.iterator("table",function(b){b._select.blurable=a})});n("select.toggleable()",function(a){return a===h?this.context[0]._select.toggleable:this.iterator("table",function(b){b._select.toggleable=a})});n("select.info()",function(a){return B===h?this.context[0]._select.info:this.iterator("table",function(b){b._select.info=a})});n("select.items()",function(a){return a===h?this.context[0]._select.items:this.iterator("table",function(b){b._select.items=
a;m(new g.Api(b),"selectItems",[a])})});n("select.style()",function(a){return a===h?this.context[0]._select.style:this.iterator("table",function(b){b._select.style=a;b._select_init||D(b);var c=new g.Api(b);v(c);"api"!==a&&A(c);m(new g.Api(b),"selectStyle",[a])})});n("select.selector()",function(a){return a===h?this.context[0]._select.selector:this.iterator("table",function(b){v(new g.Api(b));b._select.selector=a;"api"!==b._select.style&&A(new g.Api(b))})});q("rows().select()","row().select()",function(a){var b=
this;if(!1===a)return this.deselect();this.iterator("row",function(b,a){r(b);b.aoData[a]._select_selected=!0;f(b.aoData[a].nTr).addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["row",b[d]],!0)});return this});q("columns().select()","column().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("column",function(b,a){r(b);b.aoColumns[a]._select_selected=!0;a=(new g.Api(b)).column(a);f(a.header()).addClass(b._select.className);f(a.footer()).addClass(b._select.className);
a.nodes().to$().addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["column",b[d]],!0)});return this});q("cells().select()","cell().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("cell",function(b,a,e){r(b);a=b.aoData[a];a._selected_cells===h&&(a._selected_cells=[]);a._selected_cells[e]=!0;a.anCells&&f(a.anCells[e]).addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["cell",b[d]],!0)});return this});q("rows().deselect()",
"row().deselect()",function(){var a=this;this.iterator("row",function(a,c){a.aoData[c]._select_selected=!1;f(a.aoData[c].nTr).removeClass(a._select.className)});this.iterator("table",function(b,c){m(a,"deselect",["row",a[c]],!0)});return this});q("columns().deselect()","column().deselect()",function(){var a=this;this.iterator("column",function(a,c){a.aoColumns[c]._select_selected=!1;var b=new g.Api(a),e=b.column(c);f(e.header()).removeClass(a._select.className);f(e.footer()).removeClass(a._select.className);
b.cells(null,c).indexes().each(function(b){var c=a.aoData[b.row],d=c._selected_cells;!c.anCells||d&&d[b.column]||f(c.anCells[b.column]).removeClass(a._select.className)})});this.iterator("table",function(b,c){m(a,"deselect",["column",a[c]],!0)});return this});q("cells().deselect()","cell().deselect()",function(){var a=this;this.iterator("cell",function(a,c,d){c=a.aoData[c];c._selected_cells[d]=!1;c.anCells&&!a.aoColumns[d]._select_selected&&f(c.anCells[d]).removeClass(a._select.className)});this.iterator("table",
function(b,c){m(a,"deselect",["cell",a[c]],!0)});return this});var y=0;f.extend(g.ext.buttons,{selected:{text:t("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){d.enable(E(a,c))});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectedSingle:{text:t("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(a,b,c){var d=this;c._eventNamespace=
".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(1===b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectAll:{text:t("selectAll","Select all"),className:"buttons-select-all",action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:t("selectNone","Deselect all"),className:"buttons-select-none",action:function(){r(this.settings()[0],
!0)},init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(0<b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}}});f.each(["Row","Column","Cell"],function(a,b){var c=b.toLowerCase();g.ext.buttons["select"+b+"s"]={text:t("select"+b+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},
init:function(a){var b=this;a.on("selectItems.dt.DT",function(a,d,e){b.active(e===c)})}}});f(p).on("preInit.dt.dtSelect",function(a,b){"dt"===a.namespace&&g.select.init(new g.Api(b))});return g.select});

907
public/Dashboard/js/db.js Normal file
View File

@ -0,0 +1,907 @@
(function($) {
(function() {
var db = {
loadData: function(filter) {
return $.grep(this.clients, function(client) {
return (!filter.Name || client.Name.indexOf(filter.Name) > -1) &&
(filter.Age === undefined || client.Age === filter.Age) &&
(!filter.Address || client.Address.indexOf(filter.Address) > -1) &&
(!filter.Country || client.Country === filter.Country) &&
(filter.Married === undefined || client.Married === filter.Married);
});
},
insertItem: function(insertingClient) {
this.clients.push(insertingClient);
},
updateItem: function(updatingClient) {},
deleteItem: function(deletingClient) {
var clientIndex = $.inArray(deletingClient, this.clients);
this.clients.splice(clientIndex, 1);
}
};
window.db = db;
db.countries = [{
Name: "",
Id: 0
},
{
Name: "United States",
Id: 1
},
{
Name: "Canada",
Id: 2
},
{
Name: "United Kingdom",
Id: 3
},
{
Name: "France",
Id: 4
},
{
Name: "Brazil",
Id: 5
},
{
Name: "China",
Id: 6
},
{
Name: "Russia",
Id: 7
}
];
db.clients = [{
"Name": "Otto Clay",
"Age": 61,
"Country": 6,
"Address": "Ap #897-1459 Quam Avenue",
"Married": false
},
{
"Name": "Connor Johnston",
"Age": 73,
"Country": 7,
"Address": "Ap #370-4647 Dis Av.",
"Married": false
},
{
"Name": "Lacey Hess",
"Age": 29,
"Country": 7,
"Address": "Ap #365-8835 Integer St.",
"Married": false
},
{
"Name": "Timothy Henson",
"Age": 78,
"Country": 1,
"Address": "911-5143 Luctus Ave",
"Married": false
},
{
"Name": "Ramona Benton",
"Age": 43,
"Country": 5,
"Address": "Ap #614-689 Vehicula Street",
"Married": true
},
{
"Name": "Ezra Tillman",
"Age": 51,
"Country": 1,
"Address": "P.O. Box 738, 7583 Quisque St.",
"Married": true
},
{
"Name": "Dante Carter",
"Age": 59,
"Country": 1,
"Address": "P.O. Box 976, 6316 Lorem, St.",
"Married": false
},
{
"Name": "Christopher Mcclure",
"Age": 58,
"Country": 1,
"Address": "847-4303 Dictum Av.",
"Married": true
},
{
"Name": "Ruby Rocha",
"Age": 62,
"Country": 2,
"Address": "5212 Sagittis Ave",
"Married": false
},
{
"Name": "Imelda Hardin",
"Age": 39,
"Country": 5,
"Address": "719-7009 Auctor Av.",
"Married": false
},
{
"Name": "Jonah Johns",
"Age": 28,
"Country": 5,
"Address": "P.O. Box 939, 9310 A Ave",
"Married": false
},
{
"Name": "Herman Rosa",
"Age": 49,
"Country": 7,
"Address": "718-7162 Molestie Av.",
"Married": true
},
{
"Name": "Arthur Gay",
"Age": 20,
"Country": 7,
"Address": "5497 Neque Street",
"Married": false
},
{
"Name": "Xena Wilkerson",
"Age": 63,
"Country": 1,
"Address": "Ap #303-6974 Proin Street",
"Married": true
},
{
"Name": "Lilah Atkins",
"Age": 33,
"Country": 5,
"Address": "622-8602 Gravida Ave",
"Married": true
},
{
"Name": "Malik Shepard",
"Age": 59,
"Country": 1,
"Address": "967-5176 Tincidunt Av.",
"Married": false
},
{
"Name": "Keely Silva",
"Age": 24,
"Country": 1,
"Address": "P.O. Box 153, 8995 Praesent Ave",
"Married": false
},
{
"Name": "Hunter Pate",
"Age": 73,
"Country": 7,
"Address": "P.O. Box 771, 7599 Ante, Road",
"Married": false
},
{
"Name": "Mikayla Roach",
"Age": 55,
"Country": 5,
"Address": "Ap #438-9886 Donec Rd.",
"Married": true
},
{
"Name": "Upton Joseph",
"Age": 48,
"Country": 4,
"Address": "Ap #896-7592 Habitant St.",
"Married": true
},
{
"Name": "Jeanette Pate",
"Age": 59,
"Country": 2,
"Address": "P.O. Box 177, 7584 Amet, St.",
"Married": false
},
{
"Name": "Kaden Hernandez",
"Age": 79,
"Country": 3,
"Address": "366 Ut St.",
"Married": true
},
{
"Name": "Kenyon Stevens",
"Age": 20,
"Country": 3,
"Address": "P.O. Box 704, 4580 Gravida Rd.",
"Married": false
},
{
"Name": "Jerome Harper",
"Age": 31,
"Country": 5,
"Address": "2464 Porttitor Road",
"Married": false
},
{
"Name": "Jelani Patel",
"Age": 36,
"Country": 2,
"Address": "P.O. Box 541, 5805 Nec Av.",
"Married": true
},
{
"Name": "Keaton Oconnor",
"Age": 21,
"Country": 1,
"Address": "Ap #657-1093 Nec, Street",
"Married": false
},
{
"Name": "Bree Johnston",
"Age": 31,
"Country": 2,
"Address": "372-5942 Vulputate Avenue",
"Married": false
},
{
"Name": "Maisie Hodges",
"Age": 70,
"Country": 7,
"Address": "P.O. Box 445, 3880 Odio, Rd.",
"Married": false
},
{
"Name": "Kuame Calhoun",
"Age": 39,
"Country": 2,
"Address": "P.O. Box 609, 4105 Rutrum St.",
"Married": true
},
{
"Name": "Carlos Cameron",
"Age": 38,
"Country": 5,
"Address": "Ap #215-5386 A, Avenue",
"Married": false
},
{
"Name": "Fulton Parsons",
"Age": 25,
"Country": 7,
"Address": "P.O. Box 523, 3705 Sed Rd.",
"Married": false
},
{
"Name": "Wallace Christian",
"Age": 43,
"Country": 3,
"Address": "416-8816 Mauris Avenue",
"Married": true
},
{
"Name": "Caryn Maldonado",
"Age": 40,
"Country": 1,
"Address": "108-282 Nonummy Ave",
"Married": false
},
{
"Name": "Whilemina Frank",
"Age": 20,
"Country": 7,
"Address": "P.O. Box 681, 3938 Egestas. Av.",
"Married": true
},
{
"Name": "Emery Moon",
"Age": 41,
"Country": 4,
"Address": "Ap #717-8556 Non Road",
"Married": true
},
{
"Name": "Price Watkins",
"Age": 35,
"Country": 4,
"Address": "832-7810 Nunc Rd.",
"Married": false
},
{
"Name": "Lydia Castillo",
"Age": 59,
"Country": 7,
"Address": "5280 Placerat, Ave",
"Married": true
},
{
"Name": "Lawrence Conway",
"Age": 53,
"Country": 1,
"Address": "Ap #452-2808 Imperdiet St.",
"Married": false
},
{
"Name": "Kalia Nicholson",
"Age": 67,
"Country": 5,
"Address": "P.O. Box 871, 3023 Tellus Road",
"Married": true
},
{
"Name": "Brielle Baxter",
"Age": 45,
"Country": 3,
"Address": "Ap #822-9526 Ut, Road",
"Married": true
},
{
"Name": "Valentine Brady",
"Age": 72,
"Country": 7,
"Address": "8014 Enim. Road",
"Married": true
},
{
"Name": "Rebecca Gardner",
"Age": 57,
"Country": 4,
"Address": "8655 Arcu. Road",
"Married": true
},
{
"Name": "Vladimir Tate",
"Age": 26,
"Country": 1,
"Address": "130-1291 Non, Rd.",
"Married": true
},
{
"Name": "Vernon Hays",
"Age": 56,
"Country": 4,
"Address": "964-5552 In Rd.",
"Married": true
},
{
"Name": "Allegra Hull",
"Age": 22,
"Country": 4,
"Address": "245-8891 Donec St.",
"Married": true
},
{
"Name": "Hu Hendrix",
"Age": 65,
"Country": 7,
"Address": "428-5404 Tempus Ave",
"Married": true
},
{
"Name": "Kenyon Battle",
"Age": 32,
"Country": 2,
"Address": "921-6804 Lectus St.",
"Married": false
},
{
"Name": "Gloria Nielsen",
"Age": 24,
"Country": 4,
"Address": "Ap #275-4345 Lorem, Street",
"Married": true
},
{
"Name": "Illiana Kidd",
"Age": 59,
"Country": 2,
"Address": "7618 Lacus. Av.",
"Married": false
},
{
"Name": "Adria Todd",
"Age": 68,
"Country": 6,
"Address": "1889 Tincidunt Road",
"Married": false
},
{
"Name": "Kirsten Mayo",
"Age": 71,
"Country": 1,
"Address": "100-8640 Orci, Avenue",
"Married": false
},
{
"Name": "Willa Hobbs",
"Age": 60,
"Country": 6,
"Address": "P.O. Box 323, 158 Tristique St.",
"Married": false
},
{
"Name": "Alexis Clements",
"Age": 69,
"Country": 5,
"Address": "P.O. Box 176, 5107 Proin Rd.",
"Married": false
},
{
"Name": "Akeem Conrad",
"Age": 60,
"Country": 2,
"Address": "282-495 Sed Ave",
"Married": true
},
{
"Name": "Montana Silva",
"Age": 79,
"Country": 6,
"Address": "P.O. Box 120, 9766 Consectetuer St.",
"Married": false
},
{
"Name": "Kaseem Hensley",
"Age": 77,
"Country": 6,
"Address": "Ap #510-8903 Mauris. Av.",
"Married": true
},
{
"Name": "Christopher Morton",
"Age": 35,
"Country": 5,
"Address": "P.O. Box 234, 3651 Sodales Avenue",
"Married": false
},
{
"Name": "Wade Fernandez",
"Age": 49,
"Country": 6,
"Address": "740-5059 Dolor. Road",
"Married": true
},
{
"Name": "Illiana Kirby",
"Age": 31,
"Country": 2,
"Address": "527-3553 Mi Ave",
"Married": false
},
{
"Name": "Kimberley Hurley",
"Age": 65,
"Country": 5,
"Address": "P.O. Box 637, 9915 Dictum St.",
"Married": false
},
{
"Name": "Arthur Olsen",
"Age": 74,
"Country": 5,
"Address": "887-5080 Eget St.",
"Married": false
},
{
"Name": "Brody Potts",
"Age": 59,
"Country": 2,
"Address": "Ap #577-7690 Sem Road",
"Married": false
},
{
"Name": "Dillon Ford",
"Age": 60,
"Country": 1,
"Address": "Ap #885-9289 A, Av.",
"Married": true
},
{
"Name": "Hannah Juarez",
"Age": 61,
"Country": 2,
"Address": "4744 Sapien, Rd.",
"Married": true
},
{
"Name": "Vincent Shaffer",
"Age": 25,
"Country": 2,
"Address": "9203 Nunc St.",
"Married": true
},
{
"Name": "George Holt",
"Age": 27,
"Country": 6,
"Address": "4162 Cras Rd.",
"Married": false
},
{
"Name": "Tobias Bartlett",
"Age": 74,
"Country": 4,
"Address": "792-6145 Mauris St.",
"Married": true
},
{
"Name": "Xavier Hooper",
"Age": 35,
"Country": 1,
"Address": "879-5026 Interdum. Rd.",
"Married": false
},
{
"Name": "Declan Dorsey",
"Age": 31,
"Country": 2,
"Address": "Ap #926-4171 Aenean Road",
"Married": true
},
{
"Name": "Clementine Tran",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 176, 9865 Eu Rd.",
"Married": true
},
{
"Name": "Pamela Moody",
"Age": 55,
"Country": 6,
"Address": "622-6233 Luctus Rd.",
"Married": true
},
{
"Name": "Julie Leon",
"Age": 43,
"Country": 6,
"Address": "Ap #915-6782 Sem Av.",
"Married": true
},
{
"Name": "Shana Nolan",
"Age": 79,
"Country": 5,
"Address": "P.O. Box 603, 899 Eu St.",
"Married": false
},
{
"Name": "Vaughan Moody",
"Age": 37,
"Country": 5,
"Address": "880 Erat Rd.",
"Married": false
},
{
"Name": "Randall Reeves",
"Age": 44,
"Country": 3,
"Address": "1819 Non Street",
"Married": false
},
{
"Name": "Dominic Raymond",
"Age": 68,
"Country": 1,
"Address": "Ap #689-4874 Nisi Rd.",
"Married": true
},
{
"Name": "Lev Pugh",
"Age": 69,
"Country": 5,
"Address": "Ap #433-6844 Auctor Avenue",
"Married": true
},
{
"Name": "Desiree Hughes",
"Age": 80,
"Country": 4,
"Address": "605-6645 Fermentum Avenue",
"Married": true
},
{
"Name": "Idona Oneill",
"Age": 23,
"Country": 7,
"Address": "751-8148 Aliquam Avenue",
"Married": true
},
{
"Name": "Lani Mayo",
"Age": 76,
"Country": 1,
"Address": "635-2704 Tristique St.",
"Married": true
},
{
"Name": "Cathleen Bonner",
"Age": 40,
"Country": 1,
"Address": "916-2910 Dolor Av.",
"Married": false
},
{
"Name": "Sydney Murray",
"Age": 44,
"Country": 5,
"Address": "835-2330 Fringilla St.",
"Married": false
},
{
"Name": "Brenna Rodriguez",
"Age": 77,
"Country": 6,
"Address": "3687 Imperdiet Av.",
"Married": true
},
{
"Name": "Alfreda Mcdaniel",
"Age": 38,
"Country": 7,
"Address": "745-8221 Aliquet Rd.",
"Married": true
},
{
"Name": "Zachery Atkins",
"Age": 30,
"Country": 1,
"Address": "549-2208 Auctor. Road",
"Married": true
},
{
"Name": "Amelia Rich",
"Age": 56,
"Country": 4,
"Address": "P.O. Box 734, 4717 Nunc Rd.",
"Married": false
},
{
"Name": "Kiayada Witt",
"Age": 62,
"Country": 3,
"Address": "Ap #735-3421 Malesuada Avenue",
"Married": false
},
{
"Name": "Lysandra Pierce",
"Age": 36,
"Country": 1,
"Address": "Ap #146-2835 Curabitur St.",
"Married": true
},
{
"Name": "Cara Rios",
"Age": 58,
"Country": 4,
"Address": "Ap #562-7811 Quam. Ave",
"Married": true
},
{
"Name": "Austin Andrews",
"Age": 55,
"Country": 7,
"Address": "P.O. Box 274, 5505 Sociis Rd.",
"Married": false
},
{
"Name": "Lillian Peterson",
"Age": 39,
"Country": 2,
"Address": "6212 A Avenue",
"Married": false
},
{
"Name": "Adria Beach",
"Age": 29,
"Country": 2,
"Address": "P.O. Box 183, 2717 Nunc Avenue",
"Married": true
},
{
"Name": "Oleg Durham",
"Age": 80,
"Country": 4,
"Address": "931-3208 Nunc Rd.",
"Married": false
},
{
"Name": "Casey Reese",
"Age": 60,
"Country": 4,
"Address": "383-3675 Ultrices, St.",
"Married": false
},
{
"Name": "Kane Burnett",
"Age": 80,
"Country": 1,
"Address": "759-8212 Dolor. Ave",
"Married": false
},
{
"Name": "Stewart Wilson",
"Age": 46,
"Country": 7,
"Address": "718-7845 Sagittis. Av.",
"Married": false
},
{
"Name": "Charity Holcomb",
"Age": 31,
"Country": 6,
"Address": "641-7892 Enim. Ave",
"Married": false
},
{
"Name": "Kyra Cummings",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 702, 6621 Mus. Av.",
"Married": false
},
{
"Name": "Stuart Wallace",
"Age": 25,
"Country": 7,
"Address": "648-4990 Sed Rd.",
"Married": true
},
{
"Name": "Carter Clarke",
"Age": 59,
"Country": 6,
"Address": "Ap #547-2921 A Street",
"Married": false
}
];
db.users = [{
"ID": "x",
"Account": "A758A693-0302-03D1-AE53-EEFE22855556",
"Name": "Carson Kelley",
"RegisterDate": "2002-04-20T22:55:52-07:00"
},
{
"Account": "D89FF524-1233-0CE7-C9E1-56EFF017A321",
"Name": "Prescott Griffin",
"RegisterDate": "2011-02-22T05:59:55-08:00"
},
{
"Account": "06FAAD9A-5114-08F6-D60C-961B2528B4F0",
"Name": "Amir Saunders",
"RegisterDate": "2014-08-13T09:17:49-07:00"
},
{
"Account": "EED7653D-7DD9-A722-64A8-36A55ECDBE77",
"Name": "Derek Thornton",
"RegisterDate": "2012-02-27T01:31:07-08:00"
},
{
"Account": "2A2E6D40-FEBD-C643-A751-9AB4CAF1E2F6",
"Name": "Fletcher Romero",
"RegisterDate": "2010-06-25T15:49:54-07:00"
},
{
"Account": "3978F8FA-DFF0-DA0E-0A5D-EB9D281A3286",
"Name": "Thaddeus Stein",
"RegisterDate": "2013-11-10T07:29:41-08:00"
},
{
"Account": "658DBF5A-176E-569A-9273-74FB5F69FA42",
"Name": "Nash Knapp",
"RegisterDate": "2005-06-24T09:11:19-07:00"
},
{
"Account": "76D2EE4B-7A73-1212-F6F2-957EF8C1F907",
"Name": "Quamar Vega",
"RegisterDate": "2011-04-13T20:06:29-07:00"
},
{
"Account": "00E46809-A595-CE82-C5B4-D1CAEB7E3E58",
"Name": "Philip Galloway",
"RegisterDate": "2008-08-21T18:59:38-07:00"
},
{
"Account": "C196781C-DDCC-AF83-DDC2-CA3E851A47A0",
"Name": "Mason French",
"RegisterDate": "2000-11-15T00:38:37-08:00"
},
{
"Account": "5911F201-818A-B393-5888-13157CE0D63F",
"Name": "Ross Cortez",
"RegisterDate": "2010-05-27T17:35:32-07:00"
},
{
"Account": "B8BB78F9-E1A1-A956-086F-E12B6FE168B6",
"Name": "Logan King",
"RegisterDate": "2003-07-08T16:58:06-07:00"
},
{
"Account": "06F636C3-9599-1A2D-5FD5-86B24ADDE626",
"Name": "Cedric Leblanc",
"RegisterDate": "2011-06-30T14:30:10-07:00"
},
{
"Account": "FE880CDD-F6E7-75CB-743C-64C6DE192412",
"Name": "Simon Sullivan",
"RegisterDate": "2013-06-11T16:35:07-07:00"
},
{
"Account": "BBEDD673-E2C1-4872-A5D3-C4EBD4BE0A12",
"Name": "Jamal West",
"RegisterDate": "2001-03-16T20:18:29-08:00"
},
{
"Account": "19BC22FA-C52E-0CC6-9552-10365C755FAC",
"Name": "Hector Morales",
"RegisterDate": "2012-11-01T01:56:34-07:00"
},
{
"Account": "A8292214-2C13-5989-3419-6B83DD637D6C",
"Name": "Herrod Hart",
"RegisterDate": "2008-03-13T19:21:04-07:00"
},
{
"Account": "0285564B-F447-0E7F-EAA1-7FB8F9C453C8",
"Name": "Clark Maxwell",
"RegisterDate": "2004-08-05T08:22:24-07:00"
},
{
"Account": "EA78F076-4F6E-4228-268C-1F51272498AE",
"Name": "Reuben Walter",
"RegisterDate": "2011-01-23T01:55:59-08:00"
},
{
"Account": "6A88C194-EA21-426F-4FE2-F2AE33F51793",
"Name": "Ira Ingram",
"RegisterDate": "2008-08-15T05:57:46-07:00"
},
{
"Account": "4275E873-439C-AD26-56B3-8715E336508E",
"Name": "Damian Morrow",
"RegisterDate": "2015-09-13T01:50:55-07:00"
},
{
"Account": "A0D733C4-9070-B8D6-4387-D44F0BA515BE",
"Name": "Macon Farrell",
"RegisterDate": "2011-03-14T05:41:40-07:00"
},
{
"Account": "B3683DE8-C2FA-7CA0-A8A6-8FA7E954F90A",
"Name": "Joel Galloway",
"RegisterDate": "2003-02-03T04:19:01-08:00"
},
{
"Account": "01D95A8E-91BC-2050-F5D0-4437AAFFD11F",
"Name": "Rigel Horton",
"RegisterDate": "2015-06-20T11:53:11-07:00"
},
{
"Account": "F0D12CC0-31AC-A82E-FD73-EEEFDBD21A36",
"Name": "Sylvester Gaines",
"RegisterDate": "2004-03-12T09:57:13-08:00"
},
{
"Account": "874FCC49-9A61-71BC-2F4E-2CE88348AD7B",
"Name": "Abbot Mckay",
"RegisterDate": "2008-12-26T20:42:57-08:00"
},
{
"Account": "B8DA1912-20A0-FB6E-0031-5F88FD63EF90",
"Name": "Solomon Green",
"RegisterDate": "2013-09-04T01:44:47-07:00"
}
];
}());
})(jQuery);

View File

@ -0,0 +1,10 @@
(function($) {
'use strict';
$(function() {
$("#features-link").on("click", function() {
$('html, body').animate({
scrollTop: $("#features").offset().top
}, 1000);
});
});
})(jQuery);

View File

@ -0,0 +1,80 @@
(function($) {
'use strict';
$.fn.easyNotify = function(options) {
var settings = $.extend({
title: "Notification",
options: {
body: "",
icon: "",
lang: 'pt-BR',
onClose: "",
onClick: "",
onError: ""
}
}, options);
this.init = function() {
var notify = this;
if (!("Notification" in window)) {
alert("This browser does not support desktop notification");
} else if (Notification.permission === "granted") {
var notification = new Notification(settings.title, settings.options);
notification.onclose = function() {
if (typeof settings.options.onClose === 'function') {
settings.options.onClose();
}
};
notification.onclick = function() {
if (typeof settings.options.onClick === 'function') {
settings.options.onClick();
}
};
notification.onerror = function() {
if (typeof settings.options.onError === 'function') {
settings.options.onError();
}
};
} else if (Notification.permission !== 'denied') {
Notification.requestPermission(function(permission) {
if (permission === "granted") {
notify.init();
}
});
}
};
this.init();
return this;
};
//Initialise notification
var myFunction = function() {
alert('Click function');
};
var myImg = "https://unsplash.it/600/600?image=777";
$("form").submit(function(event) {
event.preventDefault();
var options = {
title: $("#title").val(),
options: {
body: $("#message").val(),
icon: myImg,
lang: 'en-US',
onClick: myFunction
}
};
console.log(options);
$("#easyNotify").easyNotify(options);
});
}(jQuery));

View File

@ -0,0 +1,16 @@
(function($) {
'use strict';
var iconTochange;
dragula([document.getElementById("dragula-left"), document.getElementById("dragula-right")]);
dragula([document.getElementById("profile-list-left"), document.getElementById("profile-list-right")]);
dragula([document.getElementById("dragula-event-left"), document.getElementById("dragula-event-right")])
.on('drop', function(el) {
console.log($(el));
iconTochange = $(el).find('.ti');
if (iconTochange.hasClass('ti-pin-alt')) {
iconTochange.removeClass('ti-pin-alt text-primary').addClass('ti-time text-success');
} else if (iconTochange.hasClass('ti-time')) {
iconTochange.removeClass('ti-time text-success').addClass('ti-pin-alt text-primary');
}
})
})(jQuery);

View File

@ -0,0 +1,4 @@
(function($) {
'use strict';
$('.dropify').dropify();
})(jQuery);

View File

@ -0,0 +1,6 @@
(function($) {
'use strict';
$("my-awesome-dropzone").dropzone({
url: "bootstrapdash.com/"
});
})(jQuery);

View File

@ -0,0 +1,219 @@
(function($) {
'use strict';
/*Quill editor*/
if ($("#quillExample1").length) {
var quill = new Quill('#quillExample1', {
modules: {
toolbar: [
[{
header: [1, 2, false]
}],
['bold', 'italic', 'underline'],
['image', 'code-block']
]
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
});
}
/*simplemde editor*/
if ($("#simpleMde").length) {
var simplemde = new SimpleMDE({
element: $("#simpleMde")[0]
});
}
/*Tinymce editor*/
if ($("#tinyMceExample").length) {
tinymce.init({
selector: '#tinyMceExample',
height: 500,
theme: 'silver',
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen'
],
toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar2: 'print preview media | forecolor backcolor emoticons | codesample help',
image_advtab: true,
templates: [{
title: 'Test template 1',
content: 'Test 1'
},
{
title: 'Test template 2',
content: 'Test 2'
}
],
content_css: []
});
}
/*Summernote editor*/
if ($("#summernoteExample").length) {
$('#summernoteExample').summernote({
height: 300,
tabsize: 2
});
}
/*X-editable editor*/
if ($('#editable-form').length) {
$.fn.editable.defaults.mode = 'inline';
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary btn-sm editable-submit">' +
'<i class="fa fa-fw fa-check"></i>' +
'</button>' +
'<button type="button" class="btn btn-default btn-sm editable-cancel">' +
'<i class="fa fa-fw fa-times"></i>' +
'</button>';
$('#username').editable({
type: 'text',
pk: 1,
name: 'username',
title: 'Enter username'
});
$('#firstname').editable({
validate: function(value) {
if ($.trim(value) === '') return 'This field is required';
}
});
$('#sex').editable({
source: [{
value: 1,
text: 'Male'
},
{
value: 2,
text: 'Female'
}
]
});
$('#status').editable();
$('#group').editable({
showbuttons: false
});
$('#vacation').editable({
datepicker: {
todayBtn: 'linked'
}
});
$('#dob').editable();
$('#event').editable({
placement: 'right',
combodate: {
firstItem: 'name'
}
});
$('#meeting_start').editable({
format: 'yyyy-mm-dd hh:ii',
viewformat: 'dd/mm/yyyy hh:ii',
validate: function(v) {
if (v && v.getDate() === 10) return 'Day cant be 10!';
},
datetimepicker: {
todayBtn: 'linked',
weekStart: 1
}
});
$('#comments').editable({
showbuttons: 'bottom'
});
$('#note').editable();
$('#pencil').on("click", function(e) {
e.stopPropagation();
e.preventDefault();
$('#note').editable('toggle');
});
$('#state').editable({
source: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
});
$('#state2').editable({
value: 'California',
typeahead: {
name: 'state',
local: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
}
});
$('#fruits').editable({
pk: 1,
limit: 3,
source: [{
value: 1,
text: 'banana'
},
{
value: 2,
text: 'peach'
},
{
value: 3,
text: 'apple'
},
{
value: 4,
text: 'watermelon'
},
{
value: 5,
text: 'orange'
}
]
});
$('#tags').editable({
inputclass: 'input-large',
select2: {
tags: ['html', 'javascript', 'css', 'ajax'],
tokenSeparators: [",", " "]
}
});
$('#address').editable({
url: '/post',
value: {
city: "Moscow",
street: "Lenina",
building: "12"
},
validate: function(value) {
if (value.city === '') return 'city is required!';
},
display: function(value) {
if (!value) {
$(this).empty();
return;
}
var html = '<b>' + $('<div>').text(value.city).html() + '</b>, ' + $('<div>').text(value.street).html() + ' st., bld. ' + $('<div>').text(value.building).html();
$(this).html(html);
}
});
$('#user .editable').on('hidden', function(e, reason) {
if (reason === 'save' || reason === 'nochange') {
var $next = $(this).closest('tr').next().find('.editable');
if ($('#autoopen').is(':checked')) {
setTimeout(function() {
$next.editable('show');
}, 300);
} else {
$next.focus();
}
}
});
}
})(jQuery);

View File

@ -0,0 +1,12 @@
(function($) {
'use strict';
$(function() {
$('.file-upload-browse').on('click', function() {
var file = $(this).parent().parent().parent().find('.file-upload-default');
file.trigger('click');
});
$('.file-upload-default').on('change', function() {
$(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, ''));
});
});
})(jQuery);

View File

@ -0,0 +1,563 @@
(function($) {
'use strict';
var data = [{
data: 18000,
color: '#FABA66',
label: 'Linda'
},
{
data: 20000,
color: '#F36368',
label: 'John'
},
{
data: 13000,
color: '#76C1FA',
label: 'Margaret'
},
{
data: 15000,
color: '#63CF72',
label: 'Richard'
}
];
if ($("#pie-chart").length) {
$.plot("#pie-chart", data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 3 / 4,
formatter: labelFormatter,
background: {
opacity: 0.5
}
}
}
},
legend: {
show: false
}
});
}
function labelFormatter(label, series) {
return "<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>" + label + "<br/>" + Math.round(series.percent) + "%</div>";
}
/*---------------------
----- LINE CHART -----
---------------------*/
var d1 = [
[0, 30],
[1, 35],
[2, 35],
[3, 30],
[4, 30]
];
var d2 = [
[0, 50],
[1, 40],
[2, 45],
[3, 60],
[4, 50]
];
var d3 = [
[0, 40],
[1, 50],
[2, 35],
[3, 25],
[4, 40]
];
var stackedData = [{
data: d1,
color: "#76C1FA"
},
{
data: d2,
color: "#63CF72"
},
{
data: d3,
color: "#F36368"
}
];
/*---------------------------------------------------
Make some random data for Recent Items chart
---------------------------------------------------*/
var options = {
series: {
shadowSize: 0,
lines: {
show: true,
},
},
grid: {
borderWidth: 1,
labelMargin: 10,
mouseActiveRadius: 6,
borderColor: '#eee',
show: true,
hoverable: true,
clickable: true
},
xaxis: {
tickColor: '#eee',
tickDecimals: 0,
font: {
lineHeight: 15,
style: "normal",
color: "#000"
},
shadowSize: 0,
ticks: [
[0, "Jan"],
[1, "Feb"],
[2, "Mar"],
[3, "Apr"],
[4, "May"],
[5, "Jun"],
[6, "Jul"],
[7, "Aug"],
[8, "Sep"],
[9, "Oct"],
[10, "Nov"],
[11, "Dec"]
]
},
yaxis: {
tickColor: '#eee',
tickDecimals: 0,
font: {
lineHeight: 15,
style: "normal",
color: "#000",
},
shadowSize: 0
},
legend: {
container: '.flc-line',
backgroundOpacity: 0.5,
noColumns: 0,
backgroundColor: "white",
lineWidth: 0
},
colors: ["#F36368", "#63CF72", "#68B3C8"]
};
if ($("#line-chart").length) {
$.plot($("#line-chart"), [{
data: d1,
lines: {
show: true
},
label: 'Product A',
stack: true,
color: '#F36368'
},
{
data: d2,
lines: {
show: true
},
label: 'Product B',
stack: true,
color: '#FABA66'
},
{
data: d3,
lines: {
show: true
},
label: 'Product C',
stack: true,
color: '#68B3C8'
}
], options);
}
/*---------------------------------
Tooltips for Flot Charts
---------------------------------*/
if ($(".flot-chart-line").length) {
$(".flot-chart-line").on("bind", "plothover", function(event, pos, item) {
if (item) {
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
$(".flot-tooltip").html(item.series.label + " Sales " + " : " + y).css({
top: item.pageY + 5,
left: item.pageX + 5
}).show();
} else {
$(".flot-tooltip").hide();
}
});
$("<div class='flot-tooltip' class='chart-tooltip'></div>").appendTo("body");
}
/*---------------------
----- AREA CHART -----
---------------------*/
var d1 = [
[0, 0],
[1, 35],
[2, 35],
[3, 30],
[4, 30],
[5, 5],
[6, 32],
[7, 37],
[8, 30],
[9, 35],
[10, 30],
[11, 5]
];
var options = {
series: {
shadowSize: 0,
curvedLines: { //This is a third party plugin to make curved lines
apply: true,
active: true,
monotonicFit: true
},
lines: {
show: false,
fill: 0.98,
lineWidth: 0,
},
},
grid: {
borderWidth: 0,
labelMargin: 10,
hoverable: true,
clickable: true,
mouseActiveRadius: 6,
},
xaxis: {
tickDecimals: 0,
tickLength: 0
},
yaxis: {
tickDecimals: 0,
tickLength: 0
},
legend: {
show: false
}
};
var curvedLineOptions = {
series: {
shadowSize: 0,
curvedLines: { //This is a third party plugin to make curved lines
apply: true,
active: true,
monotonicFit: true
},
lines: {
show: false,
lineWidth: 0,
},
},
grid: {
borderWidth: 0,
labelMargin: 10,
hoverable: true,
clickable: true,
mouseActiveRadius: 6,
},
xaxis: {
tickDecimals: 0,
ticks: false
},
yaxis: {
tickDecimals: 0,
ticks: false
},
legend: {
noColumns: 4,
container: $("#chartLegend")
}
};
if ($("#area-chart").length) {
$.plot($("#area-chart"), [{
data: d1,
lines: {
show: true,
fill: 0.6
},
label: 'Product 1',
stack: true,
color: '#76C1FA'
}], options);
}
/*---------------------
----- COLUMN CHART -----
---------------------*/
$(function() {
var data = [
["January", 10],
["February", 8],
["March", 4],
["April", 13],
["May", 17],
["June", 9]
];
if ($("#column-chart").length) {
$.plot("#column-chart", [data], {
series: {
bars: {
show: true,
barWidth: 0.6,
align: "center"
}
},
xaxis: {
mode: "categories",
tickLength: 0
},
grid: {
borderWidth: 0,
labelMargin: 10,
hoverable: true,
clickable: true,
mouseActiveRadius: 6,
}
});
}
});
/*--------------------------------
----- STACKED CHART -----
--------------------------------*/
$(function() {
var d1 = [];
for (var i = 0; i <= 10; i += 1) {
d1.push([i, parseInt(Math.random() * 30)]);
}
var d2 = [];
for (var i = 0; i <= 10; i += 1) {
d2.push([i, parseInt(Math.random() * 30)]);
}
var d3 = [];
for (var i = 0; i <= 10; i += 1) {
d3.push([i, parseInt(Math.random() * 30)]);
}
if ($("#stacked-bar-chart").length) {
$.plot("#stacked-bar-chart", stackedData, {
series: {
stack: 0,
lines: {
show: false,
fill: true,
steps: false
},
bars: {
show: true,
fill: true,
barWidth: 0.6
},
},
grid: {
borderWidth: 0,
labelMargin: 10,
hoverable: true,
clickable: true,
mouseActiveRadius: 6,
}
});
}
});
/*--------------------------------
----- REALTIME CHART -----
--------------------------------*/
$(function() {
// We use an inline data source in the example, usually data would
// be fetched from a server
var data = [],
totalPoints = 300;
function getRandomData() {
if (data.length > 0)
data = data.slice(1);
// Do a random walk
while (data.length < totalPoints) {
var prev = data.length > 0 ? data[data.length - 1] : 50,
y = prev + Math.random() * 10 - 5;
if (y < 0) {
y = 0;
} else if (y > 100) {
y = 100;
}
data.push(y);
}
// Zip the generated y values with the x values
var res = [];
for (var i = 0; i < data.length; ++i) {
res.push([i, data[i]])
}
return res;
}
// Set up the control widget
var updateInterval = 30;
if ($("#realtime-chart").length) {
var plot = $.plot("#realtime-chart", [getRandomData()], {
series: {
shadowSize: 0 // Drawing is faster without shadows
},
yaxis: {
min: 0,
max: 100
},
xaxis: {
show: false
},
grid: {
borderWidth: 0,
labelMargin: 10,
hoverable: true,
clickable: true,
mouseActiveRadius: 6,
}
});
function update() {
plot.setData([getRandomData()]);
// Since the axes don't change, we don't need to call plot.setupGrid()
plot.draw();
setTimeout(update, updateInterval);
}
update();
}
});
/*--------------------------------
----- CURVED LINE CHART -----
--------------------------------*/
$(function() {
var d1 = [
[0, 6],
[1, 14],
[2, 10],
[3, 14],
[4, 5]
];
var d2 = [
[0, 6],
[1, 7],
[2, 11],
[3, 8],
[4, 11]
];
var d3 = [
[0, 6],
[1, 5],
[2, 6],
[3, 10],
[4, 5]
];
if ($("#curved-line-chart").length) {
$.plot($("#curved-line-chart"), [{
data: d1,
lines: {
show: true,
fill: 0.98
},
label: 'Plans',
stack: true,
color: '#5E50F9'
},
{
data: d2,
lines: {
show: true,
fill: 0.98
},
label: 'Purchase',
stack: true,
color: '#8C95FC'
},
{
data: d3,
lines: {
show: true,
fill: 0.98
},
label: 'Services',
stack: true,
color: '#A8B4FD'
}
], curvedLineOptions);
}
});
})(jQuery);

View File

@ -0,0 +1,146 @@
(function($) {
'use strict';
// Jquery Tag Input Starts
$('#tags').tagsInput({
'width': '100%',
'height': '75%',
'interactive': true,
'defaultText': 'Add More',
'removeWithBackspace': true,
'minChars': 0,
'maxChars': 20, // if not provided there is no limit
'placeholderColor': '#666666'
});
// Jquery Tag Input Ends
// Jquery Bar Rating Starts
$(function() {
function ratingEnable() {
$('#example-1to10').barrating('show', {
theme: 'bars-1to10'
});
$('#example-movie').barrating('show', {
theme: 'bars-movie'
});
$('#example-movie').barrating('set', 'Mediocre');
$('#example-square').barrating('show', {
theme: 'bars-square',
showValues: true,
showSelectedRating: false
});
$('#example-pill').barrating('show', {
theme: 'bars-pill',
initialRating: 'A',
showValues: true,
showSelectedRating: false,
allowEmpty: true,
emptyValue: '-- no rating selected --',
onSelect: function(value, text) {
alert('Selected rating: ' + value);
}
});
$('#example-reversed').barrating('show', {
theme: 'bars-reversed',
showSelectedRating: true,
reverse: true
});
$('#example-horizontal').barrating('show', {
theme: 'bars-horizontal',
reverse: true,
hoverState: false
});
$('#example-fontawesome').barrating({
theme: 'fontawesome-stars',
showSelectedRating: false
});
$('#example-css').barrating({
theme: 'css-stars',
showSelectedRating: false
});
$('#example-bootstrap').barrating({
theme: 'bootstrap-stars',
showSelectedRating: false
});
var currentRating = $('#example-fontawesome-o').data('current-rating');
$('.stars-example-fontawesome-o .current-rating')
.find('span')
.html(currentRating);
$('.stars-example-fontawesome-o .clear-rating').on('click', function(event) {
event.preventDefault();
$('#example-fontawesome-o')
.barrating('clear');
});
$('#example-fontawesome-o').barrating({
theme: 'fontawesome-stars-o',
showSelectedRating: false,
initialRating: currentRating,
onSelect: function(value, text) {
if (!value) {
$('#example-fontawesome-o')
.barrating('clear');
} else {
$('.stars-example-fontawesome-o .current-rating')
.addClass('hidden');
$('.stars-example-fontawesome-o .your-rating')
.removeClass('hidden')
.find('span')
.html(value);
}
},
onClear: function(value, text) {
$('.stars-example-fontawesome-o')
.find('.current-rating')
.removeClass('hidden')
.end()
.find('.your-rating')
.addClass('hidden');
}
});
}
function ratingDisable() {
$('select').barrating('destroy');
}
$('.rating-enable').on("click", function(event) {
event.preventDefault();
ratingEnable();
$(this).addClass('deactivated');
$('.rating-disable').removeClass('deactivated');
});
$('.rating-disable').on("click", function(event) {
event.preventDefault();
ratingDisable();
$(this).addClass('deactivated');
$('.rating-enable').removeClass('deactivated');
});
ratingEnable();
});
// Jquery Bar Rating Ends
})(jQuery);

View File

@ -0,0 +1,38 @@
(function($) {
'use strict';
$(function() {
$('.repeater').repeater({
// (Optional)
// "defaultValues" sets the values of added items. The keys of
// defaultValues refer to the value of the input's name attribute.
// If a default value is not specified for an input, then it will
// have its value cleared.
defaultValues: {
'text-input': 'foo'
},
// (Optional)
// "show" is called just after an item is added. The item is hidden
// at this point. If a show callback is not given the item will
// have $(this).show() called on it.
show: function() {
$(this).slideDown();
},
// (Optional)
// "hide" is called when a user clicks on a data-repeater-delete
// element. The item is still visible. "hide" is passed a function
// as its first argument which will properly remove the item.
// "hide" allows for a confirmation step, to send a delete request
// to the server, etc. If a hide callback is not given the item
// will be deleted.
hide: function(deleteElement) {
if (confirm('Are you sure you want to delete this element?')) {
$(this).slideUp(deleteElement);
}
},
// (Optional)
// Removes the delete button from the first list item,
// defaults to false.
isFirstItemUndeletable: true
})
});
})(jQuery);

View File

@ -0,0 +1,97 @@
(function($) {
'use strict';
$.validator.setDefaults({
submitHandler: function() {
alert("submitted!");
}
});
$(function() {
// validate the comment form when it is submitted
$("#commentForm").validate({
errorPlacement: function(label, element) {
label.addClass('mt-2 text-danger');
label.insertAfter(element);
},
highlight: function(element, errorClass) {
$(element).parent().addClass('has-danger')
$(element).addClass('form-control-danger')
}
});
// validate signup form on keyup and submit
$("#signupForm").validate({
rules: {
firstname: "required",
lastname: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
email: {
required: true,
email: true
},
topic: {
required: "#newsletter:checked",
minlength: 2
},
agree: "required"
},
messages: {
firstname: "Please enter your firstname",
lastname: "Please enter your lastname",
username: {
required: "Please enter a username",
minlength: "Your username must consist of at least 2 characters"
},
password: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
confirm_password: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long",
equalTo: "Please enter the same password as above"
},
email: "Please enter a valid email address",
agree: "Please accept our policy",
topic: "Please select at least 2 topics"
},
errorPlacement: function(label, element) {
label.addClass('mt-2 text-danger');
label.insertAfter(element);
},
highlight: function(element, errorClass) {
$(element).parent().addClass('has-danger')
$(element).addClass('form-control-danger')
}
});
// propose username by combining first- and lastname
$("#username").focus(function() {
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
if (firstname && lastname && !this.value) {
this.value = firstname + "." + lastname;
}
});
//code to hide topic selection, disable for demo
var newsletter = $("#newsletter");
// newsletter topics are optional, hide at first
var inital = newsletter.is(":checked");
var topics = $("#newsletter_topics")[inital ? "removeClass" : "addClass"]("gray");
var topicInputs = topics.find("input").attr("disabled", !inital);
// show when newsletter is checked
newsletter.on("click", function() {
topics[this.checked ? "removeClass" : "addClass"]("gray");
topicInputs.attr("disabled", !this.checked);
});
});
})(jQuery);

View File

@ -0,0 +1,37 @@
(function($) {
'use strict';
if ($("#timepicker-example").length) {
$('#timepicker-example').datetimepicker({
format: 'LT'
});
}
if ($(".color-picker").length) {
$('.color-picker').asColorPicker();
}
if ($("#datepicker-popup").length) {
$('#datepicker-popup').datepicker({
enableOnReadonly: true,
todayHighlight: true,
});
}
if ($("#inline-datepicker").length) {
$('#inline-datepicker').datepicker({
enableOnReadonly: true,
todayHighlight: true,
});
}
if ($(".datepicker-autoclose").length) {
$('.datepicker-autoclose').datepicker({
autoclose: true
});
}
if ($('input[name="date-range"]').length) {
$('input[name="date-range"]').daterangepicker();
}
if($('.input-daterange').length) {
$('.input-daterange input').each(function() {
$(this).datepicker('clearDates');
});
$('.input-daterange').datepicker({});
}
})(jQuery);

View File

@ -0,0 +1,242 @@
// Region Charts Starts
google.charts.load('current', {
'packages': ['geochart'],
// Note: you will need to get a mapsApiKey for your project.
// See: https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings
'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
});
google.charts.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
var options = {
colorAxis: {
colors: ['#76C1FA', '#63CF72', '#F36368', '#FABA66']
}
};
var chart = new google.visualization.GeoChart(document.getElementById('regions-chart'));
chart.draw(data, options);
}
// Region Charts Ends
// Bar Charts Starts
google.charts.load('current', {
'packages': ['bar']
});
google.charts.setOnLoadCallback(drawStuff);
function drawStuff() {
var data = new google.visualization.arrayToDataTable([
['Opening Move', 'Percentage'],
["King's pawn (e4)", 44],
["Queen's pawn (d4)", 31],
["Knight to King 3 (Nf3)", 12],
["Queen's bishop pawn (c4)", 10],
['Other', 3]
]);
var options = {
title: 'Approximating Normal Distribution',
legend: {
position: 'none'
},
colors: ['#76C1FA'],
chartArea: {
width: 401
},
hAxis: {
ticks: [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]
},
bar: {
gap: 0
},
histogram: {
bucketSize: 0.02,
maxNumBuckets: 200,
minValue: -1,
maxValue: 1
}
};
var chart = new google.charts.Bar(document.getElementById('Bar-chart'));
chart.draw(data, options);
};
// Bar Charts Ends
// Histogram Charts Starts
(function($) {
google.charts.load("current", {
packages: ["corechart"]
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Quarks', 'Leptons', 'Gauge Bosons', 'Scalar Bosons'],
[2 / 3, -1, 0, 0],
[2 / 3, -1, 0, null],
[2 / 3, -1, 0, null],
[-1 / 3, 0, 1, null],
[-1 / 3, 0, -1, null],
[-1 / 3, 0, null, null],
[-1 / 3, 0, null, null]
]);
var options = {
title: 'Charges of subatomic particles',
legend: {
position: 'top',
maxLines: 2
},
colors: ['#76C1FA', '#63CF72', '#F36368', '#FABA66'],
interpolateNulls: false,
chartArea: {
width: 401
},
};
var chart = new google.visualization.Histogram(document.getElementById('Histogram-chart'));
chart.draw(data, options);
}
})(jQuery);
// Histogram Charts Ends
// Area Chart Starts
(function($) {
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2013', 1000, 400],
['2014', 1170, 460],
['2015', 660, 1120],
['2016', 1030, 540]
]);
var options = {
title: 'Company Performance',
hAxis: {
title: 'Year',
titleTextStyle: {
color: '#333'
}
},
colors: ['#76C1FA', '#63CF72', '#F36368', '#FABA66'],
chartArea: {
width: 500
},
vAxis: {
minValue: 0
}
};
var AreaChart = new google.visualization.AreaChart(document.getElementById('area-chart'));
AreaChart.draw(data, options);
}
})(jQuery);
// Area Chart Ends
// Donut Chart Starts
google.charts.load("current", {
packages: ["corechart"]
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities',
pieHole: 0.4,
colors: ['#76C1FA', '#63CF72', '#F36368', '#FABA66'],
chartArea: {
width: 500
},
};
var Donutchart = new google.visualization.PieChart(document.getElementById('Donut-chart'));
Donutchart.draw(data, options);
}
// Donut Chart Ends
// Curve Chart Starts
(function($) {
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance',
curveType: 'function',
legend: {
position: 'bottom'
},
colors: ['#76C1FA', '#63CF72', '#F36368', '#FABA66'],
chartArea: {
width: 500
},
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
})(jQuery);
// Curve Chart Ends

View File

@ -0,0 +1,698 @@
'use strict';
function initMap() {
//Map location
var MapLocation = {
lat: 40.6971494,
lng: -74.2598719
};
// Map Zooming
var MapZoom = 14;
// Basic Map
if($("#map-with-marker").length) {
var MapWithMarker = new google.maps.Map(document.getElementById('map-with-marker'), {
zoom: MapZoom,
center: MapLocation
});
var marker_1 = new google.maps.Marker({
position: MapLocation,
map: MapWithMarker
});
}
// Basic map with cutom marker
if($("#custom-marker").length) {
var CustomMarker = new google.maps.Map(document.getElementById('custom-marker'), {
zoom: MapZoom,
center: MapLocation
});
var iconBase = '../../images/file-icons/';
var marker_2 = new google.maps.Marker({
position: MapLocation,
map: CustomMarker,
icon: iconBase + 'flag.png'
});
}
// Map without controls
if($("#map-minimal").length) {
var MinimalMap = new google.maps.Map(document.getElementById('map-minimal'), {
zoom: MapZoom,
center: MapLocation,
disableDefaultUI: true
});
var marker_3 = new google.maps.Marker({
position: MapLocation,
map: MinimalMap
});
}
// Night Mode
if($("#night-mode-map").length) {
var NightModeMap = new google.maps.Map(document.getElementById('night-mode-map'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "all",
"elementType": "all",
"stylers": [{
"saturation": -100
},
{
"gamma": 0.5
}
]
}]
});
}
// Apple Theme
if($("#apple-map-theme").length) {
var AppletThemeMap = new google.maps.Map(document.getElementById('apple-map-theme'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "landscape.man_made",
"elementType": "geometry",
"stylers": [{
"color": "#f7f1df"
}]
},
{
"featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [{
"color": "#d0e3b4"
}]
},
{
"featureType": "landscape.natural.terrain",
"elementType": "geometry",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "poi",
"elementType": "labels",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "poi.business",
"elementType": "all",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "poi.medical",
"elementType": "geometry",
"stylers": [{
"color": "#fbd3da"
}]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [{
"color": "#bde6ab"
}]
},
{
"featureType": "road",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "road",
"elementType": "labels",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [{
"color": "#ffe15f"
}]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [{
"color": "#efd151"
}]
},
{
"featureType": "road.arterial",
"elementType": "geometry.fill",
"stylers": [{
"color": "#ffffff"
}]
},
{
"featureType": "road.local",
"elementType": "geometry.fill",
"stylers": [{
"color": "black"
}]
},
{
"featureType": "transit.station.airport",
"elementType": "geometry.fill",
"stylers": [{
"color": "#cfb2db"
}]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [{
"color": "#a2daf2"
}]
}
]
});
}
// Nature Theme
if($("#nature-map-theme").length) {
var NatureThemeMap = new google.maps.Map(document.getElementById('nature-map-theme'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "landscape",
"stylers": [{
"hue": "#FFA800"
},
{
"saturation": 0
},
{
"lightness": 0
},
{
"gamma": 1
}
]
},
{
"featureType": "road.highway",
"stylers": [{
"hue": "#53FF00"
},
{
"saturation": -73
},
{
"lightness": 40
},
{
"gamma": 1
}
]
},
{
"featureType": "road.arterial",
"stylers": [{
"hue": "#FBFF00"
},
{
"saturation": 0
},
{
"lightness": 0
},
{
"gamma": 1
}
]
},
{
"featureType": "road.local",
"stylers": [{
"hue": "#00FFFD"
},
{
"saturation": 0
},
{
"lightness": 30
},
{
"gamma": 1
}
]
},
{
"featureType": "water",
"stylers": [{
"hue": "#00BFFF"
},
{
"saturation": 6
},
{
"lightness": 8
},
{
"gamma": 1
}
]
},
{
"featureType": "poi",
"stylers": [{
"hue": "#679714"
},
{
"saturation": 33.4
},
{
"lightness": -25.4
},
{
"gamma": 1
}
]
}
]
});
}
// Captor Theme
if($("#captor-map-theme").length) {
var CaptorThemeMap = new google.maps.Map(document.getElementById('captor-map-theme'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "water",
"stylers": [{
"color": "#0e171d"
}]
},
{
"featureType": "landscape",
"stylers": [{
"color": "#1e303d"
}]
},
{
"featureType": "road",
"stylers": [{
"color": "#1e303d"
}]
},
{
"featureType": "poi.park",
"stylers": [{
"color": "#1e303d"
}]
},
{
"featureType": "transit",
"stylers": [{
"color": "#182731"
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "poi",
"elementType": "labels.icon",
"stylers": [{
"color": "#f0c514"
},
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text.stroke",
"stylers": [{
"color": "#1e303d"
},
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "labels.text.fill",
"stylers": [{
"color": "#e77e24"
},
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.text.fill",
"stylers": [{
"color": "#94a5a6"
}]
},
{
"featureType": "administrative",
"elementType": "labels",
"stylers": [{
"visibility": "simplified"
},
{
"color": "#e84c3c"
}
]
},
{
"featureType": "poi",
"stylers": [{
"color": "#e84c3c"
},
{
"visibility": "off"
}
]
}
]
});
}
// Avagardo Theme
if($("#avocado-map-theme").length) {
var AvagardoThemeMap = new google.maps.Map(document.getElementById('avocado-map-theme'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "water",
"elementType": "geometry",
"stylers": [{
"visibility": "on"
},
{
"color": "#aee2e0"
}
]
},
{
"featureType": "landscape",
"elementType": "geometry.fill",
"stylers": [{
"color": "#abce83"
}]
},
{
"featureType": "poi",
"elementType": "geometry.fill",
"stylers": [{
"color": "#769E72"
}]
},
{
"featureType": "poi",
"elementType": "labels.text.fill",
"stylers": [{
"color": "#7B8758"
}]
},
{
"featureType": "poi",
"elementType": "labels.text.stroke",
"stylers": [{
"color": "#EBF4A4"
}]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [{
"visibility": "simplified"
},
{
"color": "#8dab68"
}
]
},
{
"featureType": "road",
"elementType": "geometry.fill",
"stylers": [{
"visibility": "simplified"
}]
},
{
"featureType": "road",
"elementType": "labels.text.fill",
"stylers": [{
"color": "#5B5B3F"
}]
},
{
"featureType": "road",
"elementType": "labels.text.stroke",
"stylers": [{
"color": "#ABCE83"
}]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [{
"color": "#A4C67D"
}]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [{
"color": "#9BBF72"
}]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [{
"color": "#EBF4A4"
}]
},
{
"featureType": "transit",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
},
{
"color": "#87ae79"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [{
"color": "#7f2200"
},
{
"visibility": "off"
}
]
},
{
"featureType": "administrative",
"elementType": "labels.text.stroke",
"stylers": [{
"color": "#ffffff"
},
{
"visibility": "on"
},
{
"weight": 4.1
}
]
},
{
"featureType": "administrative",
"elementType": "labels.text.fill",
"stylers": [{
"color": "#495421"
}]
},
{
"featureType": "administrative.neighborhood",
"elementType": "labels",
"stylers": [{
"visibility": "off"
}]
}
]
});
}
// Propia Theme
if($("#propia-map-theme").length) {
var PropiaThemeMap = new google.maps.Map(document.getElementById('propia-map-theme'), {
zoom: MapZoom,
center: MapLocation,
styles: [{
"featureType": "landscape",
"stylers": [{
"visibility": "simplified"
},
{
"color": "#2b3f57"
},
{
"weight": 0.1
}
]
},
{
"featureType": "administrative",
"stylers": [{
"visibility": "on"
},
{
"hue": "#ff0000"
},
{
"weight": 0.4
},
{
"color": "#ffffff"
}
]
},
{
"featureType": "road.highway",
"elementType": "labels.text",
"stylers": [{
"weight": 1.3
},
{
"color": "#FFFFFF"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [{
"color": "#f55f77"
},
{
"weight": 3
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [{
"color": "#f55f77"
},
{
"weight": 1.1
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [{
"color": "#f55f77"
},
{
"weight": 0.4
}
]
},
{},
{
"featureType": "road.highway",
"elementType": "labels",
"stylers": [{
"weight": 0.8
},
{
"color": "#ffffff"
},
{
"visibility": "on"
}
]
},
{
"featureType": "road.local",
"elementType": "labels",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "road.arterial",
"elementType": "labels",
"stylers": [{
"color": "#ffffff"
},
{
"weight": 0.7
}
]
},
{
"featureType": "poi",
"elementType": "labels",
"stylers": [{
"visibility": "off"
}]
},
{
"featureType": "poi",
"stylers": [{
"color": "#6c5b7b"
}]
},
{
"featureType": "water",
"stylers": [{
"color": "#f3b191"
}]
},
{
"featureType": "transit.line",
"stylers": [{
"visibility": "on"
}]
}
]
});
}
}

View File

@ -0,0 +1,25 @@
(function($) {
'use strict';
//Open submenu on hover in compact sidebar mode and horizontal menu mode
$(document).on('mouseenter mouseleave', '.sidebar .nav-item', function(ev) {
var body = $('body');
var sidebarIconOnly = body.hasClass("sidebar-icon-only");
var sidebarFixed = body.hasClass("sidebar-fixed");
if (!('ontouchstart' in document.documentElement)) {
if (sidebarIconOnly) {
if (sidebarFixed) {
if (ev.type === 'mouseenter') {
body.removeClass('sidebar-icon-only');
}
} else {
var $menuItem = $(this);
if (ev.type === 'mouseenter') {
$menuItem.addClass('hover-open')
} else {
$menuItem.removeClass('hover-open')
}
}
}
}
});
})(jQuery);

View File

@ -0,0 +1,43 @@
(function($) {
'use strict';
$(function() {
$('.icheck input').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal',
increaseArea: '20%'
});
$('.icheck-square input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square',
increaseArea: '20%'
});
$('.icheck-flat input').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat',
increaseArea: '20%'
});
var icheckLineArray = $('.icheck-line input');
for (var i = 0; i < icheckLineArray.length; i++) {
var self = $(icheckLineArray[i]);
var label = self.next();
var label_text = label.text();
label.remove();
self.iCheck({
checkboxClass: 'icheckbox_line-blue',
radioClass: 'iradio_line',
insert: '<div class="icheck_line-icon"></div>' + label_text
});
}
$('.icheck-polaris input').iCheck({
checkboxClass: 'icheckbox_polaris',
radioClass: 'iradio_polaris',
increaseArea: '20%'
});
$('.icheck-futurico input').iCheck({
checkboxClass: 'icheckbox_futurico',
radioClass: 'iradio_futurico',
increaseArea: '20%'
});
});
})(jQuery);

View File

@ -0,0 +1,7 @@
(function($) {
'use strict';
// initializing inputmask
$(":input").inputmask();
})(jQuery);

View File

@ -0,0 +1,189 @@
(function($) {
'use strict';
if ($('#range_01').length) {
$("#range_01").ionRangeSlider();
}
if ($("#range_02").length) {
$("#range_02").ionRangeSlider({
min: 100,
max: 1000,
from: 550
});
}
if ($("#range_03").length) {
$("#range_03").ionRangeSlider({
type: "double",
grid: true,
min: 0,
max: 1000,
from: 200,
to: 800,
prefix: "$"
});
}
if ($("#range_04").length) {
$("#range_04").ionRangeSlider({
type: "double",
min: 100,
max: 200,
from: 145,
to: 155,
prefix: "Weight: ",
postfix: " million pounds",
decorate_both: true
});
}
if ($("#range_05").length) {
$("#range_05").ionRangeSlider({
type: "double",
min: 1000,
max: 2000,
from: 1200,
to: 1800,
hide_min_max: true,
hide_from_to: true,
grid: false
});
}
if ($("#range_06").length) {
$("#range_06").ionRangeSlider({
type: "double",
min: 1000,
max: 2000,
from: 1200,
to: 1800,
hide_min_max: true,
hide_from_to: true,
grid: true
});
}
if ($("#range_07").length) {
$("#range_07").ionRangeSlider({
type: "double",
grid: true,
min: 0,
max: 10000,
from: 1000,
prefix: "$"
});
}
if ($("#range_08").length) {
$("#range_08").ionRangeSlider({
type: "single",
grid: true,
min: -90,
max: 90,
from: 0,
postfix: "°"
});
}
if ($("#range_09").length) {
$("#range_09").ionRangeSlider({
type: "double",
min: 0,
max: 10000,
grid: true
});
}
if ($("#range_10").length) {
$("#range_10").ionRangeSlider({
type: "double",
min: 0,
max: 10000,
grid: true,
grid_num: 10
});
}
if ($("#range_11").length) {
$("#range_11").ionRangeSlider({
type: "double",
min: 0,
max: 10000,
step: 500,
grid: true,
grid_snap: true
});
}
if ($("#range_12").length) {
$("#range_12").ionRangeSlider({
type: "single",
min: 0,
max: 10,
step: 2.34,
grid: true,
grid_snap: true
});
}
if ($("#range_13").length) {
$("#range_13").ionRangeSlider({
type: "double",
min: 0,
max: 100,
from: 30,
to: 70,
from_fixed: true
});
}
if ($("#range_14").length) {
$("#range_14").ionRangeSlider({
min: 0,
max: 100,
from: 30,
from_min: 10,
from_max: 50
});
}
if ($("#range_15").length) {
$("#range_15").ionRangeSlider({
min: 0,
max: 100,
from: 30,
from_min: 10,
from_max: 50,
from_shadow: true
});
}
if ($("#range_16").length) {
$("#range_16").ionRangeSlider({
type: "double",
min: 0,
max: 100,
from: 20,
from_min: 10,
from_max: 30,
from_shadow: true,
to: 80,
to_min: 70,
to_max: 90,
to_shadow: true,
grid: true,
grid_num: 10
});
}
if ($("#range_17").length) {
$("#range_17").ionRangeSlider({
min: 0,
max: 100,
from: 30,
disable: true
});
}
})(jQuery);

View File

@ -0,0 +1,123 @@
/*
* jq.TableSort -- jQuery Table sorter Plug-in.
*
* Version 1.0.0.
*
* Copyright (c) 2017 Dmitry Zavodnikov.
*
* Licensed under the MIT License.
*/
(function($) {
'use strict';
var SORT = 'sort';
var ASC = 'asc';
var DESC = 'desc';
var UNSORT = 'unsort';
var config = {
defaultColumn: 0,
defaultOrder: 'asc',
styles: {
'sort': 'sortStyle',
'asc': 'ascStyle',
'desc': 'descStyle',
'unsort': 'unsortStyle'
},
selector: function(tableBody, column) {
var groups = [];
var tableRows = $(tableBody).find('tr');
for (var i = 0; i < tableRows.length; i++) {
var td = $(tableRows[i]).find('td')[column];
groups.push({
'values': [tableRows[i]],
'key': $(td).text()
});
}
return groups;
},
comparator: function(group1, group2) {
return group1.key.localeCompare(group2.key);
}
};
function getTableHeaders(table) {
return $(table).find('thead > tr > th');
}
function getSortableTableHeaders(table) {
return getTableHeaders(table).filter(function(index) {
return $(this).hasClass(config.styles[SORT]);
});
}
function changeOrder(table, column) {
var sortedHeader = getTableHeaders(table).filter(function(index) {
return $(this).hasClass(config.styles[ASC]) || $(this).hasClass(config.styles[DESC]);
});
var sordOrder = config.defaultOrder;
if (sortedHeader.hasClass(config.styles[ASC])) {
sordOrder = ASC;
}
if (sortedHeader.hasClass(config.styles[DESC])) {
sordOrder = DESC;
}
var th = getTableHeaders(table)[column];
if (th === sortedHeader[0]) {
if (sordOrder === ASC) {
sordOrder = DESC;
} else {
sordOrder = ASC;
}
}
var headers = getSortableTableHeaders(table);
headers.removeClass(config.styles[ASC]);
headers.removeClass(config.styles[DESC]);
headers.addClass(config.styles[UNSORT]);
$(th).removeClass(config.styles[UNSORT]);
$(th).addClass(config.styles[sordOrder]);
var tbody = $(table).find('tbody')[0];
var groups = config.selector(tbody, column);
// Sorting.
groups.sort(function(a, b) {
var res = config.comparator(a, b);
return sordOrder === ASC ? res : -1 * res;
});
for (var i = 0; i < groups.length; i++) {
var trList = groups[i];
var trListValues = trList.values;
for (var j = 0; j < trListValues.length; j++) {
tbody.append(trListValues[j]);
}
}
}
$.fn.tablesort = function(userConfig) {
// Create and save table sort configuration.
$.extend(config, userConfig);
// Process all selected tables.
var selectedTables = this;
for (var i = 0; i < selectedTables.length; i++) {
var table = selectedTables[i];
var tableHeader = getSortableTableHeaders(table);
for (var j = 0; j < tableHeader.length; j++) {
var th = tableHeader[j];
$(th).on("click", function(event) {
var clickColumn = $.inArray(event.currentTarget, getTableHeaders(table));
changeOrder(table, clickColumn);
});
}
}
return this;
};
})(jQuery);

View File

@ -0,0 +1,9 @@
(function($) {
'use strict';
if ($("#fileuploader").length) {
$("#fileuploader").uploadFile({
url: "YOUR_FILE_UPLOAD_URL",
fileName: "myfile"
});
}
})(jQuery);

View File

@ -0,0 +1,192 @@
(function($) {
'use strict';
$(function() {
//basic config
if ($("#js-grid").length) {
$("#js-grid").jsGrid({
height: "500px",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
deleteConfirm: "Do you really want to delete the client?",
data: db.clients,
fields: [{
name: "Name",
type: "text",
width: 150
},
{
name: "Age",
type: "number",
width: 50
},
{
name: "Address",
type: "text",
width: 200
},
{
name: "Country",
type: "select",
items: db.countries,
valueField: "Id",
textField: "Name"
},
{
name: "Married",
title: "Is Married",
itemTemplate: function(value, item) {
return $("<div>")
.addClass("form-check mt-0")
.append(
$("<label>").addClass("form-check-label")
.append(
$("<input>").attr("type", "checkbox")
.addClass("form-check-input")
.attr("checked", value || item.Checked)
.on("change", function() {
item.Checked = $(this).is(":checked");
})
)
.append('<i class="input-helper"></i>')
);
}
},
{
type: "control"
}
]
});
}
//Static
if ($("#js-grid-static").length) {
$("#js-grid-static").jsGrid({
height: "500px",
width: "100%",
sorting: true,
paging: true,
data: db.clients,
fields: [{
name: "Name",
type: "text",
width: 150
},
{
name: "Age",
type: "number",
width: 50
},
{
name: "Address",
type: "text",
width: 200
},
{
name: "Country",
type: "select",
items: db.countries,
valueField: "Id",
textField: "Name"
},
{
name: "Married",
title: "Is Married",
itemTemplate: function(value, item) {
return $("<div>")
.addClass("form-check mt-0")
.append(
$("<label>").addClass("form-check-label")
.append(
$("<input>").attr("type", "checkbox")
.addClass("form-check-input")
.attr("checked", value || item.Checked)
.on("change", function() {
item.Checked = $(this).is(":checked");
})
)
.append('<i class="input-helper"></i>')
);
}
}
]
});
}
//sortable
if ($("#js-grid-sortable").length) {
$("#js-grid-sortable").jsGrid({
height: "500px",
width: "100%",
autoload: true,
selecting: false,
controller: db,
fields: [{
name: "Name",
type: "text",
width: 150
},
{
name: "Age",
type: "number",
width: 50
},
{
name: "Address",
type: "text",
width: 200
},
{
name: "Country",
type: "select",
items: db.countries,
valueField: "Id",
textField: "Name"
},
{
name: "Married",
title: "Is Married",
itemTemplate: function(value, item) {
return $("<div>")
.addClass("form-check mt-0")
.append(
$("<label>").addClass("form-check-label")
.append(
$("<input>").attr("type", "checkbox")
.addClass("form-check-input")
.attr("checked", value || item.Checked)
.on("change", function() {
item.Checked = $(this).is(":checked");
})
)
.append('<i class="input-helper"></i>')
);
}
}
]
});
}
if ($("#sort").length) {
$("#sort").on("click", function() {
var field = $("#sortingField").val();
$("#js-grid-sortable").jsGrid("sort", field);
});
}
});
})(jQuery);

View File

@ -0,0 +1,193 @@
var g1, g2, gg1, g7, g8, g9, g10;
window.onload = function() {
var g1 = new JustGage({
id: "g1",
value: getRandomInt(0, 100),
min: 0,
max: 100,
title: "Big Fella",
label: "pounds"
});
setInterval(function() {
g1.refresh(getRandomInt(50, 100));
}, 2500);
};
document.addEventListener("DOMContentLoaded", function(event) {
g2 = new JustGage({
id: "g2",
value: 72,
min: 0,
max: 100,
donut: true,
gaugeWidthScale: 0.6,
counter: true,
hideInnerShadow: true
});
document.getElementById('g2_refresh').addEventListener('click', function() {
g2.refresh(getRandomInt(0, 100));
});
var g3 = new JustGage({
id: 'g3',
value: 65,
min: 0,
max: 100,
symbol: '%',
pointer: true,
gaugeWidthScale: 0.6,
customSectors: [{
color: '#ff0000',
lo: 50,
hi: 100
}, {
color: '#00ff00',
lo: 0,
hi: 50
}],
counter: true
});
var g4 = new JustGage({
id: 'g4',
value: 45,
min: 0,
max: 100,
symbol: '%',
pointer: true,
pointerOptions: {
toplength: -15,
bottomlength: 10,
bottomwidth: 12,
color: '#8e8e93',
stroke: '#ffffff',
stroke_width: 3,
stroke_linecap: 'round'
},
gaugeWidthScale: 0.6,
counter: true
});
var g5 = new JustGage({
id: 'g5',
value: 40,
min: 0,
max: 100,
symbol: '%',
donut: true,
pointer: true,
gaugeWidthScale: 0.4,
pointerOptions: {
toplength: 10,
bottomlength: 10,
bottomwidth: 8,
color: '#000'
},
customSectors: [{
color: "#ff0000",
lo: 50,
hi: 100
}, {
color: "#00ff00",
lo: 0,
hi: 50
}],
counter: true
});
var g6 = new JustGage({
id: 'g6',
value: 70,
min: 0,
max: 100,
symbol: '%',
pointer: true,
pointerOptions: {
toplength: 8,
bottomlength: -20,
bottomwidth: 6,
color: '#8e8e93'
},
gaugeWidthScale: 0.1,
counter: true
});
var g7 = new JustGage({
id: 'g7',
value: 65,
min: 0,
max: 100,
reverse: true,
gaugeWidthScale: 0.6,
customSectors: [{
color: '#ff0000',
lo: 50,
hi: 100
}, {
color: '#00ff00',
lo: 0,
hi: 50
}],
counter: true
});
var g8 = new JustGage({
id: 'g8',
value: 45,
min: 0,
max: 500,
reverse: true,
gaugeWidthScale: 0.6,
counter: true
});
var g9 = new JustGage({
id: 'g9',
value: 25000,
min: 0,
max: 100000,
humanFriendly: true,
reverse: true,
gaugeWidthScale: 1.3,
customSectors: [{
color: "#ff0000",
lo: 50000,
hi: 100000
}, {
color: "#00ff00",
lo: 0,
hi: 50000
}],
counter: true
});
var g10 = new JustGage({
id: 'g10',
value: 90,
min: 0,
max: 100,
symbol: '%',
reverse: true,
gaugeWidthScale: 0.1,
counter: true
});
document.getElementById('gauge_refresh').addEventListener('click', function() {
g3.refresh(getRandomInt(0, 100));
g4.refresh(getRandomInt(0, 100));
g5.refresh(getRandomInt(0, 100));
g6.refresh(getRandomInt(0, 100));
g7.refresh(getRandomInt(0, 100));
g8.refresh(getRandomInt(0, 100));
g9.refresh(getRandomInt(0, 100));
g10.refresh(getRandomInt(0, 100));
});
});

View File

@ -0,0 +1,18 @@
(function($) {
'use strict';
if ($("#lightgallery").length) {
$("#lightgallery").lightGallery();
}
if ($("#lightgallery-without-thumb").length) {
$("#lightgallery-without-thumb").lightGallery({
thumbnail: true,
animateThumb: false,
showThumbByDefault: false
});
}
if ($("#video-gallery").length) {
$("#video-gallery").lightGallery();
}
})(jQuery);

View File

@ -0,0 +1,8 @@
(function($) {
'use strict';
var options = {
valueNames: ['name', 'born']
};
var userList = new List('users', options);
})(jQuery);

View File

@ -0,0 +1,10 @@
$(function() {
'use strict';
if ($(".mapael-container").length) {
$(".mapael-container").mapael({
map: {
name: "world_countries"
}
});
}
});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,173 @@
$(function() {
'use strict';
if ($(".mapael-example-2").length) {
$(".mapael-example-2").mapael({
map: {
name: "france_departments"
// Enable zoom on the map
, zoom: {
enabled: false,
maxLevel: 10
}
// Set default plots and areas style
, defaultPlot: {
attrs: {
fill: "#004a9b"
, opacity: 0.6
}
, attrsHover: {
opacity: 1
}
, text: {
attrs: {
fill: "#505444"
}
, attrsHover: {
fill: "#000"
}
}
}
, defaultArea: {
attrs: {
fill: "#f4f4e8"
, stroke: "#ced8d0"
}
, attrsHover: {
fill: "#a4e100"
}
, text: {
attrs: {
fill: "#505444"
}
, attrsHover: {
fill: "#000"
}
}
}
},
legend: {
plot: [
{
labelAttrs: {
fill: "#4a4a4a"
},
titleAttrs: {
fill: "#4a4a4a"
},
cssClass: 'population',
mode: 'horizontal',
title: "Population",
marginBottomTitle: 5,
slices: [{
size: 15,
legendSpecificAttrs: {
fill: '#094a9b',
stroke: '#f4f4e8',
"stroke-width": 2
},
label: "< 10",
max: "10000"
}, {
size: 22,
legendSpecificAttrs: {
fill: '#094a9b',
stroke: '#f4f4e8',
"stroke-width": 2
},
label: "> 10 and < 100",
min: "10000",
max: "100000"
}, {
size: 30,
legendSpecificAttrs: {
fill: '#094a9b',
stroke: '#f4f4e8',
"stroke-width": 2
},
label: "> 100",
min: "100000"
}]
}
]
},
// Add some plots on the map
plots: {
'paris': {
type: "circle",
size: 18,
value: [5000, 20],
latitude: 48.86,
longitude: 2.3444,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Paris"},
text: {content: "Paris"}
},
'limoge': {
type: "circle",
size: 20,
value: [50000, 20],
latitude: 45.8188276,
longitude: 1.1060351,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Limoge"},
text: { content: "Limoge"}
},
'lyon': {
type: "circle",
size: 18,
value: [150000, 20],
latitude: 45.758888888889,
longitude: 4.8413888888889,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Lyon"},
text: {content: "Lyon"},
},
'rennes': {
type: "circle",
size: 20,
value: [5000, 200],
latitude: 48.114166666667,
longitude: -1.6808333333333,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Rennes"},
text: {content: "Rennes"},
},
"Moulins": {
type: "circle",
size: 20,
value: [150000, 200],
latitude: 46.86,
longitude: 3.3444,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Moulins"},
text: {content: "Moulins"}
},
"Bergerac": {
type: "circle",
size: 20,
value: [5000, 2000],
latitude: 44.8188276,
longitude: 1.2060351,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Bergerac"},
text: {content: "Bergerac"}
},
"Le Creusot": {
type: "circle",
size: 20,
value: [5000, 2000],
latitude: 46.658888888889,
longitude: 4.8413888888889,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> Le Creusot"},
text: {content: "Le Creusot"},
},
"La Roche Sur-Yon": {
type: "circle",
value: 860000,
size: 20,
value: [150000, 2000],
latitude: 47.114166666667,
longitude: -1.6808333333333,
tooltip: {content: "<span style=\"font-weight:bold;\">City :</span> La Roche Sur-Yon"},
text: {content: "La Roche Sur-Yon"},
}
}
});
}
});

215
public/Dashboard/js/maps.js Normal file
View File

@ -0,0 +1,215 @@
var map;
if ($('#map').length) {
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {
lat: -34.397,
lng: 150.644
},
zoom: 8
});
};
}
(function($) {
'use strict';
$('#vmap').vectorMap({
map: 'world_mill_en',
panOnDrag: true,
focusOn: {
x: 0.5,
y: 0.5,
scale: 1,
animate: true
},
series: {
regions: [{
scale: ['#812e2e', '#d87474'],
normalizeFunction: 'polynomial',
values: {
"AF": 16.63,
"AL": 11.58,
"DZ": 158.97,
"AO": 85.81,
"AG": 1.1,
"AR": 351.02,
"AM": 8.83,
"AU": 1219.72,
"AT": 366.26,
"AZ": 52.17,
"BS": 7.54,
"BH": 21.73,
"BD": 105.4,
"BB": 3.96,
"BY": 52.89,
"BE": 461.33,
"BZ": 1.43,
"BJ": 6.49,
"BT": 1.4,
"BO": 19.18,
"BA": 16.2,
"BW": 12.5,
"BR": 2023.53,
"BN": 11.96,
"BG": 44.84,
"BF": 8.67,
"BI": 1.47,
"KH": 11.36,
"CM": 21.88,
"CA": 1563.66,
"CV": 1.57,
"CF": 2.11,
"TD": 7.59,
"CL": 199.18,
"CN": 5745.13,
"CO": 283.11,
"KM": 0.56,
"CD": 12.6,
"CG": 11.88,
"CR": 35.02,
"CI": 22.38,
"HR": 59.92,
"CY": 22.75,
"CZ": 195.23,
"DK": 304.56,
"DJ": 1.14,
"DM": 0.38,
"DO": 50.87,
"EC": 61.49,
"EG": 216.83,
"SV": 21.8,
"GQ": 14.55,
"ER": 2.25,
"EE": 19.22,
"ET": 30.94,
"FJ": 3.15,
"FI": 231.98,
"FR": 2555.44,
"GA": 12.56,
"GM": 1.04,
"GE": 11.23,
"DE": 3305.9,
"GH": 18.06,
"GR": 305.01,
"GD": 0.65,
"GT": 40.77,
"GN": 4.34,
"GW": 0.83,
"GY": 2.2,
"HT": 6.5,
"HN": 15.34,
"HK": 226.49,
"HU": 132.28,
"IS": 12.77,
"IN": 1430.02,
"ID": 695.06,
"IR": 337.9,
"IQ": 84.14,
"IE": 204.14,
"IL": 201.25,
"IT": 2036.69,
"JM": 13.74,
"JP": 5390.9,
"JO": 27.13,
"KZ": 129.76,
"KE": 32.42,
"KI": 0.15,
"KR": 986.26,
"KW": 117.32,
"KG": 4.44,
"LA": 6.34,
"LV": 23.39,
"LB": 39.15,
"LS": 1.8,
"LR": 0.98,
"LY": 77.91,
"LT": 35.73,
"LU": 52.43,
"MK": 9.58,
"MG": 8.33,
"MW": 5.04,
"MY": 218.95,
"MV": 1.43,
"ML": 9.08,
"MT": 7.8,
"MR": 3.49,
"MU": 9.43,
"MX": 1004.04,
"MD": 5.36,
"MN": 5.81,
"ME": 3.88,
"MA": 91.7,
"MZ": 10.21,
"MM": 35.65,
"NA": 11.45,
"NP": 15.11,
"NL": 770.31,
"NZ": 138,
"NI": 6.38,
"NE": 5.6,
"NG": 206.66,
"NO": 413.51,
"OM": 53.78,
"PK": 174.79,
"PA": 27.2,
"PG": 8.81,
"PY": 17.17,
"PE": 153.55,
"PH": 189.06,
"PL": 438.88,
"PT": 223.7,
"QA": 126.52,
"RO": 158.39,
"RU": 1476.91,
"RW": 5.69,
"WS": 0.55,
"ST": 0.19,
"SA": 434.44,
"SN": 12.66,
"RS": 38.92,
"SC": 0.92,
"SL": 1.9,
"SG": 217.38,
"SK": 86.26,
"SI": 46.44,
"SB": 0.67,
"ZA": 354.41,
"ES": 1374.78,
"LK": 48.24,
"KN": 0.56,
"LC": 1,
"VC": 0.58,
"SD": 65.93,
"SR": 3.3,
"SZ": 3.17,
"SE": 444.59,
"CH": 522.44,
"SY": 59.63,
"TW": 426.98,
"TJ": 5.58,
"TZ": 22.43,
"TH": 312.61,
"TL": 0.62,
"TG": 3.07,
"TO": 0.3,
"TT": 21.2,
"TN": 43.86,
"TR": 729.05,
"TM": 0,
"UG": 17.12,
"UA": 136.56,
"AE": 239.65,
"GB": 2258.57,
"US": 14624.18,
"UY": 40.71,
"UZ": 37.72,
"VU": 0.72,
"VE": 285.21,
"VN": 101.99,
"YE": 30.02,
"ZM": 15.69,
"ZW": 5.57
}
}]
}
});
})(jQuery);

View File

@ -0,0 +1,12 @@
(function($) {
'use strict';
$('#exampleModal-4').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var recipient = button.data('whatever') // Extract info from data-* attributes
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
var modal = $(this)
modal.find('.modal-title').text('New message to ' + recipient)
modal.find('.modal-body input').val(recipient)
})
})(jQuery);

View File

@ -0,0 +1,239 @@
$(function() {
'use strict';
if ($('#morris-line-example').length) {
Morris.Line({
element: 'morris-line-example',
lineColors: ['#63CF72', '#F36368', '#76C1FA', '#FABA66'],
data: [{
y: '2006',
a: 100,
b: 150
},
{
y: '2007',
a: 75,
b: 65
},
{
y: '2008',
a: 50,
b: 40
},
{
y: '2009',
a: 75,
b: 65
},
{
y: '2010',
a: 50,
b: 40
},
{
y: '2011',
a: 75,
b: 65
},
{
y: '2012',
a: 100,
b: 90
}
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
}
if ($('#morris-area-example').length) {
Morris.Area({
element: 'morris-area-example',
lineColors: ['#76C1FA', '#F36368', '#63CF72', '#FABA66'],
data: [{
y: '2006',
a: 100,
b: 90
},
{
y: '2007',
a: 75,
b: 105
},
{
y: '2008',
a: 50,
b: 40
},
{
y: '2009',
a: 75,
b: 65
},
{
y: '2010',
a: 50,
b: 40
},
{
y: '2011',
a: 75,
b: 65
},
{
y: '2012',
a: 100,
b: 90
}
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
}
if ($("#morris-bar-example").length) {
Morris.Bar({
element: 'morris-bar-example',
barColors: ['#63CF72', '#F36368', '#76C1FA', '#FABA66'],
data: [{
y: '2006',
a: 100,
b: 90
},
{
y: '2007',
a: 75,
b: 65
},
{
y: '2008',
a: 50,
b: 40
},
{
y: '2009',
a: 75,
b: 65
},
{
y: '2010',
a: 50,
b: 40
},
{
y: '2011',
a: 75,
b: 65
},
{
y: '2012',
a: 100,
b: 90
}
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
}
if ($("#morris-donut-example").length) {
Morris.Donut({
element: 'morris-donut-example',
colors: ['#76C1FA', '#F36368', '#63CF72', '#FABA66'],
data: [{
label: "Download Sales",
value: 12
},
{
label: "In-Store Sales",
value: 30
},
{
label: "Mail-Order Sales",
value: 20
}
]
});
}
if ($("#morris-donut-dark-example").length) {
Morris.Donut({
element: 'morris-donut-dark-example',
colors: ['#76C1FA', '#F36368', '#63CF72', '#FABA66'],
data: [{
label: "Download Sales",
value: 12
},
{
label: "In-Store Sales",
value: 30
},
{
label: "Mail-Order Sales",
value: 20
}
],
labelColor: "#b1b1b5"
});
}
if ($('#morris-dashboard-taget').length) {
Morris.Area({
element: 'morris-dashboard-taget',
parseTime: false,
lineColors: ['#76C1FA', '#F36368', '#63CF72', '#FABA66'],
data: [{
y: 'Jan',
Revenue: 190,
Target: 170
},
{
y: 'Feb',
Revenue: 60,
Target: 90
},
{
y: 'March',
Revenue: 100,
Target: 120
},
{
y: 'Apr',
Revenue: 150,
Target: 140
},
{
y: 'May',
Revenue: 130,
Target: 170
},
{
y: 'Jun',
Revenue: 200,
Target: 160
},
{
y: 'Jul',
Revenue: 150,
Target: 180
},
{
y: 'Aug',
Revenue: 170,
Target: 180
},
{
y: 'Sep',
Revenue: 140,
Target: 90
}
],
xkey: 'y',
ykeys: ['Target', 'Revenue'],
labels: ['Monthly Target', 'Monthly Revenue'],
hideHover: 'auto',
behaveLikeLine: true,
resize: true,
axes: 'x'
});
}
});

View File

@ -0,0 +1,294 @@
(function($) {
'use strict';
// Horizontal slider
if ($("#ul-slider-1").length) {
var startSlider = document.getElementById('ul-slider-1');
noUiSlider.create(startSlider, {
start: [72],
connect: [true, false],
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-2").length) {
var startSlider = document.getElementById('ul-slider-2');
noUiSlider.create(startSlider, {
start: [92],
connect: [true, false],
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-3").length) {
var startSlider = document.getElementById('ul-slider-3');
noUiSlider.create(startSlider, {
start: [43],
connect: [true, false],
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-4").length) {
var startSlider = document.getElementById('ul-slider-4');
noUiSlider.create(startSlider, {
start: [20],
connect: [true, false],
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-5").length) {
var startSlider = document.getElementById('ul-slider-5');
noUiSlider.create(startSlider, {
start: [75],
connect: [true, false],
range: {
'min': [0],
'max': [100]
}
});
}
// Vertical slider
if ($("#ul-slider-6").length) {
var startSlider = document.getElementById('ul-slider-6');
noUiSlider.create(startSlider, {
start: [72],
connect: [true, false],
orientation: "vertical",
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-7").length) {
var startSlider = document.getElementById('ul-slider-7');
noUiSlider.create(startSlider, {
start: [92],
connect: [true, false],
orientation: "vertical",
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-8").length) {
var startSlider = document.getElementById('ul-slider-8');
noUiSlider.create(startSlider, {
start: [43],
connect: [true, false],
orientation: "vertical",
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-9").length) {
var startSlider = document.getElementById('ul-slider-9');
noUiSlider.create(startSlider, {
start: [20],
connect: [true, false],
orientation: "vertical",
range: {
'min': [0],
'max': [100]
}
});
}
if ($("#ul-slider-10").length) {
var startSlider = document.getElementById('ul-slider-10');
noUiSlider.create(startSlider, {
start: [75],
connect: [true, false],
orientation: "vertical",
range: {
'min': [0],
'max': [100]
}
});
}
// Range Slider
if ($("#value-range").length) {
var bigValueSlider = document.getElementById('value-range'),
bigValueSpan = document.getElementById('huge-value');
noUiSlider.create(bigValueSlider, {
start: 1,
step: 0,
range: {
min: 0,
max: 14
}
});
var range = [
'0', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'
];
bigValueSlider.noUiSlider.on('update', function(values, handle) {
console.log(range[Math.floor(values)]);
bigValueSpan.innerHTML = range[Math.floor(values)];
});
}
if ($("#skipstep").length) {
var skipSlider = document.getElementById('skipstep');
noUiSlider.create(skipSlider, {
range: {
'min': 0,
'10%': 10,
'20%': 20,
'30%': 30,
// Nope, 40 is no fun.
'50%': 50,
'60%': 60,
'70%': 70,
// I never liked 80.
'90%': 90,
'max': 100
},
snap: true,
start: [20, 90]
});
var skipValues = [
document.getElementById('skip-value-lower'),
document.getElementById('skip-value-upper')
];
skipSlider.noUiSlider.on('update', function(values, handle) {
skipValues[handle].innerHTML = values[handle];
});
}
// Connected Slider
if ($("#skipstep-connect").length) {
$(function() {
var skipSlider = document.getElementById('skipstep-connect');
noUiSlider.create(skipSlider, {
connect: true,
range: {
'min': 0,
'10%': 10,
'20%': 20,
'30%': 30,
// Nope, 40 is no fun.
'50%': 50,
'60%': 60,
'70%': 70,
// I never liked 80.
'90%': 90,
'max': 100
},
snap: true,
start: [20, 90]
});
var skipValues = [
document.getElementById('skip-value-lower-2'),
document.getElementById('skip-value-upper-2')
];
skipSlider.noUiSlider.on('update', function(values, handle) {
skipValues[handle].innerHTML = values[handle];
});
});
}
if ($("#skipstep-connect-3").length) {
$(function() {
var skipSlider = document.getElementById('skipstep-connect-3');
noUiSlider.create(skipSlider, {
connect: true,
range: {
'min': 0,
'10%': 10,
'20%': 20,
'30%': 30,
// Nope, 40 is no fun.
'50%': 50,
'60%': 60,
'70%': 70,
// I never liked 80.
'90%': 90,
'max': 100
},
snap: true,
start: [20, 90]
});
var skipValues = [
document.getElementById('skip-value-lower-3'),
document.getElementById('skip-value-upper-3')
];
skipSlider.noUiSlider.on('update', function(values, handle) {
skipValues[handle].innerHTML = values[handle];
});
});
}
// Tooltip Slider
if ($("#soft-limit").length) {
var softSlider = document.getElementById('soft-limit');
noUiSlider.create(softSlider, {
start: [24, 50],
tooltips: true,
connect: true,
range: {
min: 0,
max: 100
},
pips: {
mode: 'values',
values: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
density: 10
}
});
}
if ($("#soft-limit-2").length) {
var softSlider = document.getElementById('soft-limit-2');
noUiSlider.create(softSlider, {
start: [24, 50],
tooltips: [true, true],
connect: true,
range: {
min: 0,
max: 100
},
pips: {
mode: 'values',
values: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
density: 10
}
});
}
if ($("#soft-limit-3").length) {
var softSlider = document.getElementById('soft-limit-3');
noUiSlider.create(softSlider, {
start: [24, 82],
tooltips: [true, true],
connect: true,
range: {
min: 0,
max: 100
},
pips: {
mode: 'values',
values: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
density: 10
}
});
}
})(jQuery);

View File

@ -0,0 +1,8 @@
(function($) {
'use strict';
$(function() {
$('[data-toggle="offcanvas"]').on("click", function() {
$('.sidebar-offcanvas').toggleClass('active')
});
});
})(jQuery);

View File

@ -0,0 +1,134 @@
(function($) {
'use strict';
$.fn.andSelf = function() {
return this.addBack.apply(this, arguments);
}
if ($('.example-1').length) {
$('.example-1').owlCarousel({
loop: true,
margin: 10,
nav: true,
autoplay: true,
autoplayTimeout: 4500,
responsive: {
0: {
items: 1
},
600: {
items: 3
},
1000: {
items: 5
}
}
});
}
if ($('.full-width').length) {
$('.full-width').owlCarousel({
loop: true,
margin: 10,
items: 1,
nav: true,
autoplay: true,
autoplayTimeout: 5500,
navText: ["<i class='ti-angle-left'></i>", "<i class='ti-angle-right'></i>"]
});
}
if ($('.loop').length) {
$('.loop').owlCarousel({
center: true,
items: 2,
loop: true,
margin: 10,
autoplay: true,
autoplayTimeout: 8500,
responsive: {
600: {
items: 4
}
}
});
}
if ($('.nonloop').length) {
$('.nonloop').owlCarousel({
items: 5,
loop: false,
margin: 10,
autoplay: true,
autoplayTimeout: 6000,
responsive: {
600: {
items: 4
}
}
});
}
if ($('.auto-width').length) {
$('.auto-width').owlCarousel({
items: 2,
margin: 10,
loop: true,
autoplay: true,
autoplayTimeout: 3500,
autoWidth: true,
});
}
if ($('.lazy-load').length) {
$('.lazy-load').owlCarousel({
items: 4,
lazyLoad: true,
loop: true,
margin: 10,
auto: true,
autoplay: true,
autoplayTimeout: 2500,
});
}
if ($('.rtl-carousel').length) {
$('.rtl-carousel').owlCarousel({
rtl: true,
loop: true,
margin: 10,
autoplay: true,
autoplayTimeout: 3000,
responsive: {
0: {
items: 1
},
600: {
items: 3
},
1000: {
items: 5
}
}
});
}
if ($('.video-carousel').length) {
$('.video-carousel').owlCarousel({
loop: false,
margin: 10,
video: true,
lazyLoad: true,
autoplay: true,
autoplayTimeout: 7000,
responsive: {
480: {
items: 4
},
600: {
items: 4
}
}
});
}
})(jQuery);

View File

@ -0,0 +1,23 @@
(function($) {
'use strict';
if ($('#pagination-demo').length) {
$('#pagination-demo').twbsPagination({
totalPages: 35,
visiblePages: 7,
onPageClick: function(event, page) {
$('#page-content').text('Page ' + page);
}
});
}
if ($('.sync-pagination').length) {
$('.sync-pagination').twbsPagination({
totalPages: 20,
onPageClick: function(evt, page) {
$('#content').text('Page ' + page);
}
});
}
})(jQuery);

View File

@ -0,0 +1,32 @@
(function($) {
'use strict';
$(function() {
/* Code for attribute data-custom-class for adding custom class to tooltip */
if (typeof $.fn.popover.Constructor === 'undefined') {
throw new Error('Bootstrap Popover must be included first!');
}
var Popover = $.fn.popover.Constructor;
// add customClass option to Bootstrap Tooltip
$.extend(Popover.Default, {
customClass: ''
});
var _show = Popover.prototype.show;
Popover.prototype.show = function() {
// invoke parent method
_show.apply(this, Array.prototype.slice.apply(arguments));
if (this.config.customClass) {
var tip = this.getTipElement();
$(tip).addClass(this.config.customClass);
}
};
$('[data-toggle="popover"]').popover()
});
})(jQuery);

View File

@ -0,0 +1,9 @@
(function($) {
'use strict';
$(function() {
$('#profile-rating').barrating({
theme: 'css-stars',
showSelectedRating: false
});
});
})(jQuery);

View File

@ -0,0 +1,239 @@
(function($) {
'use strict';
// ProgressBar JS Starts Here
if ($('#circleProgress1').length) {
var bar = new ProgressBar.Circle(circleProgress1, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#677ae4',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.34); // Number from 0.0 to 1.0
}
if ($('#circleProgress2').length) {
var bar = new ProgressBar.Circle(circleProgress2, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#46c35f',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.54); // Number from 0.0 to 1.0
}
if ($('#circleProgress3').length) {
var bar = new ProgressBar.Circle(circleProgress3, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#f96868',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.45); // Number from 0.0 to 1.0
}
if ($('#circleProgress4').length) {
var bar = new ProgressBar.Circle(circleProgress4, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#f2a654',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.27); // Number from 0.0 to 1.0
}
if ($('#circleProgress5').length) {
var bar = new ProgressBar.Circle(circleProgress5, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#57c7d4',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.67); // Number from 0.0 to 1.0
}
if ($('#circleProgress6').length) {
var bar = new ProgressBar.Circle(circleProgress6, {
color: '#000',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 4,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: {
color: '#aaa',
width: 4
},
to: {
color: '#2a2e3b',
width: 4
},
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);
var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}
}
});
bar.text.style.fontSize = '1rem';
bar.animate(.95); // Number from 0.0 to 1.0
}
})(jQuery);

View File

@ -0,0 +1,330 @@
(function($) {
'use strict';
//Simple graph
if ($("#rickshaw-simple").length) {
var rickshawSimple = new Rickshaw.Graph({
element: document.getElementById("rickshaw-simple"),
renderer: 'line',
series: [{
data: [{
x: 0,
y: 40
}, {
x: 1,
y: 49
}, {
x: 2,
y: 38
}, {
x: 3,
y: 30
}, {
x: 4,
y: 32
}],
color: 'steelblue'
}, {
data: [{
x: 0,
y: 19
}, {
x: 1,
y: 22
}, {
x: 2,
y: 32
}, {
x: 3,
y: 20
}, {
x: 4,
y: 21
}],
color: 'lightblue'
}, {
data: [{
x: 0,
y: 39
}, {
x: 1,
y: 32
}, {
x: 2,
y: 12
}, {
x: 3,
y: 5
}, {
x: 4,
y: 12
}],
color: 'steelblue',
strokeWidth: 10,
opacity: 0.5
}]
});
rickshawSimple.render();
}
//Timescale
if ($("#rickshaw-time-scale").length) {
var seriesData = [
[],
[]
];
var random = new Rickshaw.Fixtures.RandomData(1500000);
for (var i = 0; i < 30; i++) {
random.addData(seriesData);
}
var timeScaleGraph = new Rickshaw.Graph({
element: document.getElementById("rickshaw-time-scale"),
width: 400,
height: 200,
stroke: true,
strokeWidth: 0.5,
renderer: 'area',
xScale: d3.time.scale(),
yScale: d3.scale.sqrt(),
series: [{
color: '#2796E9',
data: seriesData[0]
},
{
color: '#05BDFE',
data: seriesData[1]
}
]
});
timeScaleGraph.render();
var xAxis = new Rickshaw.Graph.Axis.X({
graph: timeScaleGraph,
tickFormat: timeScaleGraph.x.tickFormat()
});
xAxis.render();
var yAxis = new Rickshaw.Graph.Axis.Y({
graph: timeScaleGraph
});
yAxis.render();
var slider = new Rickshaw.Graph.RangeSlider.Preview({
graph: timeScaleGraph,
element: document.getElementById('slider')
});
}
//Bar chart
if ($("#rickshaw-bar").length) {
var seriesData = [
[],
[],
[]
];
var random = new Rickshaw.Fixtures.RandomData(150);
for (var i = 0; i < 15; i++) {
random.addData(seriesData);
}
var rickshawBar = new Rickshaw.Graph({
element: document.getElementById("rickshaw-bar"),
width: 400,
height: 300,
renderer: 'bar',
series: [{
color: "#2796E9",
data: seriesData[0],
}, {
color: "#05BDFE",
data: seriesData[1],
}, {
color: "#05BDFE",
data: seriesData[2],
opacity: 0.4
}]
});
rickshawBar.render();
}
//Line chart
if ($("#rickshaw-line").length) {
// set up our data series with 50 random data points
var seriesData = [
[],
[],
[]
];
var random = new Rickshaw.Fixtures.RandomData(150);
for (var i = 0; i < 30; i++) {
random.addData(seriesData);
}
// instantiate our graph!
var rickshawLine = new Rickshaw.Graph({
element: document.getElementById("rickshaw-line"),
width: 400,
height: 300,
renderer: 'line',
series: [{
color: "#2796E9",
data: seriesData[0],
name: 'New York',
strokeWidth: 5,
opacity: 0.3
}, {
color: "#05BDFE",
data: seriesData[1],
name: 'London'
}, {
color: "#05BDFE",
data: seriesData[2],
name: 'Tokyo',
opacity: 0.4
}]
});
rickshawLine.render();
var hoverDetail = new Rickshaw.Graph.HoverDetail({
graph: rickshawLine
});
}
//scatter plot
if ($("#rickshaw-scatter").length) {
// set up our data series with 50 random data points
var seriesData = [
[],
[],
[]
];
var random = new Rickshaw.Fixtures.RandomData(150);
for (var i = 0; i < 30; i++) {
random.addData(seriesData);
seriesData[0][i].r = 0 | Math.random() * 2 + 8
seriesData[1][i].r = 0 | Math.random() * 5 + 5
seriesData[2][i].r = 0 | Math.random() * 8 + 2
}
// instantiate our graph!
var rickshawScatter = new Rickshaw.Graph({
element: document.getElementById("rickshaw-scatter"),
width: 400,
height: 300,
renderer: 'scatterplot',
series: [{
color: "#2796E9",
data: seriesData[0],
opacity: 0.5
}, {
color: "#f7981c",
data: seriesData[1],
opacity: 0.3
}, {
color: "#36af47",
data: seriesData[2],
opacity: 0.6
}]
});
rickshawScatter.renderer.dotSize = 6;
new Rickshaw.Graph.HoverDetail({
graph: rickshawScatter
});
rickshawScatter.render();
}
//Multiple renderer
if ($("#rickshaw-multiple").length) {
var seriesData = [
[],
[],
[],
[],
[]
];
var random = new Rickshaw.Fixtures.RandomData(50);
for (var i = 0; i < 15; i++) {
random.addData(seriesData);
}
var rickshawMultiple = new Rickshaw.Graph({
element: document.getElementById("rickshaw-multiple"),
renderer: 'multi',
width: 400,
height: 300,
dotSize: 5,
series: [{
name: 'temperature',
data: seriesData.shift(),
color: '#2796E9',
renderer: 'stack',
opacity: 0.4,
}, {
name: 'heat index',
data: seriesData.shift(),
color: '#f7981c',
renderer: 'stack',
opacity: 0.4,
}, {
name: 'dewpoint',
data: seriesData.shift(),
color: '#36af47',
renderer: 'scatterplot',
opacity: 0.4,
}, {
name: 'pop',
data: seriesData.shift().map(function(d) {
return {
x: d.x,
y: d.y / 4
}
}),
color: '#ed1c24',
opacity: 0.4,
renderer: 'bar'
}, {
name: 'humidity',
data: seriesData.shift().map(function(d) {
return {
x: d.x,
y: d.y * 1.5
}
}),
renderer: 'line',
color: 'rgba(0, 0, 127, 0.25)',
opacity: 0.4
}]
});
var slider = new Rickshaw.Graph.RangeSlider.Preview({
graph: rickshawMultiple,
element: document.querySelector('#multiple-slider')
});
rickshawMultiple.render();
var detail = new Rickshaw.Graph.HoverDetail({
graph: rickshawMultiple
});
}
})(jQuery);

View File

@ -0,0 +1 @@
table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#B0BED9}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#acbad4}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#aab7d1}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#a6b4cd}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#a5b2cb}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#a2aec7}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:' ';margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:'\2714';margin-top:-11px;margin-left:-4px;text-align:center;text-shadow:1px 1px #B0BED9, -1px -1px #B0BED9, 1px -1px #B0BED9, -1px 1px #B0BED9}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}

View File

@ -0,0 +1,10 @@
(function($) {
'use strict';
if ($(".js-example-basic-single").length) {
$(".js-example-basic-single").select2();
}
if ($(".js-example-basic-multiple").length) {
$(".js-example-basic-multiple").select2();
}
})(jQuery);

View File

@ -0,0 +1,85 @@
(function($) {
'use strict';
$(function() {
$(".nav-settings").on("click", function() {
$("#right-sidebar").toggleClass("open");
});
$(".settings-close").on("click", function() {
$("#right-sidebar,#theme-settings").removeClass("open");
});
$("#settings-trigger").on("click" , function(){
$("#theme-settings").toggleClass("open");
});
//background constants
var navbar_classes = "navbar-danger navbar-success navbar-warning navbar-dark navbar-light navbar-primary navbar-info navbar-pink";
var sidebar_classes = "sidebar-light sidebar-dark";
var $body = $("body");
//sidebar backgrounds
$("#sidebar-light-theme").on("click" , function(){
$body.removeClass(sidebar_classes);
$body.addClass("sidebar-light");
$(".sidebar-bg-options").removeClass("selected");
$(this).addClass("selected");
});
$("#sidebar-dark-theme").on("click" , function(){
$body.removeClass(sidebar_classes);
$body.addClass("sidebar-dark");
$(".sidebar-bg-options").removeClass("selected");
$(this).addClass("selected");
});
//Navbar Backgrounds
$(".tiles.primary").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-primary");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.success").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-success");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.warning").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-warning");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.danger").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-danger");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.light").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-light");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.info").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-info");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.dark").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-dark");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.default").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
});
})(jQuery);

View File

@ -0,0 +1,79 @@
(function($) {
'use strict';
if ($("#sparkline-line-chart").length) {
$("#sparkline-line-chart").sparkline([5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7], {
type: 'line',
width: '100%',
height: '100%'
});
}
if ($("#sparkline-bar-chart").length) {
$("#sparkline-bar-chart").sparkline([5, 6, 7, 2, 0, -4, 4], {
type: 'bar',
height: '100%',
barWidth: '58.5%',
barColor: '#58D8A3',
negBarColor: '#e56e72',
zeroColor: 'green'
});
}
if ($("#sparkline-pie-chart").length) {
$("#sparkline-pie-chart").sparkline([1, 1, 2, 4], {
type: 'pie',
sliceColors: ['#0CB5F9', '#58d8a3', '#F4767B', '#F9B65F'],
borderColor: '#',
width: '100%',
height: '100%'
});
}
if ($("#sparkline-bullet-chart").length) {
$("#sparkline-bullet-chart").sparkline([10, 12, 12, 9, 7], {
type: 'bullet',
height: '238',
width: '100%',
});
}
if ($("#sparkline-composite-chart").length) {
$("#sparkline-composite-chart").sparkline([5, 6, 7, 2, 0, 3, 6, 8, 1, 2, 2, 0, 3, 6], {
type: 'line',
width: '100%',
height: '100%'
});
}
if ($("#sparkline-composite-chart").length) {
$("#sparkline-composite-chart").sparkline([5, 6, 7, 2, 0, 3, 6, 8, 1, 2, 2, 0, 3, 6], {
type: 'bar',
height: '150px',
width: '100%',
barWidth: 10,
barSpacing: 5,
barColor: '#60a76d',
negBarColor: '#60a76d',
composite: true
});
}
if ($(".demo-sparkline").length) {
$(".demo-sparkline").sparkline('html', {
enableTagOptions: true,
width: '100%',
height: '30px',
fillColor: false
});
}
if ($(".top-seelling-dashboard-chart").length) {
$(".top-seelling-dashboard-chart").sparkline('html', {
enableTagOptions: true,
width: '100%',
barWidth: 30,
fillColor: false
});
}
})(jQuery);

View File

@ -0,0 +1,11 @@
(function($) {
'use strict';
$(function() {
if ($('#sortable-table-1').length) {
$('#sortable-table-1').tablesort();
}
if ($('#sortable-table-2').length) {
$('#sortable-table-2').tablesort();
}
});
})(jQuery);

View File

@ -0,0 +1,48 @@
(function($) {
'use strict';
$(function() {
if ($('.demo-tabs').length) {
$('.demo-tabs').pwstabs({
effect: 'none'
});
}
if ($('.hello_world').length) {
$('.hello_world').pwstabs();
}
if ($('#rtl-tabs-1').length) {
$('#rtl-tabs-1').pwstabs({
effect: 'slidedown',
defaultTab: 2,
rtl: true
});
}
if ($('#vertical-left').length) {
$('#vertical-left').pwstabs({
effect: 'slideleft',
defaultTab: 1,
containerWidth: '600px',
tabsPosition: 'vertical',
verticalPosition: 'left'
});
}
if ($('#horizontal-left').length) {
$('#horizontal-left').pwstabs({
effect: 'slidedown',
defaultTab: 2,
containerWidth: '600px',
horizontalPosition: 'bottom'
});
}
if ($('.tickets-tab').length) {
$('.tickets-tab').pwstabs({
effect: 'none'
});
}
});
})(jQuery);

View File

@ -0,0 +1,119 @@
(function($) {
'use strict';
$(function() {
var body = $('body');
var contentWrapper = $('.content-wrapper');
var scroller = $('.container-scroller');
var footer = $('.footer');
var sidebar = $('.sidebar');
//Add active class to nav-link based on url dynamically
//Active class can be hard coded directly in html file also as required
function addActiveClass(element) {
if (current === "") {
//for root url
if (element.attr('href').indexOf("index.html") !== -1) {
element.parents('.nav-item').last().addClass('active');
if (element.parents('.sub-menu').length) {
element.closest('.collapse').addClass('show');
element.addClass('active');
}
}
} else {
//for other url
if (element.attr('href').indexOf(current) !== -1) {
element.parents('.nav-item').last().addClass('active');
if (element.parents('.sub-menu').length) {
element.closest('.collapse').addClass('show');
element.addClass('active');
}
if (element.parents('.submenu-item').length) {
element.addClass('active');
}
}
}
}
var current = location.pathname.split("/").slice(-1)[0].replace(/^\/|\/$/g, '');
$('.nav li a', sidebar).each(function() {
var $this = $(this);
addActiveClass($this);
})
$('.horizontal-menu .nav li a').each(function() {
var $this = $(this);
addActiveClass($this);
})
//Close other submenu in sidebar on opening any
sidebar.on('show.bs.collapse', '.collapse', function() {
sidebar.find('.collapse.show').collapse('hide');
});
//Change sidebar and content-wrapper height
applyStyles();
function applyStyles() {
//Applying perfect scrollbar
if (!body.hasClass("rtl")) {
if ($('.settings-panel .tab-content .tab-pane.scroll-wrapper').length) {
const settingsPanelScroll = new PerfectScrollbar('.settings-panel .tab-content .tab-pane.scroll-wrapper');
}
if ($('.chats').length) {
const chatsScroll = new PerfectScrollbar('.chats');
}
if (body.hasClass("sidebar-fixed")) {
if($('#sidebar').length) {
var fixedSidebarScroll = new PerfectScrollbar('#sidebar .nav');
}
}
}
}
$('[data-toggle="minimize"]').on("click", function() {
if ((body.hasClass('sidebar-toggle-display')) || (body.hasClass('sidebar-absolute'))) {
body.toggleClass('sidebar-hidden');
} else {
body.toggleClass('sidebar-icon-only');
}
});
//checkbox and radios
$(".form-check label,.form-radio label").append('<i class="input-helper"></i>');
//Horizontal menu in mobile
$('[data-toggle="horizontal-menu-toggle"]').on("click", function() {
$(".horizontal-menu .bottom-navbar").toggleClass("header-toggled");
});
// Horizontal menu navigation in mobile menu on click
var navItemClicked = $('.horizontal-menu .page-navigation >.nav-item');
navItemClicked.on("click", function(event) {
if(window.matchMedia('(max-width: 991px)').matches) {
if(!($(this).hasClass('show-submenu'))) {
navItemClicked.removeClass('show-submenu');
}
$(this).toggleClass('show-submenu');
}
})
$(window).scroll(function() {
if(window.matchMedia('(min-width: 992px)').matches) {
var header = $('.horizontal-menu');
if ($(window).scrollTop() >= 70) {
$(header).addClass('fixed-on-scroll');
} else {
$(header).removeClass('fixed-on-scroll');
}
}
});
});
// focus input when clicking on search icon
$('#navbar-search-icon').click(function() {
$("#navbar-search-input").focus();
});
})(jQuery);

View File

@ -0,0 +1,9 @@
(function($) {
'use strict';
if ($('.grid').length) {
var colcade = new Colcade('.grid', {
columns: '.grid-col',
items: '.grid-item'
});
}
})(jQuery);

View File

@ -0,0 +1,86 @@
(function($) {
showSuccessToast = function() {
'use strict';
resetToastPosition();
$.toast({
heading: 'Success',
text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
showHideTransition: 'slide',
icon: 'success',
loaderBg: '#f96868',
position: 'top-right'
})
};
showInfoToast = function() {
'use strict';
resetToastPosition();
$.toast({
heading: 'Info',
text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
showHideTransition: 'slide',
icon: 'info',
loaderBg: '#46c35f',
position: 'top-right'
})
};
showWarningToast = function() {
'use strict';
resetToastPosition();
$.toast({
heading: 'Warning',
text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
showHideTransition: 'slide',
icon: 'warning',
loaderBg: '#57c7d4',
position: 'top-right'
})
};
showDangerToast = function() {
'use strict';
resetToastPosition();
$.toast({
heading: 'Danger',
text: 'And these were just the basic demos! Scroll down to check further details on how to customize the output.',
showHideTransition: 'slide',
icon: 'error',
loaderBg: '#f2a654',
position: 'top-right'
})
};
showToastPosition = function(position) {
'use strict';
resetToastPosition();
$.toast({
heading: 'Positioning',
text: 'Specify the custom position object or use one of the predefined ones',
position: String(position),
icon: 'info',
stack: false,
loaderBg: '#f96868'
})
}
showToastInCustomPosition = function() {
'use strict';
resetToastPosition();
$.toast({
heading: 'Custom positioning',
text: 'Specify the custom position object or use one of the predefined ones',
icon: 'info',
position: {
left: 120,
top: 120
},
stack: false,
loaderBg: '#f96868'
})
}
resetToastPosition = function() {
$('.jq-toast-wrap').removeClass('bottom-left bottom-right top-left top-right mid-center'); // to remove previous position class
$(".jq-toast-wrap").css({
"top": "",
"left": "",
"bottom": "",
"right": ""
}); //to remove previous position style
}
})(jQuery);

View File

@ -0,0 +1,34 @@
(function($) {
'use strict';
$(function() {
var todoListItem = $('.todo-list');
var todoListInput = $('.todo-list-input');
$('.todo-list-add-btn').on("click", function(event) {
event.preventDefault();
var item = $(this).prevAll('.todo-list-input').val();
if (item) {
todoListItem.append("<li><div class='form-check'><label class='form-check-label'><input class='checkbox' type='checkbox'/>" + item + "<i class='input-helper'></i></label></div><i class='remove ti-close'></i></li>");
todoListInput.val("");
}
});
todoListItem.on('change', '.checkbox', function() {
if ($(this).attr('checked')) {
$(this).removeAttr('checked');
} else {
$(this).attr('checked', 'checked');
}
$(this).closest("li").toggleClass('completed');
});
todoListItem.on('click', '.remove', function() {
$(this).parent().remove();
});
});
})(jQuery);

View File

@ -0,0 +1,33 @@
(function($) {
'use strict';
$(function() {
/* Code for attribute data-custom-class for adding custom class to tooltip */
if (typeof $.fn.tooltip.Constructor === 'undefined') {
throw new Error('Bootstrap Tooltip must be included first!');
}
var Tooltip = $.fn.tooltip.Constructor;
// add customClass option to Bootstrap Tooltip
$.extend(Tooltip.Default, {
customClass: ''
});
var _show = Tooltip.prototype.show;
Tooltip.prototype.show = function() {
// invoke parent method
_show.apply(this, Array.prototype.slice.apply(arguments));
if (this.config.customClass) {
var tip = this.getTipElement();
$(tip).addClass(this.config.customClass);
}
};
$('[data-toggle="tooltip"]').tooltip();
});
})(jQuery);

View File

@ -0,0 +1,60 @@
(function($) {
'use strict';
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
var substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
for (var i = 0; i < strs.length; i++) {
if (substrRegex.test(strs[i])) {
matches.push(strs[i]);
}
}
cb(matches);
};
};
var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii',
'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota',
'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',
'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island',
'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont',
'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'
];
$('#the-basics .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
name: 'states',
source: substringMatcher(states)
});
// constructs the suggestion engine
var states = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
// `states` is an array of state names defined in "The Basics"
local: states
});
$('#bloodhound .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
name: 'states',
source: states
});
})(jQuery);

View File

@ -0,0 +1,53 @@
(function($) {
'use strict';
var form = $("#example-form");
form.children("div").steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
onFinished: function(event, currentIndex) {
alert("Submitted!");
}
});
var validationForm = $("#example-validation-form");
validationForm.val({
errorPlacement: function errorPlacement(error, element) {
element.before(error);
},
rules: {
confirm: {
equalTo: "#password"
}
}
});
validationForm.children("div").steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
onStepChanging: function(event, currentIndex, newIndex) {
validationForm.val({
ignore: [":disabled", ":hidden"]
})
return validationForm.val();
},
onFinishing: function(event, currentIndex) {
validationForm.val({
ignore: [':disabled']
})
return validationForm.val();
},
onFinished: function(event, currentIndex) {
alert("Submitted!");
}
});
var verticalForm = $("#example-vertical-wizard");
verticalForm.children("div").steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
stepsOrientation: "vertical",
onFinished: function(event, currentIndex) {
alert("Submitted!");
}
});
})(jQuery);

View File

@ -0,0 +1,162 @@
(function($) {
'use strict';
$(function() {
if ($('#editable-form').length) {
$.fn.editable.defaults.mode = 'inline';
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary btn-sm editable-submit">' +
'<i class="fa fa-fw fa-check"></i>' +
'</button>' +
'<button type="button" class="btn btn-default btn-sm editable-cancel">' +
'<i class="fa fa-fw fa-times"></i>' +
'</button>';
$('#username').editable({
type: 'text',
pk: 1,
name: 'username',
title: 'Enter username'
});
$('#firstname').editable({
validate: function(value) {
if ($.trim(value) === '') return 'This field is required';
}
});
$('#sex').editable({
source: [{
value: 1,
text: 'Male'
},
{
value: 2,
text: 'Female'
}
]
});
$('#status').editable();
$('#group').editable({
showbuttons: false
});
$('#vacation').editable({
datepicker: {
todayBtn: 'linked'
}
});
$('#dob').editable();
$('#event').editable({
placement: 'right',
combodate: {
firstItem: 'name'
}
});
$('#meeting_start').editable({
format: 'yyyy-mm-dd hh:ii',
viewformat: 'dd/mm/yyyy hh:ii',
validate: function(v) {
if (v && v.getDate() === 10) return 'Day cant be 10!';
},
datetimepicker: {
todayBtn: 'linked',
weekStart: 1
}
});
$('#comments').editable({
showbuttons: 'bottom'
});
$('#note').editable();
$('#pencil').on("click", function(e) {
e.stopPropagation();
e.preventDefault();
$('#note').editable('toggle');
});
$('#state').editable({
source: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
});
$('#state2').editable({
value: 'California',
typeahead: {
name: 'state',
local: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
}
});
$('#fruits').editable({
pk: 1,
limit: 3,
source: [{
value: 1,
text: 'banana'
},
{
value: 2,
text: 'peach'
},
{
value: 3,
text: 'apple'
},
{
value: 4,
text: 'watermelon'
},
{
value: 5,
text: 'orange'
}
]
});
$('#tags').editable({
inputclass: 'input-large',
select2: {
tags: ['html', 'javascript', 'css', 'ajax'],
tokenSeparators: [",", " "]
}
});
$('#address').editable({
url: '/post',
value: {
city: "Moscow",
street: "Lenina",
building: "12"
},
validate: function(value) {
if (value.city === '') return 'city is required!';
},
display: function(value) {
if (!value) {
$(this).empty();
return;
}
var html = '<b>' + $('<div>').text(value.city).html() + '</b>, ' + $('<div>').text(value.street).html() + ' st., bld. ' + $('<div>').text(value.building).html();
$(this).html(html);
}
});
$('#user .editable').on('hidden', function(e, reason) {
if (reason === 'save' || reason === 'nochange') {
var $next = $(this).closest('tr').next().find('.editable');
if ($('#autoopen').is(':checked')) {
setTimeout(function() {
$next.editable('show');
}, 300);
} else {
$next.focus();
}
}
});
}
});
})(jQuery);