Bugzilla – Attachment 57719 Details for
Bug 17416
Move javascript in doc-head-close.inc into a separate include
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17416 - Move javascript in doc-head-close.inc into a separate include
Bug-17416---Move-javascript-in-doc-head-closeinc-i.patch (text/plain), 9.95 KB, created by
Jonathan Druart
on 2016-11-23 09:25:10 UTC
(
hide
)
Description:
Bug 17416 - Move javascript in doc-head-close.inc into a separate include
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-23 09:25:10 UTC
Size:
9.95 KB
patch
obsolete
>From 567569b66022c05530cd55f65b5eda27c8dbb9f5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 10 Oct 2016 05:52:51 -0400 >Subject: [PATCH] Bug 17416 - Move javascript in doc-head-close.inc into a > separate include > >In order to prepare to move staff client javascript assets into the >footer, this patch creates a new include file containing all <script> >content. This change should have no visible effect on how pages are >generated. > >To test, apply the patch and view various pages in the staff client >(ciruclation, preferences, etc) to confirm that JavaScript is working >correctly. > >Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> >--- > .../prog/en/includes/doc-head-close.inc | 85 +--------------------- > .../intranet-tmpl/prog/en/includes/js_includes.inc | 85 ++++++++++++++++++++++ > 2 files changed, 87 insertions(+), 83 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index 078a6c3..fe89589 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -6,14 +6,6 @@ > [%# Prevent XFS attacks -%] > [% UNLESS popup %] > <style id="antiClickjack">body{display:none !important;}</style> >- <script type="text/javascript"> >- if (self === top) { >- var antiClickjack = document.getElementById("antiClickjack"); >- antiClickjack.parentNode.removeChild(antiClickjack); >- } else { >- top.location = self.location; >- } >- </script> > [% END %] > > <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >@@ -23,84 +15,11 @@ > <link rel="stylesheet" type="text/css" href="[% interface %]/lib/font-awesome/css/font-awesome.min.css" /> > <link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" /> > [% INCLUDE intranetstylesheet.inc %] >-[% IF ( bidi ) %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />[% END %] >- >-<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script> >-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script> >+[% IF ( bidi ) %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />[% END %] > > [% IF ( login ) %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/login.css" /> > [% END %] > [% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %] > >-<!-- koha core js --> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script> >- >-[% INCLUDE 'validator-strings.inc' %] >-[% PROCESS 'html_helpers.inc' %] >-[% IF ( IntranetUserJS ) %] >- <script type="text/javascript"> >- //<![CDATA[ >- [% IntranetUserJS %] >- //]]> >- </script> >-[% END %] >- >-[% IF ( virtualshelves || intranetbookbag ) %] >-<script type="text/javascript"> >- //<![CDATA[ >- var MSG_BASKET_EMPTY = _("Your cart is currently empty"); >- var MSG_RECORD_IN_BASKET = _("This item is already in your cart"); >- var MSG_RECORD_ADDED = _("This item has been added to your cart"); >- var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart"); >- var MSG_NRECORDS_IN_BASKET = _("%s already in your cart"); >- var MSG_NO_RECORD_SELECTED = _("No item was selected"); >- var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart)!"); >- var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?"); >- var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?"); >- var MSG_IN_YOUR_CART = _("Items in your cart: %s"); >- var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved."); >- var MSG_ITEM_NOT_IN_CART = _("Add to cart"); >- var MSG_ITEM_IN_CART = _("In your cart"); >- var MSG_RECORD_REMOVED = _("The item has been removed from your cart"); >- //]]> >- </script> >- >- <script type="text/javascript" src="[% interface %]/[% theme %]/js/basket.js"></script> >-[% END %] >- >-[% IF LocalCoverImages %] >- <script type="text/javascript" src="[% interface %]/[% theme %]/js/localcovers.js"></script> >- <script type="text/javascript"> >- //<![CDATA[ >- var NO_LOCAL_JACKET = _("No cover image available"); >- //]]> >- </script> >-[% END %] >- >-[% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %] >- <script type="text/javascript"> >- //<![CDATA[ >- var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/'; >- var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) %]' ); >- //]]> >- >- $( document ).ready(function() { >- if ( AUDIO_ALERTS ) { >- for ( var k in AUDIO_ALERTS ) { >- var alert = AUDIO_ALERTS[k]; >- if ( $( alert.selector ).length ) { >- playSound( alert.sound ); >- break; >- } >- } >- } >- }); >- </script> >-[% END %] >+[% INCLUDE js_includes.inc %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >new file mode 100644 >index 0000000..fae3a0e >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >@@ -0,0 +1,85 @@ >+[%# Prevent XFS attacks -%] >+[% UNLESS popup %] >+ <script type="text/javascript"> >+ if (self === top) { >+ var antiClickjack = document.getElementById("antiClickjack"); >+ antiClickjack.parentNode.removeChild(antiClickjack); >+ } else { >+ top.location = self.location; >+ } >+ </script> >+[% END %] >+ >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui-1.11.4.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.validate.min.js"></script> >+<!-- koha core js --> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script> >+ >+[% INCLUDE 'validator-strings.inc' %] >+[% PROCESS 'html_helpers.inc' %] >+[% IF ( IntranetUserJS ) %] >+ <script type="text/javascript"> >+ //<![CDATA[ >+ [% IntranetUserJS %] >+ //]]> >+ </script> >+[% END %] >+ >+[% IF ( virtualshelves || intranetbookbag ) %] >+<script type="text/javascript"> >+ //<![CDATA[ >+ var MSG_BASKET_EMPTY = _("Your cart is currently empty"); >+ var MSG_RECORD_IN_BASKET = _("This item is already in your cart"); >+ var MSG_RECORD_ADDED = _("This item has been added to your cart"); >+ var MSG_NRECORDS_ADDED = _("%s item(s) added to your cart"); >+ var MSG_NRECORDS_IN_BASKET = _("%s already in your cart"); >+ var MSG_NO_RECORD_SELECTED = _("No item was selected"); >+ var MSG_NO_RECORD_ADDED = _("No item was added to your cart (already in your cart)!"); >+ var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?"); >+ var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?"); >+ var MSG_IN_YOUR_CART = _("Items in your cart: %s"); >+ var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved."); >+ var MSG_ITEM_NOT_IN_CART = _("Add to cart"); >+ var MSG_ITEM_IN_CART = _("In your cart"); >+ var MSG_RECORD_REMOVED = _("The item has been removed from your cart"); >+ //]]> >+ </script> >+ >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/basket.js"></script> >+[% END %] >+ >+[% IF LocalCoverImages %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/localcovers.js"></script> >+ <script type="text/javascript"> >+ //<![CDATA[ >+ var NO_LOCAL_JACKET = _("No cover image available"); >+ //]]> >+ </script> >+[% END %] >+ >+[% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %] >+ <script type="text/javascript"> >+ //<![CDATA[ >+ var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/'; >+ var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) %]' ); >+ //]]> >+ >+ $( document ).ready(function() { >+ if ( AUDIO_ALERTS ) { >+ for ( var k in AUDIO_ALERTS ) { >+ var alert = AUDIO_ALERTS[k]; >+ if ( $( alert.selector ).length ) { >+ playSound( alert.sound ); >+ break; >+ } >+ } >+ } >+ }); >+ </script> >+[% END %] >-- >2.1.4
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 17416
:
56099
|
56152
|
57719
|
57720
|
57721
|
57722