editor.jade 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 {{ state.error }}
  15. .global-alerts(ng-cloak)
  16. .alert.alert-danger.small(ng-if="connection.forced_disconnect")
  17. strong #{translate("disconnected")}
  18. | #{translate("please_refresh")}
  19. .alert.alert-warning.small(ng-if="connection.reconnection_countdown")
  20. strong #{translate("lost_connection")}.
  21. | #{translate("reconnecting_in_x_secs", {seconds:"{{ connection.reconnection_countdown }}"})}.
  22. a.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")}
  23. .alert.alert-warning.small(ng-if="connection.reconnecting")
  24. strong #{translate("reconnecting")}...
  25. .div(ng-controller="SavingNotificationController")
  26. .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 }}"})}
  27. include ./editor/left-menu
  28. #chat-wrapper(
  29. layout="chat",
  30. spacing-open="12",
  31. spacing-closed="0",
  32. initial-size-east="250",
  33. init-closed-east="true",
  34. open-east="ui.chatOpen",
  35. ng-hide="state.loading",
  36. ng-cloak
  37. )
  38. .ui-layout-center
  39. include ./editor/header
  40. include ./editor/share
  41. #ide-body(ng-cloak, layout="main", ng-hide="state.loading", resize-on="layout:chat:resize")
  42. .ui-layout-west
  43. include ./editor/file-tree
  44. .ui-layout-center
  45. include ./editor/editor
  46. include ./editor/binary-file
  47. include ./editor/track-changes
  48. include ./editor/publish-template
  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": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML",
  75. "moment": "libs/moment-2.7.0",
  76. "libs/pdf": "libs/pdfjs-1.0.1040/pdf"
  77. },
  78. "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
  79. "waitSeconds": 0,
  80. "shim": {
  81. "libs/pdf": {
  82. deps: ["libs/pdfjs-1.0.1040/compatibility"]
  83. },
  84. "ace/ext-searchbox": {
  85. deps: ["ace/ace"]
  86. },
  87. "ace/ext-language_tools": {
  88. deps: ["ace/ace"]
  89. }
  90. },
  91. config:{
  92. moment:{
  93. noGlobal: true
  94. }
  95. }
  96. };
  97. window.aceFingerprint = "#{fingerprint(jsPath + 'ace/ace.js')}"
  98. script(type='text/javascript').
  99. ga('send', 'event', 'editor-interaction', 'editor-opened')
  100. - locals.suppressDefaultJs = true
  101. - var pdfPath = 'libs/pdfjs-1.0.1040/pdf.worker.js'
  102. - var fingerprintedPath = fingerprint(jsPath+pdfPath)
  103. - var pdfJsWorkerPath = jsPath+pdfPath+'?fingerprint='+fingerprintedPath
  104. script(type='text/javascript').
  105. window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
  106. script(
  107. data-main=jsPath+"ide.js",
  108. baseurl=jsPath,
  109. data-ace-base=jsPath+'ace',
  110. src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
  111. )