Support

  1. Inoub
  2. General
  3. Saturday, June 27 2015, 11:54 AM
hi there,

how can we extend or overwrite easy-profile's .js files (eg. '/com_jsn/assets/js/tabs.js') without losing our changes next time we update the component? Is that possible just like it works with the template files?

thanks for your advice,
Bob :)
admin Accepted Answer
Admin
Hi,
sorry for late reply, it's a weekend and our offices are closed.

Sorry, you need to overwrite this file on each update. Easy Profile extends Joomla user profile, so registration and edit profile pages are the same of Joomla. These pages are not a part of Easy Profile then we use a system plugin to load tabs.js

Complex Alternative:
We load js files with Joomla API, so to load tabs.js we use this function:
JFactory::getDocument()->addScript(JURI::root().'components/com_jsn/assets/js/tabs.js');


You can write system plugin to manipulate Joomla script references. Before compile HEAD section joomla trigger a system event called "onBeforeCompileHead"

so you can write a system plugin with a function like this:
function onBeforeCompileHead()
{
$app = JFactory::getApplication();
if (!$app->isAdmin()){
$doc = JFactory::getDocument();
unset($doc->_scripts[JURI::root().'components/com_jsn/assets/js/tabs.js']);
$doc->->addScript(JURI::root().'components/com_jsn/assets/js/custom_tabs.js');
}
}


NOTE: This code is not tested and not supported, this code is provided only to example purpose.
  1. more than a month ago
  2. General
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.