editor.jade 3.8 KB

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