editor.jade 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. extends ../layout
  2. block content
  3. #loadingScreen
  4. h3 Loading...
  5. p#loadingMessage Loading editor
  6. #errorMessages
  7. #connectionLostMessage(style="display: none;")
  8. | Lost connection.
  9. span#trying-reconnect
  10. | Reconnecting in
  11. span#reconnection-countdown ?
  12. | seconds.
  13. a(href='#')#try-reconnect-now Try now.
  14. span#reconnecting
  15. | Reconnecting...
  16. #savingProblems(style="display: none")
  17. | Saving...
  18. div#toolbar.sidebar-navigation
  19. ul#tabs
  20. #toolbar-footer
  21. #tab-content.tab-content
  22. include ../templates
  23. include ../templates/dropbox
  24. script(src='/socket.io/socket.io.js')
  25. script(type='text/javascript')
  26. window.sharelatex = !{sharelatexObject};
  27. window.userSettings = !{userSettingsObject};
  28. window.user = !{userObject};
  29. window.csrfToken = "!{csrfToken}";
  30. window.requirejs = {
  31. "paths" : {
  32. "underscore": "libs/underscore",
  33. "mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"
  34. },
  35. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}",
  36. "waitSeconds": 0,
  37. "shim": {
  38. "libs/backbone": {
  39. deps: ["libs/underscore"]
  40. },
  41. "libs/pdfListView/PdfListView": {
  42. deps: ["libs/pdf"]
  43. },
  44. "libs/pdf": {
  45. deps: ["libs/compatibility"]
  46. }
  47. }
  48. };
  49. script(type='text/javascript')
  50. if (typeof(mixpanel) != "undefined") {
  51. mixpanel.track('Opened Editor', { project_id: window.userSettings.project_id });
  52. }
  53. - locals.supressDefaultJs = true
  54. - var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js')
  55. - var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath
  56. script
  57. window.sharelatex.pdfJsWorkerPath = "#{pdfJsWorkerPath}"
  58. script(
  59. data-main=jsPath+'ide.js',
  60. baseurl=jsPath,
  61. data-ace-base=jsPath+'ace',
  62. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  63. )
  64. - if (!anonymous)
  65. script(type="text/javascript")
  66. var chatReq = require.config({
  67. context: "chat",
  68. baseUrl: "#{chatUrl}/chat"
  69. });
  70. chatReq(["require", "chat"], function(require, Chat) {
  71. new Chat({
  72. room: {
  73. project_id: window.userSettings.project_id
  74. },
  75. url: "#{chatUrl}"
  76. })
  77. });