editor.jade 3.6 KB

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