[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] JavaScript & JQuery on EPrints



EPrints uses a library called prototype.js which clashes the function name "$".

https://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flearn.jquery.com%2Fusing-jquery-core%2Favoid-conflicts-other-libraries%2F&data=01%7C01%7C%7Cd1886dd1ee7a453da39408d640103a03%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=2nWWLOrBVDo1ETYbstBu8FWeoRV5PRV6FZWv%2FUBdis4%3D&reserved=0>

On 01/11/2018 14:38, James Kerwin via Eprints-tech wrote:
Hi all,

This isn't exclusively an EPrints problem, but it's possible some of you may have experienced similar.

I'm putting some new institutional headers on the test repository and I have a problem with the JQuery line of code (src="//www.liverpool.ac.uk/files/js/common-scripts/jquery/jquery-3.1.0.min.js<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.liverpool.ac.uk%2Ffiles%2Fjs%2Fcommon-scripts%2Fjquery%2Fjquery-3.1.0.min.js&data=01%7C01%7C%7Cd1886dd1ee7a453da39408d640103a03%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=4CL71yvDWE8YqaditVp6nAuE8028C%2FdRTcjceXL8DwE%3D&reserved=0>") and the eprints "epc:pin ref="head"" element. Both of these were in the previous layout of the ../[ARCHIVE_ID/cfg/templatesdefault.xml file.

If I put the eprints pin before the JQuery call, the eprints JS is ignored. The small drop down "+" does nothing when clicked and so some parts of EPrints can't become visible to the user. If the pin is placed after the JQuery call, the headers aren't dynamic and can't be expanded etc.

Frustratingly, if I remove all references to JavaScript in the file except for the eprints pin and the jquery call, it still behaves in the same way. People have suggested that it may be a clash between function/variable names, but I can't see where this clash could be. If I revert to the previous file, everything works as expected (headers and dropdowns despite the exact same files being called in the same order).

Has anybody experienced anything like this?

Thanks,
James





*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7C%7C6833a158e67e4440f9d308d64007eed8%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=ILYlxtesY9NfJMF0XoabBeBtSakPU8RMwUosk7Uu90o%3D&amp;reserved=0<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7Cd1886dd1ee7a453da39408d640103a03%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=a53LbY500NcSnoqcLsVoel%2BvN9tlBJd7jpjQEaBMAS0%3D&reserved=0>
*** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7C%7C6833a158e67e4440f9d308d64007eed8%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=DAJsWQte52XW394XelRgkMMjfLvdr0ylP2Q3TUKozSY%3D&amp;reserved=0<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7Cd1886dd1ee7a453da39408d640103a03%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=aNjFChnrqVCnxxxjFyCGgti8gE0GUHhBi1yjqX0bB5M%3D&reserved=0>
*** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7C%7C6833a158e67e4440f9d308d64007eed8%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=IaQpbqXxadGGkioFCN3SzI%2Be%2FsScLMVxxN1HRo7hQy4%3D&amp;reserved=0<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&data=01%7C01%7C%7Cd1886dd1ee7a453da39408d640103a03%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=RCY%2FcWYGGxzzXaG9floeqaUydo04kbXVwT7%2FF6GyTi8%3D&reserved=0>



--
Christopher Gutteridge <totl at soton.ac.uk><mailto:totl at soton.ac.uk>
You should read our team blog at http://blog.soton.ac.uk/webteam/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20181101/ded8994a/attachment-0001.html