2015-05-08 11:55:03 -04:00
|
|
|
//-- Activate anything Mods for HESK needs, such as tooltips.
|
2014-06-07 16:16:39 -04:00
|
|
|
var loadJquery = function()
|
|
|
|
{
|
|
|
|
//-- Activate tooltips
|
2015-02-05 20:39:43 -05:00
|
|
|
$('[data-toggle="tooltip"]').tooltip({
|
|
|
|
container: 'body'
|
|
|
|
});
|
2014-06-28 00:15:32 -04:00
|
|
|
|
2015-01-01 16:08:59 -05:00
|
|
|
//-- Activate popovers
|
2014-06-28 00:15:32 -04:00
|
|
|
$('[data-toggle="popover"]').popover({
|
2014-12-28 23:56:02 -05:00
|
|
|
trigger: 'hover',
|
|
|
|
container: 'body'
|
2014-12-24 01:47:05 -05:00
|
|
|
});
|
|
|
|
|
2015-01-01 16:08:59 -05:00
|
|
|
//-- Activate HTML popovers
|
|
|
|
$('[data-toggle="htmlpopover"]').popover({
|
|
|
|
trigger: 'hover',
|
|
|
|
container: 'body',
|
|
|
|
html: 'true'
|
|
|
|
});
|
|
|
|
|
2014-12-24 01:47:05 -05:00
|
|
|
//-- Activate jQuery's date picker
|
|
|
|
$(function() {
|
2014-12-27 22:25:20 -05:00
|
|
|
$('.datepicker').datepicker({
|
|
|
|
todayBtn: "linked",
|
|
|
|
clearBtn: true,
|
|
|
|
autoclose: true,
|
2015-03-10 00:49:44 -04:00
|
|
|
autoclose: true,
|
2014-12-27 23:57:46 -05:00
|
|
|
todayHighlight: true,
|
|
|
|
format: "yyyy-mm-dd"
|
2014-12-27 22:25:20 -05:00
|
|
|
});
|
2014-12-24 01:47:05 -05:00
|
|
|
});
|
2015-04-30 22:02:03 -04:00
|
|
|
|
|
|
|
$('[data-toggle="iconpicker"]').iconpicker({
|
2015-05-07 22:31:38 -04:00
|
|
|
iconset: ['fontawesome', 'octicon'],
|
2015-05-08 11:55:03 -04:00
|
|
|
selectedClass: "btn-warning",
|
|
|
|
labelNoIcon: $('#no-icon').text(),
|
|
|
|
searchText: $('#search-icon').text(),
|
|
|
|
labelFooter: $('#footer-icon').text()
|
2015-04-30 22:02:03 -04:00
|
|
|
});
|
2014-06-07 16:16:39 -04:00
|
|
|
};
|
|
|
|
|
2015-05-08 11:55:03 -04:00
|
|
|
var setIcon = function(icon) {
|
|
|
|
$('[data-toggle="iconpicker"]').iconpicker('setIcon', icon);
|
|
|
|
}
|
|
|
|
|
2015-01-02 00:52:35 -05:00
|
|
|
function selectAll(id) {
|
|
|
|
$('#' + id + ' option').prop('selected', true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function deselectAll(id) {
|
|
|
|
$('#' + id + ' option').prop('selected', false);
|
|
|
|
}
|
|
|
|
|
2014-06-28 16:11:06 -04:00
|
|
|
function toggleRow(id) {
|
|
|
|
if ($('#' + id).hasClass('danger'))
|
|
|
|
{
|
|
|
|
$('#' + id).removeClass('danger');
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
$('#' + id).addClass('danger');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-27 22:14:49 -04:00
|
|
|
function toggleChildrenForm(show) {
|
|
|
|
if (show) {
|
|
|
|
$('#childrenForm').show();
|
|
|
|
$('#addChildText').hide();
|
|
|
|
} else {
|
|
|
|
$('#childrenForm').hide();
|
|
|
|
$('#addChildText').show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-29 22:05:31 -05:00
|
|
|
function toggleContainers(showIds, hideIds) {
|
|
|
|
showIds.forEach(function (entry) {
|
|
|
|
$('#' + entry).show();
|
|
|
|
});
|
|
|
|
hideIds.forEach(function (entry) {
|
|
|
|
$('#' + entry).hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-03-09 00:04:59 -04:00
|
|
|
function disableIfEmpty(sourceId, destinationId) {
|
|
|
|
if ($('#' + sourceId).val().length > 0) {
|
|
|
|
$('#' + destinationId).attr('disabled', false);
|
|
|
|
} else {
|
|
|
|
if ($('#' + destinationId).is(':checkbox')) {
|
|
|
|
$('#' + destinationId).attr('checked', false);
|
|
|
|
}
|
|
|
|
$('#' + destinationId).attr('disabled', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-11 22:25:43 -04:00
|
|
|
function changeText(id, checkedValue, uncheckedValue, object) {
|
|
|
|
if (object.checked) {
|
|
|
|
$('#'+id).text(checkedValue);
|
|
|
|
} else {
|
|
|
|
$('#'+id).text(uncheckedValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-07 16:16:39 -04:00
|
|
|
jQuery(document).ready(loadJquery);
|