This commit is contained in:
2026-03-03 16:30:57 +07:00
parent a13304e40e
commit c253e1a370
7569 changed files with 1324841 additions and 0 deletions
+463
View File
@@ -0,0 +1,463 @@
(function($) {
'use strict';
$(function() {
if ($("#dashboard-rating-1").length) {
$('#dashboard-rating-1').barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
initialRating: '2',
});
}
if ($("#dashboard-rating-2").length) {
$('#dashboard-rating-2').barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
initialRating: '4',
});
}
if ($("#dashboard-rating-3").length) {
$('#dashboard-rating-3').barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
initialRating: '3',
});
}
if ($("#dashboard-rating-4").length) {
$('#dashboard-rating-4').barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
initialRating: '1',
});
}
if ($("#dashboard-lineChart").length) {
var lineChartCanvas = $("#dashboard-lineChart").get(0).getContext("2d");
var lineChart = new Chart(lineChartCanvas, {
type: 'line',
data: {
labels: ["2013", "2014", "2014", "2015", "2016", "2017"],
datasets: [{
data: [2, 4, 3, 3, 2, 3],
backgroundColor: [
'#e6f2fb'
],
borderColor: [
'rgba(102, 16 ,242, 1)'
],
borderWidth: 2
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
scales: {
xAxes: [{
gridLines: {
drawBorder: false,
display: false
},
ticks: {
display: false,
}
}],
yAxes: [{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
}
}]
},
legend: {
display: false
},
elements: {
point: {
radius: 0
}
}
}
});
}
if ($("#dashboard-lineChart-2").length) {
var lineChartCanvas = $("#dashboard-lineChart-2").get(0).getContext("2d");
var lineChart = new Chart(lineChartCanvas, {
type: 'line',
data: {
labels: ["2013", "2014", "2014", "2015", "2016", "2017"],
datasets: [{
data: [2, 4, 3, 3, 2, 3],
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
backgroundColor: [
'rgba(0,0,0,0)'
],
borderColor: [
'#caa8f9'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
scales: {
xAxes: [{
gridLines: {
drawBorder: false,
display: false
},
ticks: {
display: false,
}
}],
yAxes: [{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
}
}]
},
legend: {
display: false
},
tooltips: {
enabled: false
},
layout: {
padding: {
top: 5,
bottom: 5
}
}
}
});
}
if ($("#dashboard-lineChart-3").length) {
var lineChartCanvas = $("#dashboard-lineChart-3").get(0).getContext("2d");
var lineChart = new Chart(lineChartCanvas, {
type: 'line',
data: {
labels: ["2013", "2014", "2014", "2015", "2016", "2017"],
datasets: [{
data: [2, 4, 3, 3, 2, 3],
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
backgroundColor: [
'rgba(0,0,0,0)'
],
borderColor: [
'#fff'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
scales: {
xAxes: [{
gridLines: {
drawBorder: false,
display: false
},
ticks: {
display: false,
}
}],
yAxes: [{
gridLines: {
drawBorder: false,
display: false,
},
ticks: {
display: false,
}
}]
},
legend: {
display: false
},
tooltips: {
enabled: false
},
layout: {
padding: {
top: 5,
bottom: 5
}
}
}
});
}
if ($("#dashboard-donut-chart").length) {
$(function() {
var total = 62;
var browsersChart = Morris.Donut({
element: 'dashboard-donut-chart',
data: [{
label: "Download Sales",
value: 12
},
{
label: "In-Store Sales",
value: 30
},
{
label: "Mail-Order Sales",
value: 20
}
],
resize: true,
colors: ['#03a9f3', '#00c292', '#dddddd'],
formatter: function(value, data) {
return Math.floor(value / total * 100) + '%';
}
});
browsersChart.options.data.forEach(function(label, i) {
var legendItem = $('<span></span>').text(label['label']).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', browsersChart.options.colors[i]);
$('#legend').append(legendItem)
});
});
}
if ($('#morris-line-example').length) {
Morris.Line({
element: 'morris-line-example',
lineColors: ['#dadada', '#fb9678'],
data: [{
y: '2006',
a: 50,
b: 0
},
{
y: '2007',
a: 75,
b: 78
},
{
y: '2008',
a: 30,
b: 12
},
{
y: '2009',
a: 35,
b: 50
},
{
y: '2010',
a: 70,
b: 100
},
{
y: '2011',
a: 78,
b: 65
}
],
grid: false,
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B'],
hideHover: "always"
});
}
if ($("#dashboard-monthly-analytics").length) {
var ctx = document.getElementById('dashboard-monthly-analytics').getContext("2d");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Arl', 'May', 'Jun', 'Jul', 'Aug'],
datasets: [{
label: "Ios",
borderColor: 'rgba(171, 140 ,228, 0.8)',
backgroundColor: 'rgba(171, 140 ,228, 0.8)',
pointRadius: 0,
fill: true,
borderWidth: 1,
fill: 'origin',
data: [0, 0, 30, 0, 0, 0, 50, 0]
},
{
label: "Android",
borderColor: 'rgba(88, 216 ,163, 0.7)',
backgroundColor: 'rgba(88, 216 ,163, 0.7)',
pointRadius: 0,
fill: true,
borderWidth: 1,
fill: 'origin',
data: [0, 35, 0, 0, 30, 0, 0, 0]
},
{
label: "Windows",
borderColor: 'rgba(255, 180 ,99, 0.7)',
backgroundColor: 'rgba(255, 180 ,99, 0.7)',
pointRadius: 0,
fill: true,
borderWidth: 1,
fill: 'origin',
data: [0, 0, 0, 40, 10, 50, 0, 0]
}
]
},
options: {
maintainAspectRatio: false,
legend: {
display: false,
position: "top"
},
scales: {
xAxes: [{
ticks: {
display: true,
beginAtZero: true,
fontColor: 'rgba(0, 0, 0, 1)'
},
gridLines: {
display: false,
drawBorder: false,
color: 'transparent',
zeroLineColor: '#eeeeee'
}
}],
yAxes: [{
gridLines: {
drawBorder: true,
display: true,
color: '#eeeeee',
},
categoryPercentage: 0.5,
ticks: {
display: true,
beginAtZero: true,
stepSize: 20,
max: 80,
fontColor: 'rgba(0, 0, 0, 1)'
}
}]
},
},
elements: {
point: {
radius: 0
}
}
});
document.getElementById('js-legend').innerHTML = myChart.generateLegend();
}
if ($('#morris-area-example').length) {
var browsersChart = Morris.Area({
element: 'morris-area-example',
lineColors: ['#00c292', '#03a9f3'],
fillOpacity: 0.1,
xLabelMargin: 10,
yLabelMargin: 10,
data: [{
y: '2006',
a: 30,
b: 0
},
{
y: '2007',
a: 75,
b: 50
},
{
y: '2008',
a: 30,
b: 12
},
{
y: '2009',
a: 55,
b: 50
},
{
y: '2010',
a: 40,
b: 60
},
{
y: '2011',
a: 60,
b: 45
},
{
y: '2012',
a: 60,
b: 35
}
],
grid: false,
axes: false,
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B'],
hideHover: "always",
formatter: function(value, data) {
return Math.floor(value / total * 100) + '%';
}
});
}
if ($("#morris-dashboard-bar-chart").length) {
Morris.Bar({
element: 'morris-dashboard-bar-chart',
barColors: ['#fe946b', '#b663e6'],
barGap: 9,
barSizeRatio: 0.55,
hideHover: 'always',
grid: false,
data: [{
y: 'a',
a: 30,
b: 40
},
{
y: 'b',
a: 55,
b: 65
},
{
y: 'c',
a: 60,
b: 70
},
{
y: 'd',
a: 55,
b: 45
},
{
y: 'e',
a: 40,
b: 45
}
],
xkey: 'y',
ykeys: ['a', 'b'],
axes: 'x',
labels: ['Series A', 'Series B']
});
}
if($("#growth-chart").length) {
$("#growth-chart").sparkline('html', {
enableTagOptions: true,
type: 'bar',
width: '100%',
height: '50',
fillColor: 'false',
barColor: '#fb9678',
barWidth: 4,
barSpacing: 4,
chartRangeMin: 0
});
}
});
})(jQuery);
+79
View File
@@ -0,0 +1,79 @@
(function ($) {
"use strict";
$(function () {
$(`#order-listing`).DataTable({
aLengthMenu: [
[5, 10, 15, -1],
[5, 10, 15, "All"],
],
iDisplayLength: 10,
ordering: false,
language: { search: "" },
});
$(`#order-listing`).each(function () {
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_filter] input");
search_input.attr("placeholder", "Search");
search_input.removeClass("form-control-sm");
// LENGTH - Inline-Form control
var length_sel = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_length] select");
length_sel.removeClass("form-control-sm");
});
for (let index = 1; index < 50; index++) {
$(`#order-listing${index}`).DataTable({
aLengthMenu: [
[5, 10, 15, -1],
[5, 10, 15, "All"],
],
iDisplayLength: 10,
ordering: false,
language: { search: "" },
});
$(`#order-listing${index}`).each(function () {
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_filter] input");
search_input.attr("placeholder", "Search");
search_input.removeClass("form-control-sm");
// LENGTH - Inline-Form control
var length_sel = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_length] select");
length_sel.removeClass("form-control-sm");
});
}
});
$("#order-list").DataTable({
aLengthMenu: [
[5, 10, 15, -1],
[5, 10, 15, "All"]
],
iDisplayLength: 5,
ordering: false,
language: { search: "" }
});
$("#order-list").each(function() {
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_filter] input");
search_input.attr("placeholder", "Search");
search_input.removeClass("form-control-sm");
// LENGTH - Inline-Form control
var length_sel = datatable
.closest(".dataTables_wrapper")
.find("div[id$=_length] select");
length_sel.removeClass("form-control-sm");
});
})(jQuery);
+17
View File
@@ -0,0 +1,17 @@
(function($) {
'use strict';
var iconTochange;
dragula([document.getElementById("dragula-left"), document.getElementById("dragula-right")]);
dragula([document.getElementById("profile-list-left"), document.getElementById("profile-list-right")]);
dragula([document.getElementById("dragula-event-left"), document.getElementById("dragula-event-right")])
.on('drop', function(el) {
console.log($(el));
iconTochange = $(el).find('.mdi');
if (iconTochange.hasClass('mdi-check')) {
iconTochange.removeClass('mdi-check text-primary').addClass('mdi-check-all text-success');
}
else if (iconTochange.hasClass('mdi-check-all')) {
iconTochange.removeClass('mdi-check-all text-success').addClass('mdi-check text-primary');
}
})
})(jQuery);
+4
View File
@@ -0,0 +1,4 @@
(function($) {
'use strict';
$('.dropify').dropify();
})(jQuery);
+25
View File
@@ -0,0 +1,25 @@
$("input[data-type='currency']").on({
keyup: function () {
formatCurrency($(this));
},
blur: function () {
formatCurrency($(this), "rupiah");
},
});
function formatNumber(angka)
{
var rupiah = '';
var angkarev = angka.toString().split('').reverse().join('');
for(var i = 0; i < angkarev.length; i++) if(i%3 == 0) rupiah += angkarev.substr(i,3)+'.';
return 'Rp. '+rupiah.split('',rupiah.length-1).reverse().join('');
}
/**
* Usage example:
* alert(convertToRupiah(10000000)); -> "Rp. 10.000.000"
*/
function convertToAngka(rupiah)
{
return parseInt(rupiah.replace(/,.*|[^0-9]/g, ''), 10);
}
+865
View File
@@ -0,0 +1,865 @@
(function($) {
"use strict";
/*Quill editor*/
if ($("#quillExample1").length) {
var quill = new Quill("#quillExample1", {
modules: {
toolbar: [
[
{
header: [1, 2, false]
}
],
["bold", "italic", "underline"],
["image", "code-block"]
]
},
placeholder: "Compose an epic...",
theme: "snow" // or 'bubble'
});
}
/*simplemde editor*/
if ($("#simpleMde3").length) {
var simplemde = new SimpleMDE({ element: $("#simpleMde3")[0] });
}
if ($("#simpleMde1").length) {
var simplemde = new SimpleMDE({ element: $("#simpleMde1")[0] });
}
if ($("#simpleMde2").length) {
var simplemde = new SimpleMDE({ element: $("#simpleMde2")[0] });
}
/*Tinymce editor*/
if ($("#tinyMceExample").length) {
tinymce.init({
selector: "#tinyMceExample",
height: 500,
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help"
],
toolbar1:
"undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2:
"print preview media | forecolor backcolor emoticons | codesample help",
image_advtab: true,
templates: [
{
title: "Test template 1",
content: "Test 1"
},
{
title: "Test template 2",
content: "Test 2"
}
],
content_css: []
});
}
if ($("#tinyMceExample1").length) {
tinymce.init({
selector: "#tinyMceExample1",
height: 500,
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help"
],
toolbar1:
"undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2:
"print preview media | forecolor backcolor emoticons | codesample help",
image_advtab: true,
templates: [
{
title: "Test template 1",
content: "Test 1"
},
{
title: "Test template 2",
content: "Test 2"
}
],
content_css: []
});
}
if ($("#tinyMceExample2").length) {
tinymce.init({
selector: "#tinyMceExample2",
height: 500,
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help"
],
toolbar1:
"undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2:
"print preview media | forecolor backcolor emoticons | codesample help",
image_advtab: true,
templates: [
{
title: "Test template 1",
content: "Test 1"
},
{
title: "Test template 2",
content: "Test 2"
}
],
content_css: []
});
}
/*Summernote editor*/
if ($("#summernoteExample").length) {
$("#summernoteExample").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample1").length) {
$("#summernoteExample1").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample2").length) {
$("#summernoteExample2").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample3").length) {
$("#summernoteExample3").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample4").length) {
$("#summernoteExample4").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample5").length) {
$("#summernoteExample5").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample6").length) {
$("#summernoteExample6").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
if ($("#summernoteExample7").length) {
$("#summernoteExample7").summernote({
height: 300,
toolbar: [
["style", ["style"]],
["fontname", ["fontname"]],
["fontsize", ["fontsize"]],
["para", ["ol", "ul", "paragraph", "height"]],
["insert", ["link"]],
["view", ["undo", "redo", "fullscreen", "codeview", "help"]]
],
tabsize: 2
});
}
/*X-editable editor*/
if ($("#editable-form").length) {
$.fn.editable.defaults.mode = "inline";
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary btn-sm editable-submit">' +
'<i class="fa fa-fw fa-check"></i>' +
"</button>" +
'<button type="button" class="btn btn-default btn-sm editable-cancel">' +
'<i class="fa fa-fw fa-times"></i>' +
"</button>";
$("#username").editable({
type: "text",
pk: 1,
name: "username",
title: "Enter username"
});
$("#firstname").editable({
validate: function(value) {
if ($.trim(value) === "") return "This field is required";
}
});
$("#sex").editable({
source: [
{
value: 1,
text: "Male"
},
{
value: 2,
text: "Female"
}
]
});
$("#status").editable();
$("#group").editable({
showbuttons: false
});
$("#vacation").editable({
datepicker: {
todayBtn: "linked"
}
});
$("#dob").editable();
$("#event").editable({
placement: "right",
combodate: {
firstItem: "name"
}
});
$("#meeting_start").editable({
format: "yyyy-mm-dd hh:ii",
viewformat: "dd/mm/yyyy hh:ii",
validate: function(v) {
if (v && v.getDate() === 10) return "Day cant be 10!";
},
datetimepicker: {
todayBtn: "linked",
weekStart: 1
}
});
$("#comments").editable({
showbuttons: "bottom"
});
$("#note").editable();
$("#pencil").on("click", function(e) {
e.stopPropagation();
e.preventDefault();
$("#note").editable("toggle");
});
$("#state").editable({
source: [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Dakota",
"North Carolina",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming"
]
});
$("#state2").editable({
value: "California",
typeahead: {
name: "state",
local: [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Dakota",
"North Carolina",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming"
]
}
});
$("#fruits").editable({
pk: 1,
limit: 3,
source: [
{
value: 1,
text: "banana"
},
{
value: 2,
text: "peach"
},
{
value: 3,
text: "apple"
},
{
value: 4,
text: "watermelon"
},
{
value: 5,
text: "orange"
}
]
});
$("#tags").editable({
inputclass: "input-large",
select2: {
tags: ["html", "javascript", "css", "ajax"],
tokenSeparators: [",", " "]
}
});
$("#address").editable({
url: "/post",
value: {
city: "Moscow",
street: "Lenina",
building: "12"
},
validate: function(value) {
if (value.city === "") return "city is required!";
},
display: function(value) {
if (!value) {
$(this).empty();
return;
}
var html =
"<b>" +
$("<div>")
.text(value.city)
.html() +
"</b>, " +
$("<div>")
.text(value.street)
.html() +
" st., bld. " +
$("<div>")
.text(value.building)
.html();
$(this).html(html);
}
});
$("#user .editable").on("hidden", function(e, reason) {
if (reason === "save" || reason === "nochange") {
var $next = $(this)
.closest("tr")
.next()
.find(".editable");
if ($("#autoopen").is(":checked")) {
setTimeout(function() {
$next.editable("show");
}, 300);
} else {
$next.focus();
}
}
});
}
})(jQuery);
(function($) {
"use strict";
/*Quill editor*/
if ($("#quillExample1").length) {
var quill = new Quill("#quillExample1", {
modules: {
toolbar: [
[
{
header: [1, 2, false]
}
],
["bold", "italic", "underline"],
["image", "code-block"]
]
},
placeholder: "Compose an epic...",
theme: "snow" // or 'bubble'
});
}
/*simplemde editor*/
if ($("#simpleMde").length) {
var simplemde = new SimpleMDE({ element: $("#simpleMde")[0] });
}
/*Tinymce editor*/
if ($("#tinyMceExample").length) {
tinymce.init({
selector: "#tinyMceExample",
height: 500,
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help"
],
toolbar1:
"undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2:
"print preview media | forecolor backcolor emoticons | codesample help",
image_advtab: true,
templates: [
{
title: "Test template 1",
content: "Test 1"
},
{
title: "Test template 2",
content: "Test 2"
}
],
content_css: []
});
}
/*Summernote editor*/
if ($("#summernoteExample").length) {
$("#summernoteExample").summernote({
height: 300,
tabsize: 2
});
}
/*X-editable editor*/
if ($("#editable-form").length) {
$.fn.editable.defaults.mode = "inline";
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary btn-sm editable-submit">' +
'<i class="fa fa-fw fa-check"></i>' +
"</button>" +
'<button type="button" class="btn btn-default btn-sm editable-cancel">' +
'<i class="fa fa-fw fa-times"></i>' +
"</button>";
$("#username").editable({
type: "text",
pk: 1,
name: "username",
title: "Enter username"
});
$("#firstname").editable({
validate: function(value) {
if ($.trim(value) === "") return "This field is required";
}
});
$("#sex").editable({
source: [
{
value: 1,
text: "Male"
},
{
value: 2,
text: "Female"
}
]
});
$("#status").editable();
$("#group").editable({
showbuttons: false
});
$("#vacation").editable({
datepicker: {
todayBtn: "linked"
}
});
$("#dob").editable();
$("#event").editable({
placement: "right",
combodate: {
firstItem: "name"
}
});
$("#meeting_start").editable({
format: "yyyy-mm-dd hh:ii",
viewformat: "dd/mm/yyyy hh:ii",
validate: function(v) {
if (v && v.getDate() === 10) return "Day cant be 10!";
},
datetimepicker: {
todayBtn: "linked",
weekStart: 1
}
});
$("#comments").editable({
showbuttons: "bottom"
});
$("#note").editable();
$("#pencil").on("click", function(e) {
e.stopPropagation();
e.preventDefault();
$("#note").editable("toggle");
});
$("#state").editable({
source: [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Dakota",
"North Carolina",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming"
]
});
$("#state2").editable({
value: "California",
typeahead: {
name: "state",
local: [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Dakota",
"North Carolina",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming"
]
}
});
$("#fruits").editable({
pk: 1,
limit: 3,
source: [
{
value: 1,
text: "banana"
},
{
value: 2,
text: "peach"
},
{
value: 3,
text: "apple"
},
{
value: 4,
text: "watermelon"
},
{
value: 5,
text: "orange"
}
]
});
$("#tags").editable({
inputclass: "input-large",
select2: {
tags: ["html", "javascript", "css", "ajax"],
tokenSeparators: [",", " "]
}
});
$("#address").editable({
url: "/post",
value: {
city: "Moscow",
street: "Lenina",
building: "12"
},
validate: function(value) {
if (value.city === "") return "city is required!";
},
display: function(value) {
if (!value) {
$(this).empty();
return;
}
var html =
"<b>" +
$("<div>")
.text(value.city)
.html() +
"</b>, " +
$("<div>")
.text(value.street)
.html() +
" st., bld. " +
$("<div>")
.text(value.building)
.html();
$(this).html(html);
}
});
$("#user .editable").on("hidden", function(e, reason) {
if (reason === "save" || reason === "nochange") {
var $next = $(this)
.closest("tr")
.next()
.find(".editable");
if ($("#autoopen").is(":checked")) {
setTimeout(function() {
$next.editable("show");
}, 300);
} else {
$next.focus();
}
}
});
}
})(jQuery);
+12
View File
@@ -0,0 +1,12 @@
(function($) {
'use strict';
$(function() {
$('.file-upload-browse').on('click', function(){
var file = $(this).parent().parent().parent().find('.file-upload-default');
file.trigger('click');
});
$('.file-upload-default').on('change', function(){
$(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, ''));
});
});
})(jQuery);
@@ -0,0 +1,28 @@
(function($) {
'use strict';
//Open submenu on hover in compact sidebar mode and horizontal menu mode
$(document).on('mouseenter mouseleave', '.sidebar .nav-item', function (ev) {
var body = $('body');
var sidebarIconOnly = body.hasClass("sidebar-icon-only");
var horizontalMenu = body.hasClass("horizontal-menu");
var sidebarFixed = body.hasClass("sidebar-fixed");
if(!('ontouchstart' in document.documentElement)) {
if(sidebarIconOnly || horizontalMenu) {
if(sidebarFixed) {
if(ev.type === 'mouseenter') {
body.removeClass('sidebar-icon-only');
}
}
else {
var $menuItem = $(this);
if(ev.type === 'mouseenter') {
$menuItem.addClass('hover-open')
}
else {
$menuItem.removeClass('hover-open')
}
}
}
}
});
})(jQuery);
+43
View File
@@ -0,0 +1,43 @@
(function($) {
'use strict';
$(function() {
$('.icheck input').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal',
increaseArea: '20%'
});
$('.icheck-square input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square',
increaseArea: '20%'
});
$('.icheck-flat input').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat',
increaseArea: '20%'
});
var icheckLineArray = $('.icheck-line input');
for (var i = 0; i < icheckLineArray.length; i++) {
var self = $(icheckLineArray[i]);
var label = self.next();
var label_text = label.text();
label.remove();
self.iCheck({
checkboxClass: 'icheckbox_line-blue',
radioClass: 'iradio_line',
insert: '<div class="icheck_line-icon"></div>' + label_text
});
}
$('.icheck-polaris input').iCheck({
checkboxClass: 'icheckbox_polaris',
radioClass: 'iradio_polaris',
increaseArea: '20%'
});
$('.icheck-futurico input').iCheck({
checkboxClass: 'icheckbox_futurico',
radioClass: 'iradio_futurico',
increaseArea: '20%'
});
});
})(jQuery);
@@ -0,0 +1,400 @@
/*! jquery-locationpicker - v0.1.15 - 2016-09-26 */
(function($) {
function GMapContext(domElement, options) {
var _map = new google.maps.Map(domElement, options);
var _marker = new google.maps.Marker({
position: new google.maps.LatLng(54.19335, -3.92695),
map: _map,
title: "Drag Me",
visible: options.markerVisible,
draggable: options.markerDraggable,
icon: options.markerIcon !== undefined ? options.markerIcon : undefined
});
return {
map: _map,
marker: _marker,
circle: null,
location: _marker.position,
radius: options.radius,
locationName: options.locationName,
addressComponents: {
formatted_address: null,
addressLine1: null,
addressLine2: null,
streetName: null,
streetNumber: null,
city: null,
district: null,
state: null,
stateOrProvince: null
},
settings: options.settings,
domContainer: domElement,
geodecoder: new google.maps.Geocoder()
};
}
var GmUtility = {
drawCircle: function(gmapContext, center, radius, options) {
if (gmapContext.circle != null) {
gmapContext.circle.setMap(null);
}
if (radius > 0) {
radius *= 1;
options = $.extend({
strokeColor: "#0000FF",
strokeOpacity: .35,
strokeWeight: 2,
fillColor: "#0000FF",
fillOpacity: .2
}, options);
options.map = gmapContext.map;
options.radius = radius;
options.center = center;
gmapContext.circle = new google.maps.Circle(options);
return gmapContext.circle;
}
return null;
},
setPosition: function(gMapContext, location, callback) {
gMapContext.location = location;
gMapContext.marker.setPosition(location);
gMapContext.map.panTo(location);
this.drawCircle(gMapContext, location, gMapContext.radius, {});
if (gMapContext.settings.enableReverseGeocode) {
this.updateLocationName(gMapContext, callback);
} else {
if (callback) {
callback.call(this, gMapContext);
}
}
},
locationFromLatLng: function(lnlg) {
return {
latitude: lnlg.lat(),
longitude: lnlg.lng()
};
},
addressByFormat: function(addresses, format) {
var result = null;
for (var i = addresses.length - 1; i >= 0; i--) {
if (addresses[i].types.indexOf(format) >= 0) {
result = addresses[i];
}
}
return result || addresses[0];
},
updateLocationName: function(gmapContext, callback) {
gmapContext.geodecoder.geocode({
latLng: gmapContext.marker.position
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length > 0) {
var address = GmUtility.addressByFormat(results, gmapContext.settings.addressFormat);
gmapContext.locationName = address.formatted_address;
gmapContext.addressComponents = GmUtility.address_component_from_google_geocode(address.address_components);
} else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
return setTimeout(function() {
GmUtility.updateLocationName(gmapContext, callback);
}, 1e3);
}
if (callback) {
callback.call(this, gmapContext);
}
});
},
address_component_from_google_geocode: function(address_components) {
var result = {};
for (var i = address_components.length - 1; i >= 0; i--) {
var component = address_components[i];
if (component.types.indexOf("postal_code") >= 0) {
result.postalCode = component.short_name;
} else if (component.types.indexOf("street_number") >= 0) {
result.streetNumber = component.short_name;
} else if (component.types.indexOf("route") >= 0) {
result.streetName = component.short_name;
} else if (component.types.indexOf("locality") >= 0) {
result.city = component.short_name;
} else if (component.types.indexOf("sublocality") >= 0) {
result.district = component.short_name;
} else if (component.types.indexOf("administrative_area_level_1") >= 0) {
result.stateOrProvince = component.short_name;
} else if (component.types.indexOf("country") >= 0) {
result.country = component.short_name;
}
}
result.addressLine1 = [ result.streetNumber, result.streetName ].join(" ").trim();
result.addressLine2 = "";
return result;
}
};
function isPluginApplied(domObj) {
return getContextForElement(domObj) != undefined;
}
function getContextForElement(domObj) {
return $(domObj).data("locationpicker");
}
function updateInputValues(inputBinding, gmapContext) {
if (!inputBinding) return;
var currentLocation = GmUtility.locationFromLatLng(gmapContext.marker.position);
if (inputBinding.latitudeInput) {
inputBinding.latitudeInput.val(currentLocation.latitude).change();
}
if (inputBinding.longitudeInput) {
inputBinding.longitudeInput.val(currentLocation.longitude).change();
}
if (inputBinding.radiusInput) {
inputBinding.radiusInput.val(gmapContext.radius).change();
}
if (inputBinding.locationNameInput) {
inputBinding.locationNameInput.val(gmapContext.locationName).change();
}
}
function setupInputListenersInput(inputBinding, gmapContext) {
if (inputBinding) {
if (inputBinding.radiusInput) {
inputBinding.radiusInput.on("change", function(e) {
var radiusInputValue = $(this).val();
if (!e.originalEvent || isNaN(radiusInputValue)) {
return;
}
gmapContext.radius = radiusInputValue;
GmUtility.setPosition(gmapContext, gmapContext.location, function(context) {
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
});
});
}
if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) {
var blur = false;
gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0), gmapContext.settings.autocompleteOptions);
google.maps.event.addListener(gmapContext.autocomplete, "place_changed", function() {
blur = false;
var place = gmapContext.autocomplete.getPlace();
if (!place.geometry) {
gmapContext.settings.onlocationnotfound(place.name);
return;
}
GmUtility.setPosition(gmapContext, place.geometry.location, function(context) {
updateInputValues(inputBinding, context);
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
});
});
if (gmapContext.settings.enableAutocompleteBlur) {
inputBinding.locationNameInput.on("change", function(e) {
if (!e.originalEvent) {
return;
}
blur = true;
});
inputBinding.locationNameInput.on("blur", function(e) {
if (!e.originalEvent) {
return;
}
setTimeout(function() {
var address = $(inputBinding.locationNameInput).val();
if (address.length > 5 && blur) {
blur = false;
gmapContext.geodecoder.geocode({
address: address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results && results.length) {
GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) {
updateInputValues(inputBinding, context);
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
});
}
});
}
}, 1e3);
});
}
}
if (inputBinding.latitudeInput) {
inputBinding.latitudeInput.on("change", function(e) {
var latitudeInputValue = $(this).val();
if (!e.originalEvent || isNaN(latitudeInputValue)) {
return;
}
GmUtility.setPosition(gmapContext, new google.maps.LatLng(latitudeInputValue, gmapContext.location.lng()), function(context) {
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
});
});
}
if (inputBinding.longitudeInput) {
inputBinding.longitudeInput.on("change", function(e) {
var longitudeInputValue = $(this).val();
if (!e.originalEvent || isNaN(longitudeInputValue)) {
return;
}
GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), longitudeInputValue), function(context) {
context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]);
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
});
});
}
}
}
function autosize(gmapContext) {
google.maps.event.trigger(gmapContext.map, "resize");
setTimeout(function() {
gmapContext.map.setCenter(gmapContext.marker.position);
}, 300);
}
function updateMap(gmapContext, $target, options) {
var settings = $.extend({}, $.fn.locationpicker.defaults, options), latNew = settings.location.latitude, lngNew = settings.location.longitude, radiusNew = settings.radius, latOld = gmapContext.settings.location.latitude, lngOld = gmapContext.settings.location.longitude, radiusOld = gmapContext.settings.radius;
if (latNew == latOld && lngNew == lngOld && radiusNew == radiusOld) return;
gmapContext.settings.location.latitude = latNew;
gmapContext.settings.location.longitude = lngNew;
gmapContext.radius = radiusNew;
GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.settings.location.latitude, gmapContext.settings.location.longitude), function(context) {
setupInputListenersInput(gmapContext.settings.inputBinding, gmapContext);
context.settings.oninitialized($target);
});
}
$.fn.locationpicker = function(options, params) {
if (typeof options == "string") {
var _targetDomElement = this.get(0);
if (!isPluginApplied(_targetDomElement)) return;
var gmapContext = getContextForElement(_targetDomElement);
switch (options) {
case "location":
if (params == undefined) {
var location = GmUtility.locationFromLatLng(gmapContext.location);
location.radius = gmapContext.radius;
location.name = gmapContext.locationName;
return location;
} else {
if (params.radius) {
gmapContext.radius = params.radius;
}
GmUtility.setPosition(gmapContext, new google.maps.LatLng(params.latitude, params.longitude), function(gmapContext) {
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
});
}
break;
case "subscribe":
if (params == undefined) {
return null;
} else {
var event = params.event;
var callback = params.callback;
if (!event || !callback) {
console.error('LocationPicker: Invalid arguments for method "subscribe"');
return null;
}
google.maps.event.addListener(gmapContext.map, event, callback);
}
break;
case "map":
if (params == undefined) {
var locationObj = GmUtility.locationFromLatLng(gmapContext.location);
locationObj.formattedAddress = gmapContext.locationName;
locationObj.addressComponents = gmapContext.addressComponents;
return {
map: gmapContext.map,
marker: gmapContext.marker,
location: locationObj
};
} else {
return null;
}
case "autosize":
autosize(gmapContext);
return this;
}
return null;
}
return this.each(function() {
var $target = $(this);
if (isPluginApplied(this)) {
updateMap(getContextForElement(this), $(this), options);
return;
}
var settings = $.extend({}, $.fn.locationpicker.defaults, options);
var gmapContext = new GMapContext(this, $.extend({}, settings.mapOptions, {
zoom: settings.zoom,
center: new google.maps.LatLng(settings.location.latitude, settings.location.longitude),
mapTypeId: settings.mapTypeId,
mapTypeControl: false,
styles: settings.styles,
disableDoubleClickZoom: false,
scrollwheel: settings.scrollwheel,
streetViewControl: false,
radius: settings.radius,
locationName: settings.locationName,
settings: settings,
autocompleteOptions: settings.autocompleteOptions,
addressFormat: settings.addressFormat,
draggable: settings.draggable,
markerIcon: settings.markerIcon,
markerDraggable: settings.markerDraggable,
markerVisible: settings.markerVisible
}));
$target.data("locationpicker", gmapContext);
function displayMarkerWithSelectedArea() {
GmUtility.setPosition(gmapContext, gmapContext.marker.position, function(context) {
var currentLocation = GmUtility.locationFromLatLng(gmapContext.location);
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
context.settings.onchanged.apply(gmapContext.domContainer, [ currentLocation, context.radius, true ]);
});
}
if (settings.markerInCenter) {
gmapContext.map.addListener("bounds_changed", function() {
if (!gmapContext.marker.dragging) {
gmapContext.marker.setPosition(gmapContext.map.center);
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
}
});
gmapContext.map.addListener("idle", function() {
if (!gmapContext.marker.dragging) {
displayMarkerWithSelectedArea();
}
});
}
google.maps.event.addListener(gmapContext.marker, "drag", function(event) {
updateInputValues(gmapContext.settings.inputBinding, gmapContext);
});
google.maps.event.addListener(gmapContext.marker, "dragend", function(event) {
displayMarkerWithSelectedArea();
});
GmUtility.setPosition(gmapContext, new google.maps.LatLng(settings.location.latitude, settings.location.longitude), function(context) {
updateInputValues(settings.inputBinding, gmapContext);
setupInputListenersInput(settings.inputBinding, gmapContext);
context.settings.oninitialized($target);
});
});
};
$.fn.locationpicker.defaults = {
location: {
latitude: 40.7324319,
longitude: -73.82480777777776
},
locationName: "",
radius: 500,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [],
mapOptions: {},
scrollwheel: true,
inputBinding: {
latitudeInput: null,
longitudeInput: null,
radiusInput: null,
locationNameInput: null
},
enableAutocomplete: false,
enableAutocompleteBlur: false,
autocompleteOptions: null,
addressFormat: "postal_code",
enableReverseGeocode: true,
draggable: true,
onchanged: function(currentLocation, radius, isMarkerDropped) {},
onlocationnotfound: function(locationName) {},
oninitialized: function(component) {},
markerIcon: undefined,
markerDraggable: true,
markerVisible: true
};
})(jQuery);
+143
View File
@@ -0,0 +1,143 @@
(function($) {
'use strict';
$(function() {
var body = $('body');
var contentWrapper = $('.content-wrapper');
var scroller = $('.container-scroller');
var footer = $('.footer');
var sidebar = $('.sidebar');
//Add active class to nav-link based on url dynamically
//Active class can be hard coded directly in html file also as required
var current = location.pathname.split("/").slice(-1)[0].replace(/^\/|\/$/g, '');
$('.nav li a', sidebar).each(function(){
var $this = $(this);
if(current === "") {
//for root url
if($this.attr('href').indexOf("index.html") !== -1){
$(this).parents('.nav-item').last().addClass('active');
if ($(this).parents('.sub-menu').length) {
$(this).closest('.collapse').addClass('show');
$(this).addClass('active');
}
}
}
else {
//for other url
if($this.attr('href').indexOf(current) !== -1){
$(this).parents('.nav-item').last().addClass('active');
if ($(this).parents('.sub-menu').length) {
$(this).closest('.collapse').addClass('show');
$(this).addClass('active');
}
}
}
})
//Close other submenu in sidebar on opening any
sidebar.on('show.bs.collapse','.collapse', function() {
sidebar.find('.collapse.show').collapse('hide');
});
//Change sidebar and content-wrapper height
applyStyles();
function applyStyles() {
//setting content wrapper height
if(!(body.hasClass("horizontal-menu") && window.matchMedia('(min-width: 992px)').matches)) {
setTimeout(function(){
if(contentWrapper.outerHeight() < (sidebar.outerHeight() - footer.outerHeight())) {
contentWrapper.css({
'min-height':sidebar.outerHeight() - footer.outerHeight()
});
}
if(sidebar.outerHeight() < (contentWrapper.outerHeight() + footer.outerHeight())) {
sidebar.css({
'min-height':contentWrapper.outerHeight() + footer.outerHeight()
});
}
}, 1000);
}
else {
contentWrapper.css({
'min-height':'100vh'
});
}
//Applying perfect scrollbar
if(!body.hasClass("rtl")) {
$('.settings-panel .tab-content .tab-pane.scroll-wrapper, ul.chats, .product-chart-wrapper').perfectScrollbar();
if(body.hasClass("sidebar-fixed")) {
$('#sidebar .nav').perfectScrollbar();
}
}
}
$('.sidebar [data-toggle="collapse"]').on("click", function(event) {
if(!((body.hasClass('sidebar-icon-only')||body.hasClass('horizontal-menu'))&&window.matchMedia('(min-width: 992px)').matches)) {
//Updating content wrapper height to sidebar height on expanding a menu in sidebar
var clickedItem = $(this);
if(clickedItem.attr('aria-expanded') === 'false') {
var scrollTop = scroller.scrollTop() - 20;
}
else {
var scrollTop = scroller.scrollTop() - 100;
}
setTimeout(function(){
if(contentWrapper.outerHeight()+ footer.outerHeight()!== sidebar.outerHeight()) {
applyStyles();
scroller.animate({ scrollTop: scrollTop }, 350);
}
}, 400);
}
else {
//Disable click on sidebar menu item when sidebar icon only mode or horizontal menu mode is in use
//to avoid ambiguity of mixed hover and click on menu item
return false;
}
})
$('[data-toggle="minimize"]').on("click", function () {
if((body.hasClass('sidebar-toggle-display'))||(body.hasClass('sidebar-absolute'))) {
body.toggleClass('sidebar-hidden');
applyStyles();
}
else {
body.toggleClass('sidebar-icon-only');
applyStyles();
}
});
//checkbox and radios
$(".form-check label,.form-radio label").append('<i class="input-helper"></i>');
//fullscreen
$("#fullscreen-button").on("click",function toggleFullScreen() {
if ((document.fullScreenElement !== undefined && document.fullScreenElement === null) || (document.msFullscreenElement !== undefined && document.msFullscreenElement === null) || (document.mozFullScreen !== undefined && !document.mozFullScreen) || (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (document.documentElement.msRequestFullscreen) {
document.documentElement.msRequestFullscreen();
}
}
else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
})
});
})(jQuery);
+8
View File
@@ -0,0 +1,8 @@
(function($) {
'use strict';
$(function() {
$('[data-toggle="offcanvas"]').on("click", function () {
$('.row-offcanvas').toggleClass('active')
});
});
})(jQuery);
+10
View File
@@ -0,0 +1,10 @@
(function($) {
'use strict';
if($(".js-example-basic-single").length){
$(".js-example-basic-single").select2();
}
if($(".js-example-basic-multiple").length){
$(".js-example-basic-multiple").select2();
}
})(jQuery);
+85
View File
@@ -0,0 +1,85 @@
(function($) {
'use strict';
$(function() {
$(".nav-settings").click(function(){
$("#right-sidebar").toggleClass("open");
});
$(".settings-close").click(function(){
$("#right-sidebar,#theme-settings").removeClass("open");
});
$("#settings-trigger").on("click" , function(){
$("#theme-settings").toggleClass("open");
});
//background constants
var navbar_classes = "navbar-danger navbar-success navbar-warning navbar-dark navbar-light navbar-primary navbar-info navbar-pink";
var sidebar_classes = "sidebar-light sidebar-dark";
var $body = $("body");
//sidebar backgrounds
$("#sidebar-light-theme").on("click" , function(){
$body.removeClass(sidebar_classes);
$body.addClass("sidebar-light");
$(".sidebar-bg-options").removeClass("selected");
$(this).addClass("selected");
});
$("#sidebar-dark-theme").on("click" , function(){
$body.removeClass(sidebar_classes);
$body.addClass("sidebar-dark");
$(".sidebar-bg-options").removeClass("selected");
$(this).addClass("selected");
});
//Navbar Backgrounds
$(".tiles.primary").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-primary");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.success").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-success");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.warning").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-warning");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.danger").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-danger");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.pink").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-pink");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.info").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-info");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.dark").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".navbar").addClass("navbar-dark");
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
$(".tiles.default").on("click" , function(){
$(".navbar").removeClass(navbar_classes);
$(".tiles").removeClass("selected");
$(this).addClass("selected");
});
});
})(jQuery);
+48
View File
@@ -0,0 +1,48 @@
(function($) {
'use strict';
$(function() {
if($('.demo-tabs').length) {
$('.demo-tabs').pwstabs({
effect: 'none'
});
}
if($('.hello_world').length) {
$('.hello_world').pwstabs();
}
if($('#rtl-tabs-1').length) {
$('#rtl-tabs-1').pwstabs({
effect: 'slidedown',
defaultTab: 2,
rtl: true
});
}
if($('#vertical-left').length) {
$('#vertical-left').pwstabs({
effect: 'slideleft',
defaultTab: 1,
containerWidth: '600px',
tabsPosition: 'vertical',
verticalPosition: 'left'
});
}
if($('#horizontal-left').length) {
$('#horizontal-left').pwstabs({
effect: 'slidedown',
defaultTab: 2,
containerWidth: '600px',
horizontalPosition: 'bottom'
});
}
if($('.tickets-tab').length) {
$('.tickets-tab').pwstabs({
effect: 'none'
});
}
});
})(jQuery);
+40
View File
@@ -0,0 +1,40 @@
(function($) {
'use strict';
$(function() {
var todoListItem = $('.todo-list');
var todoListInput = $('.todo-list-input');
$('.todo-list-add-btn').on("click", function (event) {
event.preventDefault();
var item = $(this).prevAll('.todo-list-input').val();
if(item)
{
todoListItem.append("<li><div class='form-check'><label class='form-check-label'><input class='checkbox' type='checkbox'/>" + item + "<i class='input-helper'></i></label></div><i class='remove mdi mdi-close-circle-outline'></i></li>");
todoListInput.val("");
}
});
todoListItem.on('change', '.checkbox', function()
{
if($(this).attr('checked'))
{
$(this).removeAttr('checked');
}
else
{
$(this).attr('checked', 'checked');
}
$(this).closest( "li" ).toggleClass('completed');
});
todoListItem.on('click', '.remove', function()
{
$(this).parent().remove();
});
});
})(jQuery);
+60
View File
@@ -0,0 +1,60 @@
(function ($) {
'use strict';
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
var substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
for(var i=0; i<strs.length;i++) {
if (substrRegex.test(strs[i])) {
matches.push(strs[i]);
}
}
cb(matches);
};
};
var states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',
'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii',
'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana',
'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota',
'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',
'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island',
'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont',
'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'
];
$('#the-basics .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
name: 'states',
source: substringMatcher(states)
});
// constructs the suggestion engine
var states = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
// `states` is an array of state names defined in "The Basics"
local: states
});
$('#bloodhound .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
name: 'states',
source: states
});
})(jQuery);