remove gitiegnore to public

This commit is contained in:
2026-06-15 11:37:20 +07:00
parent e96d58dcb4
commit bfb1af2417
988 changed files with 308081 additions and 1 deletions

View File

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

View File

@@ -0,0 +1,329 @@
let messageDuration = 2000;
function getProvinces(targetSelectorId, selected_province_id = 0) {
fetchRefsData(get_refs_base_url + '/provinces/json', targetSelectorId, selected_province_id);
}
function getDistrictsByProvinceId(targetSelectorId, province_id, selected_district_id = 0) {
fetchRefsData(get_refs_base_url + '/districts/json/'+province_id, targetSelectorId, selected_district_id);
}
function getCommunesByDistrictId(targetSelectorId, district_id, selected_commune_id = 0){
fetchRefsData(get_refs_base_url + '/communes/json/'+district_id, targetSelectorId, selected_commune_id);
}
function getVillagesByCommuneId(targetSelectorId, commune_id, selected_village_id = 0) {
fetchRefsData(get_refs_base_url + '/villages/json/'+commune_id, targetSelectorId, selected_village_id);
}
function fetchRefsData(url, targetSelectorId, selectedId ) {
$.ajax({
url: url,
type:"GET",
dataType:"json",
success:function(response){
$('#'+targetSelectorId).html('');
$('#'+targetSelectorId).append('<option selected></option>');
response.map(item =>{
var patientOption = document.createElement('OPTION');
patientOption.setAttribute('value',item.id);
if(selectedId == item.id){
patientOption.setAttribute('selected','selected');
}
patientOption.text = item.name;
$('#'+targetSelectorId).append(patientOption);
})
}
});
}
function generate_uuid (classPrefix, targetDisplayElementId) {
$.ajax({
url: get_refs_base_url+"/uuid.generate/json",
type:"GET",
dataType:"json",
success:function(response){
if(response.success) $(''+targetDisplayElementId).val(classPrefix+'-'+response.data.uuid);
else alertify.error("Can't generate uuid.")
}
});
}
function deleteEntityRecord(uid, url){
var success = false
Swal.fire({
text: confirm_delete_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_delete,
cancelButtonText: confirm_cancel
}).then((result) => {
if (result.value) {
$.ajax({
url: url,
method:'POST',
dataType:"JSON",
data:{
"_token": csrf_token,
uid : uid,
},
success:function(response){
handleMessage(response.success, response.message)
setTimeout(function () {location.reload()}, messageDuration)
success = true
}
})
}
});
return success
}
function restoreEntityRecord(uid, url){
Swal.fire({
text: confirm_restore_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_restore,
cancelButtonText: confirm_cancel_restore,
}).then((result) => {
if (result.value) {
$.ajax({
url: url,
method:'POST',
dataType:"JSON",
data:{
"_token": csrf_token,
uid : uid,
},
success:function(response){
handleMessage(response.success, response.message)
setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
function addRejectComment(targetSelectorId){
Swal.fire({
html:"<p style='float: left;'>Reject Comment</p>",
input: "text",
showCancelButton: !0,
position: "center-right",
confirmButtonText: "<i class='fa fa-save mr-2'></i>Save",
cancelButtonText: "Cancel",
showLoaderOnConfirm: !1,
confirmButtonColor: "#4fb51a",
preConfirm: function (n) {
return new Promise(function (t) {
$.ajax({
url: get_refs_base_url + '/reject-comment/save',
method:'post',
dataType:'json',
data:{
"_token": csrf_token,
name_en: n
},
success:function(r)
{
if(!r.success){
Swal.showValidationMessage('Failed while saving reject comment. ' + r.errors)
Swal.enableButtons()
}
else {
t(r.data)
}
}
})
})
},
allowOutsideClick:!1,
}).then(function (t) {
if(!t.dismiss){
t.value.map(item =>{
var patientOption = document.createElement('OPTION');
patientOption.setAttribute('value',item.id);
patientOption.setAttribute('selected','selected');
patientOption.text = item.reject_comment;
$('#'+targetSelectorId).append(patientOption);
alertify.success("Reject comment successfully added.")
})
}
})
}
function customErrorAlert(error) {
$('.custom-error-alert').remove()
var alertComponent = document.createElement('DIV')
alertComponent.classList.add('alert', 'text-white','bg-danger', 'custom-error-alert','col-sm-12','col-lg-6')
alertComponent.innerHTML= _getResponseErrorMessage(error)
document.body.append(alertComponent)
setTimeout(function () {
$('.custom-error-alert').remove()
}, 10000)
}
function _getResponseErrorMessage (error) {
if (error.message) return error.message
if (error.errors) return 'Internal server error. please contact system administrator.'
if (error.responseJSON) return _getCustomResponseErrorMessage(error.statusText, error.responseJSON.errors)
return error.message === 'Network Error' ? 'Oops! Network Error. Try again later' : error.message
}
function _getCustomResponseErrorMessage (message, errObject) {
arr = []
var errors = [];
for(var i in errObject) {
errors.push(errObject[i]);
}
errors.forEach(item=> {
if(Array.isArray(item)){
item.forEach(v=> {
arr.concat(v)
})
}
else{
arr.concat(item)
}
return arr
})
return errors.join('<br/>')
}
function list_to_tree(list) {
var map = {}, node, roots = [], i;
for (i = 0; i < list.length; i += 1) {
map[list[i].id] = i; // initialize the map
list[i].children = []; // initialize the children
}
for (i = 0; i < list.length; i += 1) {
node = list[i];
if (node.closed_parent_id !== "0") {
// if you have dangling branches check that map[node.parentId] exists
//console.log('node ', list[map[node.closed_parent_id]])
if(typeof map[node.closed_parent_id] !== 'undefined') {
list[map[node.closed_parent_id]].children.push(node);
}
} else {
roots.push(node);
}
}
return roots;
}
function list_to_tree_v2(flatArray, parent = null) {
const tree = [];
for (const item of obj.values(flatArray)) {
if (item.closed_parent_id === parent) {
const children = arrayToTree(flatArray, item.id);
if (children.length) {
item.children = children;
}
tree.push(item);
}
}
return tree;
}
function getSampleTypeByDepartmentId(departmentId, sampleTypeControlId, selected_sample_type_id = 0) {
$.ajax({
url: get_refs_base_url+'/sample-type/department/'+(departmentId>0 ? departmentId : 'null'),
type:"GET",
dataType:"JSON",
success:function(response){
$('#'+sampleTypeControlId).html('');
$('#'+sampleTypeControlId).append('<option></option>');
response.data.map(item =>{
var patientOption = document.createElement('OPTION');
patientOption.setAttribute('value',item.id);
if(selected_sample_type_id == item.id){
patientOption.setAttribute('selected','selected');
}
patientOption.text = item.name_en;
$('#'+sampleTypeControlId).append(patientOption);
})
},
error: function(response) {
},
});
}
function removeUserSignature() {
$.ajax({
url: get_refs_base_url + '/reject-comment/save',
method:'post',
dataType:'json',
data:{
"_token": csrf_token
},
success:function(r)
{
if(!r.success){
Swal.showValidationMessage('Failed while saving reject comment. ' + r.errors)
Swal.enableButtons()
}
else {
t(r.data)
}
}
})
}
function toFixedNumber(num, fixed) {
fixed = fixed || 0;
fixed = Math.pow(10, fixed);
return Math.floor(num * fixed) / fixed;
}
function handleMessage(actionStatus = true, message) {
if(actionStatus) alertify.success(message)
else alertify.error(message)
}
function getDate(date) {
if(date) {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();
if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;
return [year, month, day].join('-');
} else return '';
}
function renderArrayString(data) {
var options = []
if(data!=null){
var tags = JSON.parse(data)
options = tags.map(function (val) {
return {id: val, text: val, selected: true}
})
}
return options
}
function calculateBMI(weight=0, height=1, displayElementId) {
let bmi = (weight / ((height * height)/10000)).toFixed(1)
$('#'+displayElementId).val(bmi);
}

View File

@@ -0,0 +1,134 @@
$("#btnSave").on('click',function(e){
e.preventDefault();
labid = $('#lab-id').val();
url = parseInt(labid) === 0 ? save_lab_url : update_lab_url;
$.ajax({
url: url,
type:"POST",
data:{
"_token": csrf_token,
organization_id : labid,
lab_name_en: $('#lab-name-en').val(),
lab_name_kh: $('#lab-name-kh').val(),
lab_code: $('#lab-code').val(),
address_en: $('#address-en').val(),
address_kh: $('#address-kh').val(),
sample_number: $('input[name="sample_number"]:checked').attr('data-id'),
patient_code: $('input[name="patient_number"]:checked').attr('data-id'),
is_auto_make_invoice: $('input[name="is_auto_make_invoice"]:checked').attr('data-id'),
start_date : $('#start-date').val(),
end_date : $('#end-date').val(),
phone_number: $('#phone-number').val(),
email: $('#email').val(),
shareable_lab_result: $('input[name="shareable_lab_result"]:checked').attr('data-id'),
lab_category_id : $('#lab-category-id').val()
},
success:function(res){
handleMessage(res.success, res.message)
setTimeout(function () {location.reload()}, messageDuration)
}
});
});
function delete_lab(labid){
Swal.fire({
text: confirm_delete_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_delete,
cancelButtonText: confirm_cancel
}).then((result) => {
if (result.value) {
$.ajax({
url: delete_lab_url,
method:'POST',
data:{
"_token": csrf_token,
organization_id : labid,
},
success:function(res){
handleMessage(res.success, res.message)
setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
function restore_lab(labid){
Swal.fire({
text: confirm_restore_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_restore,
cancelButtonText: confirm_cancel_restore,
}).then((result) => {
if (result.value) {
$.ajax({
url: restore_lab_url,
method:'POST',
data:{
"_token": csrf_token,
organization_id : labid,
},
success:function(res){
handleMessage(res.success, res.message)
setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
$('#modal-laboratory').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var action = button.data('action') // Extract info from data-* attributes
$('#shareable_lab_result').prop("checked", false)
var modal = $(this);
if(action === "new"){
// Clear inputs
modal.find('.modal-body input').val("");
modal.find('.modal-body input[name="organization_id"]').val(0);
modal.find('.modal-title').html(modal_add_title);
}else if(action === "edit"){
organization_id = button.data('labid');
modal.find('.modal-body input[name="organization_id"]').val(organization_id);
modal.find('.modal-title').html(modal_edit_title);
//e.preventDefault();
$.ajax({
url: get_lab_url,
type:"POST",
data:{
"_token": csrf_token,
organization_id: organization_id,
},
success:function(res){
if(res.success) {
let data = res.data;
modal.find('.modal-body input[name="lab_name_en"]').val(data.name_en);
modal.find('.modal-body input[name="lab_name_kh"]').val(data.name_kh);
modal.find('.modal-body input[name="lab_code"]').val(data.short_name);
modal.find('.modal-body select[name="lab_category_id"]').val(data.lab_category_id);
modal.find('.modal-body input:radio[name="sample_number"]').filter("[data-id=" + data.sample_number + "]").prop('checked', true);
modal.find('.modal-body input:radio[name="is_auto_make_invoice"]').filter("[data-id=" + data.is_auto_make_invoice + "]").prop('checked', true);
modal.find('.modal-body input[name="address_en"]').val(data.address_en);
modal.find('.modal-body input[name="address_kh"]').val(data.address_kh);
modal.find('.modal-body input[name="start_date"]').val(getDate(data.start_date));
modal.find('.modal-body input[name="end_date"]').val(getDate(data.end_date));
modal.find('.modal-body input:radio[name="patient_number"]').filter("[data-id=" + data.patient_code + "]").prop('checked', true);
modal.find('.modal-body input:checkbox[name="shareable_lab_result"]').filter("[data-id=" + data.shareable_lab_result + "]").prop('checked', true);
modal.find('.modal-body input[name="email"]').val(data.email);
modal.find('.modal-body input[name="phone_number"]').val(data.phone_number);
} else{
handleMessage(res.success, res.message)
}
},
});
}
})

View File

@@ -0,0 +1,170 @@
$("#btnSave").on('click',function(e){
e.preventDefault();
data_id = $('#data-id').val();
let url = parseInt(data_id) === 0 ? save_url : update_url;
$.ajax({
url: url,
type:"POST",
data :{
"_token": csrf_token,
uid : data_id,
name_en: $('#name-en').val(),
organization_ids: $('#lab-ids').val()
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
},
});
});
function delete_lab(uid){
Swal.fire({
text: confirm_delete_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_delete,
cancelButtonText: confirm_cancel
}).then((result) => {
if (result.value) {
$.ajax({
url: delete_url,
method:'POST',
data:{
"_token": csrf_token,
uid : uid,
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
function restore_lab(uid){
Swal.fire({
text: confirm_restore_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_restore,
cancelButtonText: confirm_cancel_restore,
}).then((result) => {
if (result.value) {
$.ajax({
url: restore_url,
method:'POST',
data:{
"_token": csrf_token,
uid : uid,
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
$('#modal-role').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var action = button.data('action') // Extract info from data-* attributes
var modal = $(this);
if(action === "new"){
// Clear inputs
modal.find('.modal-body input').val("");
modal.find('.modal-body input[name="uid"]').val(0);
modal.find('.modal-title').html(modal_add_title);
}else if(action === "edit"){
uid = button.data('uid');
modal.find('.modal-body input[name="uid"]').val(uid);
modal.find('.modal-title').html(modal_edit_title);
$.ajax({
url: get_url,
type:"POST",
data:{
"_token": csrf_token,
uid: uid,
},
success:function(res){
let data = res.data;
modal.find('.modal-body input[name="name_en"]').val(data.name_en);
modal.find('.modal-body input[name="name_kh"]').val(data.name_kh);
if(!res.success) handleMessage(res.success, res.message)
},
error: function(response) {
},
});
}
})
$('#modal-role-permission').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
uid = button.data('uid');
$('#role-id').val(uid)
name = button.data('name');
$('#modal-role-permission .modal-title').text(name)
$.ajax({
url: system_url + '/role-permission/'+uid,
type:"get",
success:function(res){
if(res.success){
$('#modal-role-permission #role-permission').empty()
let permissions = res.data
for (var i in permissions){
let permission_group = permissions[i];
group_permissions(permission_group)
// for sub group
permission_group.permissions.map(item => {
for(j in item){
if(item[j].permissions){
group_permissions(item[j], '4')
}
}
})
}
}
else handleMessage(res.success, res.message)
},
error: function(response) {
},
});
})
function group_permissions(permission, level = 0)
{
let group_permission = document.createElement('DIV')
group_permission.classList.add('col-sm-12', 'pl-'+level)
group_permission.style.border="1px dashed gray;"
let permission_group_name = document.createElement('h6');
permission_group_name.classList.add('my-3', 'font-14', 'text-info'); permission_group_name.innerHTML = permission.name
group_permission.append(permission_group_name)
group_permission.append(permissions(permission))
$('#modal-role-permission #role-permission').append(group_permission)
}
function permissions(permission) {
let permissions = document.createElement('DIV')
permissions.classList.add('row')
permission.permissions.map(item => {
permissions.append(permissionElement(item))
})
return permissions
}
function permissionElement(item) {
if(item.name == '') return '';
let singlePermission = document.createElement('div')
singlePermission.classList.add('col-sm-12','bg-white','rounded','px-4','col-md-12','col-lg-12','col-xl-12','border','border-white')
singlePermission.innerHTML = '<div class="form-check my-1"><label class="form-check-label font-14"><input '+(item.is_can>=1 ? 'checked':'')+' name="permission_id[]" value="'+item.id+'" type="checkbox" class="form-check-input">'+item.name+' <i class="input-helper"></i></label></div> ';
return singlePermission;
}

View File

@@ -0,0 +1,204 @@
$("#btnSave").on('click',function(e){
e.preventDefault();
data_id = $('#data-id').val();
let url = parseInt(data_id) === 0 ? save_url : update_url;
$.ajax({
url: url,
type:"POST",
data :{
"_token": csrf_token,
uid : data_id,
name: $('#name').val(),
email: $('#email').val(),
is_manager: isManager,
role_id: $('#role-id').val(),
password: $('#password').val(),
default_manager: $('#default-manager').val(),
signature: $('#signature').val(),
sample_source_id: ($('#role-id').val() == 6 ? $('#sample-source-id').val():0)
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
},
});
});
function delete_lab(uid){
Swal.fire({
text: confirm_delete_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_delete,
cancelButtonText: confirm_cancel
}).then((result) => {
if (result.value) {
$.ajax({
url: delete_url,
method:'POST',
data:{
"_token": csrf_token,
uid : uid,
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
function restore_lab(uid){
Swal.fire({
text: confirm_restore_record,
icon: 'question',
showCancelButton: true,
cancelButtonClass:'danger',
confirmButtonText: confirm_ok_restore,
cancelButtonText: confirm_cancel_restore,
}).then((result) => {
if (result.value) {
$.ajax({
url: restore_url,
method:'POST',
data:{
"_token": csrf_token,
uid : uid,
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
})
}
});
}
$('#modal-user').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var action = button.data('action') // Extract info from data-* attributes
var modal = $(this);
if(action === "new"){
// Clear inputs
modal.find('.modal-body input').val("");
modal.find('.modal-body input[name="uid"]').val(0);
modal.find('.modal-title').html(modal_add_title);
}else if(action === "edit"){
uid = button.data('uid');
modal.find('.modal-body input[name="uid"]').val(uid);
modal.find('.modal-title').html(modal_edit_title);
$.ajax({
url: get_url,
type:"POST",
data:{
"_token": csrf_token,
uid: uid,
},
success:function(res){
let data = res.data;
console.log();
modal.find('.modal-body input[name="name"]').val(data.name);
modal.find('.modal-body input[name="email"]').val(data.email);
modal.find('.modal-body input[name="password"]').val('***************');
modal.find('.modal-body input[name="is_manager"]').prop( "checked", data.is_manager);
modal.find('.modal-body select[name="role_id"]').val(data.role_id).trigger('change');
isManager = data.is_manager
if(data.role_id==6) {
$('#physician-id').show();
$('#sample-source-id').val(data.sample_source_id).trigger('change')
} else{
$('#physician-id').hide();
$('#sample-source-id').val(0).trigger('change')
}
if(!res.success) handleMessage(res.success, res.message)
}
});
}
})
$('#modal-user-labs').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var action = button.data('action') // Extract info from data-* attributes
var modal = $(this);
if(action === "assign_lab"){
uid = button.data('uid');
modal.find('.modal-body input[name="uid"]').val(uid);
$.ajax({
url: get_url,
type:"POST",
data:{
"_token": csrf_token,
uid: uid,
},
success:function(res){
let data = res.data;
organization_ids = []
if(data.lab_covers.length) {
$.each(data.lab_covers, function (key, value) {
organization_ids[key] = value.organization_id
});
}
else{
organization_ids[0] = base_organization_id
}
modal.find('.modal-body select[name="organization_ids"]').val(organization_ids).trigger('change');
modal.find('.modal-body input[name="email"]').val(data.email);
},
error: function(response) {
},
});
}
})
$("#btnAssignLab").on('click',function(e){
e.preventDefault();
data_id = $('#data-user-id').val();
$.ajax({
url: assignLabUrl,
type:"POST",
data :{
"_token": csrf_token,
uid : data_id,
organization_ids: $('#organization_ids').val(),
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
}
});
});
$('#reset-password-modal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget) // Button that triggered the modal
var modal = $(this);
uid = button.data('uid');
modal.find('.modal-body input[name="uid"]').val(uid);
})
$("#btn-reset-password").on('click',function(e){
e.preventDefault();
$.ajax({
url: reset_password_url,
type:"POST",
data :{
"_token": csrf_token,
uid : $('#user-id-to-reset-pwd').val(),
password: $('#reset-new-password').val()
},
success:function(res){
handleMessage(res.success, res.message)
if(res.success) setTimeout(function () {location.reload()}, messageDuration)
},
});
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,221 @@
(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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,40 @@
(function($) {
'use strict';
if ($("#timepicker-example").length) {
$('#timepicker-example').datetimepicker({
format: 'LT'
});
}
if ($(".color-picker").length) {
$('.color-picker').asColorPicker();
}
if ($("#datepicker-popup").length) {
$('#datepicker-popup').datepicker({
enableOnReadonly: true,
todayHighlight: true,
});
}
if ($("#inline-datepicker").length) {
$('#inline-datepicker').datepicker({
enableOnReadonly: true,
todayHighlight: true,
});
}
if ($(".datepicker-autoclose").length) {
$('.datepicker-autoclose').datepicker({
autoclose: true
});
}
if ($('input[name="date-range"]').length) {
$('input[name="date-range"]').daterangepicker();
}
if ($('input[name="date-time-range"]').length) {
$('input[name="date-time-range"]').daterangepicker({
timePicker: true,
timePickerIncrement: 30,
locale: {
format: 'MM/DD/YYYY h:mm A'
}
});
}
})(jQuery);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,20 @@
(function($) {
'use strict';
$(".select2").select2({
placeholder: choose_option,
allowClear: true,
});
$(".select2-multiple").select2({
placeholder: choose_option,
closeOnSelect : false,
});
$(".select2-tags").select2({
placeholder: choose_option,
tags: true,
tokenSeparators: [',']
});
})(jQuery);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,34 @@
(function($) {
'use strict';
$(function() {
var todoListItem = $('.todo-list');
var todoListInput = $('.todo-list-input');
$('.todo-list-add-btn').on("click", function(event) {
event.preventDefault();
var item = $(this).prevAll('.todo-list-input').val();
if (item) {
todoListItem.append("<li><div class='form-check'><label class='form-check-label'><input class='checkbox' type='checkbox'/>" + item + "<i class='input-helper'></i></label></div><i class='remove typcn typcn-delete-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);

View File

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

View File

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

View File

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

View File

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