settings_tmpl.coffee 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. app.templates.settingsPage = (settings) -> """
  2. <h1 class="_lined-heading">Preferences</h1>
  3. <div class="_settings-fieldset">
  4. <h2 class="_settings-legend">General:</h2>
  5. <div class="_settings-inputs">
  6. <label class="_settings-label">
  7. <input type="checkbox" form="settings" name="dark" value="1"#{if settings.dark then ' checked' else ''}>Enable dark theme
  8. </label>
  9. <label class="_settings-label _setting-max-width">
  10. <input type="checkbox" form="settings" name="layout" value="_max-width"#{if settings['_max-width'] then ' checked' else ''}>Enable fixed-width layout
  11. </label>
  12. <label class="_settings-label _hide-on-mobile">
  13. <input type="checkbox" form="settings" name="layout" value="_sidebar-hidden"#{if settings['_sidebar-hidden'] then ' checked' else ''}>Automatically hide and show the sidebar
  14. <small>Tip: drag the edge of the sidebar to resize it.</small>
  15. </label>
  16. <label class="_settings-label">
  17. <input type="checkbox" form="settings" name="autoInstall" value="_auto-install"#{if settings.autoInstall then ' checked' else ''}>Automatically download documentation for offline use
  18. <small>Only enable this when bandwidth isn't a concern to you.</small>
  19. </label>
  20. <label class="_settings-label _hide-in-development">
  21. <input type="checkbox" form="settings" name="analyticsConsent"#{if settings.analyticsConsent then ' checked' else ''}>Enable tracking cookies
  22. <small>With this checked, we enable Google Analytics and Gauges to collect anonymous traffic information.</small>
  23. </label>
  24. </div>
  25. </div>
  26. <div class="_settings-fieldset _hide-on-mobile">
  27. <h2 class="_settings-legend">Scrolling:</h2>
  28. <div class="_settings-inputs">
  29. <label class="_settings-label">
  30. <input type="checkbox" form="settings" name="smoothScroll" value="1"#{if settings.smoothScroll then ' checked' else ''}>Use smooth scrolling
  31. </label>
  32. <label class="_settings-label _setting-native-scrollbar">
  33. <input type="checkbox" form="settings" name="layout" value="_native-scrollbars"#{if settings['_native-scrollbars'] then ' checked' else ''}>Use native scrollbars
  34. </label>
  35. <label class="_settings-label">
  36. <input type="checkbox" form="settings" name="arrowScroll" value="1"#{if settings.arrowScroll then ' checked' else ''}>Use arrow keys to scroll the main content area
  37. <small>With this checked, use <code class="_label">alt</code> + <code class="_label">&uarr;</code><code class="_label">&darr;</code><code class="_label">&larr;</code><code class="_label">&rarr;</code> to navigate the sidebar.</small>
  38. </label>
  39. </div>
  40. </div>
  41. <p class="_hide-on-mobile">
  42. <button type="button" class="_btn" data-action="export">Export</button>
  43. <label class="_btn _file-btn"><input type="file" form="settings" name="import" accept=".json">Import</label>
  44. <p>
  45. <button type="button" class="_btn-link _reset-btn" data-behavior="reset">Reset all preferences and data</button>
  46. """