?
avatar rgjoyce
rgjoyce
23 Dec 2018

My component uses tabs and includes the tabs.js and tabs-state.js files.

Will these be added to the J4.0 release? If not I'll have to include them in my component.

avatar rgjoyce rgjoyce - open - 23 Dec 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Dec 2018
avatar rgjoyce rgjoyce - change - 23 Dec 2018
Title
…
tabs js files missing from media/system.js folder
tabs js files missing from media/system/js folder
avatar rgjoyce rgjoyce - edited - 23 Dec 2018
avatar mbabker
mbabker - comment - 23 Dec 2018

media/system/js/tabs.js is used in core by the deprecated JHtmlTabs class, removed in 4.0 as MooTools library support was dropped. So you shouldn't be using that at this point anyway.

avatar rgjoyce
rgjoyce - comment - 23 Dec 2018

Ok, I don’t see jhtmltabs in this document.

https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4

From: Michael Babker [mailto:notifications@github.com]
Sent: Sunday, December 23, 2018 8:34 PM
To: joomla/joomla-cms
Cc: rgjoyce; Author
Subject: Re: [joomla/joomla-cms] tabs js files missing from media/system/js folder (#23323)

media/system/js/tabs.js is used in core by the deprecated JHtmlTabs class, removed in 4.0 as MooTools library support was dropped. So you shouldn't be using that at this point anyway.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #23323 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AFMGLCmxtvBuhu2W18IVANZoTBk1u9jBks5u75RRgaJpZM4Zf2GQ . https://github.com/notifications/beacon/AFMGLLgpzmJtHn82NeS0loPi0Uijink4ks5u75RRgaJpZM4Zf2GQ.gif


This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

avatar mbabker
mbabker - comment - 23 Dec 2018

As it says, the document is incomplete. If you look at the class in 3.x it does have deprecation notices, those shouldn't be ignored either.

avatar rgjoyce
rgjoyce - comment - 23 Dec 2018

I understand and many thanks.

However, What do I replace it with?

From: Michael Babker [mailto:notifications@github.com]
Sent: Sunday, December 23, 2018 8:49 PM
To: joomla/joomla-cms
Cc: rgjoyce; Author
Subject: Re: [joomla/joomla-cms] tabs js files missing from media/system/js folder (#23323)

As it says, the document is incomplete. If you look at the class in 3.x it does have deprecation notices, those shouldn't be ignored either.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #23323 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AFMGLBRgR1bFufNdDGzgyTHXRboX__fdks5u75fLgaJpZM4Zf2GQ . https://github.com/notifications/beacon/AFMGLC-WS4nefpoj_9VC6lJuHO7tJivrks5u75fLgaJpZM4Zf2GQ.gif


This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

avatar ggppdk
ggppdk - comment - 23 Dec 2018

Do you mean how to use Bootstrap based Tabs, while also remembering last active TAB ?

avatar rgjoyce
rgjoyce - comment - 24 Dec 2018

Yes, how to use bootstrap tabs.

Rob

From: Georgios Papadakis [mailto:notifications@github.com]
Sent: Monday, December 24, 2018 1:24 AM
To: joomla/joomla-cms
Cc: rgjoyce; Author
Subject: Re: [joomla/joomla-cms] tabs js files missing from media/system/js folder (#23323)

Do you mean how to use Bootstrap based Tabs, while also remembering last active TAB ?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #23323 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AFMGLHPAD6s2Zv3dK3f38wfthQvYZAPXks5u79g3gaJpZM4Zf2GQ . https://github.com/notifications/beacon/AFMGLBwt4aZbpJIeZJnwdLlM_MD8Ii1Dks5u79g3gaJpZM4Zf2GQ.gif


This email has been checked for viruses by AVG.
https://www.avg.com

avatar ggppdk
ggppdk - comment - 24 Dec 2018

To keep track which Tab was last active,
you will need to do with your own code

  • any better way please someone say

in my example below,
i am using a cookie to set Last active Tab of every Tab-Set
which is indexed by the HTML TagId of every Tab-Set,

Please correct any syntax or logic errors i have made below

<?php
$jcookie       = JFactory::getApplication()->input->cookie;
$itemset_tagid = 'some_tagid';
$cookie_name   = 'some_cookie_name';

// Get cookie of all Tab-Sets
$tabs_conf = $jcookie->get($cookie_name, '{}', 'string');

// Try to parse cookie contents
try
{
	$tabs_conf = json_decode($tabs_conf);
}
catch (Exception $e)
{
	$jcookie->set($cookie_name, '{}', time()+60*60*24, JUri::base(true), '');
}

$tabs_conf = is_object($tabs_conf)
	? $tabs_conf
	: (new stdClass);


// "tabs_conf" is an object, where every property is the HTML TAGID of every Tab-Set
$last_active_tagid_from_cookie = !empty($tabs_conf->$itemset_tagid)
	? $tabs_conf->$itemset_tagid
	: $itemset_tagid . '_' . $items[0]->id;  // Activate first TAB


JHtml::_('bootstrap.startTabSet',
	$itemset_tagid,
	array('active' => $last_active_tagid_from_cookie)
);

/**
 * $items have content of your Tabs
 */
foreach ($items as $item)
{
	JHtml::_('bootstrap.addTab',
		$itemset_tagid,
		$itemset_tagid . '_' . $item->id,
		$item->title
	);

	// Add item HTML here

	JHtml::_('bootstrap.endTab');
}

JHtml::_('bootstrap.endTabSet');

?>

<script>

(function($) {
	$(document).ready(function ()
	{
		$('#<?php $itemset_tagid; ?>Tabs"').on('shown', function ()
		{
			/**
			 * Try to use a same cookie for all Tab-Sets 
			 */
			var tabs_conf = YOUR_METHOD_TO_GET_COOKIE('<?php $cookie_name; ?>');
			try { tabs_conf = JSON.parse(tabs_conf); } catch(e) { tabs_conf = {}; }

			var new_active_tagid = $('#<?php $itemset_tagid; ?>Tabs').next().find('.active').attr('id');

			/**
			 * Set new_active_tagid to the cookie of all Tab-Sets 
			 */
			tabs_conf['<?php $itemset_tagid; ?>'] = new_active_tagid;
			YOUR_METHOD_TO_GET_COOKIE('<?php $cookie_name; ?>', JSON.stringify(tabs_conf));
		});
	});
});

</script>
avatar joomla-cms-bot joomla-cms-bot - change - 29 Dec 2018
Closed_By Quy ⇒ joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 29 Dec 2018
avatar Quy Quy - change - 29 Dec 2018
Status New ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2018-12-29 03:00:28
Closed_By ⇒ Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 29 Dec 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23323

Add a Comment

Login with GitHub to post a comment