Remove legacy code

pull/570/merge
Thibaut Courouble 8 years ago
parent e94af979d9
commit 88ba685441

@ -15,7 +15,7 @@
@el = $('._app') @el = $('._app')
@localStorage = new LocalStorageStore @localStorage = new LocalStorageStore
@appCache = new app.AppCache if app.AppCache.isEnabled() @appCache = new app.AppCache if app.AppCache.isEnabled()
@settings = new app.Settings @localStorage @settings = new app.Settings
@db = new app.DB() @db = new app.DB()
@docs = new app.collections.Docs @docs = new app.collections.Docs
@ -106,7 +106,6 @@
@hideLoading() @hideLoading()
@welcomeBack() unless @doc @welcomeBack() unless @doc
@removeEvent 'ready bootError' @removeEvent 'ready bootError'
try navigator.mozApps?.getSelf().onsuccess = -> app.mozApp = true catch
return return
initDoc: (doc) -> initDoc: (doc) ->
@ -117,12 +116,7 @@
migrateDocs: -> migrateDocs: ->
for slug in @settings.getDocs() when not @docs.findBy('slug', slug) for slug in @settings.getDocs() when not @docs.findBy('slug', slug)
needsSaving = true needsSaving = true
doc = @disabledDocs.findBy('slug', 'codeigniter~3') if slug == 'codeigniter~3.0' doc = @disabledDocs.findBy('slug_without_version', slug)
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)
if doc if doc
@disabledDocs.remove(doc) @disabledDocs.remove(doc)
@docs.add(doc) @docs.add(doc)

@ -13,21 +13,8 @@ class app.Settings
manualUpdate: false manualUpdate: false
schema: 1 schema: 1
constructor: (legacyStore) -> constructor: ->
@store = new CookieStore @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) -> set: (key, value) ->
@store.set(key, value) @store.set(key, value)

@ -90,9 +90,6 @@
"2015-07-26", "2015-07-26",
"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>.", "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>.",
"Added <code class=\"_label\">shift + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</code>)." "Added <code class=\"_label\">shift + &darr;/&uarr;</code> shortcut for scrolling (same as <code class=\"_label\">alt + &darr;/&uarr;</code>)."
], [
"2015-07-12",
"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!"
], [ ], [
"2015-07-05", "2015-07-05",
"New documentations: <a href=\"/drupal/\">Drupal</a>, <a href=\"/vue/\">Vue.js</a>, <a href=\"/phaser/\">Phaser</a> and <a href=\"/webpack/\">webpack</a>" "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) -> """
canICloseTheTab = -> canICloseTheTab = ->
if app.AppCache.isEnabled() if app.AppCache.isEnabled()
""" 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). """ """ 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). """
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 else
""" 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> """ 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>
The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """ The current tab will continue to work, though (provided you installed all the documentations you want to use beforehand). """

Loading…
Cancel
Save