History

Remove legacy code

Thibaut Courouble committed 9 years ago

Commit 88ba6851 parent e94af974 files · +3 −27Browse files

Unified · Split

4 files
  1. assets/javascripts/app/app.coffee +2 −8
  2. assets/javascripts/app/settings.coffee +1 −14
  3. assets/javascripts/news.json +0 −3
  4. assets/javascripts/templates/pages/offline_tmpl.coffee +0 −2
assets/javascripts/app/app.coffee+2−8
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 @el = $('._app')
1616 @localStorage = new LocalStorageStore
1717 @appCache = new app.AppCache if app.AppCache.isEnabled()
18− @settings = new app.Settings @localStorage
18+ @settings = new app.Settings
1919 @db = new app.DB()
2020
2121 @docs = new app.collections.Docs
@@ -106,7 +106,6 @@ · 84 unmodified lines
106106 @hideLoading()
107107 @welcomeBack() unless @doc
108108 @removeEvent 'ready bootError'
109− try navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true catch
110109 return
111110
112111 initDoc: (doc) ->
@@ -117,12 +116,7 @@ · 4 unmodified lines
117116 migrateDocs: ->
118117 for slug in @settings.getDocs() when not @docs.findBy('slug', slug)
119118 needsSaving = true
120− doc = @disabledDocs.findBy('slug', 'codeigniter~3') if slug == 'codeigniter~3.0'
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)
119+ doc = @disabledDocs.findBy('slug_without_version', slug)
126120 if doc
127121 @disabledDocs.remove(doc)
128122 @docs.add(doc)
assets/javascripts/app/settings.coffee+1−14
@@ -13,21 +13,8 @@ class app.Settings · 12 unmodified lines
1313 manualUpdate: false
1414 schema: 1
1515
16− constructor: (legacyStore) ->
16+ constructor: ->
1717 @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
3118
3219 set: (key, value) ->
3320 @store.set(key, value)
assets/javascripts/news.json+0−3
@@ -90,9 +90,6 @@ · 89 unmodified lines
9090 "2015-07-26",
9191 "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>.",
9292 "Added <code class=\"_label\">shift + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</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!"
9693 ], [
9794 "2015-07-05",
9895 "New documentations: <a href=\"/drupal/\">Drupal</a>, <a href=\"/vue/\">Vue.js</a>, <a href=\"/phaser/\">Phaser</a> and <a href=\"/webpack/\">webpack</a>"
assets/javascripts/templates/pages/offline_tmpl.coffee+0−2
@@ -42,8 +42,6 @@ app.templates.offlinePage = (docs) -> """ · 41 unmodified lines
4242 canICloseTheTab = ->
4343 if app.AppCache.isEnabled()
4444 """ 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). """
4745 else
4846 """ 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>
4947 The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """