Can't get jquery scripts to work in koha
Hi all, I tried to get a jquery to work in koha 3.16.04.000, using iceweasel with iced-tea web plugin. Since i am new to jquery, I tried two existing jquery scripts, I copied and pasted from here; http://www.mydk-tomic.net/?q=node/17, which should be a script that gives me 3 different words in the advanced search page, instead of 3 times keyword, I want title, author and subject, or whatever else I choose . Apparently this script should do it; $(document).ready(function(){ $("#booleansearch option:eq(0)[value='ti']").attr('selected','selected');$("#booleansearch option:eq(1)[value='au,wrdl']").attr('selected','selected');$("#booleansearch option:eq(2)[value='su,wrdl']").attr('selected','selected');}); I pasted that in the intranetuserjs system preference, and behold; nothing is happening. I still get keyword, keyword, keyword. So I tried something else, and found in the koha jquery library a script by Nicole C. Engard (and I am convinced she KNOWS what she is doing) to change the text of the OPAC login form. I pasted that into the opacuserjs system preference, and that did not do anything either. Just for reference, I pasted that in here as well (see end of message). So, what do I do wrong? Did I miss a setting, is there a kind of main switch preference for turning jquery on or off? Thanks! Marty $(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");});
Hello Marty, On Sat, Oct 11, 2014 at 11:11 PM, Marty Jongepier <marty.jongepier@gmail.com> wrote: <snipped>
So I tried something else, and found in the koha jquery library a script by Nicole C. Engard (and I am convinced she KNOWS what she is doing) to change the text of the OPAC login form. I pasted that into the opacuserjs system preference, and that did not do anything either. Just for reference, I pasted that in here as well (see end of message).
Nicole's script works perfectly fine. This is what you are tripping over http://www.standardista.com/javascript/15-common-javascript-gotchas/#linebre... You had copy-pasted the code... right? You need to remove the line-break after "Log in to" and the code will work :-)
$(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");});
cheers -indra -- Indranil Das Gupta Phone : +91-98300-20971 Blog : http://indradg.randomink.org/blog IRC : indradg on irc://irc.freenode.net Twitter : indradg -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=- Please exchange editable Office documents only in ODF Format. No other format is acceptable. Support Open Standards. For a free editor supporting ODF, please visit LibreOffice - http://www.documentfoundation.org
Yup, you were right. It works now, I just would like to figure out how to get the different search words on the OPAC side Thanks for your help! On Wed, Oct 15, 2014 at 11:35 PM, Indranil Das Gupta <indradg@gmail.com> wrote:
Hello Marty,
On Sat, Oct 11, 2014 at 11:11 PM, Marty Jongepier <marty.jongepier@gmail.com> wrote:
<snipped>
So I tried something else, and found in the koha jquery library a script by Nicole C. Engard (and I am convinced she KNOWS what she is doing) to change the text of the OPAC login form. I pasted that into the opacuserjs system preference, and that did not do anything either. Just for reference, I pasted that in here as well (see end of message).
Nicole's script works perfectly fine. This is what you are tripping over http://www.standardista.com/javascript/15-common-javascript-gotchas/#linebre...
You had copy-pasted the code... right? You need to remove the line-break after "Log in to" and the code will work :-)
$(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");});
cheers -indra
-- Indranil Das Gupta
Phone : +91-98300-20971 Blog : http://indradg.randomink.org/blog IRC : indradg on irc://irc.freenode.net Twitter : indradg
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=- Please exchange editable Office documents only in ODF Format. No other format is acceptable. Support Open Standards.
For a free editor supporting ODF, please visit LibreOffice - http://www.documentfoundation.org
Oops, I meant to get it the different search words to work on the intranet side, sorry. It does work on the OPAC! On Sat, Oct 18, 2014 at 4:39 PM, Marty Jongepier <marty.jongepier@gmail.com> wrote:
Yup, you were right. It works now, I just would like to figure out how to get the different search words on the OPAC side
Thanks for your help!
On Wed, Oct 15, 2014 at 11:35 PM, Indranil Das Gupta <indradg@gmail.com> wrote:
Hello Marty,
On Sat, Oct 11, 2014 at 11:11 PM, Marty Jongepier <marty.jongepier@gmail.com> wrote:
So I tried something else, and found in the koha jquery library a
<snipped> script by
Nicole C. Engard (and I am convinced she KNOWS what she is doing) to change the text of the OPAC login form. I pasted that into the opacuserjs system preference, and that did not do anything either. Just for reference, I pasted that in here as well (see end of message).
Nicole's script works perfectly fine. This is what you are tripping over http://www.standardista.com/javascript/15-common-javascript-gotchas/#linebre...
You had copy-pasted the code... right? You need to remove the line-break after "Log in to" and the code will work :-)
$(document).ready(function(){ $("#auth legend:contains('Log in to your account')").text("Log in to your library account"); $("#auth label[for='userid']").html("Library Card Number:"); $("#auth label[for='password']").html("PIN:");});
cheers -indra
-- Indranil Das Gupta
Phone : +91-98300-20971 Blog : http://indradg.randomink.org/blog IRC : indradg on irc://irc.freenode.net Twitter : indradg
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=- Please exchange editable Office documents only in ODF Format. No other format is acceptable. Support Open Standards.
For a free editor supporting ODF, please visit LibreOffice - http://www.documentfoundation.org
participants (2)
-
Indranil Das Gupta -
Marty Jongepier