Unified · Split
| @@ -29,6 +29,7 @@ class app.DB · 28 unmodified lines | ||
| 29 | 29 | @checkedBuggyIDB = true |
| 30 | 30 | catch |
| 31 | 31 | try db.close() |
| 32 | + @reason = 'apple' | |
| 32 | 33 | @onOpenError() |
| 33 | 34 | return |
| 34 | 35 | |
| @@ -47,6 +48,7 @@ class app.DB · 12 unmodified lines | ||
| 47 | 48 | app.onQuotaExceeded() |
| 48 | 49 | else |
| 49 | 50 | @useIndexedDB = false |
| 51 | + @reason or= 'cant_open' | |
| 50 | 52 | @runCallbacks() |
| 51 | 53 | return |
| 52 | 54 | |
| @@ -251,7 +253,11 @@ class app.DB · 198 unmodified lines | ||
| 251 | 253 | |
| 252 | 254 | useIndexedDB: -> |
| 253 | 255 | try |
| 254 | − !app.isSingleDoc() and !!window.indexedDB | |
| 256 | + if !app.isSingleDoc() and window.indexedDB | |
| 257 | + true | |
| 258 | + else | |
| 259 | + @reason = 'not_supported' | |
| 260 | + false | |
| 255 | 261 | catch |
| 256 | 262 | false |
| 257 | 263 | |
| @@ -22,10 +22,19 @@ app.templates.bootError = -> · 21 unmodified lines | ||
| 22 | 22 | """ Check your Internet connection and try <a href="javascript:location.reload()">reloading</a>.<br> |
| 23 | 23 | If you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """ |
| 24 | 24 | |
| 25 | −app.templates.offlineError = -> | |
| 26 | − error """ Oops, the database failed to load. """, | |
| 27 | − """ DevDocs requires IndexedDB to cache documentations for offline access.<br> | |
| 28 | − Unfortunately IndexedDB is either not supported in your browser, disabled, or buggy. """ | |
| 25 | +app.templates.offlineError = (reason) -> | |
| 26 | + reason = switch reason | |
| 27 | + when 'not_supported' | |
| 28 | + """ Unfortunately your browser either doesn't support it or does not make it available. """ | |
| 29 | + when 'cant_open' | |
| 30 | + """ Although your browser appears to support it, DevDocs couldn't open the database.<br> | |
| 31 | + This could be because you're browsing in private mode and have disallowed offline storage on the domain. """ | |
| 32 | + when 'apple' | |
| 33 | + """ Unfortunately Safari's implementation of IndexedDB is <a href="https://bugs.webkit.org/show_bug.cgi?id=136937">badly broken</a>.<br> | |
| 34 | + This message will automatically go away when Apple fix their code. """ | |
| 35 | + | |
| 36 | + error """ Oops, offline mode is unavailable. """, | |
| 37 | + """ DevDocs requires IndexedDB to cache documentations for offline access.<br>#{reason} """ | |
| 29 | 38 | |
| 30 | 39 | app.templates.unsupportedBrowser = """ |
| 31 | 40 | <div class="_fail"> |
| @@ -14,7 +14,7 @@ class app.views.OfflinePage extends app.View · 13 unmodified lines | ||
| 14 | 14 | app.docs.getInstallStatuses (statuses) => |
| 15 | 15 | return unless @activated |
| 16 | 16 | if statuses is false |
| 17 | − @html @tmpl('offlineError') | |
| 17 | + @html @tmpl('offlineError', app.db.reason) | |
| 18 | 18 | else |
| 19 | 19 | html = '' |
| 20 | 20 | html += @renderDoc(doc, statuses[doc.slug]) for doc in app.docs.all() |
| @@ -163,8 +163,8 @@ · 162 unmodified lines | ||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | ._error-title { |
| 166 | − margin: -5.5rem 0 .5rem; | |
| 167 | − line-height: 2; | |
| 166 | + margin: -5.5rem 0 1rem; | |
| 167 | + line-height: 2rem; | |
| 168 | 168 | font-size: 1.5rem; |
| 169 | 169 | } |
| 170 | 170 | |