Removing unused components

This commit is contained in:
Khanh Ngo
2016-01-09 09:38:26 +07:00
parent 9eb458cb11
commit 3aba1832af
1958 changed files with 0 additions and 244038 deletions

View File

@ -1,175 +0,0 @@
var Calendar = function() {
return {
//main function to initiate the module
init: function() {
Calendar.initCalendar();
},
initCalendar: function() {
if (!jQuery().fullCalendar) {
return;
}
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var h = {};
if (Metronic.isRTL()) {
if ($('#calendar').parents(".portlet").width() <= 720) {
$('#calendar').addClass("mobile");
h = {
right: 'title, prev, next',
center: '',
left: 'agendaDay, agendaWeek, month, today'
};
} else {
$('#calendar').removeClass("mobile");
h = {
right: 'title',
center: '',
left: 'agendaDay, agendaWeek, month, today, prev,next'
};
}
} else {
if ($('#calendar').parents(".portlet").width() <= 720) {
$('#calendar').addClass("mobile");
h = {
left: 'title, prev, next',
center: '',
right: 'today,month,agendaWeek,agendaDay'
};
} else {
$('#calendar').removeClass("mobile");
h = {
left: 'title',
center: '',
right: 'prev,next,today,month,agendaWeek,agendaDay'
};
}
}
var initDrag = function(el) {
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim(el.text()) // use the element's text as the event title
};
// store the Event Object in the DOM element so we can get to it later
el.data('eventObject', eventObject);
// make the event draggable using jQuery UI
el.draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});
};
var addEvent = function(title) {
title = title.length === 0 ? "Untitled Event" : title;
var html = $('<div class="external-event label label-default">' + title + '</div>');
jQuery('#event_box').append(html);
initDrag(html);
};
$('#external-events div.external-event').each(function() {
initDrag($(this));
});
$('#event_add').unbind('click').click(function() {
var title = $('#event_title').val();
addEvent(title);
});
//predefined events
$('#event_box').html("");
addEvent("My Event 1");
addEvent("My Event 2");
addEvent("My Event 3");
addEvent("My Event 4");
addEvent("My Event 5");
addEvent("My Event 6");
$('#calendar').fullCalendar('destroy'); // destroy the calendar
$('#calendar').fullCalendar({ //re-initialize the calendar
header: h,
defaultView: 'month', // change default view with available options from http://arshaw.com/fullcalendar/docs/views/Available_Views/
slotMinutes: 15,
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
copiedEventObject.className = $(this).attr("data-class");
// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
events: [{
title: 'All Day Event',
start: new Date(y, m, 1),
backgroundColor: Metronic.getBrandColor('yellow')
}, {
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2),
backgroundColor: Metronic.getBrandColor('green')
}, {
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false,
backgroundColor: Metronic.getBrandColor('red')
}, {
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false,
backgroundColor: Metronic.getBrandColor('green')
}, {
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false,
}, {
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
backgroundColor: Metronic.getBrandColor('grey'),
allDay: false,
}, {
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
backgroundColor: Metronic.getBrandColor('purple'),
allDay: false,
}, {
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
backgroundColor: Metronic.getBrandColor('yellow'),
url: 'http://google.com/',
}]
});
}
};
}();

File diff suppressed because it is too large Load Diff

View File

@ -1,899 +0,0 @@
var ChartsFlotcharts = function() {
return {
//main function to initiate the module
init: function() {
Metronic.addResizeHandler(function() {
Charts.initPieCharts();
});
},
initCharts: function() {
if (!jQuery.plot) {
return;
}
var data = [];
var totalPoints = 250;
// random data generator for plot charts
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;
var y = prev + Math.random() * 10 - 5;
if (y < 0) y = 0;
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;
}
//Basic Chart
function chart1() {
if ($('#chart_1').size() != 1) {
return;
}
var d1 = [];
for (var i = 0; i < Math.PI * 2; i += 0.25)
d1.push([i, Math.sin(i)]);
var d2 = [];
for (var i = 0; i < Math.PI * 2; i += 0.25)
d2.push([i, Math.cos(i)]);
var d3 = [];
for (var i = 0; i < Math.PI * 2; i += 0.1)
d3.push([i, Math.tan(i)]);
$.plot($("#chart_1"), [{
label: "sin(x)",
data: d1,
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
label: "cos(x)",
data: d2,
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
label: "tan(x)",
data: d3,
lines: {
lineWidth: 1,
},
shadowSize: 0
}], {
series: {
lines: {
show: true,
},
points: {
show: true,
fill: true,
radius: 3,
lineWidth: 1
}
},
xaxis: {
tickColor: "#eee",
ticks: [0, [Math.PI / 2, "\u03c0/2"],
[Math.PI, "\u03c0"],
[Math.PI * 3 / 2, "3\u03c0/2"],
[Math.PI * 2, "2\u03c0"]
]
},
yaxis: {
tickColor: "#eee",
ticks: 10,
min: -2,
max: 2
},
grid: {
borderColor: "#eee",
borderWidth: 1
}
});
}
//Interactive Chart
function chart2() {
if ($('#chart_2').size() != 1) {
return;
}
function randValue() {
return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
}
var pageviews = [
[1, randValue()],
[2, randValue()],
[3, 2 + randValue()],
[4, 3 + randValue()],
[5, 5 + randValue()],
[6, 10 + randValue()],
[7, 15 + randValue()],
[8, 20 + randValue()],
[9, 25 + randValue()],
[10, 30 + randValue()],
[11, 35 + randValue()],
[12, 25 + randValue()],
[13, 15 + randValue()],
[14, 20 + randValue()],
[15, 45 + randValue()],
[16, 50 + randValue()],
[17, 65 + randValue()],
[18, 70 + randValue()],
[19, 85 + randValue()],
[20, 80 + randValue()],
[21, 75 + randValue()],
[22, 80 + randValue()],
[23, 75 + randValue()],
[24, 70 + randValue()],
[25, 65 + randValue()],
[26, 75 + randValue()],
[27, 80 + randValue()],
[28, 85 + randValue()],
[29, 90 + randValue()],
[30, 95 + randValue()]
];
var visitors = [
[1, randValue() - 5],
[2, randValue() - 5],
[3, randValue() - 5],
[4, 6 + randValue()],
[5, 5 + randValue()],
[6, 20 + randValue()],
[7, 25 + randValue()],
[8, 36 + randValue()],
[9, 26 + randValue()],
[10, 38 + randValue()],
[11, 39 + randValue()],
[12, 50 + randValue()],
[13, 51 + randValue()],
[14, 12 + randValue()],
[15, 13 + randValue()],
[16, 14 + randValue()],
[17, 15 + randValue()],
[18, 15 + randValue()],
[19, 16 + randValue()],
[20, 17 + randValue()],
[21, 18 + randValue()],
[22, 19 + randValue()],
[23, 20 + randValue()],
[24, 21 + randValue()],
[25, 14 + randValue()],
[26, 24 + randValue()],
[27, 25 + randValue()],
[28, 26 + randValue()],
[29, 27 + randValue()],
[30, 31 + randValue()]
];
var plot = $.plot($("#chart_2"), [{
data: pageviews,
label: "Unique Visits",
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
data: visitors,
label: "Page Views",
lines: {
lineWidth: 1,
},
shadowSize: 0
}], {
series: {
lines: {
show: true,
lineWidth: 2,
fill: true,
fillColor: {
colors: [{
opacity: 0.05
}, {
opacity: 0.01
}]
}
},
points: {
show: true,
radius: 3,
lineWidth: 1
},
shadowSize: 2
},
grid: {
hoverable: true,
clickable: true,
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
},
colors: ["#d12610", "#37b7f3", "#52e136"],
xaxis: {
ticks: 11,
tickDecimals: 0,
tickColor: "#eee",
},
yaxis: {
ticks: 11,
tickDecimals: 0,
tickColor: "#eee",
}
});
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css({
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 15,
border: '1px solid #333',
padding: '4px',
color: '#fff',
'border-radius': '3px',
'background-color': '#333',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
var previousPoint = null;
$("#chart_2").bind("plothover", function(event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y);
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
});
}
//Tracking Curves
function chart3() {
if ($('#chart_3').size() != 1) {
return;
}
//tracking curves:
var sin = [],
cos = [];
for (var i = 0; i < 14; i += 0.1) {
sin.push([i, Math.sin(i)]);
cos.push([i, Math.cos(i)]);
}
plot = $.plot($("#chart_3"), [{
data: sin,
label: "sin(x) = -0.00",
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
data: cos,
label: "cos(x) = -0.00",
lines: {
lineWidth: 1,
},
shadowSize: 0
}], {
series: {
lines: {
show: true
}
},
crosshair: {
mode: "x"
},
grid: {
hoverable: true,
autoHighlight: false,
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
},
yaxis: {
min: -1.2,
max: 1.2
}
});
var legends = $("#chart_3 .legendLabel");
legends.each(function() {
// fix the widths so they don't jump around
$(this).css('width', $(this).width());
});
var updateLegendTimeout = null;
var latestPosition = null;
function updateLegend() {
updateLegendTimeout = null;
var pos = latestPosition;
var axes = plot.getAxes();
if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max || pos.y < axes.yaxis.min || pos.y > axes.yaxis.max) return;
var i, j, dataset = plot.getData();
for (i = 0; i < dataset.length; ++i) {
var series = dataset[i];
// find the nearest points, x-wise
for (j = 0; j < series.data.length; ++j)
if (series.data[j][0] > pos.x) break;
// now interpolate
var y, p1 = series.data[j - 1],
p2 = series.data[j];
if (p1 == null) y = p2[1];
else if (p2 == null) y = p1[1];
else y = p1[1] + (p2[1] - p1[1]) * (pos.x - p1[0]) / (p2[0] - p1[0]);
legends.eq(i).text(series.label.replace(/=.*/, "= " + y.toFixed(2)));
}
}
$("#chart_3").bind("plothover", function(event, pos, item) {
latestPosition = pos;
if (!updateLegendTimeout) updateLegendTimeout = setTimeout(updateLegend, 50);
});
}
//Dynamic Chart
function chart4() {
if ($('#chart_4').size() != 1) {
return;
}
//server load
var options = {
series: {
shadowSize: 1
},
lines: {
show: true,
lineWidth: 0.5,
fill: true,
fillColor: {
colors: [{
opacity: 0.1
}, {
opacity: 1
}]
}
},
yaxis: {
min: 0,
max: 100,
tickColor: "#eee",
tickFormatter: function(v) {
return v + "%";
}
},
xaxis: {
show: false,
},
colors: ["#6ef146"],
grid: {
tickColor: "#eee",
borderWidth: 0,
}
};
var updateInterval = 30;
var plot = $.plot($("#chart_4"), [getRandomData()], options);
function update() {
plot.setData([getRandomData()]);
plot.draw();
setTimeout(update, updateInterval);
}
update();
}
//bars with controls
function chart5() {
if ($('#chart_5').size() != 1) {
return;
}
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)]);
var stack = 0,
bars = true,
lines = false,
steps = false;
function plotWithOptions() {
$.plot($("#chart_5"),
[{
label: "sales",
data: d1,
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
label: "tax",
data: d2,
lines: {
lineWidth: 1,
},
shadowSize: 0
}, {
label: "profit",
data: d3,
lines: {
lineWidth: 1,
},
shadowSize: 0
}]
, {
series: {
stack: stack,
lines: {
show: lines,
fill: true,
steps: steps,
lineWidth: 0, // in pixels
},
bars: {
show: bars,
barWidth: 0.5,
lineWidth: 0, // in pixels
shadowSize: 0,
align: 'center'
}
},
grid: {
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
}
}
);
}
$(".stackControls input").click(function(e) {
e.preventDefault();
stack = $(this).val() == "With stacking" ? true : null;
plotWithOptions();
});
$(".graphControls input").click(function(e) {
e.preventDefault();
bars = $(this).val().indexOf("Bars") != -1;
lines = $(this).val().indexOf("Lines") != -1;
steps = $(this).val().indexOf("steps") != -1;
plotWithOptions();
});
plotWithOptions();
}
//graph
chart1();
chart2();
chart3();
chart4();
chart5();
},
initBarCharts: function() {
// bar chart:
var data = GenerateSeries(0);
function GenerateSeries(added) {
var data = [];
var start = 100 + added;
var end = 200 + added;
for (i = 1; i <= 20; i++) {
var d = Math.floor(Math.random() * (end - start + 1) + start);
data.push([i, d]);
start++;
end++;
}
return data;
}
var options = {
series: {
bars: {
show: true
}
},
bars: {
barWidth: 0.8,
lineWidth: 0, // in pixels
shadowSize: 0,
align: 'left'
},
grid: {
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
}
};
if ($('#chart_1_1').size() !== 0) {
$.plot($("#chart_1_1"), [{
data: data,
lines: {
lineWidth: 1,
},
shadowSize: 0
}], options);
}
// horizontal bar chart:
var data1 = [
[10, 10],
[20, 20],
[30, 30],
[40, 40],
[50, 50]
];
var options = {
series: {
bars: {
show: true
}
},
bars: {
horizontal: true,
barWidth: 6,
lineWidth: 0, // in pixels
shadowSize: 0,
align: 'left'
},
grid: {
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
}
};
if ($('#chart_1_2').size() !== 0) {
$.plot($("#chart_1_2"), [data1], options);
}
},
initPieCharts: function() {
var data = [];
var series = Math.floor(Math.random() * 10) + 1;
series = series < 5 ? 5 : series;
for (var i = 0; i < series; i++) {
data[i] = {
label: "Series" + (i + 1),
data: Math.floor(Math.random() * 100) + 1
};
}
// DEFAULT
if ($('#pie_chart').size() !== 0) {
$.plot($("#pie_chart"), data, {
series: {
pie: {
show: true
}
}
});
}
// GRAPH 1
if ($('#pie_chart_1').size() !== 0) {
$.plot($("#pie_chart_1"), data, {
series: {
pie: {
show: true
}
},
legend: {
show: false
}
});
}
// GRAPH 2
if ($('#pie_chart_2').size() !== 0) {
$.plot($("#pie_chart_2"), data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 1,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
background: {
opacity: 0.8
}
}
}
},
legend: {
show: false
}
});
}
// GRAPH 3
if ($('#pie_chart_3').size() !== 0) {
$.plot($("#pie_chart_3"), data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 3 / 4,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
background: {
opacity: 0.5
}
}
}
},
legend: {
show: false
}
});
}
// GRAPH 4
if ($('#pie_chart_4').size() !== 0) {
$.plot($("#pie_chart_4"), data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 3 / 4,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
background: {
opacity: 0.5,
color: '#000'
}
}
}
},
legend: {
show: false
}
});
}
// GRAPH 5
if ($('#pie_chart_5').size() !== 0) {
$.plot($("#pie_chart_5"), data, {
series: {
pie: {
show: true,
radius: 3 / 4,
label: {
show: true,
radius: 3 / 4,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
background: {
opacity: 0.5,
color: '#000'
}
}
}
},
legend: {
show: false
}
});
}
// GRAPH 6
if ($('#pie_chart_6').size() !== 0) {
$.plot($("#pie_chart_6"), data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 2 / 3,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
threshold: 0.1
}
}
},
legend: {
show: false
}
});
}
// GRAPH 7
if ($('#pie_chart_7').size() !== 0) {
$.plot($("#pie_chart_7"), data, {
series: {
pie: {
show: true,
combine: {
color: '#999',
threshold: 0.1
}
}
},
legend: {
show: false
}
});
}
// GRAPH 8
if ($('#pie_chart_8').size() !== 0) {
$.plot($("#pie_chart_8"), data, {
series: {
pie: {
show: true,
radius: 300,
label: {
show: true,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
threshold: 0.1
}
}
},
legend: {
show: false
}
});
}
// GRAPH 9
if ($('#pie_chart_9').size() !== 0) {
$.plot($("#pie_chart_9"), data, {
series: {
pie: {
show: true,
radius: 1,
tilt: 0.5,
label: {
show: true,
radius: 1,
formatter: function(label, series) {
return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>';
},
background: {
opacity: 0.8
}
},
combine: {
color: '#999',
threshold: 0.1
}
}
},
legend: {
show: false
}
});
}
// DONUT
if ($('#donut').size() !== 0) {
$.plot($("#donut"), data, {
series: {
pie: {
innerRadius: 0.5,
show: true
}
}
});
}
// INTERACTIVE
if ($('#interactive').size() !== 0) {
$.plot($("#interactive"), data, {
series: {
pie: {
show: true
}
},
grid: {
hoverable: true,
clickable: true
}
});
$("#interactive").bind("plothover", pieHover);
$("#interactive").bind("plotclick", pieClick);
}
function pieHover(event, pos, obj) {
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
$("#hover").html('<span style="font-weight: bold; color: ' + obj.series.color + '">' + obj.series.label + ' (' + percent + '%)</span>');
}
function pieClick(event, pos, obj) {
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
alert('' + obj.series.label + ': ' + percent + '%');
}
}
};
}();

View File

@ -1,14 +0,0 @@
var ComingSoon = function () {
return {
//main function to initiate the module
init: function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
$('#defaultCountdown').countdown({until: austDay});
$('#year').text(austDay.getFullYear());
}
};
}();

View File

@ -1,27 +0,0 @@
var ContactUs = function () {
return {
//main function to initiate the module
init: function () {
var map;
$(document).ready(function(){
map = new GMaps({
div: '#map',
lat: -13.004333,
lng: -38.494333
});
var marker = map.addMarker({
lat: -13.004333,
lng: -38.494333,
title: 'Loop, Inc.',
infoWindow: {
content: "<b>Loop, Inc.</b> 795 Park Ave, Suite 120<br>San Francisco, CA 94107"
}
});
marker.infoWindow.open(map, marker);
});
}
};
}();

View File

@ -1,242 +0,0 @@
var EcommerceIndex = function () {
function showTooltip(x, y, labelX, labelY) {
$('<div id="tooltip" class="chart-tooltip">' + (labelY.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')) + 'USD<\/div>').css({
position: 'absolute',
display: 'none',
top: y - 40,
left: x - 60,
border: '0px solid #ccc',
padding: '2px 6px',
'background-color': '#fff'
}).appendTo("body").fadeIn(200);
}
var initChart1 = function () {
var data = [
['01/2013', 4],
['02/2013', 8],
['03/2013', 10],
['04/2013', 12],
['05/2013', 2125],
['06/2013', 324],
['07/2013', 1223],
['08/2013', 1365],
['09/2013', 250],
['10/2013', 999],
['11/2013', 390]
];
var plot_statistics = $.plot(
$("#statistics_1"),
[
{
data:data,
lines: {
fill: 0.6,
lineWidth: 0
},
color: ['#f89f9f']
},
{
data: data,
points: {
show: true,
fill: true,
radius: 5,
fillColor: "#f89f9f",
lineWidth: 3
},
color: '#fff',
shadowSize: 0
}
],
{
xaxis: {
tickLength: 0,
tickDecimals: 0,
mode: "categories",
min: 2,
font: {
lineHeight: 15,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
yaxis: {
ticks: 3,
tickDecimals: 0,
tickColor: "#f0f0f0",
font: {
lineHeight: 15,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
grid: {
backgroundColor: {
colors: ["#fff", "#fff"]
},
borderWidth: 1,
borderColor: "#f0f0f0",
margin: 0,
minBorderMargin: 0,
labelMargin: 20,
hoverable: true,
clickable: true,
mouseActiveRadius: 6
},
legend: {
show: false
}
}
);
var previousPoint = null;
$("#statistics_1").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1]);
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
});
}
var initChart2 = function() {
var data = [
['01/2013', 10],
['02/2013', 0],
['03/2013', 10],
['04/2013', 12],
['05/2013', 212],
['06/2013', 324],
['07/2013', 122],
['08/2013', 136],
['09/2013', 250],
['10/2013', 99],
['11/2013', 190]
];
var plot_statistics = $.plot(
$("#statistics_2"),
[
{
data:data,
lines: {
fill: 0.6,
lineWidth: 0
},
color: ['#BAD9F5']
},
{
data: data,
points: {
show: true,
fill: true,
radius: 5,
fillColor: "#BAD9F5",
lineWidth: 3
},
color: '#fff',
shadowSize: 0
}
],
{
xaxis: {
tickLength: 0,
tickDecimals: 0,
mode: "categories",
min: 2,
font: {
lineHeight: 14,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
yaxis: {
ticks: 3,
tickDecimals: 0,
tickColor: "#f0f0f0",
font: {
lineHeight: 14,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
grid: {
backgroundColor: {
colors: ["#fff", "#fff"]
},
borderWidth: 1,
borderColor: "#f0f0f0",
margin: 0,
minBorderMargin: 0,
labelMargin: 20,
hoverable: true,
clickable: true,
mouseActiveRadius: 6
},
legend: {
show: false
}
}
);
var previousPoint = null;
$("#statistics_2").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1]);
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
});
}
return {
//main function
init: function () {
initChart1();
$('#statistics_amounts_tab').on('shown.bs.tab', function (e) {
initChart2();
});
}
};
}();

View File

@ -1,233 +0,0 @@
var EcommerceOrdersView = function () {
var handleInvoices = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_invoices"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/scripts/datatable.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r>t<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>",
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[19, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_order_invoices.php", // ajax source
},
"order": [
[1, "asc"]
] // set first column as a default sort by asc
}
});
// handle group actionsubmit button click
grid.getTableWrapper().on('click', '.table-group-action-submit', function (e) {
e.preventDefault();
var action = $(".table-group-action-input", grid.getTableWrapper());
if (action.val() != "" && grid.getSelectedRowsCount() > 0) {
grid.setAjaxParam("customActionType", "group_action");
grid.setAjaxParam("customActionName", action.val());
grid.setAjaxParam("id", grid.getSelectedRows());
grid.getDataTable().ajax.reload();
grid.clearAjaxParams();
} else if (action.val() == "") {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'Please select an action',
container: grid.getTableWrapper(),
place: 'prepend'
});
} else if (grid.getSelectedRowsCount() === 0) {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'No record selected',
container: grid.getTableWrapper(),
place: 'prepend'
});
}
});
}
var handleCreditMemos = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_credit_memos"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/scripts/datatable.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r>t<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>",
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_order_credit_memos.php", // ajax source
},
"columnDefs": [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column)
'orderable': true,
'targets': [0]
}],
"order": [
[0, "asc"]
] // set first column as a default sort by asc
}
});
}
var handleShipment = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_shipment"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_order_shipment.php", // ajax source
},
"columnDefs": [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column)
'orderable': true,
'targets': [0]
}],
"order": [
[0, "asc"]
] // set first column as a default sort by asc
}
});
}
var handleHistory = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_history"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_order_history.php", // ajax source
},
"columnDefs": [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column)
'orderable': true,
'targets': [0]
}],
"order": [
[0, "asc"]
] // set first column as a default sort by asc
}
});
// handle group actionsubmit button click
grid.getTableWrapper().on('click', '.table-group-action-submit', function (e) {
e.preventDefault();
var action = $(".table-group-action-input", grid.getTableWrapper());
if (action.val() != "" && grid.getSelectedRowsCount() > 0) {
grid.setAjaxParam("customActionType", "group_action");
grid.setAjaxParam("customActionName", action.val());
grid.setAjaxParam("id", grid.getSelectedRows());
grid.getDataTable().ajax.reload();
grid.clearAjaxParams();
} else if (action.val() == "") {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'Please select an action',
container: grid.getTableWrapper(),
place: 'prepend'
});
} else if (grid.getSelectedRowsCount() === 0) {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'No record selected',
container: grid.getTableWrapper(),
place: 'prepend'
});
}
});
}
var initPickers = function () {
//init date pickers
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
autoclose: true
});
$(".datetime-picker").datetimepicker({
isRTL: Metronic.isRTL(),
autoclose: true,
todayBtn: true,
pickerPosition: (Metronic.isRTL() ? "bottom-right" : "bottom-left"),
minuteStep: 10
});
}
return {
//main function to initiate the module
init: function () {
initPickers();
handleInvoices();
handleCreditMemos();
handleShipment();
handleHistory();
}
};
}();

View File

@ -1,86 +0,0 @@
var EcommerceOrders = function () {
var initPickers = function () {
//init date pickers
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
autoclose: true
});
}
var handleOrders = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_orders"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/scripts/datatable.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r>t<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>",
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_orders.php", // ajax source
},
"order": [
[1, "asc"]
] // set first column as a default sort by asc
}
});
// handle group actionsubmit button click
grid.getTableWrapper().on('click', '.table-group-action-submit', function (e) {
e.preventDefault();
var action = $(".table-group-action-input", grid.getTableWrapper());
if (action.val() != "" && grid.getSelectedRowsCount() > 0) {
grid.setAjaxParam("customActionType", "group_action");
grid.setAjaxParam("customActionName", action.val());
grid.setAjaxParam("id", grid.getSelectedRows());
grid.getDataTable().ajax.reload();
grid.clearAjaxParams();
} else if (action.val() == "") {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'Please select an action',
container: grid.getTableWrapper(),
place: 'prepend'
});
} else if (grid.getSelectedRowsCount() === 0) {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'No record selected',
container: grid.getTableWrapper(),
place: 'prepend'
});
}
});
}
return {
//main function to initiate the module
init: function () {
initPickers();
handleOrders();
}
};
}();

View File

@ -1,185 +0,0 @@
var EcommerceProductsEdit = function () {
var handleImages = function() {
// see http://www.plupload.com/
var uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,html4',
browse_button : document.getElementById('tab_images_uploader_pickfiles'), // you can pass in id...
container: document.getElementById('tab_images_uploader_container'), // ... or DOM Element itself
url : "assets/plugins/plupload/examples/upload.php",
filters : {
max_file_size : '10mb',
mime_types: [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
},
// Flash settings
flash_swf_url : 'assets/plugins/plupload/js/Moxie.swf',
// Silverlight settings
silverlight_xap_url : 'assets/plugins/plupload/js/Moxie.xap',
init: {
PostInit: function() {
$('#tab_images_uploader_filelist').html("");
$('#tab_images_uploader_uploadfiles').click(function() {
uploader.start();
return false;
});
$('#tab_images_uploader_filelist').on('click', '.added-files .remove', function(){
uploader.removeFile($(this).parent('.added-files').attr("id"));
$(this).parent('.added-files').remove();
});
},
FilesAdded: function(up, files) {
plupload.each(files, function(file) {
$('#tab_images_uploader_filelist').append('<div class="alert alert-warning added-files" id="uploaded_file_' + file.id + '">' + file.name + '(' + plupload.formatSize(file.size) + ') <span class="status label label-info"></span>&nbsp;<a href="javascript:;" style="margin-top:-5px" class="remove pull-right btn btn-sm red"><i class="fa fa-times"></i> remove</a></div>');
});
},
UploadProgress: function(up, file) {
$('#uploaded_file_' + file.id + ' > .status').html(file.percent + '%');
},
FileUploaded: function(up, file, response) {
var response = $.parseJSON(response.response);
if (response.result && response.result == 'OK') {
var id = response.id; // uploaded file's unique name. Here you can collect uploaded file names and submit an jax request to your server side script to process the uploaded files and update the images tabke
$('#uploaded_file_' + file.id + ' > .status').removeClass("label-info").addClass("label-success").html('<i class="fa fa-check"></i> Done'); // set successfull upload
} else {
$('#uploaded_file_' + file.id + ' > .status').removeClass("label-info").addClass("label-danger").html('<i class="fa fa-warning"></i> Failed'); // set failed upload
Metronic.alert({type: 'danger', message: 'One of uploads failed. Please retry.', closeInSeconds: 10, icon: 'warning'});
}
},
Error: function(up, err) {
Metronic.alert({type: 'danger', message: err.message, closeInSeconds: 10, icon: 'warning'});
}
}
});
uploader.init();
}
var handleReviews = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_reviews"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/scripts/datatable.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r>t<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>",
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_product_reviews.php", // ajax source
},
"columnDefs": [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column)
'orderable': true,
'targets': [0]
}],
"order": [
[0, "asc"]
] // set first column as a default sort by asc
}
});
}
var handleHistory = function () {
var grid = new Datatable();
grid.init({
src: $("#datatable_history"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_product_history.php", // ajax source
},
"columnDefs": [{ // define columns sorting options(by default all columns are sortable extept the first checkbox column)
'orderable': true,
'targets': [0]
}],
"order": [
[0, "asc"]
] // set first column as a default sort by asc
}
});
}
var initComponents = function () {
//init datepickers
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
autoclose: true
});
//init datetimepickers
$(".datetime-picker").datetimepicker({
isRTL: Metronic.isRTL(),
autoclose: true,
todayBtn: true,
pickerPosition: (Metronic.isRTL() ? "bottom-right" : "bottom-left"),
minuteStep: 10
});
//init maxlength handler
$('.maxlength-handler').maxlength({
limitReachedClass: "label label-danger",
alwaysShow: true,
threshold: 5
});
}
return {
//main function to initiate the module
init: function () {
initComponents();
handleImages();
handleReviews();
handleHistory();
}
};
}();

View File

@ -1,86 +0,0 @@
var EcommerceProducts = function () {
var initPickers = function () {
//init date pickers
$('.date-picker').datepicker({
rtl: Metronic.isRTL(),
autoclose: true
});
}
var handleProducts = function() {
var grid = new Datatable();
grid.init({
src: $("#datatable_products"),
onSuccess: function (grid) {
// execute some code after table records loaded
},
onError: function (grid) {
// execute some code on network or other general error
},
loadingMessage: 'Loading...',
dataTable: { // here you can define a typical datatable settings from http://datatables.net/usage/options
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/scripts/datatable.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'<'table-group-actions pull-right'>>r>t<'row'<'col-md-8 col-sm-12'pli><'col-md-4 col-sm-12'>>",
"lengthMenu": [
[10, 20, 50, 100, 150],
[10, 20, 50, 100, 150] // change per page values here
],
"pageLength": 10, // default record count per page
"ajax": {
"url": "demo/ecommerce_products.php", // ajax source
},
"order": [
[1, "asc"]
] // set first column as a default sort by asc
}
});
// handle group actionsubmit button click
grid.getTableWrapper().on('click', '.table-group-action-submit', function (e) {
e.preventDefault();
var action = $(".table-group-action-input", grid.getTableWrapper());
if (action.val() != "" && grid.getSelectedRowsCount() > 0) {
grid.setAjaxParam("customActionType", "group_action");
grid.setAjaxParam("customActionName", action.val());
grid.setAjaxParam("id", grid.getSelectedRows());
grid.getDataTable().ajax.reload();
grid.clearAjaxParams();
} else if (action.val() == "") {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'Please select an action',
container: grid.getTableWrapper(),
place: 'prepend'
});
} else if (grid.getSelectedRowsCount() === 0) {
Metronic.alert({
type: 'danger',
icon: 'warning',
message: 'No record selected',
container: grid.getTableWrapper(),
place: 'prepend'
});
}
});
}
return {
//main function to initiate the module
init: function () {
handleProducts();
initPickers();
}
};
}();

View File

@ -1,572 +0,0 @@
var FormEditable = function () {
$.mockjaxSettings.responseTime = 500;
var log = function (settings, response) {
var s = [],
str;
s.push(settings.type.toUpperCase() + ' url = "' + settings.url + '"');
for (var a in settings.data) {
if (settings.data[a] && typeof settings.data[a] === 'object') {
str = [];
for (var j in settings.data[a]) {
str.push(j + ': "' + settings.data[a][j] + '"');
}
str = '{ ' + str.join(', ') + ' }';
} else {
str = '"' + settings.data[a] + '"';
}
s.push(a + ' = ' + str);
}
s.push('RESPONSE: status = ' + response.status);
if (response.responseText) {
if ($.isArray(response.responseText)) {
s.push('[');
$.each(response.responseText, function (i, v) {
s.push('{value: ' + v.value + ', text: "' + v.text + '"}');
});
s.push(']');
} else {
s.push($.trim(response.responseText));
}
}
s.push('--------------------------------------\n');
$('#console').val(s.join('\n') + $('#console').val());
}
var initAjaxMock = function () {
//ajax mocks
$.mockjax({
url: '/post',
response: function (settings) {
log(settings, this);
}
});
$.mockjax({
url: '/error',
status: 400,
statusText: 'Bad Request',
response: function (settings) {
this.responseText = 'Please input correct value';
log(settings, this);
}
});
$.mockjax({
url: '/status',
status: 500,
response: function (settings) {
this.responseText = 'Internal Server Error';
log(settings, this);
}
});
$.mockjax({
url: '/groups',
response: function (settings) {
this.responseText = [{
value: 0,
text: 'Guest'
}, {
value: 1,
text: 'Service'
}, {
value: 2,
text: 'Customer'
}, {
value: 3,
text: 'Operator'
}, {
value: 4,
text: 'Support'
}, {
value: 5,
text: 'Admin'
}
];
log(settings, this);
}
});
}
var initEditables = function () {
//set editable mode based on URL parameter
if (Metronic.getURLParameter('mode') == 'inline') {
$.fn.editable.defaults.mode = 'inline';
$('#inline').attr("checked", true);
jQuery.uniform.update('#inline');
} else {
$('#inline').attr("checked", false);
jQuery.uniform.update('#inline');
}
//global settings
$.fn.editable.defaults.inputclass = 'form-control';
$.fn.editable.defaults.url = '/post';
//editables element samples
$('#username').editable({
url: '/post',
type: 'text',
pk: 1,
name: 'username',
title: 'Enter username'
});
$('#firstname').editable({
validate: function (value) {
if ($.trim(value) == '') return 'This field is required';
}
});
$('#sex').editable({
prepend: "not selected",
inputclass: 'form-control',
source: [{
value: 1,
text: 'Male'
}, {
value: 2,
text: 'Female'
}
],
display: function (value, sourceData) {
var colors = {
"": "gray",
1: "green",
2: "blue"
},
elem = $.grep(sourceData, function (o) {
return o.value == value;
});
if (elem.length) {
$(this).text(elem[0].text).css("color", colors[value]);
} else {
$(this).empty();
}
}
});
$('#status').editable();
$('#group').editable({
showbuttons: false
});
$('#vacation').editable({
rtl : Metronic.isRTL()
});
$('#dob').editable({
inputclass: 'form-control',
});
$('#event').editable({
placement: (Metronic.isRTL() ? 'left' : '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: {
rtl : Metronic.isRTL(),
todayBtn: 'linked',
weekStart: 1
}
});
$('#comments').editable({
showbuttons: 'bottom'
});
$('#note').editable({
showbuttons : (Metronic.isRTL() ? 'left' : 'right')
});
$('#pencil').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"]
});
$('#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'
}
]
});
$('#fruits').on('shown', function(e, reason) {
Metronic.initUniform();
});
$('#tags').editable({
inputclass: 'form-control input-medium',
select2: {
tags: ['html', 'javascript', 'css', 'ajax'],
tokenSeparators: [",", " "]
}
});
var countries = [];
$.each({
"BD": "Bangladesh",
"BE": "Belgium",
"BF": "Burkina Faso",
"BG": "Bulgaria",
"BA": "Bosnia and Herzegovina",
"BB": "Barbados",
"WF": "Wallis and Futuna",
"BL": "Saint Bartelemey",
"BM": "Bermuda",
"BN": "Brunei Darussalam",
"BO": "Bolivia",
"BH": "Bahrain",
"BI": "Burundi",
"BJ": "Benin",
"BT": "Bhutan",
"JM": "Jamaica",
"BV": "Bouvet Island",
"BW": "Botswana",
"WS": "Samoa",
"BR": "Brazil",
"BS": "Bahamas",
"JE": "Jersey",
"BY": "Belarus",
"O1": "Other Country",
"LV": "Latvia",
"RW": "Rwanda",
"RS": "Serbia",
"TL": "Timor-Leste",
"RE": "Reunion",
"LU": "Luxembourg",
"TJ": "Tajikistan",
"RO": "Romania",
"PG": "Papua New Guinea",
"GW": "Guinea-Bissau",
"GU": "Guam",
"GT": "Guatemala",
"GS": "South Georgia and the South Sandwich Islands",
"GR": "Greece",
"GQ": "Equatorial Guinea",
"GP": "Guadeloupe",
"JP": "Japan",
"GY": "Guyana",
"GG": "Guernsey",
"GF": "French Guiana",
"GE": "Georgia",
"GD": "Grenada",
"GB": "United Kingdom",
"GA": "Gabon",
"SV": "El Salvador",
"GN": "Guinea",
"GM": "Gambia",
"GL": "Greenland",
"GI": "Gibraltar",
"GH": "Ghana",
"OM": "Oman",
"TN": "Tunisia",
"JO": "Jordan",
"HR": "Croatia",
"HT": "Haiti",
"HU": "Hungary",
"HK": "Hong Kong",
"HN": "Honduras",
"HM": "Heard Island and McDonald Islands",
"VE": "Venezuela",
"PR": "Puerto Rico",
"PS": "Palestinian Territory",
"PW": "Palau",
"PT": "Portugal",
"SJ": "Svalbard and Jan Mayen",
"PY": "Paraguay",
"IQ": "Iraq",
"PA": "Panama",
"PF": "French Polynesia",
"BZ": "Belize",
"PE": "Peru",
"PK": "Pakistan",
"PH": "Philippines",
"PN": "Pitcairn",
"TM": "Turkmenistan",
"PL": "Poland",
"PM": "Saint Pierre and Miquelon",
"ZM": "Zambia",
"EH": "Western Sahara",
"RU": "Russian Federation",
"EE": "Estonia",
"EG": "Egypt",
"TK": "Tokelau",
"ZA": "South Africa",
"EC": "Ecuador",
"IT": "Italy",
"VN": "Vietnam",
"SB": "Solomon Islands",
"EU": "Europe",
"ET": "Ethiopia",
"SO": "Somalia",
"ZW": "Zimbabwe",
"SA": "Saudi Arabia",
"ES": "Spain",
"ER": "Eritrea",
"ME": "Montenegro",
"MD": "Moldova, Republic of",
"MG": "Madagascar",
"MF": "Saint Martin",
"MA": "Morocco",
"MC": "Monaco",
"UZ": "Uzbekistan",
"MM": "Myanmar",
"ML": "Mali",
"MO": "Macao",
"MN": "Mongolia",
"MH": "Marshall Islands",
"MK": "Macedonia",
"MU": "Mauritius",
"MT": "Malta",
"MW": "Malawi",
"MV": "Maldives",
"MQ": "Martinique",
"MP": "Northern Mariana Islands",
"MS": "Montserrat",
"MR": "Mauritania",
"IM": "Isle of Man",
"UG": "Uganda",
"TZ": "Tanzania, United Republic of",
"MY": "Malaysia",
"MX": "Mexico",
"IL": "Israel",
"FR": "France",
"IO": "British Indian Ocean Territory",
"FX": "France, Metropolitan",
"SH": "Saint Helena",
"FI": "Finland",
"FJ": "Fiji",
"FK": "Falkland Islands (Malvinas)",
"FM": "Micronesia, Federated States of",
"FO": "Faroe Islands",
"NI": "Nicaragua",
"NL": "Netherlands",
"NO": "Norway",
"NA": "Namibia",
"VU": "Vanuatu",
"NC": "New Caledonia",
"NE": "Niger",
"NF": "Norfolk Island",
"NG": "Nigeria",
"NZ": "New Zealand",
"NP": "Nepal",
"NR": "Nauru",
"NU": "Niue",
"CK": "Cook Islands",
"CI": "Cote d'Ivoire",
"CH": "Switzerland",
"CO": "Colombia",
"CN": "China",
"CM": "Cameroon",
"CL": "Chile",
"CC": "Cocos (Keeling) Islands",
"CA": "Canada",
"CG": "Congo",
"CF": "Central African Republic",
"CD": "Congo, The Democratic Republic of the",
"CZ": "Czech Republic",
"CY": "Cyprus",
"CX": "Christmas Island",
"CR": "Costa Rica",
"CV": "Cape Verde",
"CU": "Cuba",
"SZ": "Swaziland",
"SY": "Syrian Arab Republic",
"KG": "Kyrgyzstan",
"KE": "Kenya",
"SR": "Suriname",
"KI": "Kiribati",
"KH": "Cambodia",
"KN": "Saint Kitts and Nevis",
"KM": "Comoros",
"ST": "Sao Tome and Principe",
"SK": "Slovakia",
"KR": "Korea, Republic of",
"SI": "Slovenia",
"KP": "Korea, Democratic People's Republic of",
"KW": "Kuwait",
"SN": "Senegal",
"SM": "San Marino",
"SL": "Sierra Leone",
"SC": "Seychelles",
"KZ": "Kazakhstan",
"KY": "Cayman Islands",
"SG": "Singapore",
"SE": "Sweden",
"SD": "Sudan",
"DO": "Dominican Republic",
"DM": "Dominica",
"DJ": "Djibouti",
"DK": "Denmark",
"VG": "Virgin Islands, British",
"DE": "Germany",
"YE": "Yemen",
"DZ": "Algeria",
"US": "United States",
"UY": "Uruguay",
"YT": "Mayotte",
"UM": "United States Minor Outlying Islands",
"LB": "Lebanon",
"LC": "Saint Lucia",
"LA": "Lao People's Democratic Republic",
"TV": "Tuvalu",
"TW": "Taiwan",
"TT": "Trinidad and Tobago",
"TR": "Turkey",
"LK": "Sri Lanka",
"LI": "Liechtenstein",
"A1": "Anonymous Proxy",
"TO": "Tonga",
"LT": "Lithuania",
"A2": "Satellite Provider",
"LR": "Liberia",
"LS": "Lesotho",
"TH": "Thailand",
"TF": "French Southern Territories",
"TG": "Togo",
"TD": "Chad",
"TC": "Turks and Caicos Islands",
"LY": "Libyan Arab Jamahiriya",
"VA": "Holy See (Vatican City State)",
"VC": "Saint Vincent and the Grenadines",
"AE": "United Arab Emirates",
"AD": "Andorra",
"AG": "Antigua and Barbuda",
"AF": "Afghanistan",
"AI": "Anguilla",
"VI": "Virgin Islands, U.S.",
"IS": "Iceland",
"IR": "Iran, Islamic Republic of",
"AM": "Armenia",
"AL": "Albania",
"AO": "Angola",
"AN": "Netherlands Antilles",
"AQ": "Antarctica",
"AP": "Asia/Pacific Region",
"AS": "American Samoa",
"AR": "Argentina",
"AU": "Australia",
"AT": "Austria",
"AW": "Aruba",
"IN": "India",
"AX": "Aland Islands",
"AZ": "Azerbaijan",
"IE": "Ireland",
"ID": "Indonesia",
"UA": "Ukraine",
"QA": "Qatar",
"MZ": "Mozambique"
}, function (k, v) {
countries.push({
id: k,
text: v
});
});
$('#country').editable({
inputclass: 'form-control input-medium',
source: countries
});
$('#address').editable({
url: '/post',
value: {
city: "San Francisco",
street: "Valencia",
building: "#24"
},
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);
}
});
}
return {
//main function to initiate the module
init: function () {
// inii ajax simulation
initAjaxMock();
// init editable elements
initEditables();
// init editable toggler
$('#enable').click(function () {
$('#user .editable').editable('toggleDisabled');
});
// init
$('#inline').on('change', function (e) {
if ($(this).is(':checked')) {
window.location.href = 'form_editable.html?mode=inline';
} else {
window.location.href = 'form_editable.html';
}
});
// handle editable elements on hidden event fired
$('#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();
}
}
});
}
};
}();

View File

@ -1,57 +0,0 @@
var FormiCheck = function () {
return {
//main function to initiate the module
init: function () {
$('.icheck-colors li').click(function() {
var self = $(this);
if (!self.hasClass('active')) {
self.siblings().removeClass('active');
var skin = self.closest('.skin'),
color = self.attr('class') ? '-' + self.attr('class') : '',
colorTmp = skin.data('color') ? '-' + skin.data('color') : '-grey',
colorTmp = (colorTmp === '-black' ? '' : colorTmp);
checkbox_default = 'icheckbox_minimal',
radio_default = 'iradio_minimal',
checkbox = 'icheckbox_minimal' + colorTmp,
radio = 'iradio_minimal' + colorTmp;
if (skin.hasClass('skin-square')) {
checkbox_default = 'icheckbox_square';
radio_default = 'iradio_square';
checkbox = 'icheckbox_square' + colorTmp;
radio = 'iradio_square' + colorTmp;
};
if (skin.hasClass('skin-flat')) {
checkbox_default = 'icheckbox_flat';
radio_default = 'iradio_flat';
checkbox = 'icheckbox_flat' + colorTmp;
radio = 'iradio_flat' + colorTmp;
};
if (skin.hasClass('skin-line')) {
checkbox_default = 'icheckbox_line';
radio_default = 'iradio_line';
checkbox = 'icheckbox_line' + colorTmp;
radio = 'iradio_line' + colorTmp;
};
skin.find('.icheck').each(function() {
var element = $(this).hasClass('state') ? $(this) : $(this).parent();
var element_class = element.attr('class').replace(checkbox, checkbox_default + color).replace(radio, radio_default + color);
element.attr('class', element_class);
});
skin.data('color', self.attr('class') ? self.attr('class') : 'black');
self.addClass('active');
};
});
}
};
}();

View File

@ -1,527 +0,0 @@
var FormImageCrop = function () {
var demo1 = function() {
$('#demo1').Jcrop();
}
var demo2 = function() {
var jcrop_api;
$('#demo2').Jcrop({
onChange: showCoords,
onSelect: showCoords,
onRelease: clearCoords
},function(){
jcrop_api = this;
});
$('#coords').on('change','input',function(e){
var x1 = $('#x1').val(),
x2 = $('#x2').val(),
y1 = $('#y1').val(),
y2 = $('#y2').val();
jcrop_api.setSelect([x1,y1,x2,y2]);
});
// Simple event handler, called from onChange and onSelect
// event handlers, as per the Jcrop invocation above
function showCoords(c)
{
$('#x1').val(c.x);
$('#y1').val(c.y);
$('#x2').val(c.x2);
$('#y2').val(c.y2);
$('#w').val(c.w);
$('#h').val(c.h);
};
function clearCoords()
{
$('#coords input').val('');
};
}
var demo3 = function() {
// Create variables (in this scope) to hold the API and image size
var jcrop_api,
boundx,
boundy,
// Grab some information about the preview pane
$preview = $('#preview-pane'),
$pcnt = $('#preview-pane .preview-container'),
$pimg = $('#preview-pane .preview-container img'),
xsize = $pcnt.width(),
ysize = $pcnt.height();
console.log('init',[xsize,ysize]);
$('#demo3').Jcrop({
onChange: updatePreview,
onSelect: updatePreview,
aspectRatio: xsize / ysize
},function(){
// Use the API to get the real image size
var bounds = this.getBounds();
boundx = bounds[0];
boundy = bounds[1];
// Store the API in the jcrop_api variable
jcrop_api = this;
// Move the preview into the jcrop container for css positioning
$preview.appendTo(jcrop_api.ui.holder);
});
function updatePreview(c)
{
if (parseInt(c.w) > 0)
{
var rx = xsize / c.w;
var ry = ysize / c.h;
$pimg.css({
width: Math.round(rx * boundx) + 'px',
height: Math.round(ry * boundy) + 'px',
marginLeft: '-' + Math.round(rx * c.x) + 'px',
marginTop: '-' + Math.round(ry * c.y) + 'px'
});
}
};
}
var demo4 = function() {
var jcrop_api;
$('#demo4').Jcrop({
bgFade: true,
bgOpacity: .2,
setSelect: [ 60, 70, 540, 330 ]
},function(){
jcrop_api = this;
});
$('#fadetog').change(function(){
jcrop_api.setOptions({
bgFade: this.checked
});
}).attr('checked', true);
Metronic.updateUniform('#fadetog');
$('#shadetog').change(function(){
if (this.checked) $('#shadetxt').slideDown();
else $('#shadetxt').slideUp();
jcrop_api.setOptions({
shade: this.checked
});
}).attr('checked', false);
// Define page sections
var sections = {
bgc_buttons: 'Change bgColor',
bgo_buttons: 'Change bgOpacity',
anim_buttons: 'Animate Selection'
};
// Define animation buttons
var ac = {
anim1: [217,122,382,284],
anim2: [20,20,580,380],
anim3: [24,24,176,376],
anim4: [347,165,550,355],
anim5: [136,55,472,183]
};
// Define bgOpacity buttons
var bgo = {
Low: .2,
Mid: .5,
High: .8,
Full: 1
};
// Define bgColor buttons
var bgc = {
R: '#900',
B: '#4BB6F0',
Y: '#F0B207',
G: '#46B81C',
W: 'white',
K: 'black'
};
// Create fieldset targets for buttons
for(i in sections)
insertSection(i,sections[i]);
function create_btn(c) {
var $o = $('<button />').addClass('btn small');
if (c) $o.append(c);
return $o;
}
var a_count = 1;
// Create animation buttons
for(i in ac) {
$('#anim_buttons .btn-group')
.append(
create_btn(a_count++).click(animHandler(ac[i])),
' '
);
}
$('#anim_buttons .btn-group').append(
create_btn('Bye!').click(function(e){
$(e.target).addClass('active');
jcrop_api.animateTo(
[300,200,300,200],
function(){
this.release();
$(e.target).closest('.btn-group').find('.active').removeClass('active');
}
);
return false;
})
);
// Create bgOpacity buttons
for(i in bgo) {
$('#bgo_buttons .btn-group').append(
create_btn(i).click(setoptHandler('bgOpacity',bgo[i])),
' '
);
}
// Create bgColor buttons
for(i in bgc) {
$('#bgc_buttons .btn-group').append(
create_btn(i).css({
background: bgc[i],
color: ((i == 'K') || (i == 'R'))?'white':'black'
}).click(setoptHandler('bgColor',bgc[i])), ' '
);
}
// Function to insert named sections into interface
function insertSection(k,v) {
$('#interface').prepend(
$('<fieldset></fieldset>').attr('id',k).append(
$('<h4></h4>').append(v),
'<div class="btn-toolbar"><div class="btn-group"></div></div>'
)
);
};
// Handler for option-setting buttons
function setoptHandler(k,v) {
return function(e) {
$(e.target).closest('.btn-group').find('.active').removeClass('active');
$(e.target).addClass('active');
var opt = { };
opt[k] = v;
jcrop_api.setOptions(opt);
return false;
};
};
// Handler for animation buttons
function animHandler(v) {
return function(e) {
$(e.target).addClass('active');
jcrop_api.animateTo(v,function(){
$(e.target).closest('.btn-group').find('.active').removeClass('active');
});
return false;
};
};
$('#bgo_buttons .btn:first,#bgc_buttons .btn:last').addClass('active');
$('#interface').show();
}
var demo5 = function() {
// The variable jcrop_api will hold a reference to the
// Jcrop API once Jcrop is instantiated.
var jcrop_api;
// In this example, since Jcrop may be attached or detached
// at the whim of the user, I've wrapped the call into a function
initJcrop();
// The function is pretty simple
function initJcrop()//{{{
{
// Hide any interface elements that require Jcrop
// (This is for the local user interface portion.)
$('.requiresjcrop').hide();
// Invoke Jcrop in typical fashion
$('#demo5').Jcrop({
onRelease: releaseCheck
},function(){
jcrop_api = this;
jcrop_api.animateTo([100,100,400,300]);
// Setup and dipslay the interface for "enabled"
$('#can_click,#can_move,#can_size').attr('checked','checked');
Metronic.updateUniform('#can_click,#can_move,#can_size');
$('#ar_lock,#size_lock,#bg_swap').attr('checked',false);
Metronic.updateUniform('#ar_lock,#size_lock,#bg_swap');
$('.requiresjcrop').show();
});
};
//}}}
// Use the API to find cropping dimensions
// Then generate a random selection
// This function is used by setSelect and animateTo buttons
// Mainly for demonstration purposes
function getRandom() {
var dim = jcrop_api.getBounds();
return [
Math.round(Math.random() * dim[0]),
Math.round(Math.random() * dim[1]),
Math.round(Math.random() * dim[0]),
Math.round(Math.random() * dim[1])
];
};
// This function is bound to the onRelease handler...
// In certain circumstances (such as if you set minSize
// and aspectRatio together), you can inadvertently lose
// the selection. This callback re-enables creating selections
// in such a case. Although the need to do this is based on a
// buggy behavior, it's recommended that you in some way trap
// the onRelease callback if you use allowSelect: false
function releaseCheck()
{
jcrop_api.setOptions({ allowSelect: true });
$('#can_click').attr('checked',false);
Metronic.updateUniform('#can_click');
};
// Attach interface buttons
// This may appear to be a lot of code but it's simple stuff
$('#setSelect').click(function(e) {
// Sets a random selection
jcrop_api.setSelect(getRandom());
});
$('#animateTo').click(function(e) {
// Animates to a random selection
jcrop_api.animateTo(getRandom());
});
$('#release').click(function(e) {
// Release method clears the selection
jcrop_api.release();
});
$('#disable').click(function(e) {
// Disable Jcrop instance
jcrop_api.disable();
// Update the interface to reflect disabled state
$('#enable').show();
$('.requiresjcrop').hide();
});
$('#enable').click(function(e) {
// Re-enable Jcrop instance
jcrop_api.enable();
// Update the interface to reflect enabled state
$('#enable').hide();
$('.requiresjcrop').show();
});
$('#rehook').click(function(e) {
// This button is visible when Jcrop has been destroyed
// It performs the re-attachment and updates the UI
$('#rehook,#enable').hide();
initJcrop();
$('#unhook,.requiresjcrop').show();
return false;
});
$('#unhook').click(function(e) {
// Destroy Jcrop widget, restore original state
jcrop_api.destroy();
// Update the interface to reflect un-attached state
$('#unhook,#enable,.requiresjcrop').hide();
$('#rehook').show();
return false;
});
// Hook up the three image-swapping buttons
$('#img1').click(function(e) {
$(this).addClass('active').closest('.btn-group')
.find('button.active').not(this).removeClass('active');
jcrop_api.setImage('../../assets/global/plugins/jcrop/demos/demo_files/sago.jpg');
jcrop_api.setOptions({ bgOpacity: .6 });
return false;
});
$('#img2').click(function(e) {
$(this).addClass('active').closest('.btn-group')
.find('button.active').not(this).removeClass('active');
jcrop_api.setImage('../../assets/global/plugins/jcrop/demos/demo_files/pool.jpg');
jcrop_api.setOptions({ bgOpacity: .6 });
return false;
});
$('#img3').click(function(e) {
$(this).addClass('active').closest('.btn-group')
.find('button.active').not(this).removeClass('active');
jcrop_api.setImage('../../assets/global/plugins/jcrop/demos/demo_files/sago.jpg',function(){
this.setOptions({
bgOpacity: 1,
outerImage: '../../assets/global/plugins/jcrop/demos/demo_files/sagomod.jpg'
});
this.animateTo(getRandom());
});
return false;
});
// The checkboxes simply set options based on it's checked value
// Options are changed by passing a new options object
// Also, to prevent strange behavior, they are initially checked
// This matches the default initial state of Jcrop
$('#can_click').change(function(e) {
jcrop_api.setOptions({ allowSelect: !!this.checked });
jcrop_api.focus();
});
$('#can_move').change(function(e) {
jcrop_api.setOptions({ allowMove: !!this.checked });
jcrop_api.focus();
});
$('#can_size').change(function(e) {
jcrop_api.setOptions({ allowResize: !!this.checked });
jcrop_api.focus();
});
$('#ar_lock').change(function(e) {
jcrop_api.setOptions(this.checked?
{ aspectRatio: 4/3 }: { aspectRatio: 0 });
jcrop_api.focus();
});
$('#size_lock').change(function(e) {
jcrop_api.setOptions(this.checked? {
minSize: [ 80, 80 ],
maxSize: [ 350, 350 ]
}: {
minSize: [ 0, 0 ],
maxSize: [ 0, 0 ]
});
jcrop_api.focus();
});
}
var demo6 = function() {
var api;
$('#demo6').Jcrop({
// start off with jcrop-light class
bgOpacity: 0.5,
bgColor: 'white',
addClass: 'jcrop-light'
},function(){
api = this;
api.setSelect([130,65,130+350,65+285]);
api.setOptions({ bgFade: true });
api.ui.selection.addClass('jcrop-selection');
});
$('#buttonbar').on('click','button',function(e){
var $t = $(this), $g = $t.closest('.btn-group');
$g.find('button.active').removeClass('active');
$t.addClass('active');
$g.find('[data-setclass]').each(function(){
var $th = $(this), c = $th.data('setclass'),
a = $th.hasClass('active');
if (a) {
api.ui.holder.addClass(c);
switch(c){
case 'jcrop-light':
api.setOptions({ bgColor: 'white', bgOpacity: 0.5 });
break;
case 'jcrop-dark':
api.setOptions({ bgColor: 'black', bgOpacity: 0.4 });
break;
case 'jcrop-normal':
api.setOptions({
bgColor: $.Jcrop.defaults.bgColor,
bgOpacity: $.Jcrop.defaults.bgOpacity
});
break;
}
}
else api.ui.holder.removeClass(c);
});
});
}
var demo7 = function() {
// I did JSON.stringify(jcrop_api.tellSelect()) on a crop I liked:
var c = {"x":13,"y":7,"x2":487,"y2":107,"w":474,"h":100};
$('#demo7').Jcrop({
bgFade: true,
setSelect: [c.x,c.y,c.x2,c.y2]
});
}
var demo8 = function() {
$('#demo8').Jcrop({
aspectRatio: 1,
onSelect: updateCoords
});
function updateCoords(c)
{
$('#crop_x').val(c.x);
$('#crop_y').val(c.y);
$('#crop_w').val(c.w);
$('#crop_h').val(c.h);
};
$('#demo8_form').submit(function(){
if (parseInt($('#crop_w').val())) return true;
alert('Please select a crop region then press submit.');
return false;
});
}
var handleResponsive = function() {
if ($(window).width() <= 1024 && $(window).width() >= 678) {
$('.responsive-1024').each(function(){
$(this).attr("data-class", $(this).attr("class"));
$(this).attr("class", 'responsive-1024 col-md-12');
});
} else {
$('.responsive-1024').each(function(){
if ($(this).attr("data-class")) {
$(this).attr("class", $(this).attr("data-class"));
$(this).removeAttr("data-class");
}
});
}
}
return {
//main function to initiate the module
init: function () {
if (!jQuery().Jcrop) {;
return;
}
Metronic.addResizeHandler(handleResponsive);
handleResponsive();
demo1();
demo2();
demo3();
demo4();
demo5();
demo6();
demo7();
demo8();
}
};
}();

View File

@ -1,49 +0,0 @@
var FormSamples = function () {
return {
//main function to initiate the module
init: function () {
// use select2 dropdown instead of chosen as select2 works fine with bootstrap on responsive layouts.
$('.select2_category').select2({
placeholder: "Select an option",
allowClear: true
});
$('.select2_sample1').select2({
placeholder: "Select a State",
allowClear: true
});
$(".select2_sample2").select2({
placeholder: "Type to select an option",
allowClear: true,
minimumInputLength: 1,
query: function (query) {
var data = {
results: []
}, i, j, s;
for (i = 1; i < 5; i++) {
s = "";
for (j = 0; j < i; j++) {
s = s + query.term;
}
data.results.push({
id: query.term + i,
text: s
});
}
query.callback(data);
}
});
$(".select2_sample3").select2({
tags: ["red", "green", "blue", "yellow", "pink"]
});
}
};
}();

View File

@ -1,255 +0,0 @@
var FormWizard = function () {
return {
//main function to initiate the module
init: function () {
if (!jQuery().bootstrapWizard) {
return;
}
function format(state) {
if (!state.id) return state.text; // optgroup
return "<img class='flag' src='../../assets/global/img/flags/" + state.id.toLowerCase() + ".png'/>&nbsp;&nbsp;" + state.text;
}
$("#country_list").select2({
placeholder: "Select",
allowClear: true,
formatResult: format,
formatSelection: format,
escapeMarkup: function (m) {
return m;
}
});
var form = $('#submit_form');
var error = $('.alert-danger', form);
var success = $('.alert-success', form);
form.validate({
doNotHideMessage: true, //this option enables to show the error/success messages on tab switch.
errorElement: 'span', //default input error message container
errorClass: 'help-block help-block-error', // default input error message class
focusInvalid: false, // do not focus the last invalid input
rules: {
//account
username: {
minlength: 5,
required: true
},
password: {
minlength: 5,
required: true
},
rpassword: {
minlength: 5,
required: true,
equalTo: "#submit_form_password"
},
//profile
fullname: {
required: true
},
email: {
required: true,
email: true
},
phone: {
required: true
},
gender: {
required: true
},
address: {
required: true
},
city: {
required: true
},
country: {
required: true
},
//payment
card_name: {
required: true
},
card_number: {
minlength: 16,
maxlength: 16,
required: true
},
card_cvc: {
digits: true,
required: true,
minlength: 3,
maxlength: 4
},
card_expiry_date: {
required: true
},
'payment[]': {
required: true,
minlength: 1
}
},
messages: { // custom messages for radio buttons and checkboxes
'payment[]': {
required: "Please select at least one option",
minlength: jQuery.validator.format("Please select at least one option")
}
},
errorPlacement: function (error, element) { // render error placement for each input type
if (element.attr("name") == "gender") { // for uniform radio buttons, insert the after the given container
error.insertAfter("#form_gender_error");
} else if (element.attr("name") == "payment[]") { // for uniform checkboxes, insert the after the given container
error.insertAfter("#form_payment_error");
} else {
error.insertAfter(element); // for other inputs, just perform default behavior
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
success.hide();
error.show();
Metronic.scrollTo(error, -200);
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group
},
unhighlight: function (element) { // revert the change done by hightlight
$(element)
.closest('.form-group').removeClass('has-error'); // set error class to the control group
},
success: function (label) {
if (label.attr("for") == "gender" || label.attr("for") == "payment[]") { // for checkboxes and radio buttons, no need to show OK icon
label
.closest('.form-group').removeClass('has-error').addClass('has-success');
label.remove(); // remove error label here
} else { // display success icon for other inputs
label
.addClass('valid') // mark the current input as valid and display OK icon
.closest('.form-group').removeClass('has-error').addClass('has-success'); // set success class to the control group
}
},
submitHandler: function (form) {
success.show();
error.hide();
//add here some ajax code to submit your form or just call form.submit() if you want to submit the form without ajax
}
});
var displayConfirm = function() {
$('#tab4 .form-control-static', form).each(function(){
var input = $('[name="'+$(this).attr("data-display")+'"]', form);
if (input.is(":radio")) {
input = $('[name="'+$(this).attr("data-display")+'"]:checked', form);
}
if (input.is(":text") || input.is("textarea")) {
$(this).html(input.val());
} else if (input.is("select")) {
$(this).html(input.find('option:selected').text());
} else if (input.is(":radio") && input.is(":checked")) {
$(this).html(input.attr("data-title"));
} else if ($(this).attr("data-display") == 'payment[]') {
var payment = [];
$('[name="payment[]"]:checked', form).each(function(){
payment.push($(this).attr('data-title'));
});
$(this).html(payment.join("<br>"));
}
});
}
var handleTitle = function(tab, navigation, index) {
var total = navigation.find('li').length;
var current = index + 1;
// set wizard title
$('.step-title', $('#form_wizard_1')).text('Step ' + (index + 1) + ' of ' + total);
// set done steps
jQuery('li', $('#form_wizard_1')).removeClass("done");
var li_list = navigation.find('li');
for (var i = 0; i < index; i++) {
jQuery(li_list[i]).addClass("done");
}
if (current == 1) {
$('#form_wizard_1').find('.button-previous').hide();
} else {
$('#form_wizard_1').find('.button-previous').show();
}
if (current >= total) {
$('#form_wizard_1').find('.button-next').hide();
$('#form_wizard_1').find('.button-submit').show();
displayConfirm();
} else {
$('#form_wizard_1').find('.button-next').show();
$('#form_wizard_1').find('.button-submit').hide();
}
Metronic.scrollTo($('.page-title'));
}
// default form wizard
$('#form_wizard_1').bootstrapWizard({
'nextSelector': '.button-next',
'previousSelector': '.button-previous',
onTabClick: function (tab, navigation, index, clickedIndex) {
return false;
/*
success.hide();
error.hide();
if (form.valid() == false) {
return false;
}
handleTitle(tab, navigation, clickedIndex);
*/
},
onNext: function (tab, navigation, index) {
success.hide();
error.hide();
if (form.valid() == false) {
return false;
}
handleTitle(tab, navigation, index);
},
onPrevious: function (tab, navigation, index) {
success.hide();
error.hide();
handleTitle(tab, navigation, index);
},
onTabShow: function (tab, navigation, index) {
var total = navigation.find('li').length;
var current = index + 1;
var $percent = (current / total) * 100;
$('#form_wizard_1').find('.progress-bar').css({
width: $percent + '%'
});
}
});
$('#form_wizard_1').find('.button-previous').hide();
$('#form_wizard_1 .button-submit').click(function () {
alert('Finished! Hope you like it :)');
}).hide();
//apply validation on select2 dropdown value change, this only needed for chosen dropdown integration.
$('#country_list', form).change(function () {
form.validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
});
}
};
}();

View File

@ -1,332 +0,0 @@
var Inbox = function () {
var content = $('.inbox-content');
var loading = $('.inbox-loading');
var listListing = '';
var loadInbox = function (el, name) {
var url = 'inbox_inbox.html';
var title = $('.inbox-nav > li.' + name + ' a').attr('data-title');
listListing = name;
loading.show();
content.html('');
toggleButton(el);
$.ajax({
type: "GET",
cache: false,
url: url,
dataType: "html",
success: function(res)
{
toggleButton(el);
$('.inbox-nav > li.active').removeClass('active');
$('.inbox-nav > li.' + name).addClass('active');
$('.inbox-header > h1').text(title);
loading.hide();
content.html(res);
if (Layout.fixContentHeight) {
Layout.fixContentHeight();
}
Metronic.initUniform();
},
error: function(xhr, ajaxOptions, thrownError)
{
toggleButton(el);
},
async: false
});
// handle group checkbox:
jQuery('body').on('change', '.mail-group-checkbox', function () {
var set = jQuery('.mail-checkbox');
var checked = jQuery(this).is(":checked");
jQuery(set).each(function () {
$(this).attr("checked", checked);
});
jQuery.uniform.update(set);
});
}
var loadMessage = function (el, name, resetMenu) {
var url = 'inbox_view.html';
loading.show();
content.html('');
toggleButton(el);
var message_id = el.parent('tr').attr("data-messageid");
$.ajax({
type: "GET",
cache: false,
url: url,
dataType: "html",
data: {'message_id': message_id},
success: function(res)
{
toggleButton(el);
if (resetMenu) {
$('.inbox-nav > li.active').removeClass('active');
}
$('.inbox-header > h1').text('View Message');
loading.hide();
content.html(res);
Layout.fixContentHeight();
Metronic.initUniform();
},
error: function(xhr, ajaxOptions, thrownError)
{
toggleButton(el);
},
async: false
});
}
var initWysihtml5 = function () {
$('.inbox-wysihtml5').wysihtml5({
"stylesheets": ["../../assets/global/plugins/bootstrap-wysihtml5/wysiwyg-color.css"]
});
}
var initFileupload = function () {
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '../../assets/global/plugins/jquery-file-upload/server/php/',
autoUpload: true
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '../../assets/global/plugins/jquery-file-upload/server/php/',
type: 'HEAD'
}).fail(function () {
$('<span class="alert alert-error"/>')
.text('Upload server currently unavailable - ' +
new Date())
.appendTo('#fileupload');
});
}
}
var loadCompose = function (el) {
var url = 'inbox_compose.html';
loading.show();
content.html('');
toggleButton(el);
// load the form via ajax
$.ajax({
type: "GET",
cache: false,
url: url,
dataType: "html",
success: function(res)
{
toggleButton(el);
$('.inbox-nav > li.active').removeClass('active');
$('.inbox-header > h1').text('Compose');
loading.hide();
content.html(res);
initFileupload();
initWysihtml5();
$('.inbox-wysihtml5').focus();
Layout.fixContentHeight();
Metronic.initUniform();
},
error: function(xhr, ajaxOptions, thrownError)
{
toggleButton(el);
},
async: false
});
}
var loadReply = function (el) {
var messageid = $(el).attr("data-messageid");
var url = 'inbox_reply.html?messageid=' + messageid;
loading.show();
content.html('');
toggleButton(el);
// load the form via ajax
$.ajax({
type: "GET",
cache: false,
url: url,
dataType: "html",
success: function(res)
{
toggleButton(el);
$('.inbox-nav > li.active').removeClass('active');
$('.inbox-header > h1').text('Reply');
loading.hide();
content.html(res);
$('[name="message"]').val($('#reply_email_content_body').html());
handleCCInput(); // init "CC" input field
initFileupload();
initWysihtml5();
Layout.fixContentHeight();
Metronic.initUniform();
},
error: function(xhr, ajaxOptions, thrownError)
{
toggleButton(el);
},
async: false
});
}
var loadSearchResults = function (el) {
var url = 'inbox_inbox.html';
loading.show();
content.html('');
toggleButton(el);
$.ajax({
type: "GET",
cache: false,
url: url,
dataType: "html",
success: function(res)
{
toggleButton(el);
$('.inbox-nav > li.active').removeClass('active');
$('.inbox-header > h1').text('Search');
loading.hide();
content.html(res);
Layout.fixContentHeight();
Metronic.initUniform();
},
error: function(xhr, ajaxOptions, thrownError)
{
toggleButton(el);
},
async: false
});
}
var handleCCInput = function () {
var the = $('.inbox-compose .mail-to .inbox-cc');
var input = $('.inbox-compose .input-cc');
the.hide();
input.show();
$('.close', input).click(function () {
input.hide();
the.show();
});
}
var handleBCCInput = function () {
var the = $('.inbox-compose .mail-to .inbox-bcc');
var input = $('.inbox-compose .input-bcc');
the.hide();
input.show();
$('.close', input).click(function () {
input.hide();
the.show();
});
}
var toggleButton = function(el) {
if (typeof el == 'undefined') {
return;
}
if (el.attr("disabled")) {
el.attr("disabled", false);
} else {
el.attr("disabled", true);
}
}
return {
//main function to initiate the module
init: function () {
// handle compose btn click
$('.inbox').on('click', '.compose-btn a', function () {
loadCompose($(this));
});
// handle discard btn
$('.inbox').on('click', '.inbox-discard-btn', function(e) {
e.preventDefault();
loadInbox($(this), listListing);
});
// handle reply and forward button click
$('.inbox').on('click', '.reply-btn', function () {
loadReply($(this));
});
// handle view message
$('.inbox-content').on('click', '.view-message', function () {
loadMessage($(this));
});
// handle inbox listing
$('.inbox-nav > li.inbox > a').click(function () {
loadInbox($(this), 'inbox');
});
// handle sent listing
$('.inbox-nav > li.sent > a').click(function () {
loadInbox($(this), 'sent');
});
// handle draft listing
$('.inbox-nav > li.draft > a').click(function () {
loadInbox($(this), 'draft');
});
// handle trash listing
$('.inbox-nav > li.trash > a').click(function () {
loadInbox($(this), 'trash');
});
//handle compose/reply cc input toggle
$('.inbox-content').on('click', '.mail-to .inbox-cc', function () {
handleCCInput();
});
//handle compose/reply bcc input toggle
$('.inbox-content').on('click', '.mail-to .inbox-bcc', function () {
handleBCCInput();
});
//handle loading content based on URL parameter
if (Metronic.getURLParameter("a") === "view") {
loadMessage();
} else if (Metronic.getURLParameter("a") === "compose") {
loadCompose();
} else {
$('.inbox-nav > li.inbox > a').click();
}
}
};
}();

View File

@ -1,630 +0,0 @@
var Index = function () {
return {
//main function
init: function () {
Metronic.addResizeHandler(function () {
jQuery('.vmaps').each(function () {
var map = jQuery(this);
map.width(map.parent().width());
});
});
},
initJQVMAP: function () {
if (!jQuery().vectorMap) {
return;
}
var showMap = function (name) {
jQuery('.vmaps').hide();
jQuery('#vmap_' + name).show();
}
var setMap = function (name) {
var data = {
map: 'world_en',
backgroundColor: null,
borderColor: '#333333',
borderOpacity: 0.5,
borderWidth: 1,
color: '#c6c6c6',
enableZoom: true,
hoverColor: '#c9dfaf',
hoverOpacity: null,
values: sample_data,
normalizeFunction: 'linear',
scaleColors: ['#b6da93', '#909cae'],
selectedColor: '#c9dfaf',
selectedRegion: null,
showTooltip: true,
onLabelShow: function (event, label, code) {
},
onRegionOver: function (event, code) {
if (code == 'ca') {
event.preventDefault();
}
},
onRegionClick: function (element, code, region) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert(message);
}
};
data.map = name + '_en';
var map = jQuery('#vmap_' + name);
if (!map) {
return;
}
map.width(map.parent().parent().width());
map.show();
map.vectorMap(data);
map.hide();
}
setMap("world");
setMap("usa");
setMap("europe");
setMap("russia");
setMap("germany");
showMap("world");
jQuery('#regional_stat_world').click(function () {
showMap("world");
});
jQuery('#regional_stat_usa').click(function () {
showMap("usa");
});
jQuery('#regional_stat_europe').click(function () {
showMap("europe");
});
jQuery('#regional_stat_russia').click(function () {
showMap("russia");
});
jQuery('#regional_stat_germany').click(function () {
showMap("germany");
});
$('#region_statistics_loading').hide();
$('#region_statistics_content').show();
},
initCalendar: function () {
if (!jQuery().fullCalendar) {
return;
}
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var h = {};
if ($('#calendar').width() <= 400) {
$('#calendar').addClass("mobile");
h = {
left: 'title, prev, next',
center: '',
right: 'today,month,agendaWeek,agendaDay'
};
} else {
$('#calendar').removeClass("mobile");
if (Metronic.isRTL()) {
h = {
right: 'title',
center: '',
left: 'prev,next,today,month,agendaWeek,agendaDay'
};
} else {
h = {
left: 'title',
center: '',
right: 'prev,next,today,month,agendaWeek,agendaDay'
};
}
}
$('#calendar').fullCalendar('destroy'); // destroy the calendar
$('#calendar').fullCalendar({ //re-initialize the calendar
disableDragging : false,
header: h,
editable: true,
events: [{
title: 'All Day',
start: new Date(y, m, 1),
backgroundColor: Metronic.getBrandColor('yellow')
}, {
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2),
backgroundColor: Metronic.getBrandColor('blue')
}, {
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false,
backgroundColor: Metronic.getBrandColor('red')
}, {
title: 'Repeating Event',
start: new Date(y, m, d + 6, 16, 0),
allDay: false,
backgroundColor: Metronic.getBrandColor('green')
}, {
title: 'Meeting',
start: new Date(y, m, d+9, 10, 30),
allDay: false
}, {
title: 'Lunch',
start: new Date(y, m, d, 14, 0),
end: new Date(y, m, d, 14, 0),
backgroundColor: Metronic.getBrandColor('grey'),
allDay: false
}, {
title: 'Birthday',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
backgroundColor: Metronic.getBrandColor('purple'),
allDay: false
}, {
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
backgroundColor: Metronic.getBrandColor('yellow'),
url: 'http://google.com/'
}]
});
},
initCharts: function () {
if (!jQuery.plot) {
return;
}
function showChartTooltip(x, y, xValue, yValue) {
$('<div id="tooltip" class="chart-tooltip">' + yValue + '<\/div>').css({
position: 'absolute',
display: 'none',
top: y - 40,
left: x - 40,
border: '0px solid #ccc',
padding: '2px 6px',
'background-color': '#fff'
}).appendTo("body").fadeIn(200);
}
var data = [];
var totalPoints = 250;
// random data generator for plot charts
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;
var y = prev + Math.random() * 10 - 5;
if (y < 0) y = 0;
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;
}
function randValue() {
return (Math.floor(Math.random() * (1 + 50 - 20))) + 10;
}
var visitors = [
['02/2013', 1500],
['03/2013', 2500],
['04/2013', 1700],
['05/2013', 800],
['06/2013', 1500],
['07/2013', 2350],
['08/2013', 1500],
['09/2013', 1300],
['10/2013', 4600]
];
if ($('#site_statistics').size() != 0) {
$('#site_statistics_loading').hide();
$('#site_statistics_content').show();
var plot_statistics = $.plot($("#site_statistics"),
[{
data: visitors,
lines: {
fill: 0.6,
lineWidth: 0
},
color: ['#f89f9f']
}, {
data: visitors,
points: {
show: true,
fill: true,
radius: 5,
fillColor: "#f89f9f",
lineWidth: 3
},
color: '#fff',
shadowSize: 0
}],
{
xaxis: {
tickLength: 0,
tickDecimals: 0,
mode: "categories",
min: 0,
font: {
lineHeight: 14,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
yaxis: {
ticks: 5,
tickDecimals: 0,
tickColor: "#eee",
font: {
lineHeight: 14,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
grid: {
hoverable: true,
clickable: true,
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
}
});
var previousPoint = null;
$("#site_statistics").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showChartTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1] + ' visits');
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
});
}
if ($('#site_activities').size() != 0) {
//site activities
var previousPoint2 = null;
$('#site_activities_loading').hide();
$('#site_activities_content').show();
var data1 = [
['DEC', 300],
['JAN', 600],
['FEB', 1100],
['MAR', 1200],
['APR', 860],
['MAY', 1200],
['JUN', 1450],
['JUL', 1800],
['AUG', 1200],
['SEP', 600]
];
var plot_statistics = $.plot($("#site_activities"),
[{
data: data1,
lines: {
fill: 0.2,
lineWidth: 0,
},
color: ['#BAD9F5']
}, {
data: data1,
points: {
show: true,
fill: true,
radius: 4,
fillColor: "#9ACAE6",
lineWidth: 2
},
color: '#9ACAE6',
shadowSize: 1
}, {
data: data1,
lines: {
show: true,
fill: false,
lineWidth: 3
},
color: '#9ACAE6',
shadowSize: 0
}],
{
xaxis: {
tickLength: 0,
tickDecimals: 0,
mode: "categories",
min: 0,
font: {
lineHeight: 18,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
yaxis: {
ticks: 5,
tickDecimals: 0,
tickColor: "#eee",
font: {
lineHeight: 14,
style: "normal",
variant: "small-caps",
color: "#6F7B8A"
}
},
grid: {
hoverable: true,
clickable: true,
tickColor: "#eee",
borderColor: "#eee",
borderWidth: 1
}
});
$("#site_activities").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint2 != item.dataIndex) {
previousPoint2 = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showChartTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1] + 'M$');
}
}
});
$('#site_activities').bind("mouseleave", function () {
$("#tooltip").remove();
});
}
},
initMiniCharts: function () {
if (!jQuery().easyPieChart || !jQuery().sparkline) {
return;
}
// IE8 Fix: function.bind polyfill
if (Metronic.isIE8() && !Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis ? this : oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
$('.easy-pie-chart .number.transactions').easyPieChart({
animate: 1000,
size: 75,
lineWidth: 3,
barColor: Metronic.getBrandColor('yellow')
});
$('.easy-pie-chart .number.visits').easyPieChart({
animate: 1000,
size: 75,
lineWidth: 3,
barColor: Metronic.getBrandColor('green')
});
$('.easy-pie-chart .number.bounce').easyPieChart({
animate: 1000,
size: 75,
lineWidth: 3,
barColor: Metronic.getBrandColor('red')
});
$('.easy-pie-chart-reload').click(function () {
$('.easy-pie-chart .number').each(function () {
var newValue = Math.floor(100 * Math.random());
$(this).data('easyPieChart').update(newValue);
$('span', this).text(newValue);
});
});
$("#sparkline_bar").sparkline([8, 9, 10, 11, 10, 10, 12, 10, 10, 11, 9, 12, 11, 10, 9, 11, 13, 13, 12], {
type: 'bar',
width: '100',
barWidth: 5,
height: '55',
barColor: '#35aa47',
negBarColor: '#e02222'
});
$("#sparkline_bar2").sparkline([9, 11, 12, 13, 12, 13, 10, 14, 13, 11, 11, 12, 11, 11, 10, 12, 11, 10], {
type: 'bar',
width: '100',
barWidth: 5,
height: '55',
barColor: '#ffb848',
negBarColor: '#e02222'
});
$("#sparkline_line").sparkline([9, 10, 9, 10, 10, 11, 12, 10, 10, 11, 11, 12, 11, 10, 12, 11, 10, 12], {
type: 'line',
width: '100',
height: '55',
lineColor: '#ffb848'
});
},
initChat: function () {
var cont = $('#chats');
var list = $('.chats', cont);
var form = $('.chat-form', cont);
var input = $('input', form);
var btn = $('.btn', form);
var handleClick = function (e) {
e.preventDefault();
var text = input.val();
if (text.length == 0) {
return;
}
var time = new Date();
var time_str = (time.getHours() + ':' + time.getMinutes());
var tpl = '';
tpl += '<li class="out">';
tpl += '<img class="avatar" alt="" src="' + Layout.getLayoutImgPath() + 'avatar1.jpg"/>';
tpl += '<div class="message">';
tpl += '<span class="arrow"></span>';
tpl += '<a href="#" class="name">Bob Nilson</a>&nbsp;';
tpl += '<span class="datetime">at ' + time_str + '</span>';
tpl += '<span class="body">';
tpl += text;
tpl += '</span>';
tpl += '</div>';
tpl += '</li>';
var msg = list.append(tpl);
input.val("");
var getLastPostPos = function () {
var height = 0;
cont.find("li.out, li.in").each(function () {
height = height + $(this).outerHeight();
});
return height;
}
cont.find('.scroller').slimScroll({
scrollTo: getLastPostPos()
});
}
$('body').on('click', '.message .name', function (e) {
e.preventDefault(); // prevent click event
var name = $(this).text(); // get clicked user's full name
input.val('@' + name + ':'); // set it into the input field
Metronic.scrollTo(input); // scroll to input if needed
});
btn.click(handleClick);
input.keypress(function (e) {
if (e.which == 13) {
handleClick(e);
return false; //<---- Add this line
}
});
},
initDashboardDaterange: function () {
if (!jQuery().daterangepicker) {
return;
}
$('#dashboard-report-range').daterangepicker({
opens: (Metronic.isRTL() ? 'right' : 'left'),
startDate: moment().subtract('days', 29),
endDate: moment(),
minDate: '01/01/2012',
maxDate: '12/31/2014',
dateLimit: {
days: 60
},
showDropdowns: false,
showWeekNumbers: true,
timePicker: false,
timePickerIncrement: 1,
timePicker12Hour: true,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
'Last 7 Days': [moment().subtract('days', 6), moment()],
'Last 30 Days': [moment().subtract('days', 29), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
},
buttonClasses: ['btn btn-sm'],
applyClass: ' blue',
cancelClass: 'default',
format: 'MM/DD/YYYY',
separator: ' to ',
locale: {
applyLabel: 'Apply',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom Range',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
}
},
function (start, end) {
$('#dashboard-report-range span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
}
);
$('#dashboard-report-range span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
$('#dashboard-report-range').show();
}
};
}();

View File

@ -1,197 +0,0 @@
var Index = function() {
var dashboardMainChart = null;
return {
//main function
init: function() {
Metronic.addResizeHandler(function() {
jQuery('.vmaps').each(function() {
var map = jQuery(this);
map.width(map.parent().width());
});
});
Index.initCharts();
Index.initMiniCharts();
Index.initJQVMAP();
},
initJQVMAP: function() {
if (!jQuery().vectorMap) {
return;
}
var showMap = function(name) {
jQuery('.vmaps').hide();
jQuery('#vmap_' + name).show();
}
var setMap = function(name) {
var data = {
map: 'world_en',
backgroundColor: null,
borderColor: '#333333',
borderOpacity: 0.5,
borderWidth: 1,
color: '#c6c6c6',
enableZoom: true,
hoverColor: '#c9dfaf',
hoverOpacity: null,
values: sample_data,
normalizeFunction: 'linear',
scaleColors: ['#b6da93', '#909cae'],
selectedColor: '#c9dfaf',
selectedRegion: null,
showTooltip: true,
onLabelShow: function(event, label, code) {
},
onRegionOver: function(event, code) {
if (code == 'ca') {
event.preventDefault();
}
},
onRegionClick: function(element, code, region) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert(message);
}
};
data.map = name + '_en';
var map = jQuery('#vmap_' + name);
if (!map) {
return;
}
map.width(map.parent().parent().width());
map.show();
map.vectorMap(data);
map.hide();
}
setMap("world");
setMap("usa");
setMap("europe");
setMap("russia");
setMap("germany");
showMap("world");
jQuery('#regional_stat_world').click(function() {
showMap("world");
});
jQuery('#regional_stat_usa').click(function() {
showMap("usa");
});
jQuery('#regional_stat_europe').click(function() {
showMap("europe");
});
jQuery('#regional_stat_russia').click(function() {
showMap("russia");
});
jQuery('#regional_stat_germany').click(function() {
showMap("germany");
});
$('#region_statistics_loading').hide();
$('#region_statistics_content').show();
},
initCharts: function() {
if (Morris.EventEmitter) {
// Use Morris.Area instead of Morris.Line
dashboardMainChart = Morris.Area({
element: 'sales_statistics',
padding: 0,
behaveLikeLine: false,
gridEnabled: false,
gridLineColor: false,
axes: false,
fillOpacity: 1,
data: [{
period: '2011 Q1',
sales: 1400,
profit: 400
}, {
period: '2011 Q2',
sales: 1100,
profit: 600
}, {
period: '2011 Q3',
sales: 1600,
profit: 500
}, {
period: '2011 Q4',
sales: 1200,
profit: 400
}, {
period: '2012 Q1',
sales: 1550,
profit: 800
}],
lineColors: ['#399a8c', '#92e9dc'],
xkey: 'period',
ykeys: ['sales', 'profit'],
labels: ['Sales', 'Profit'],
pointSize: 0,
lineWidth: 0,
hideHover: 'auto',
resize: true
});
}
},
redrawCharts: function() {
dashboardMainChart.resizeHandler();
},
initMiniCharts: function() {
// IE8 Fix: function.bind polyfill
if (Metronic.isIE8() && !Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP && oThis ? this : oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
$("#sparkline_bar").sparkline([8, 9, 10, 11, 10, 10, 12, 10, 10, 11, 9, 12, 11], {
type: 'bar',
width: '100',
barWidth: 6,
height: '45',
barColor: '#F36A5B',
negBarColor: '#e02222'
});
$("#sparkline_bar2").sparkline([9, 11, 12, 13, 12, 13, 10, 14, 13, 11, 11, 12, 11], {
type: 'bar',
width: '100',
barWidth: 6,
height: '45',
barColor: '#5C9BD1',
negBarColor: '#e02222'
});
}
};
}();

View File

@ -1,20 +0,0 @@
var Lock = function () {
return {
//main function to initiate the module
init: function () {
$.backstretch([
"../../assets/admin/pages/media/bg/1.jpg",
"../../assets/admin/pages/media/bg/2.jpg",
"../../assets/admin/pages/media/bg/3.jpg",
"../../assets/admin/pages/media/bg/4.jpg"
], {
fade: 1000,
duration: 8000
});
}
};
}();

View File

@ -1,255 +0,0 @@
var Login = function () {
var handleLogin = function() {
$('.login-form').validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: false, // do not focus the last invalid input
rules: {
username: {
required: true
},
password: {
required: true
},
remember: {
required: false
}
},
messages: {
username: {
required: "Username is required."
},
password: {
required: "Password is required."
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
$('.alert-danger', $('.login-form')).show();
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
},
success: function (label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
},
errorPlacement: function (error, element) {
error.insertAfter(element.closest('.input-icon'));
},
submitHandler: function (form) {
form.submit();
}
});
$('.login-form input').keypress(function (e) {
if (e.which == 13) {
if ($('.login-form').validate().form()) {
$('.login-form').submit();
}
return false;
}
});
}
var handleForgetPassword = function () {
$('.forget-form').validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: false, // do not focus the last invalid input
ignore: "",
rules: {
email: {
required: true,
email: true
}
},
messages: {
email: {
required: "Email is required."
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
},
success: function (label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
},
errorPlacement: function (error, element) {
error.insertAfter(element.closest('.input-icon'));
},
submitHandler: function (form) {
form.submit();
}
});
$('.forget-form input').keypress(function (e) {
if (e.which == 13) {
if ($('.forget-form').validate().form()) {
$('.forget-form').submit();
}
return false;
}
});
jQuery('#forget-password').click(function () {
jQuery('.login-form').hide();
jQuery('.forget-form').show();
});
jQuery('#back-btn').click(function () {
jQuery('.login-form').show();
jQuery('.forget-form').hide();
});
}
var handleRegister = function () {
function format(state) {
if (!state.id) return state.text; // optgroup
return "<img class='flag' src='../../assets/global/img/flags/" + state.id.toLowerCase() + ".png'/>&nbsp;&nbsp;" + state.text;
}
$("#select2_sample4").select2({
placeholder: '<i class="fa fa-map-marker"></i>&nbsp;Select a Country',
allowClear: true,
formatResult: format,
formatSelection: format,
escapeMarkup: function (m) {
return m;
}
});
$('#select2_sample4').change(function () {
$('.register-form').validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
});
$('.register-form').validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: false, // do not focus the last invalid input
ignore: "",
rules: {
fullname: {
required: true
},
email: {
required: true,
email: true
},
address: {
required: true
},
city: {
required: true
},
country: {
required: true
},
username: {
required: true
},
password: {
required: true
},
rpassword: {
equalTo: "#register_password"
},
tnc: {
required: true
}
},
messages: { // custom messages for radio buttons and checkboxes
tnc: {
required: "Please accept TNC first."
}
},
invalidHandler: function (event, validator) { //display error alert on form submit
},
highlight: function (element) { // hightlight error inputs
$(element)
.closest('.form-group').addClass('has-error'); // set error class to the control group
},
success: function (label) {
label.closest('.form-group').removeClass('has-error');
label.remove();
},
errorPlacement: function (error, element) {
if (element.attr("name") == "tnc") { // insert checkbox errors after the container
error.insertAfter($('#register_tnc_error'));
} else if (element.closest('.input-icon').size() === 1) {
error.insertAfter(element.closest('.input-icon'));
} else {
error.insertAfter(element);
}
},
submitHandler: function (form) {
form.submit();
}
});
$('.register-form input').keypress(function (e) {
if (e.which == 13) {
if ($('.register-form').validate().form()) {
$('.register-form').submit();
}
return false;
}
});
jQuery('#register-btn').click(function () {
jQuery('.login-form').hide();
jQuery('.register-form').show();
});
jQuery('#register-back-btn').click(function () {
jQuery('.login-form').show();
jQuery('.register-form').hide();
});
}
return {
//main function to initiate the module
init: function () {
handleLogin();
handleForgetPassword();
handleRegister();
}
};
}();

View File

@ -1,203 +0,0 @@
var MapsGoogle = function () {
var mapBasic = function () {
new GMaps({
div: '#gmap_basic',
lat: -12.043333,
lng: -77.028333
});
}
var mapMarker = function () {
var map = new GMaps({
div: '#gmap_marker',
lat: -51.38739,
lng: -6.187181,
});
map.addMarker({
lat: -51.38739,
lng: -6.187181,
title: 'Lima',
details: {
database_id: 42,
author: 'HPNeo'
},
click: function (e) {
if (console.log) console.log(e);
alert('You clicked in this marker');
}
});
map.addMarker({
lat: -12.042,
lng: -77.028333,
title: 'Marker with InfoWindow',
infoWindow: {
content: '<span style="color:#000">HTML Content!</span>'
}
});
map.setZoom(5);
}
var mapPolylines = function () {
var map = new GMaps({
div: '#gmap_polylines',
lat: -12.043333,
lng: -77.028333,
click: function (e) {
console.log(e);
}
});
path = [
[-12.044012922866312, -77.02470665341184],
[-12.05449279282314, -77.03024273281858],
[-12.055122327623378, -77.03039293652341],
[-12.075917129727586, -77.02764635449216],
[-12.07635776902266, -77.02792530422971],
[-12.076819390363665, -77.02893381481931],
[-12.088527520066453, -77.0241058385925],
[-12.090814532191756, -77.02271108990476]
];
map.drawPolyline({
path: path,
strokeColor: '#131540',
strokeOpacity: 0.6,
strokeWeight: 6
});
}
var mapGeolocation = function () {
var map = new GMaps({
div: '#gmap_geo',
lat: -12.043333,
lng: -77.028333
});
GMaps.geolocate({
success: function (position) {
map.setCenter(position.coords.latitude, position.coords.longitude);
},
error: function (error) {
alert('Geolocation failed: ' + error.message);
},
not_supported: function () {
alert("Your browser does not support geolocation");
},
always: function () {
//alert("Geolocation Done!");
}
});
}
var mapGeocoding = function () {
var map = new GMaps({
div: '#gmap_geocoding',
lat: -12.043333,
lng: -77.028333
});
var handleAction = function () {
var text = $.trim($('#gmap_geocoding_address').val());
GMaps.geocode({
address: text,
callback: function (results, status) {
if (status == 'OK') {
var latlng = results[0].geometry.location;
map.setCenter(latlng.lat(), latlng.lng());
map.addMarker({
lat: latlng.lat(),
lng: latlng.lng()
});
Metronic.scrollTo($('#gmap_geocoding'));
}
}
});
}
$('#gmap_geocoding_btn').click(function (e) {
e.preventDefault();
handleAction();
});
$("#gmap_geocoding_address").keypress(function (e) {
var keycode = (e.keyCode ? e.keyCode : e.which);
if (keycode == '13') {
e.preventDefault();
handleAction();
}
});
}
var mapPolygone = function () {
var map = new GMaps({
div: '#gmap_polygons',
lat: -12.043333,
lng: -77.028333
});
var path = [
[-12.040397656836609, -77.03373871559225],
[-12.040248585302038, -77.03993927003302],
[-12.050047116528843, -77.02448169303511],
[-12.044804866577001, -77.02154422636042]
];
var polygon = map.drawPolygon({
paths: path,
strokeColor: '#BBD8E9',
strokeOpacity: 1,
strokeWeight: 3,
fillColor: '#BBD8E9',
fillOpacity: 0.6
});
}
var mapRoutes = function () {
var map = new GMaps({
div: '#gmap_routes',
lat: -12.043333,
lng: -77.028333
});
$('#gmap_routes_start').click(function (e) {
e.preventDefault();
Metronic.scrollTo($(this), 400);
map.travelRoute({
origin: [-12.044012922866312, -77.02470665341184],
destination: [-12.090814532191756, -77.02271108990476],
travelMode: 'driving',
step: function (e) {
$('#gmap_routes_instructions').append('<li>' + e.instructions + '</li>');
$('#gmap_routes_instructions li:eq(' + e.step_number + ')').delay(800 * e.step_number).fadeIn(500, function () {
map.setCenter(e.end_location.lat(), e.end_location.lng());
map.drawPolyline({
path: e.path,
strokeColor: '#131540',
strokeOpacity: 0.6,
strokeWeight: 6
});
});
}
});
});
}
return {
//main function to initiate map samples
init: function () {
mapBasic();
mapMarker();
mapGeolocation();
mapGeocoding();
mapPolylines();
mapPolygone();
mapRoutes();
}
};
}();

View File

@ -1,64 +0,0 @@
var MapsVector = function () {
var setMap = function (name) {
var data = {
map: 'world_en',
backgroundColor: null,
borderColor: '#333333',
borderOpacity: 0.5,
borderWidth: 1,
color: '#c6c6c6',
enableZoom: true,
hoverColor: '#c9dfaf',
hoverOpacity: null,
values: sample_data,
normalizeFunction: 'linear',
scaleColors: ['#b6da93', '#427d1a'],
selectedColor: '#c9dfaf',
selectedRegion: null,
showTooltip: true,
onRegionOver: function (event, code) {
//sample to interact with map
if (code == 'ca') {
event.preventDefault();
}
},
onRegionClick: function (element, code, region) {
//sample to interact with map
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert(message);
}
};
data.map = name + '_en';
var map = jQuery('#vmap_' + name);
if (!map) {
return;
}
map.width(map.parent().width());
map.vectorMap(data);
}
return {
//main function to initiate map samples
init: function () {
setMap("world");
setMap("usa");
setMap("europe");
setMap("russia");
setMap("germany");
// redraw maps on window or content resized
Metronic.addResizeHandler(function(){
setMap("world");
setMap("usa");
setMap("europe");
setMap("russia");
setMap("germany");
});
}
};
}();

View File

@ -1,12 +0,0 @@
var Portfolio = function () {
return {
//main function to initiate the module
init: function () {
$('.mix-grid').mixitup();
}
};
}();

View File

@ -1,34 +0,0 @@
var PortletDraggable = function () {
return {
//main function to initiate the module
init: function () {
if (!jQuery().sortable) {
return;
}
$("#sortable_portlets").sortable({
connectWith: ".portlet",
items: ".portlet",
opacity: 0.8,
handle : '.portlet-title',
coneHelperSize: true,
placeholder: 'portlet-sortable-placeholder',
forcePlaceholderSize: true,
tolerance: "pointer",
helper: "clone",
tolerance: "pointer",
forcePlaceholderSize: !0,
helper: "clone",
cancel: ".portlet-sortable-empty, .portlet-fullscreen", // cancel dragging if portlet is in fullscreen mode
revert: 250, // animation in milliseconds
update: function(b, c) {
if (c.item.prev().hasClass("portlet-sortable-empty")) {
c.item.prev().before(c.item);
}
}
});
}
};
}();

View File

@ -1,40 +0,0 @@
var TableTree = function() {
var demo1 = function() {
jQuery('#gtreetable').gtreetable({
'draggable': true,
'source': function(id) {
return {
type: 'GET',
url: 'demo/table_tree.php',
data: {
'id': id
},
dataType: 'json',
error: function(XMLHttpRequest) {
alert(XMLHttpRequest.status + ': ' + XMLHttpRequest.responseText);
}
}
},
'sort': function (a, b) {
var aName = a.name.toLowerCase();
var bName = b.name.toLowerCase();
return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));
},
'types': { default: 'glyphicon glyphicon-folder-open', folder: 'glyphicon glyphicon-folder-open'},
'inputWidth': '255px'
});
}
return {
//main function to initiate the module
init: function() {
demo1();
}
};
}();

View File

@ -1,35 +0,0 @@
var Timeline = function () {
var mapPolygone = function () {
var map = new GMaps({
div: '#gmap_polygons',
lat: -12.043333,
lng: -77.028333
});
var path = [
[-12.040397656836609, -77.03373871559225],
[-12.040248585302038, -77.03993927003302],
[-12.050047116528843, -77.02448169303511],
[-12.044804866577001, -77.02154422636042]
];
var polygon = map.drawPolygon({
paths: path,
strokeColor: '#BBD8E9',
strokeOpacity: 1,
strokeWeight: 3,
fillColor: '#BBD8E9',
fillOpacity: 0.6
});
}
return {
//main function to initiate map samples
init: function () {
mapPolygone();
}
};
}();

View File

@ -1,46 +0,0 @@
/**
Todo Module
**/
var Todo = function () {
// private functions & variables
var _initComponents = function() {
// init datepicker
$('.todo-taskbody-due').datepicker({
rtl: Metronic.isRTL(),
orientation: "left",
autoclose: true
});
// init tags
$(".todo-taskbody-tags").select2({
tags: ["Testing", "Important", "Info", "Pending", "Completed", "Requested", "Approved"]
});
}
var _handleProjectListMenu = function() {
if (Metronic.getViewPort().width <= 992) {
$('.todo-project-list-content').addClass("collapse");
} else {
$('.todo-project-list-content').removeClass("collapse").css("height", "auto");
}
}
// public functions
return {
//main function
init: function () {
_initComponents();
_handleProjectListMenu();
Metronic.addResizeHandler(function(){
_handleProjectListMenu();
});
}
};
}();

View File

@ -1,97 +0,0 @@
var UIAlertDialogApi = function () {
var handleDialogs = function() {
$('#demo_1').click(function(){
bootbox.alert("Hello world!");
});
//end #demo_1
$('#demo_2').click(function(){
bootbox.alert("Hello world!", function() {
alert("Hello world callback");
});
});
//end #demo_2
$('#demo_3').click(function(){
bootbox.confirm("Are you sure?", function(result) {
alert("Confirm result: "+result);
});
});
//end #demo_3
$('#demo_4').click(function(){
bootbox.prompt("What is your name?", function(result) {
if (result === null) {
alert("Prompt dismissed");
} else {
alert("Hi <b>"+result+"</b>");
}
});
});
//end #demo_6
$('#demo_5').click(function(){
bootbox.dialog({
message: "I am a custom dialog",
title: "Custom title",
buttons: {
success: {
label: "Success!",
className: "green",
callback: function() {
alert("great success");
}
},
danger: {
label: "Danger!",
className: "red",
callback: function() {
alert("uh oh, look out!");
}
},
main: {
label: "Click ME!",
className: "blue",
callback: function() {
alert("Primary button");
}
}
}
});
});
//end #demo_7
}
var handleAlerts = function() {
$('#alert_show').click(function(){
Metronic.alert({
container: $('#alert_container').val(), // alerts parent container(by default placed after the page breadcrumbs)
place: $('#alert_place').val(), // append or prepent in container
type: $('#alert_type').val(), // alert's type
message: $('#alert_message').val(), // alert's message
close: $('#alert_close').is(":checked"), // make alert closable
reset: $('#alert_reset').is(":checked"), // close all previouse alerts first
focus: $('#alert_focus').is(":checked"), // auto scroll to the alert after shown
closeInSeconds: $('#alert_close_in_seconds').val(), // auto close after defined seconds
icon: $('#alert_icon').val() // put icon before the message
});
});
}
return {
//main function to initiate the module
init: function () {
handleDialogs();
handleAlerts();
}
};
}();

View File

@ -1,166 +0,0 @@
var UIBlockUI = function() {
var handleSample1 = function() {
$('#blockui_sample_1_1').click(function() {
Metronic.blockUI({
target: '#blockui_sample_1_portlet_body'
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_1_portlet_body');
}, 2000);
});
$('#blockui_sample_1_2').click(function() {
Metronic.blockUI({
target: '#blockui_sample_1_portlet_body',
boxed: true
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_1_portlet_body');
}, 2000);
});
$('#blockui_sample_1_3').click(function() {
Metronic.blockUI({
target: '#blockui_sample_1_portlet_body',
animate: true
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_1_portlet_body');
}, 2000);
});
}
var handleSample2 = function() {
$('#blockui_sample_2_1').click(function() {
Metronic.blockUI();
window.setTimeout(function() {
Metronic.unblockUI();
}, 2000);
});
$('#blockui_sample_2_2').click(function() {
Metronic.blockUI({
boxed: true
});
window.setTimeout(function() {
Metronic.unblockUI();
}, 2000);
});
$('#blockui_sample_2_3').click(function() {
Metronic.startPageLoading({message: 'Please wait...'});
window.setTimeout(function() {
Metronic.stopPageLoading();
}, 2000);
});
$('#blockui_sample_2_4').click(function() {
Metronic.startPageLoading({animate: true});
window.setTimeout(function() {
Metronic.stopPageLoading();
}, 2000);
});
}
var handleSample3 = function() {
$('#blockui_sample_3_1_0').click(function() {
Metronic.blockUI({
target: '#basic',
overlayColor: 'none',
cenrerY: true,
animate: true
});
window.setTimeout(function() {
Metronic.unblockUI('#basic');
}, 2000);
});
$('#blockui_sample_3_1').click(function() {
Metronic.blockUI({
target: '#blockui_sample_3_1_element',
overlayColor: 'none',
animate: true
});
});
$('#blockui_sample_3_1_1').click(function() {
Metronic.unblockUI('#blockui_sample_3_1_element');
});
$('#blockui_sample_3_2').click(function() {
Metronic.blockUI({
target: '#blockui_sample_3_2_element',
boxed: true
});
});
$('#blockui_sample_3_2_1').click(function() {
Metronic.unblockUI('#blockui_sample_3_2_element');
});
}
var handleSample4 = function() {
$('#blockui_sample_4_1').click(function() {
Metronic.blockUI({
target: '#blockui_sample_4_portlet_body',
boxed: true,
message: 'Processing...'
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_4_portlet_body');
}, 2000);
});
$('#blockui_sample_4_2').click(function() {
Metronic.blockUI({
target: '#blockui_sample_4_portlet_body',
iconOnly: true
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_4_portlet_body');
}, 2000);
});
$('#blockui_sample_4_3').click(function() {
Metronic.blockUI({
target: '#blockui_sample_4_portlet_body',
boxed: true,
textOnly: true
});
window.setTimeout(function() {
Metronic.unblockUI('#blockui_sample_4_portlet_body');
}, 2000);
});
}
return {
//main function to initiate the module
init: function() {
handleSample1();
handleSample2();
handleSample3();
handleSample4();
}
};
}();

View File

@ -1,30 +0,0 @@
var UIBootstrapGrowl = function() {
return {
//main function to initiate the module
init: function() {
$('#bs_growl_show').click(function(event) {
$.bootstrapGrowl($('#growl_text').val(), {
ele: 'body', // which element to append to
type: $('#growl_type').val(), // (null, 'info', 'danger', 'success', 'warning')
offset: {
from: $('#growl_offset').val(),
amount: parseInt($('#growl_offset_val').val())
}, // 'top', or 'bottom'
align: $('#growl_align').val(), // ('left', 'right', or 'center')
width: parseInt($('#growl_width')), // (integer, or 'auto')
delay: $('#growl_delay').val(), // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
allow_dismiss: $('#glowl_dismiss').is(":checked"), // If true then will display a cross to close the popup.
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
});
}
};
}();

View File

@ -1,33 +0,0 @@
var UIConfirmations = function () {
var handleSample = function () {
$('#bs_confirmation_demo_1').on('confirmed.bs.confirmation', function () {
alert('You confirmed action #1');
});
$('#bs_confirmation_demo_1').on('canceled.bs.confirmation', function () {
alert('You canceled action #1');
});
$('#bs_confirmation_demo_2').on('confirmed.bs.confirmation', function () {
alert('You confirmed action #2');
});
$('#bs_confirmation_demo_2').on('canceled.bs.confirmation', function () {
alert('You canceled action #2');
});
}
return {
//main function to initiate the module
init: function () {
handleSample();
}
};
}();

View File

@ -1,32 +0,0 @@
var UIDatepaginator = function () {
return {
//main function to initiate the module
init: function () {
//sample #1
$('#datepaginator_sample_1').datepaginator();
//sample #2
$('#datepaginator_sample_2').datepaginator({
size: "large"
});
//sample #3
$('#datepaginator_sample_3').datepaginator({
size: "small"
});
//sample #3
$('#datepaginator_sample_4').datepaginator({
onSelectedDateChanged: function(event, date) {
alert("Selected date: " + moment(date).format("Do, MMM YYYY"));
}
});
} // end init
};
}();

View File

@ -1,69 +0,0 @@
var UIExtendedModals = function () {
return {
//main function to initiate the module
init: function () {
// general settings
$.fn.modal.defaults.spinner = $.fn.modalmanager.defaults.spinner =
'<div class="loading-spinner" style="width: 200px; margin-left: -100px;">' +
'<div class="progress progress-striped active">' +
'<div class="progress-bar" style="width: 100%;"></div>' +
'</div>' +
'</div>';
$.fn.modalmanager.defaults.resize = true;
//dynamic demo:
$('.dynamic .demo').click(function(){
var tmpl = [
// tabindex is required for focus
'<div class="modal hide fade" tabindex="-1">',
'<div class="modal-header">',
'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>',
'<h4 class="modal-title">Modal header</h4>',
'</div>',
'<div class="modal-body">',
'<p>Test</p>',
'</div>',
'<div class="modal-footer">',
'<a href="#" data-dismiss="modal" class="btn btn-default">Close</a>',
'<a href="#" class="btn btn-primary">Save changes</a>',
'</div>',
'</div>'
].join('');
$(tmpl).modal();
});
//ajax demo:
var $modal = $('#ajax-modal');
$('#ajax-demo').on('click', function(){
// create the backdrop and wait for next modal to be triggered
$('body').modalmanager('loading');
setTimeout(function(){
$modal.load('ui_extended_modals_ajax_sample.html', '', function(){
$modal.modal();
});
}, 1000);
});
$modal.on('click', '.update', function(){
$modal.modal('loading');
setTimeout(function(){
$modal
.modal('loading')
.find('.modal-body')
.prepend('<div class="alert alert-info fade in">' +
'Updated!<button type="button" class="close" data-dismiss="alert">&times;</button>' +
'</div>');
}, 1000);
});
}
};
}();

View File

@ -1,68 +0,0 @@
var UIGeneral = function () {
var handlePulsate = function () {
if (!jQuery().pulsate) {
return;
}
if (Metronic.isIE8() == true) {
return; // pulsate plugin does not support IE8 and below
}
if (jQuery().pulsate) {
jQuery('#pulsate-regular').pulsate({
color: "#bf1c56"
});
jQuery('#pulsate-once').click(function () {
$('#pulsate-once-target').pulsate({
color: "#399bc3",
repeat: false
});
});
jQuery('#pulsate-crazy').click(function () {
$('#pulsate-crazy-target').pulsate({
color: "#fdbe41",
reach: 50,
repeat: 10,
speed: 100,
glow: true
});
});
}
}
var handleDynamicPagination = function() {
$('#dynamic_pager_demo1').bootpag({
paginationClass: 'pagination',
next: '<i class="fa fa-angle-right"></i>',
prev: '<i class="fa fa-angle-left"></i>',
total: 6,
page: 1,
}).on("page", function(event, num){
$("#dynamic_pager_content1").html("Page " + num + " content here"); // or some ajax content loading...
});
$('#dynamic_pager_demo2').bootpag({
paginationClass: 'pagination pagination-sm',
next: '<i class="fa fa-angle-right"></i>',
prev: '<i class="fa fa-angle-left"></i>',
total: 24,
page: 1,
maxVisible: 6
}).on('page', function(event, num){
$("#dynamic_pager_content2").html("Page " + num + " content here"); // or some ajax content loading...
});
}
return {
//main function to initiate the module
init: function () {
handlePulsate();
handleDynamicPagination();
}
};
}();

View File

@ -1,45 +0,0 @@
var UIIdleTimeout = function () {
return {
//main function to initiate the module
init: function () {
// cache a reference to the countdown element so we don't have to query the DOM for it on each ping.
var $countdown;
$('body').append('<div class="modal fade" id="idle-timeout-dialog" data-backdrop="static"><div class="modal-dialog modal-small"><div class="modal-content"><div class="modal-header"><h4 class="modal-title">Your session is about to expire.</h4></div><div class="modal-body"><p><i class="fa fa-warning"></i> You session will be locked in <span id="idle-timeout-counter"></span> seconds.</p><p>Do you want to continue your session?</p></div><div class="modal-footer"><button id="idle-timeout-dialog-logout" type="button" class="btn btn-default">No, Logout</button><button id="idle-timeout-dialog-keepalive" type="button" class="btn btn-primary" data-dismiss="modal">Yes, Keep Working</button></div></div></div></div>');
// start the idle timer plugin
$.idleTimeout('#idle-timeout-dialog', '.modal-content button:last', {
idleAfter: 5, // 5 seconds
timeout: 30000, //30 seconds to timeout
pollingInterval: 5, // 5 seconds
keepAliveURL: 'demo/idletimeout_keepalive.php',
serverResponseEquals: 'OK',
onTimeout: function(){
window.location = "extra_lock.html";
},
onIdle: function(){
$('#idle-timeout-dialog').modal('show');
$countdown = $('#idle-timeout-counter');
$('#idle-timeout-dialog-keepalive').on('click', function () {
$('#idle-timeout-dialog').modal('hide');
});
$('#idle-timeout-dialog-logout').on('click', function () {
$('#idle-timeout-dialog').modal('hide');
$.idleTimeout.options.onTimeout.call(this);
});
},
onCountdown: function(counter){
$countdown.html(counter); // update the counter
}
});
}
};
}();

View File

@ -1,51 +0,0 @@
var UINestable = function () {
var updateOutput = function (e) {
var list = e.length ? e : $(e.target),
output = list.data('output');
if (window.JSON) {
output.val(window.JSON.stringify(list.nestable('serialize'))); //, null, 2));
} else {
output.val('JSON browser support required for this demo.');
}
};
return {
//main function to initiate the module
init: function () {
// activate Nestable for list 1
$('#nestable_list_1').nestable({
group: 1
})
.on('change', updateOutput);
// activate Nestable for list 2
$('#nestable_list_2').nestable({
group: 1
})
.on('change', updateOutput);
// output initial serialised data
updateOutput($('#nestable_list_1').data('output', $('#nestable_list_1_output')));
updateOutput($('#nestable_list_2').data('output', $('#nestable_list_2_output')));
$('#nestable_list_menu').on('click', function (e) {
var target = $(e.target),
action = target.data('action');
if (action === 'expand-all') {
$('.dd').nestable('expandAll');
}
if (action === 'collapse-all') {
$('.dd').nestable('collapseAll');
}
});
$('#nestable_list_3').nestable();
}
};
}();

View File

@ -1,40 +0,0 @@
var UINotific8 = function () {
return {
//main function to initiate the module
init: function () {
$('#notific8_show').click(function(event) {
var settings = {
theme: $('#notific8_theme').val(),
sticky: $('#notific8_sticky').is(':checked'),
horizontalEdge: $('#notific8_pos_hor').val(),
verticalEdge: $('#notific8_pos_ver').val()
},
$button = $(this);
if ($.trim($('#notific8_heading').val()) != '') {
settings.heading = $.trim($('#notific8_heading').val());
}
if (!settings.sticky) {
settings.life = $('#notific8_life').val();
}
$.notific8('zindex', 11500);
$.notific8($.trim($('#notific8_text').val()), settings);
$button.attr('disabled', 'disabled');
setTimeout(function() {
$button.removeAttr('disabled');
}, 1000);
});
}
};
}();

View File

@ -1,117 +0,0 @@
var UIToastr = function () {
return {
//main function to initiate the module
init: function () {
var i = -1,
toastCount = 0,
$toastlast,
getMessage = function () {
var msgs = ['Hello, some notification sample goes here',
'<div><input class="form-control input-small" value="textbox"/>&nbsp;<a href="http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" target="_blank">Check this out</a></div><div><button type="button" id="okBtn" class="btn blue">Close me</button><button type="button" id="surpriseBtn" class="btn default" style="margin: 0 8px 0 8px">Surprise me</button></div>',
'Did you like this one ? :)',
'Totally Awesome!!!',
'Yeah, this is the Metronic!',
'Explore the power of Metronic. Purchase it now!'
];
i++;
if (i === msgs.length) {
i = 0;
}
return msgs[i];
};
$('#showtoast').click(function () {
var shortCutFunction = $("#toastTypeGroup input:checked").val();
var msg = $('#message').val();
var title = $('#title').val() || '';
var $showDuration = $('#showDuration');
var $hideDuration = $('#hideDuration');
var $timeOut = $('#timeOut');
var $extendedTimeOut = $('#extendedTimeOut');
var $showEasing = $('#showEasing');
var $hideEasing = $('#hideEasing');
var $showMethod = $('#showMethod');
var $hideMethod = $('#hideMethod');
var toastIndex = toastCount++;
toastr.options = {
closeButton: $('#closeButton').prop('checked'),
debug: $('#debugInfo').prop('checked'),
positionClass: $('#positionGroup input:checked').val() || 'toast-top-right',
onclick: null
};
if ($('#addBehaviorOnToastClick').prop('checked')) {
toastr.options.onclick = function () {
alert('You can perform some custom action after a toast goes away');
};
}
if ($showDuration.val().length) {
toastr.options.showDuration = $showDuration.val();
}
if ($hideDuration.val().length) {
toastr.options.hideDuration = $hideDuration.val();
}
if ($timeOut.val().length) {
toastr.options.timeOut = $timeOut.val();
}
if ($extendedTimeOut.val().length) {
toastr.options.extendedTimeOut = $extendedTimeOut.val();
}
if ($showEasing.val().length) {
toastr.options.showEasing = $showEasing.val();
}
if ($hideEasing.val().length) {
toastr.options.hideEasing = $hideEasing.val();
}
if ($showMethod.val().length) {
toastr.options.showMethod = $showMethod.val();
}
if ($hideMethod.val().length) {
toastr.options.hideMethod = $hideMethod.val();
}
if (!msg) {
msg = getMessage();
}
$("#toastrOptions").text("Command: toastr[" + shortCutFunction + "](\"" + msg + (title ? "\", \"" + title : '') + "\")\n\ntoastr.options = " + JSON.stringify(toastr.options, null, 2));
var $toast = toastr[shortCutFunction](msg, title); // Wire up an event handler to a button in the toast, if it exists
$toastlast = $toast;
if ($toast.find('#okBtn').length) {
$toast.delegate('#okBtn', 'click', function () {
alert('you clicked me. i was toast #' + toastIndex + '. goodbye!');
$toast.remove();
});
}
if ($toast.find('#surpriseBtn').length) {
$toast.delegate('#surpriseBtn', 'click', function () {
alert('Surprise! you clicked me. i was toast #' + toastIndex + '. You could perform an action here.');
});
}
$('#clearlasttoast').click(function () {
toastr.clear($toastlast);
});
});
$('#cleartoasts').click(function () {
toastr.clear();
});
}
};
}();

View File

@ -1,196 +0,0 @@
var UITree = function () {
var handleSample1 = function () {
$('#tree_1').jstree({
"core" : {
"themes" : {
"responsive": false
}
},
"types" : {
"default" : {
"icon" : "fa fa-folder icon-state-warning icon-lg"
},
"file" : {
"icon" : "fa fa-file icon-state-warning icon-lg"
}
},
"plugins": ["types"]
});
// handle link clicks in tree nodes(support target="_blank" as well)
$('#tree_1').on('select_node.jstree', function(e,data) {
var link = $('#' + data.selected).find('a');
if (link.attr("href") != "#" && link.attr("href") != "javascript:;" && link.attr("href") != "") {
if (link.attr("target") == "_blank") {
link.attr("href").target = "_blank";
}
document.location.href = link.attr("href");
return false;
}
});
}
var handleSample2 = function () {
$('#tree_2').jstree({
'plugins': ["wholerow", "checkbox", "types"],
'core': {
"themes" : {
"responsive": false
},
'data': [{
"text": "Same but with checkboxes",
"children": [{
"text": "initially selected",
"state": {
"selected": true
}
}, {
"text": "custom icon",
"icon": "fa fa-warning icon-state-danger"
}, {
"text": "initially open",
"icon" : "fa fa-folder icon-state-default",
"state": {
"opened": true
},
"children": ["Another node"]
}, {
"text": "custom icon",
"icon": "fa fa-warning icon-state-warning"
}, {
"text": "disabled node",
"icon": "fa fa-check icon-state-success",
"state": {
"disabled": true
}
}]
},
"And wholerow selection"
]
},
"types" : {
"default" : {
"icon" : "fa fa-folder icon-state-warning icon-lg"
},
"file" : {
"icon" : "fa fa-file icon-state-warning icon-lg"
}
}
});
}
var contextualMenuSample = function() {
$("#tree_3").jstree({
"core" : {
"themes" : {
"responsive": false
},
// so that create works
"check_callback" : true,
'data': [{
"text": "Parent Node",
"children": [{
"text": "Initially selected",
"state": {
"selected": true
}
}, {
"text": "Custom Icon",
"icon": "fa fa-warning icon-state-danger"
}, {
"text": "Initially open",
"icon" : "fa fa-folder icon-state-success",
"state": {
"opened": true
},
"children": [
{"text": "Another node", "icon" : "fa fa-file icon-state-warning"}
]
}, {
"text": "Another Custom Icon",
"icon": "fa fa-warning icon-state-warning"
}, {
"text": "Disabled Node",
"icon": "fa fa-check icon-state-success",
"state": {
"disabled": true
}
}, {
"text": "Sub Nodes",
"icon": "fa fa-folder icon-state-danger",
"children": [
{"text": "Item 1", "icon" : "fa fa-file icon-state-warning"},
{"text": "Item 2", "icon" : "fa fa-file icon-state-success"},
{"text": "Item 3", "icon" : "fa fa-file icon-state-default"},
{"text": "Item 4", "icon" : "fa fa-file icon-state-danger"},
{"text": "Item 5", "icon" : "fa fa-file icon-state-info"}
]
}]
},
"Another Node"
]
},
"types" : {
"default" : {
"icon" : "fa fa-folder icon-state-warning icon-lg"
},
"file" : {
"icon" : "fa fa-file icon-state-warning icon-lg"
}
},
"state" : { "key" : "demo2" },
"plugins" : [ "contextmenu", "dnd", "state", "types" ]
});
}
var ajaxTreeSample = function() {
$("#tree_4").jstree({
"core" : {
"themes" : {
"responsive": false
},
// so that create works
"check_callback" : true,
'data' : {
'url' : function (node) {
return 'demo/jstree_ajax_data.php';
},
'data' : function (node) {
return { 'parent' : node.id };
}
}
},
"types" : {
"default" : {
"icon" : "fa fa-folder icon-state-warning icon-lg"
},
"file" : {
"icon" : "fa fa-file icon-state-warning icon-lg"
}
},
"state" : { "key" : "demo3" },
"plugins" : [ "dnd", "state", "types" ]
});
}
return {
//main function to initiate the module
init: function () {
handleSample1();
handleSample2();
contextualMenuSample();
ajaxTreeSample();
}
};
}();