editor.jade 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. extends ../layout
  2. block vars
  3. - var suppressNavbar = true
  4. - var suppressFooter = true
  5. - var suppressDefaultJs = true
  6. - var suppressSystemMessages = true
  7. block content
  8. .editor(ng-controller="IdeController")
  9. .loading-screen(ng-show="state.loading")
  10. .container
  11. h3 Loading...
  12. .progress
  13. .progress-bar(style="width: 20%", ng-style="{'width': state.load_progress + '%'}")
  14. .global-alerts(ng-cloak)
  15. .alert.alert-danger.small(ng-if="connection.forced_disconnect")
  16. strong Disconnected
  17. | Please refresh the page to continue.
  18. .alert.alert-warning.small(ng-if="connection.reconnection_countdown")
  19. strong Lost Connection.
  20. | Reconnecting in {{ connection.reconnection_countdown }} secs.
  21. a.pull-right(href, ng-click="tryReconnectNow()") Try Now
  22. .alert.alert-warning.small(ng-if="connection.reconnecting")
  23. strong Reconnecting...
  24. .div(ng-controller="SavingNotificationController")
  25. .alert.alert-warning.small(
  26. ng-repeat="(doc_id, state) in docSavingStatus"
  27. ng-if="state.unsavedSeconds > 3"
  28. )
  29. | Saving {{ state.doc.name }}... ({{ state.unsavedSeconds }} seconds of unsaved changes)
  30. include ./editor/left-menu
  31. #chat-wrapper(
  32. layout="chat",
  33. spacing-open="12",
  34. spacing-closed="0",
  35. initial-size-east="250",
  36. init-closed-east="true",
  37. open-east="ui.chatOpen",
  38. ng-hide="state.loading",
  39. ng-cloak
  40. )
  41. .ui-layout-center
  42. include ./editor/header
  43. include ./editor/share
  44. #ide-body(ng-cloak, layout="main", ng-hide="state.loading", resize-on="layout:chat:resize")
  45. .ui-layout-west
  46. include ./editor/file-tree
  47. .ui-layout-center
  48. include ./editor/editor
  49. include ./editor/binary-file
  50. include ./editor/track-changes
  51. include ./editor/publish-template
  52. include ./editor/dropbox
  53. .ui-layout-east
  54. include ./editor/chat
  55. include ./editor/hotkeys
  56. script(type="text/ng-template", id="genericMessageModalTemplate")
  57. .modal-header
  58. button.close(
  59. type="button"
  60. data-dismiss="modal"
  61. ng-click="done()"
  62. ) ×
  63. h3 {{ title }}
  64. .modal-body {{ message }}
  65. .modal-footer
  66. button.btn.btn-info(ng-click="done()") OK
  67. script(src='/socket.io/socket.io.js')
  68. //- We need to do .replace(/\//g, '\\/') do that '</script>' -> '<\/script>'
  69. //- and doesn't prematurely end the script tag.
  70. script(type='text/javascript').
  71. window.project_id = "!{project_id}"
  72. window.userSettings = !{JSON.stringify(userSettings).replace(/\//g, '\\/')};
  73. window.user = !{JSON.stringify(user).replace(/\//g, '\\/')};
  74. window.csrfToken = "!{csrfToken}";
  75. window.anonymous = #{anonymous};
  76. window.requirejs = {
  77. "paths" : {
  78. "mathjax": "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML",
  79. "moment": "libs/moment-2.7.0"
  80. },
  81. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
  82. "waitSeconds": 0,
  83. "shim": {
  84. "libs/pdfListView/PdfListView": {
  85. deps: ["libs/pdf"]
  86. },
  87. "libs/pdf": {
  88. deps: ["libs/compatibility"]
  89. },
  90. "ace/ext-searchbox": {
  91. deps: ["ace/ace"]
  92. }
  93. }
  94. };
  95. window.aceFingerprint = "#{fingerprint(jsPath + 'ace/ace.js')}"
  96. script(type='text/javascript').
  97. ga('send', 'event', 'editor-interaction', 'editor-opened')
  98. - locals.suppressDefaultJs = true
  99. - var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js')
  100. - var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath
  101. script(type='text/javascript').
  102. window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
  103. script(
  104. data-main=jsPath+"ide.js",
  105. baseurl=jsPath,
  106. data-ace-base=jsPath+'ace',
  107. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  108. )