UPDATES EasyBlog 6.0.14 Released! Joomla 5.x and PHP 8.x compatible now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is online
Our support specialists is available now. We will attend to you as soon as we can.
  Support is online

where to locate includes/shareable libs, ... ?

Gregor de Lijzer · ·
2:00 PM Monday, 13 March 2017
None
i programmed two apps which should share js functions which i like to put in a seperate file.

To simplify let's say the apps are app1 and app2.

the first app is located at htdocs/media/com_easysocial/apps/group/app1/themes/default/canvas/default.js
and the code looks like


EasySocial.require()
.library('ui/datepicker')
.done(function($) {
function f1(date){
fDate = $.datepicker.formatDate("YY-mm-dd", date);
return fDate;
}
})


the second app is located at htdocs/media/com_easysocial/apps/group/app1/themes/default/canvas/default.js
an looks like


EasySocial.require()
.library('ui/datepicker')
.done(function($) {
function f1(date){
fDate = $.datepicker.formatDate("YY-mm-dd", date);
return fDate;
}
})


The result should be, that i can call
f1(new Date())
from app1 and app2.

Now i like to have this function (f1) in a file which should be included in both apps so that f1 can be called from both.
Also "ui/datepicker" should be included!

How can i handle this?
Where do i have to put this file?
Should an app have its own folder like htdocs/media/com_easysocial/apps/MY_APPS/app1/themes/... ?
The replies under this section are restricted to logged in users or users with an active subscription with us