Bugzilla – Attachment 129987 Details for
Bug 22671
Warn the user in offline circulation if applicationCache isn't supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22671: Show warning if browser doesn't support applicationCache
Bug-22671-Show-warning-if-browser-doesnt-support-a.patch (text/plain), 4.83 KB, created by
Martin Renvoize (ashimema)
on 2022-01-31 09:48:44 UTC
(
hide
)
Description:
Bug 22671: Show warning if browser doesn't support applicationCache
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-01-31 09:48:44 UTC
Size:
4.83 KB
patch
obsolete
>From 9c4cccf4581ffad5c8de002e9bb1d5b1ec7be52e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 18 Oct 2021 12:29:19 +0000 >Subject: [PATCH] Bug 22671: Show warning if browser doesn't support > applicationCache > >This patch adds a check for browser support for the "applicationCache" >feature required by the offline circulation tool. If the feature is not >available, a message is shown to the user that offline circulation is >disabled. > >To test, apply the patch and enable the AllowOfflineCirculation system >preference. > >In a browser which supports applicationCache (Firefox < 81, Chrome < 94, >Safari <= 15), go to Circulation -> Built-in offline circulation >interface. > >- You should see the standard Offline Circulation menu options: Check > out, check in, syncrhonize, etc. >- Click "Synchronize," then "Download records." >- The process should complete correctly, updating the "last synced" > information on the page. > >Follow the same steps in a browser which has dropped support for >applicationCache. As soon as you reach the built-in offline circulation >page you should see a message, "Your browser is not compatible..." > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/circ/offline.tt | 36 +++++++++++-------- > 1 file changed, 21 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >index 90f85425bb..9c5e1fbc30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >@@ -73,9 +73,9 @@ > <div id="offline-sync" style="display: none;" class="offline-sync"> > <div id="toolbar" class="btn-toolbar"> > [% IF (AllowOfflineCirculation) %] >- <a href="#" id="download-records" class="btn btn-default"><i class="fa fa-arrow-down"></i>Download records</a> >+ <a href="#" id="download-records" class="btn btn-default"><i class="fa fa-arrow-down"></i> Download records</a> > [% END %] >- <a href="#" id="upload-transactions" class="btn btn-default"><i class="fa fa-arrow-up"></i>Upload transactions</a> >+ <a href="#" id="upload-transactions" class="btn btn-default"><i class="fa fa-arrow-up"></i> Upload transactions</a> > </div> > <h1>Offline circulation</h1> > <div class="row"> >@@ -639,24 +639,30 @@ > } > > // This next bit of code is to deal with the updated session issue >- window.addEventListener('load', function(e) { >- window.applicationCache.addEventListener('updateready', function(e) { >- if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { >- // Browser downloaded a new app cache. >- // Swap it in and reload the page to get the new hotness. >- window.applicationCache.swapCache(); >- if (confirm(_("A new version of this site is available. Load it?"))) { >- window.location.reload(); >+ if( typeof window.applicationCache !== "undefined" ){ >+ window.addEventListener('load', function(e) { >+ window.applicationCache.addEventListener('updateready', function(e) { >+ if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { >+ // Browser downloaded a new app cache. >+ // Swap it in and reload the page to get the new hotness. >+ window.applicationCache.swapCache(); >+ if (confirm(_("A new version of this site is available. Load it?"))) { >+ window.location.reload(); >+ } >+ } else { >+ // Manifest didn't changed. Nothing new to server. > } >- } else { >- // Manifest didn't changed. Nothing new to server. >- } >+ }, false); > }, false); >- }, false); >+ } > > > $(document).ready(function () { >- kohadb.initialize(); >+ if( typeof window.applicationCache === "undefined" ){ >+ $("#offline-home div").html('<div class="dialog alert"><h3>' + _("Offline circulation disabled") + '</h3><p>' + _("Your browser is not compatible with the built-in offline circulation tool.") + '</div>'); >+ } else { >+ kohadb.initialize(); >+ } > $('#header_search #circ_search .tip').text(_("Enter patron card number:")); > > $('ul[aria-labelledby="logged-in-menu"]').html('<li><a class="toplinks">' + _("You cannot change your branch or logout while using offline circulation") + '</a></li>'); >-- >2.20.1
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 22671
:
126433
|
129987
|
130814