editor.jade 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. extends ../layout
  2. block vars
  3. - var suppressNavbar = true
  4. - var suppressFooter = true
  5. - var suppressDefaultJs = true
  6. block scripts
  7. //- Only use the native bootstrap on the editor page,
  8. //- since we use the Angular-based bootstrap elsewhere.
  9. script(src=jsPath+'libs/bootstrap-3.1.1.js')
  10. script(src=jsPath+'libs/jquery-layout.js')
  11. script(src=jsPath+'libs/jquery.storage.js')
  12. block content
  13. .editor(ng-controller="IdeController")
  14. .loading-screen(ng-show="state.loading")
  15. .container
  16. h3 Loading...
  17. .progress
  18. .progress-bar(ng-style="{'width': state.load_progress + '%'}")
  19. .global-alerts(ng-cloak)
  20. .alert.alert-danger.small(ng-if="connection.forced_disconnect")
  21. strong Disconnected
  22. | Please refresh the page to continue.
  23. .alert.alert-warning.small(ng-if="connection.reconnection_countdown")
  24. strong Lost Connection.
  25. | Reconnecting in {{ connection.reconnection_countdown }} secs.
  26. a.pull-right(href, ng-click="tryReconnectNow()") Try Now
  27. .alert.alert-warning.small(ng-if="connection.reconnecting")
  28. strong Reconnecting...
  29. include ./editor/left-menu
  30. include ./editor/header
  31. #ide-body(ng-cloak, layout="main", ng-hide="state.loading")
  32. .ui-layout-west
  33. include ./editor/file-tree
  34. .ui-layout-center
  35. include ./editor/editor
  36. include ./editor/track-changes
  37. //- #loadingScreen
  38. //- h3 Loading...
  39. //- p#loadingMessage Loading editor
  40. //- #errorMessages
  41. //- #connectionLostMessage(style="display: none;")
  42. //- | Lost connection.
  43. //- span#trying-reconnect
  44. //- | Reconnecting in
  45. //- span#reconnection-countdown ?
  46. //- | seconds.
  47. //- a(href='#')#try-reconnect-now Try now.
  48. //- span#reconnecting
  49. //- | Reconnecting...
  50. //- #savingProblems(style="display: none")
  51. //- | Saving...
  52. //- div#toolbar.sidebar-navigation
  53. //- ul#tabs
  54. //- #toolbar-footer
  55. //- #tab-content.tab-content
  56. //- include ../templates
  57. //- include ../templates/dropbox
  58. script(src='/socket.io/socket.io.js')
  59. script(type='text/javascript').
  60. window.project_id = "!{project_id}"
  61. window.sharelatex = !{sharelatexObject};
  62. window.userSettings = !{userSettingsObject};
  63. window.user = !{userObject};
  64. window.csrfToken = "!{csrfToken}";
  65. window.requirejs = {
  66. "paths" : {
  67. "underscore": "../libs/underscore-1.3.3",
  68. "mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML",
  69. "moment": "libs/moment-2.4.0",
  70. "ace": "#{jsPath}ace",
  71. "libs": "#{jsPath}libs",
  72. "text": "#{jsPath}text"
  73. },
  74. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}",
  75. "waitSeconds": 0,
  76. "shim": {
  77. "libs/backbone": {
  78. deps: ["libs/underscore-1.3.3"]
  79. },
  80. "libs/pdfListView/PdfListView": {
  81. deps: ["libs/pdf"]
  82. },
  83. "libs/pdf": {
  84. deps: ["libs/compatibility"]
  85. }
  86. }
  87. };
  88. script(type='text/javascript').
  89. ga('send', 'event', 'editor-interaction', 'editor-opened')
  90. - locals.suppressDefaultJs = true
  91. - var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js')
  92. - var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath
  93. script(type='text/javascript').
  94. window.sharelatex.pdfJsWorkerPath = "#{pdfJsWorkerPath}"
  95. script(
  96. data-main=jsPath+'app/ide.js',
  97. baseurl=jsPath,
  98. data-ace-base=jsPath+'ace',
  99. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  100. )
  101. - if (!anonymous)
  102. script(type="text/javascript").
  103. var chatReq = require.config({
  104. context: "chat",
  105. baseUrl: "#{chatUrl}/chat"
  106. });
  107. chatReq(["require", "chat"], function(require, Chat) {
  108. new Chat({
  109. room: {
  110. project_id: window.userSettings.project_id
  111. },
  112. url: "#{chatUrl}"
  113. })
  114. });