From 88ba685441f1da0630d52c0c62872e3953853072 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 26 Feb 2017 10:06:20 -0500 Subject: [PATCH] Remove legacy code --- assets/javascripts/app/app.coffee | 10 ++-------- assets/javascripts/app/settings.coffee | 15 +-------------- assets/javascripts/news.json | 3 --- .../templates/pages/offline_tmpl.coffee | 2 -- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index 427e31e0..50190069 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -15,7 +15,7 @@ @el = $('._app') @localStorage = new LocalStorageStore @appCache = new app.AppCache if app.AppCache.isEnabled() - @settings = new app.Settings @localStorage + @settings = new app.Settings @db = new app.DB() @docs = new app.collections.Docs @@ -106,7 +106,6 @@ @hideLoading() @welcomeBack() unless @doc @removeEvent 'ready bootError' - try navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true catch return initDoc: (doc) -> @@ -117,12 +116,7 @@ migrateDocs: -> for slug in @settings.getDocs() when not @docs.findBy('slug', slug) needsSaving = true - doc = @disabledDocs.findBy('slug', 'codeigniter~3') if slug == 'codeigniter~3.0' - doc = @disabledDocs.findBy('slug', 'node~4_lts') if slug == 'node~4.2_lts' - doc = @disabledDocs.findBy('slug', 'xslt_xpath') if slug == 'xpath' - doc = @disabledDocs.findBy('slug', 'angular~2_typescript') if slug == 'angular~2.0_typescript' - doc = @disabledDocs.findBy('slug', "angularjs~#{match[1]}") if match = /^angular~(1\.\d)$/.exec(slug) - doc ||= @disabledDocs.findBy('slug_without_version', slug) + doc = @disabledDocs.findBy('slug_without_version', slug) if doc @disabledDocs.remove(doc) @docs.add(doc) diff --git a/assets/javascripts/app/settings.coffee b/assets/javascripts/app/settings.coffee index 96f923bd..ec651b32 100644 --- a/assets/javascripts/app/settings.coffee +++ b/assets/javascripts/app/settings.coffee @@ -13,21 +13,8 @@ class app.Settings manualUpdate: false schema: 1 - constructor: (legacyStore) -> + constructor: -> @store = new CookieStore - @importLegacyValues(legacyStore) - - importLegacyValues: (legacyStore) -> - return unless settings = legacyStore.get('settings') - for key, value of settings - if key == 'autoUpdate' - key = 'manualUpdate' - value = !value - else if key == 'tips' - value = value.join('/') - @store.set(key, value) - legacyStore.del('settings') - return set: (key, value) -> @store.set(key, value) diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index a67185d7..e28e6f25 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -90,9 +90,6 @@ "2015-07-26", "Added search abbreviations (e.g. $ is an alias for jQuery).\nClick here to see the full list. Feel free to suggest more on GitHub.", "Added shift + ↓/↑ shortcut for scrolling (same as alt + ↓/↑)." - ], [ - "2015-07-12", - "New sponsors: JetBrains and Code School\nIf you like DevDocs, please take a moment to check out their products — they're awesome!" ], [ "2015-07-05", "New documentations: Drupal, Vue.js, Phaser and webpack" diff --git a/assets/javascripts/templates/pages/offline_tmpl.coffee b/assets/javascripts/templates/pages/offline_tmpl.coffee index d60d9968..752031d2 100644 --- a/assets/javascripts/templates/pages/offline_tmpl.coffee +++ b/assets/javascripts/templates/pages/offline_tmpl.coffee @@ -42,8 +42,6 @@ app.templates.offlinePage = (docs) -> """ canICloseTheTab = -> if app.AppCache.isEnabled() """ Yes! Even offline, you can open a new tab, go to devdocs.io, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """ - else if app.mozApp - """ 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). """ else """ No. AppCache isn't available in your browser (or is disabled) so loading devdocs.io offline won't work.
The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """