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
15 @el = $('._app')15 @el = $('._app')
16 @localStorage = new LocalStorageStore16 @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 @localStorage18 @settings = new app.Settings
19 @db = new app.DB()19 @db = new app.DB()
20 20
21 @docs = new app.collections.Docs21 @docs = new app.collections.Docs
@@ -106,7 +106,6 @@ · 84 unmodified lines
106 @hideLoading()106 @hideLoading()
107 @welcomeBack() unless @doc107 @welcomeBack() unless @doc
108 @removeEvent 'ready bootError'108 @removeEvent 'ready bootError'
109 try navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true catch
110 return109 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 = true118 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 doc120 if doc
127 @disabledDocs.remove(doc)121 @disabledDocs.remove(doc)
128 @docs.add(doc)122 @docs.add(doc)
assets/javascripts/app/settings.coffee+1−14
@@ -13,21 +13,8 @@ class app.Settings · 12 unmodified lines
13 manualUpdate: false13 manualUpdate: false
14 schema: 114 schema: 1
15 15
16 constructor: (legacyStore) ->16 constructor: ->
17 @store = new CookieStore17 @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)
assets/javascripts/news.json+0−3
@@ -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 + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</code>)."92 "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!"
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>"
assets/javascripts/templates/pages/offline_tmpl.coffee+0−2
@@ -42,8 +42,6 @@ app.templates.offlinePage = (docs) -> """ · 41 unmodified lines
42canICloseTheTab = ->42canICloseTheTab = ->
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 else45 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). """