403Webshell
Server IP : 66.29.146.62  /  Your IP : 216.73.216.2
Web Server : LiteSpeed
System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User : dokkdzvi ( 925)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/dokkdzvi/goldenmayar-omn.store/business-gov/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/dokkdzvi/goldenmayar-omn.store/business-gov/js/custom.js
/*!
* Simple jQuery Equal Heights
*
* Copyright (c) 2013 Matt Banks
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 1.5.1
*/
(function($) {

	$.fn.equalHeights = function() {
		var maxHeight = 0,
			$this = $(this);

		$this.each( function() {
			var height = $(this).innerHeight();

			if ( height > maxHeight ) { maxHeight = height; }
		});

		return $this.css('height', maxHeight);
	};

	// auto-initialize plugin
	$('[data-equal]').each(function(){
		var $this = $(this),
			target = $this.data('equal');
		$this.find(target).equalHeights();
	});

})(jQuery);

/* toggle subrow */

function toggleSubrow(){
	$("td.toggle-subrow a").on('click',function(){

		var anchor = $(this),
			glyph = anchor.find('.glyphicon'),
			row		= anchor.closest("tr"),
			subrow = row.next("tr.subrow");

		if ( subrow.is(":hidden") ) {
			subrow.show();
			glyph.removeClass("glyphicon-plus-sign").addClass("glyphicon-minus-sign");
		}
		else {
			subrow.hide();
			glyph.addClass("glyphicon-plus-sign").removeClass("glyphicon-minus-sign");


		}
		return false;
	})
};

/* hierarchy table */

function expandRows (clickedLink) {
	var exp = clickedLink,
		glyph = exp.find('.glyphicon'),
		row = exp.parents('TR:eq(0)'),
		currentLevel = parseInt(row.attr('class').split(' ')[0].split('-')[1]),
		parentLevel = parseInt(row.attr('class').split(' ')[0].split('-')[1]) - 1,
		childLevel = parseInt(row.attr('class').split(' ')[0].split('-')[1]) + 1;

	row.nextAll('TR').each(function() {
		var nextRow = $(this),
			nextGlyph = nextRow.find('a.exp').find('.glyphicon'),
			nextRowLevel = parseInt(nextRow.attr('class').split(' ')[0].split('-')[1]);

		if (nextRowLevel <= currentLevel) {
			return false;
		}
		else if (currentLevel + 1 === nextRowLevel) {
			if (nextRow.is(':hidden')){
				nextRow.removeClass('hidden').show();
			}
			else {
				nextRow.removeClass('level-open');
				nextRow.removeClass('hidden').hide();
				nextGlyph.removeClass('glyphicon-minus-sign').addClass('glyphicon-plus-sign');
			}
		}
		else {
			nextRow.removeClass('level-open');
			nextRow.removeClass('hidden').hide();
			nextGlyph.removeClass('glyphicon-minus-sign').addClass('glyphicon-plus-sign');
		}
	})

	row.toggleClass('level-open');
	glyph.toggleClass('glyphicon-minus-sign');
	glyph.toggleClass('glyphicon-plus-sign');
}

function hierarchyTable(){
	$('table.hierarchy-table:not(.ajax)').each(function() {
		var table = $(this);
		/*table.find('A.exp').click(function(){*/
		table.on('click', 'a.exp', function(e) {
			e.preventDefault();
			expandRows($(this));
		});
	});
}

/* check all/none */


function checkAll(){
	$("a.check-all").on('click',function(e) {
		e.preventDefault();
		$(this).parent().nextAll("table.table").first().find("td.check input:checkbox").prop("checked",true);
	});
};
function checkNone(){
	$("a.check-none").on('click',function(e) {
		e.preventDefault();
		$(this).parent().nextAll("table.table").first().find("td.check input:checkbox").prop("checked",false);
	});
};

function collapseAll(){
	$("a.collapse-all").on('click',function(e) {
		e.preventDefault();
		$(this).parent().nextAll("table.table").first().find('tbody').children('tr').each(function(){
			var tr = $(this);

			if (tr.hasClass('level-1')) {
				tr.removeClass('level-open');
				tr.find('a.exp').find('.glyphicon').removeClass('glyphicon-minus-sign').addClass('glyphicon-plus-sign');
			} else {
				tr.removeClass('level-open').hide();
				tr.find('a.exp').find('.glyphicon').removeClass('glyphicon-minus-sign').addClass('glyphicon-plus-sign');
			}
		})
	});
};
function expandAll(){
	$("a.expand-all").on('click',function(e) {
		e.preventDefault();
		$(this).parent().nextAll("table.table").first().find('tbody').children('tr').each(function(){
			var tr = $(this);

			tr.addClass('level-open').removeClass('hidden').show();
			tr.find('a.exp').find('.glyphicon').removeClass('glyphicon-plus-sign').addClass('glyphicon-minus-sign');
		});
	});
};
function panelTabbed(){
	var el = $('.panel-tabbed [data-action=activate]');
	if (el.length == 0) {
		return;
	}
	el.click(function(e){
		e.stopPropagation();
		e.preventDefault();
		var btn = $(this);
		btn.closest('.panel-tabbed').find('.active').removeClass('active');
		btn.addClass('active');
		$(btn.attr('href')).addClass('active');
	})
};
function accordion(){
	var el = $('.accordion [data-action=toggle-active]');
	if (el.length == 0) {
		return;
	}
	el.click(function(e){
		e.stopPropagation();
		e.preventDefault();
		var btn = $(this);
		if (btn.closest('li').hasClass('active')) {
			btn.closest('li').removeClass('active');
			btn.closest('li').find('.accordion-content').css('height','');
			btn.removeClass('active');
			btn.closest('li').find('.accordion-content').slideUp(400);
		} else {
			btn.closest('.accordion').find('.active .accordion-content').slideUp(400);
			btn.closest('.accordion').find('.active').removeClass('active');
			btn.addClass('active');
			btn.closest('li').addClass('active');
			btn.closest('li').find('.accordion-content').slideDown(400);
		}
	})
};
function asideMenu(){
	if ($('.aside-nav > li').find('li:not(.wmprt-addnew)').length > 0) {
		$('.aside-nav > li').addClass('hasChildren'); //setting default value
	}
	if ($('.aside-nav > li.active').find('li:not(.wmprt-addnew)').length > 0) {
		$('.aside-nav > li.active').addClass('open'); //setting default value
	}
	$('.aside-nav > li > a').click(function(e) {
		var sub = $(this).parent().find('ul');
		var nav = $('.aside-nav');
		if (sub.length > 0){

			// proto specific check
			if (sub.find('li:not(.wmprt-addnew)').length > 0) {
				if (!$(this).parent().hasClass('open')) {
					nav.find('.open').removeClass('open').find('ul').slideToggle();

				}
				$(this).parent().toggleClass('open');
				sub.slideToggle();
				e.preventDefault();
			}
		}
	});
}

function getNestedValue(item, nestedPath) {
	var properties = nestedPath.split('.');

	var nestedValue = item[properties[0]];
	for (var i = 1; i < properties.length; i++) {
		nestedValue = nestedValue[properties[i]];
	}
	return nestedValue;
}

function autocomplete(){
	$('input.autocomplete-field').each(function() {
		if ($(this).attr('data-value') != null && $(this).attr('data-value') != 'undefined' && $(this).attr('data-display-value') != null && $(this).attr('data-display-value') != 'undefined')
		{
			var data = JSON.parse($(this).attr('data-value').replace(/'/g,'\"'));
			var displayedValue = $(this).attr('data-display-value');

			var obtainer = function(query, cb) {
				var filteredList = $.grep(data, function (item, index) {
					return getNestedValue(item, displayedValue).match(new RegExp(query, "ig"));
				});
				mapped = $.map(filteredList, function (item) { return item; });
				cb(mapped);
			}

			$(this).typeahead({
				hint: false,
				minLength: 0,
				items: 9999,
				highlight: true,
			},{
				name: 'data',
				displayKey: function(item) {
					return getNestedValue(item, displayedValue);
				},
				source: obtainer//engine.ttAdapter()
			});
		}
	});
	$('a[data-action="toggle-autocomplete"]').click(function(){
		var ac = $($(this).attr('data-target'));
		ev = $.Event("keydown");
		ev.keyCode = ev.which = 27;
		if (!ac.parent().find('.tt-dropdown-menu').is(":visible")) {
			ev.keyCode = ev.which = 40;
		}
		ac.trigger(ev);
		return true;
	});
}

function fileinput() {
	$(document).on('change', '.btn-file :file', function() {
		var input = $(this),
			numFiles = input.get(0).files ? input.get(0).files.length : 1,
			label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
		input.trigger('fileselect', [numFiles, label]);
	});
	$('.btn-file :file').on('fileselect', function(event, numFiles, label) {
		var input = $(this).parents('.input-group').find(':text'),
			log = numFiles > 1 ? numFiles + ' files selected' : label;

		if( input.length ) {
			input.val(log);
		} else {
			if( log ) alert(log);
		}

	});
}

/* footer fix */

/*function footerFix(){
	$('#page').css({
		'padding-bottom': $('#footer').outerHeight() + 30,
		'margin-bottom': $('#footer').outerHeight() * -1
	});
}*/


$(function(){
	toggleSubrow();
	hierarchyTable();
	checkAll();
	checkNone();
	collapseAll();
	expandAll();
	panelTabbed();
	asideMenu();
	autocomplete();
	fileinput();
	//accordion();

	// CUSTOM DATE FORMAT
	$('.date-field:not(.dform-date)').datepicker({
		format: "dd/mm/yyyy",
		autoclose: true
	});

	$("input[placeholder], textarea[placeholder]").placeholder();
	$('.form-control-help').popover();



	$('.title-toggle').on('click',function(e){
		e.preventDefault();
	});

	/* footer fix */
	//footerFix();
	$(window).on('resize', function(){
		//footerFix();
	})

	/* loader background */
	$('#loader.modal').on('show.bs.modal hidden.bs.modal', function () {
		$('body').toggleClass('modal-open-loader');
		$('#loader.modal').css('padding-top', ($(window).height() - 240) / 2); // 240 -> loader height with margins
	});

	/* equal heights */

	$('.equal-heights').each(function(){
		$(this).find('.equal-item').equalHeights();
	});
	$('img').load(function(){
		$('.equal-heights').each(function(){
			$(this).find('.equal-item').equalHeights();
		});
	});
	$( window ).resize(function(){
		$('.equal-heights').each(function(){
			$(this).find('.equal-item').equalHeights();
		});
	});
	/* multiselect */
	/* http://davidstutz.github.io/bootstrap-multiselect/ */

	$('.multiselect').each(function(i, el){
		el = $(el);
		var searchst = el.attr('text-search-placeholder') ? el.attr('text-search-placeholder') : 'Search';
		var selallst = el.attr('text-select-all') ? el.attr('text-select-all') : 'Select all';
		var noselst = el.attr('text-no-selection') ? el.attr('text-no-selection') : 'None selected';
		var selst = el.attr('text-selection-count') ? el.attr('text-selection-count') : 'selected';
		var includeSelectAllIfMoreThan = el.attr('select-all-threshold') ? el.attr('select-all-threshold') : 5;
		var enableFiltering = el.attr('enable-filtering') === 'true';
		el.multiselect({
			includeSelectAllOption: true,
			includeSelectAllIfMoreThan: includeSelectAllIfMoreThan,
			includeSelectAllDivider: true,
			enableFiltering: enableFiltering,
			filterBehavior: 'text',
			enableCaseInsensitiveFiltering: true,
			buttonWidth: '100%',
			dropRight: true,
			selectAllText: selallst,
			filterPlaceholder: searchst,
			buttonText: function(options, select) {
				if (options.length == 0) {
					return noselst;
				}
				else {
					if (options.length > this.numberDisplayed) {
						return options.length + ' ' + selst;
					}
					else {
						var selected = '';
						options.each(function() {
							var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).html();

							selected += label + ', ';
						});
						return selected.substr(0, selected.length - 2);
					}
				}
			}
		});
	});

	//TODO: Custon button text
	$('.multiselect-filter').each(function(i, el){
		el = $(el);
		var searchst = el.attr('text-search-placeholder') ? el.attr('text-search-placeholder') : 'Search';
		var allselst = el.attr('text-all-selected') ? el.attr('text-all-selected') : 'All selected';
		var noselst = el.attr('text-no-selection') ? el.attr('text-no-selection') : ' ';
		var selst = el.attr('text-selection-count') ? el.attr('text-selection-count') : 'selected';
		el.multiselect({
			allSelectedText: allselst,
			filterPlaceholder: searchst,
			nonSelectedText: noselst,
			numberDisplayed: 2,
			buttonWidth: "150px",
			onDropdownHide: function() {
				var form = el.parents("form")[0];
				addInputHidden(form, '_eventId', "_find");
			}
		});
	});

	$('.multiselect.btn').parent().css('width', '100%');
})

Youez - 2016 - github.com/yon3zu
LinuXploit