editor.jade 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. include ./editor/share
  32. #ide-body(ng-cloak, layout="main", ng-hide="state.loading")
  33. .ui-layout-west
  34. include ./editor/file-tree
  35. .ui-layout-center
  36. include ./editor/editor
  37. include ./editor/track-changes
  38. script(src='/socket.io/socket.io.js')
  39. script(type='text/javascript').
  40. window.project_id = "!{project_id}"
  41. window.sharelatex = !{sharelatexObject};
  42. window.userSettings = !{userSettingsObject};
  43. window.user = !{userObject};
  44. window.csrfToken = "!{csrfToken}";
  45. window.requirejs = {
  46. "paths" : {
  47. "underscore": "../libs/underscore-1.3.3",
  48. "mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML",
  49. "moment": "libs/moment-2.4.0",
  50. "ace": "#{jsPath}ace",
  51. "libs": "#{jsPath}libs",
  52. "text": "#{jsPath}text"
  53. },
  54. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}",
  55. "waitSeconds": 0,
  56. "shim": {
  57. "libs/backbone": {
  58. deps: ["libs/underscore-1.3.3"]
  59. },
  60. "libs/pdfListView/PdfListView": {
  61. deps: ["libs/pdf"]
  62. },
  63. "libs/pdf": {
  64. deps: ["libs/compatibility"]
  65. }
  66. }
  67. };
  68. script(type='text/javascript').
  69. ga('send', 'event', 'editor-interaction', 'editor-opened')
  70. - locals.suppressDefaultJs = true
  71. - var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js')
  72. - var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath
  73. script(type='text/javascript').
  74. window.sharelatex.pdfJsWorkerPath = "#{pdfJsWorkerPath}"
  75. script(
  76. data-main=jsPath+'app/ide.js',
  77. baseurl=jsPath,
  78. data-ace-base=jsPath+'ace',
  79. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  80. )
  81. - if (!anonymous)
  82. script(type="text/javascript").
  83. var chatReq = require.config({
  84. context: "chat",
  85. baseUrl: "#{chatUrl}/chat"
  86. });
  87. chatReq(["require", "chat"], function(require, Chat) {
  88. new Chat({
  89. room: {
  90. project_id: window.userSettings.project_id
  91. },
  92. url: "#{chatUrl}"
  93. })
  94. });