editor.jade 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. p.text-center.text-danger(ng-if="state.error").ng-cloak
  15. span(ng-bind-html="state.error")
  16. .global-alerts(ng-cloak)
  17. .alert.alert-danger.small(ng-if="connection.forced_disconnect")
  18. strong #{translate("disconnected")}
  19. | #{translate("please_refresh")}
  20. .alert.alert-warning.small(ng-if="connection.reconnection_countdown")
  21. strong #{translate("lost_connection")}.
  22. | #{translate("reconnecting_in_x_secs", {seconds:"{{ connection.reconnection_countdown }}"})}.
  23. a#try-reconnect-now-button.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")}
  24. .alert.alert-warning.small(ng-if="connection.reconnecting")
  25. strong #{translate("reconnecting")}...
  26. .alert.alert-warning.small(ng-if="connection.inactive_disconnect")
  27. strong #{translate("editor_disconected_click_to_reconnect")}
  28. .div(ng-controller="SavingNotificationController")
  29. .alert.alert-warning.small(ng-repeat="(doc_id, state) in docSavingStatus" ng-if="state.unsavedSeconds > 8") #{translate("saving_notification_with_seconds", {docname:"{{ state.doc.name }}", seconds:"{{ state.unsavedSeconds }}"})}
  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. .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(ng-bind-html="message")
  64. .modal-footer
  65. button.btn.btn-info(ng-click="done()") #{translate("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.maxDocLength = #{maxDocLength};
  76. window.requirejs = {
  77. "paths" : {
  78. "mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML",
  79. "moment": "libs/moment-2.7.0",
  80. "libs/pdf": "libs/pdfjs-1.0.1040/pdf"
  81. },
  82. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
  83. "waitSeconds": 0,
  84. "shim": {
  85. "libs/pdf": {
  86. deps: ["libs/pdfjs-1.0.1040/compatibility"]
  87. },
  88. "ace/ext-searchbox": {
  89. deps: ["ace/ace"]
  90. },
  91. "ace/ext-language_tools": {
  92. deps: ["ace/ace"]
  93. }
  94. },
  95. config:{
  96. moment:{
  97. noGlobal: true
  98. }
  99. }
  100. };
  101. window.aceFingerprint = "#{fingerprint(jsPath + 'ace/ace.js')}"
  102. - locals.suppressDefaultJs = true
  103. - var pdfPath = 'libs/pdfjs-1.0.1040/pdf.worker.js'
  104. - var fingerprintedPath = fingerprint(jsPath+pdfPath)
  105. - var pdfJsWorkerPath = jsPath+pdfPath+'?fingerprint='+fingerprintedPath
  106. script(type='text/javascript').
  107. window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
  108. script(
  109. data-main=jsPath+"ide.js",
  110. baseurl=jsPath,
  111. data-ace-base=jsPath+'ace',
  112. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  113. )