Closed shkodskihk closed 9 years ago
I think it is a mistake. I'll try to find the reason and solve it.
Thank you for report.
OK, Remoteimage will remove this js file if you disable all com_media replacement options in 2.0.2.
It will be hard to disable this JS by user authorized because there are many use cases which will including the built-in media manager, for instance, editor, file input, any custom inputs of 3rd components. So this script must load every where to make sure com_media replacement can work.
Thank you for your support.
See what happened.
[Extension Version 2.0.2; Joomla! 3.3.6]
script file remoteimage-admin.js
use and load both plugins:
[A]. {SITEROOT}/plugins/editors-xtd/remoteimage/remoteimage.php
[B]. {SITEROOT}/plugins/system/remoteimage/remoteimage.php
wherein
remoteimage-admin.js
missing in your frontend of the component: {SITEROOT}/components/com_remoteimage/asset/js/
remoteimage-admin.js
to folder {SITEROOT}/components/com_remoteimage/asset/js/
, then after editing a frontend - the script is loaded twice. Of paths:
(1) {SITEROOT}/components/com_remoteimage/asset/js/remoteimage-admin.js
(2) {SITEROOT}/administrator/components/com_remoteimage/asset/js/remoteimage-admin.js
See screenshot: http://i.imgur.com/Ee0cAl1.png
I added to plugin [B] your code that checks the user authorization in the Frontend:
$ user = JFactory :: getUser (); if ($ app-> isSite () &&! $ user-> authorise ('frontend.access')) { return array (); }
and it solved the problem: the script was the loaded only when the user is logged in.
What do you think about how to solve the problem of dual boot file remoteimage-admin.js
?
remoteimage-admin.js
: if it loaded one plugin, the other no longer loads.OK, I know about the front-end issues, I'll find a solution to solve this problem.
It is not necessary to worry about loaded twice of the script, if I load them from same path, JDocument will merge them as one.
Please wait.
Added front.access
check for system plugin in 2.0.3
[Version: 2.0.1] Javascript file 'remoteimage-admin.js' loaded on all pages frontend, including those where it is not needed (where there is no editor). Which is not good. It would be better to make a choice:
What is your opinion about this?