Bugzilla – Attachment 18391 Details for
Bug 9424
Move JavaScript out of header include
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9424: Move JavaScript out of header include
Bug-9424-Move-JavaScript-out-of-header-include.patch (text/plain), 3.56 KB, created by
Galen Charlton
on 2013-05-24 16:31:24 UTC
(
hide
)
Description:
Bug 9424: Move JavaScript out of header include
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-05-24 16:31:24 UTC
Size:
3.56 KB
patch
obsolete
>From cd46c9ebb03eade1a11da2c4abd57c1bd2e11761 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 10 May 2013 08:32:11 -0400 >Subject: [PATCH] Bug 9424: Move JavaScript out of header include > >This patch removes JavaScript "onlick" attributes from header.inc and >moves the functionality to staff-global.js. This is in keeping with the >idea of progressive enhancement. > >To test, be sure to clear your browser cache after applying the patch. > >- Test the help link. >- Test the logout link with the intranetbookbag preference on and off. >- Open a patron's account and click "search to hold." Log out, and log > in again. Koha should not remember the patron you chose before > logging out (as seen from a search results page). > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > .../intranet-tmpl/prog/en/includes/header.inc | 10 ++-------- > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 19 +++++++++++++++++++ > 2 files changed, 21 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 194a0f9..9070aa4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -75,21 +75,15 @@ > <a class="toplinks" href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a> > </li> > [% END %] >- [% IF ( intranetbookbag ) %] > <li> >- <a class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1" onclick="clearHoldFor(); delBasket('main', true);">Log out</a> >+ <a id="logout" class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Log out</a> > </li> > [% ELSE %] >- <li> >- <a class="toplinks" href="/cgi-bin/koha/mainpage.pl?logout.x=1" onclick="clearHoldFor();">Log out</a> >- </li> >- [% END %] >- [% ELSE %] > You are not logged in | > [% END %] > </ul> > <li> >- <a class="toplinks" href="/cgi-bin/koha/help.pl" id="helper" onclick="var link=window.open('','Koha_Help','width=600,height=600,toolbar=false,scrollbars=yes'); link.location='/cgi-bin/koha/help.pl'; return false;">Help</a> >+ <a class="toplinks" href="/cgi-bin/koha/help.pl" id="helper">Help</a> > </li> > </li> > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >index 1d23253..17fe162 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -15,6 +15,14 @@ function _(s) { return s; } // dummy function for gettext > $(".focus").focus(); > $(".validated").validate(); > >+ $("#logout").on("click",function(){ >+ logOut(); >+ }); >+ $("#helper").on("click",function(){ >+ openHelp(); >+ return false; >+ }); >+ > $('.noEnterSubmit').keypress(function(e){ > if ( e.which == 13 ) return false; > }); >@@ -42,6 +50,17 @@ function clearHoldFor(){ > $.cookie("holdfor",null, { path: "/", expires: 0 }); > } > >+function logOut(){ >+ if( typeof delBasket == 'function' ){ >+ delBasket('main', true); >+ } >+ clearHoldFor(); >+} >+ >+function openHelp(){ >+ openWindow("/cgi-bin/koha/help.pl","Koha help",600,600); >+} >+ > jQuery.fn.preventDoubleFormSubmit = function() { > jQuery(this).submit(function() { > $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9424
:
14706
|
15101
|
15191
|
18062
|
18358
|
18391
|
18408