[Bug 29295] New: Page specific jQuery
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29295 Bug ID: 29295 Summary: Page specific jQuery Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: cbrannon@cdalibrary.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Would love it if there was an option laid out, just like sql reports, where we could list jQuery modifications. We would have a global tab for each module (internet, OPAC, Self-Check, etc.) and then we could pick a specific page and have jQuery that was just for that page. That way if you have jQuery that only deals with a specific page, it would only load with that page, and not be loaded in the background when on all the other pages it will never apply to. This would also help organize modifications as well. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29295 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29295 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- You mean JQuery code added in IntranetUserJS or OPACUserJS ? Each page as an id in the body. For example : <body id="main_intranet-main" class="intranet-main"> So you can create a code loaded just for that page with : if ( $("body#main_intranet-main").length > 0 ) { -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29295 --- Comment #2 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Fridolin Somers from comment #1)
You mean JQuery code added in IntranetUserJS or OPACUserJS ?
Each page as an id in the body. For example : <body id="main_intranet-main" class="intranet-main">
So you can create a code loaded just for that page with : if ( $("body#main_intranet-main").length > 0 ) {
That solution is a logical selector. I am talking about jquery that will only be loaded for specific pages. If you look at ANY page source in Koha, you will always see ALL of your jQuery, not just jQuery that relates to that page. Some libraries have a lot of jQuery, and an enhancement of this nature would A) reduce the amount of code that is looked at and processed when the page is loaded, and B) reduce unexpected side effects of jQuery that might affect unintended pages due to mistakes in the Koha or jQuery code. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29295 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org