Unified · Split
| @@ -15,7 +15,7 @@ · 14 unmodified lines | |||
| 15 | @el = $('._app') | 15 | @el = $('._app') |
| 16 | @localStorage = new LocalStorageStore | 16 | @localStorage = new LocalStorageStore |
| 17 | @appCache = new app.AppCache if app.AppCache.isEnabled() | 17 | @appCache = new app.AppCache if app.AppCache.isEnabled() |
| 18 | @settings = new app.Settings @localStorage | 18 | @settings = new app.Settings |
| 19 | @db = new app.DB() | 19 | @db = new app.DB() |
| 20 | 20 | ||
| 21 | @docs = new app.collections.Docs | 21 | @docs = new app.collections.Docs |
| @@ -106,7 +106,6 @@ · 84 unmodified lines | |||
| 106 | @hideLoading() | 106 | @hideLoading() |
| 107 | @welcomeBack() unless @doc | 107 | @welcomeBack() unless @doc |
| 108 | @removeEvent 'ready bootError' | 108 | @removeEvent 'ready bootError' |
| 109 | try navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true catch | ||
| 110 | return | 109 | return |
| 111 | 110 | ||
| 112 | initDoc: (doc) -> | 111 | initDoc: (doc) -> |
| @@ -117,12 +116,7 @@ · 4 unmodified lines | |||
| 117 | migrateDocs: -> | 116 | migrateDocs: -> |
| 118 | for slug in @settings.getDocs() when not @docs.findBy('slug', slug) | 117 | for slug in @settings.getDocs() when not @docs.findBy('slug', slug) |
| 119 | needsSaving = true | 118 | needsSaving = true |
| 120 | doc = @disabledDocs.findBy('slug', 'codeigniter~3') if slug == 'codeigniter~3.0' | 119 | doc = @disabledDocs.findBy('slug_without_version', slug) |
| 121 | doc = @disabledDocs.findBy('slug', 'node~4_lts') if slug == 'node~4.2_lts' | ||
| 122 | doc = @disabledDocs.findBy('slug', 'xslt_xpath') if slug == 'xpath' | ||
| 123 | doc = @disabledDocs.findBy('slug', 'angular~2_typescript') if slug == 'angular~2.0_typescript' | ||
| 124 | doc = @disabledDocs.findBy('slug', "angularjs~#{match[1]}") if match = /^angular~(1\.\d)$/.exec(slug) | ||
| 125 | doc ||= @disabledDocs.findBy('slug_without_version', slug) | ||
| 126 | if doc | 120 | if doc |
| 127 | @disabledDocs.remove(doc) | 121 | @disabledDocs.remove(doc) |
| 128 | @docs.add(doc) | 122 | @docs.add(doc) |
| @@ -13,21 +13,8 @@ class app.Settings · 12 unmodified lines | |||
| 13 | manualUpdate: false | 13 | manualUpdate: false |
| 14 | schema: 1 | 14 | schema: 1 |
| 15 | 15 | ||
| 16 | constructor: (legacyStore) -> | 16 | constructor: -> |
| 17 | @store = new CookieStore | 17 | @store = new CookieStore |
| 18 | @importLegacyValues(legacyStore) | ||
| 19 | |||
| 20 | importLegacyValues: (legacyStore) -> | ||
| 21 | return unless settings = legacyStore.get('settings') | ||
| 22 | for key, value of settings | ||
| 23 | if key == 'autoUpdate' | ||
| 24 | key = 'manualUpdate' | ||
| 25 | value = !value | ||
| 26 | else if key == 'tips' | ||
| 27 | value = value.join('/') | ||
| 28 | @store.set(key, value) | ||
| 29 | legacyStore.del('settings') | ||
| 30 | return | ||
| 31 | 18 | ||
| 32 | set: (key, value) -> | 19 | set: (key, value) -> |
| 33 | @store.set(key, value) | 20 | @store.set(key, value) |
| @@ -90,9 +90,6 @@ · 89 unmodified lines | |||
| 90 | "2015-07-26", | 90 | "2015-07-26", |
| 91 | "Added search abbreviations (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#abbreviations\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/Thibaut/devdocs/issues/new\" target=\"_blank\" rel=\"noopener\">GitHub</a>.", | 91 | "Added search abbreviations (e.g. <code class=\"_label\">$</code> is an alias for <code class=\"_label\">jQuery</code>).\n<a href=\"/help#abbreviations\">Click here</a> to see the full list. Feel free to suggest more on <a href=\"https://github.com/Thibaut/devdocs/issues/new\" target=\"_blank\" rel=\"noopener\">GitHub</a>.", |
| 92 | "Added <code class=\"_label\">shift + ↓/↑</code> shortcut for scrolling (same as <code class=\"_label\">alt + ↓/↑</code>)." | 92 | "Added <code class=\"_label\">shift + ↓/↑</code> shortcut for scrolling (same as <code class=\"_label\">alt + ↓/↑</code>)." |
| 93 | ], [ | ||
| 94 | "2015-07-12", | ||
| 95 | "New sponsors: <a href=\"http://out.devdocs.io/s/jetbrains\">JetBrains</a> and <a href=\"http://out.devdocs.io/s/code-school\">Code School</a>\nIf you like DevDocs, please take a moment to check out their products — they're awesome!" | ||
| 96 | ], [ | 93 | ], [ |
| 97 | "2015-07-05", | 94 | "2015-07-05", |
| 98 | "New documentations: <a href=\"/drupal/\">Drupal</a>, <a href=\"/vue/\">Vue.js</a>, <a href=\"/phaser/\">Phaser</a> and <a href=\"/webpack/\">webpack</a>" | 95 | "New documentations: <a href=\"/drupal/\">Drupal</a>, <a href=\"/vue/\">Vue.js</a>, <a href=\"/phaser/\">Phaser</a> and <a href=\"/webpack/\">webpack</a>" |
| @@ -42,8 +42,6 @@ app.templates.offlinePage = (docs) -> """ · 41 unmodified lines | |||
| 42 | canICloseTheTab = -> | 42 | canICloseTheTab = -> |
| 43 | if app.AppCache.isEnabled() | 43 | if app.AppCache.isEnabled() |
| 44 | """ Yes! Even offline, you can open a new tab, go to <a href="//devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """ | 44 | """ Yes! Even offline, you can open a new tab, go to <a href="//devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """ |
| 45 | else if app.mozApp | ||
| 46 | """ Yes! Even offline, you can open the app and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """ | ||
| 47 | else | 45 | else |
| 48 | """ No. AppCache isn't available in your browser (or is disabled) so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br> | 46 | """ No. AppCache isn't available in your browser (or is disabled) so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br> |
| 49 | The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """ | 47 | The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """ |