editor.pug 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. extends ../layout
  2. block vars
  3. - var suppressNavbar = true
  4. - var suppressFooter = true
  5. - var suppressSkipToContent = true
  6. - metadata.robotsNoindexNofollow = true
  7. block css
  8. each file in entrypointStyles('ide')
  9. link(rel='stylesheet', href=file)
  10. block content
  11. .editor(ng-controller="IdeController").full-size
  12. //- required by react2angular-shared-context, must be rendered as a top level component
  13. shared-context-react()
  14. .loading-screen(ng-if="state.loading")
  15. .loading-screen-brand-container
  16. .loading-screen-brand(
  17. style="height: 20%;"
  18. ng-style="{ 'height': state.load_progress + '%' }"
  19. )
  20. h3.loading-screen-label(ng-if="!state.error") #{translate("loading")}
  21. span.loading-screen-ellip .
  22. span.loading-screen-ellip .
  23. span.loading-screen-ellip .
  24. p.loading-screen-error(ng-if="state.error").ng-cloak
  25. span(ng-bind-html="state.error")
  26. .global-alerts(ng-cloak ng-hide="editor.error_state")
  27. .alert.alert-danger.small(ng-if="connection.forced_disconnect")
  28. strong #{translate("disconnected")}
  29. .alert.alert-warning.small(ng-if="connection.reconnection_countdown")
  30. strong #{translate("lost_connection")}.
  31. | #{translate("reconnecting_in_x_secs", {seconds:"{{ connection.reconnection_countdown }}"})}.
  32. a#try-reconnect-now-button.alert-link-as-btn.pull-right(href, ng-click="tryReconnectNow()") #{translate("try_now")}
  33. .alert.alert-warning.small(ng-if="connection.reconnecting && connection.stillReconnecting")
  34. strong #{translate("reconnecting")}…
  35. .alert.alert-warning.small(ng-if="sync_tex_error")
  36. strong #{translate("synctex_failed")}.
  37. a#synctex-more-info-button.alert-link-as-btn.pull-right(
  38. href="/learn/how-to/SyncTeX_Errors"
  39. target="_blank"
  40. ) #{translate("more_info")}
  41. .alert.alert-warning.small(ng-if="connection.inactive_disconnect")
  42. strong #{translate("editor_disconected_click_to_reconnect")}
  43. .alert.alert-warning.small(ng-if="connection.debug") {{ connection.state }}
  44. .div(ng-controller="SavingNotificationController")
  45. .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 }}"})}
  46. .div(ng-controller="SystemMessagesController")
  47. .alert.alert-warning.system-message(
  48. ng-repeat="message in messages"
  49. ng-controller="SystemMessageController"
  50. ng-hide="hidden"
  51. )
  52. button(ng-hide="protected",ng-click="hide()").close.pull-right
  53. span(aria-hidden="true") ×
  54. span.sr-only #{translate("close")}
  55. .system-message-content(ng-bind-html="htmlContent")
  56. include ./editor/left-menu
  57. #chat-wrapper.full-size(
  58. layout="chat",
  59. spacing-open="{{ui.chatResizerSizeOpen}}",
  60. spacing-closed="{{ui.chatResizerSizeClosed}}",
  61. initial-size-east="250",
  62. init-closed-east="true",
  63. open-east="ui.chatOpen",
  64. ng-hide="state.loading",
  65. ng-cloak
  66. )
  67. .ui-layout-center
  68. if showNewNavigationUI
  69. include ./editor/header-react
  70. else
  71. include ./editor/header
  72. != moduleIncludes("publish:body", locals)
  73. include ./editor/history/toolbarV2.pug
  74. main#ide-body(
  75. ng-cloak,
  76. role="main",
  77. ng-class="{ 'ide-history-open' : (ui.view == 'history' && history.isV2) }",
  78. layout="main",
  79. ng-hide="state.loading",
  80. resize-on="layout:chat:resize,history:toggle,layout:flat-screen:toggle",
  81. minimum-restore-size-west="130"
  82. custom-toggler-pane=hasFeature('custom-togglers') ? "west" : false
  83. custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_filetree") : false
  84. custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_filetree") : false
  85. ng-keydown="handleKeyDown($event)"
  86. tabindex="0"
  87. )
  88. .ui-layout-west
  89. include ./editor/file-tree-react
  90. include ./editor/file-tree-history
  91. include ./editor/history/fileTreeV2
  92. .ui-layout-center
  93. include ./editor/editor
  94. include ./editor/file-view
  95. include ./editor/history
  96. if !isRestrictedTokenMember
  97. .ui-layout-east
  98. aside.chat(
  99. ng-controller="ReactChatController"
  100. )
  101. chat()
  102. script(type="text/ng-template", id="genericMessageModalTemplate")
  103. .modal-header
  104. button.close(
  105. type="button"
  106. data-dismiss="modal"
  107. ng-click="done()"
  108. aria-label="Close"
  109. )
  110. span(aria-hidden="true") ×
  111. h3 {{ title }}
  112. .modal-body(ng-bind-html="message")
  113. .modal-footer
  114. button.btn.btn-info(ng-click="done()") #{translate("ok")}
  115. script(type="text/ng-template", id="outOfSyncModalTemplate")
  116. .modal-header
  117. button.close(
  118. type="button"
  119. data-dismiss="modal"
  120. ng-click="done()"
  121. aria-label="Close"
  122. )
  123. span(aria-hidden="true") ×
  124. h3 {{ title }}
  125. .modal-body(ng-bind-html="message")
  126. .modal-body
  127. button.btn.btn-info(
  128. ng-init="showFileContents = false"
  129. ng-click="showFileContents = !showFileContents"
  130. )
  131. | {{showFileContents ? "Hide" : "Show"}} Local File Contents
  132. .text-preview(ng-show="showFileContents")
  133. textarea.scroll-container(readonly="readonly" rows="{{editorContentRows}}")
  134. | {{editorContent}}
  135. .modal-footer
  136. button.btn.btn-info(ng-click="done()") #{translate("reload_editor")}
  137. script(type="text/ng-template", id="lockEditorModalTemplate")
  138. .modal-header
  139. h3 {{ title }}
  140. .modal-body(ng-bind-html="message")
  141. block append meta
  142. meta(name="ol-useV2History" data-type="boolean" content=useV2History)
  143. meta(name="ol-project_id" content=project_id)
  144. meta(name="ol-userSettings" data-type="json" content=userSettings)
  145. meta(name="ol-user" data-type="json" content=user)
  146. meta(name="ol-anonymous" data-type="boolean" content=anonymous)
  147. meta(name="ol-brandVariation" data-type="json" content=brandVariation)
  148. meta(name="ol-anonymousAccessToken" content=anonymousAccessToken)
  149. meta(name="ol-isTokenMember" data-type="boolean" content=isTokenMember)
  150. meta(name="ol-isRestrictedTokenMember" data-type="boolean" content=isRestrictedTokenMember)
  151. meta(name="ol-maxDocLength" data-type="json" content=maxDocLength)
  152. meta(name="ol-wikiEnabled" data-type="boolean" content=!!(settings.apis.wiki && settings.apis.wiki.url))
  153. meta(name="ol-gitBridgePublicBaseUrl" content=gitBridgePublicBaseUrl)
  154. //- Set base path for Ace scripts loaded on demand/workers and don't use cdn
  155. meta(name="ol-aceBasePath" content="/js/" + lib('ace'))
  156. //- Set path for PDFjs CMaps and images
  157. meta(name="ol-pdfCMapsPath" content="/js/cmaps/")
  158. meta(name="ol-pdfImageResourcesPath" content="/images/")
  159. //- enable doc hash checking for all projects
  160. //- used in public/js/libs/sharejs.js
  161. meta(name="ol-useShareJsHash" data-type="boolean" content=true)
  162. meta(name="ol-wsRetryHandshake" data-type="json" content=settings.wsRetryHandshake)
  163. meta(name="ol-showNewLogsUI" data-type="boolean" content=showNewLogsUI)
  164. meta(name="ol-logsUISubvariant" content=logsUISubvariant)
  165. meta(name="ol-showSymbolPalette" data-type="boolean" content=showSymbolPalette)
  166. meta(name="ol-enablePdfCaching" data-type="boolean" content=enablePdfCaching)
  167. meta(name="ol-trackPdfDownload" data-type="boolean" content=trackPdfDownload)
  168. meta(name="ol-resetServiceWorker" data-type="boolean" content=resetServiceWorker)
  169. - var fileActionI18n = ['edited', 'renamed', 'created', 'deleted'].reduce((acc, i) => {acc[i] = translate('file_action_' + i); return acc}, {})
  170. meta(name="ol-fileActionI18n" data-type="json" content=fileActionI18n)
  171. if (settings.overleaf != null)
  172. meta(name="ol-overallThemes" data-type="json" content=overallThemes)
  173. block foot-scripts
  174. script(type="text/javascript", nonce=scriptNonce, src=(wsUrl || '/socket.io') + '/socket.io.js')
  175. script(type="text/javascript", nonce=scriptNonce, src=mathJaxPath)
  176. each file in entrypointScripts("ide")
  177. script(type="text/javascript", nonce=scriptNonce, src=file)