editor.jade 4.0 KB

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