mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Remove legacy code
This commit is contained in:
parent
e94af979d9
commit
88ba685441
4 changed files with 3 additions and 27 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -90,9 +90,6 @@
|
|||
"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 <code class=\"_label\">shift + ↓/↑</code> shortcut for scrolling (same as <code class=\"_label\">alt + ↓/↑</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",
|
||||
"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 = ->
|
||||
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). """
|
||||
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 <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). """
|
||||
|
|
Loading…
Reference in a new issue