editor.jade 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. div.full-size(
  2. ng-show="ui.view == 'editor'"
  3. layout="pdf"
  4. layout-disabled="ui.pdfLayout != 'sideBySide'"
  5. mask-iframes-on-resize="true"
  6. resize-on="layout:main:resize"
  7. resize-proportionally="true"
  8. initial-size-east="'50%'"
  9. minimum-restore-size-east="300"
  10. )
  11. .ui-layout-center(ng-controller="ReviewPanelController", ng-class="{'has-review-panel': ui.reviewPanelOpen}")
  12. .loading-panel(ng-show="!editor.sharejs_doc || editor.opening")
  13. span(ng-show="editor.open_doc_id")
  14. i.fa.fa-spin.fa-refresh
  15. |   #{translate("loading")}...
  16. span(ng-show="!editor.open_doc_id")
  17. i.fa.fa-arrow-left
  18. |   #{translate("open_a_file_on_the_left")}
  19. #editor(
  20. ace-editor="editor",
  21. ng-show="!!editor.sharejs_doc && !editor.opening"
  22. theme="settings.theme",
  23. keybindings="settings.mode",
  24. font-size="settings.fontSize",
  25. auto-complete="settings.autoComplete",
  26. spell-check="!anonymous",
  27. spell-check-language="project.spellCheckLanguage",
  28. highlights="onlineUserCursorHighlights[editor.open_doc_id]"
  29. show-print-margin="false",
  30. sharejs-doc="editor.sharejs_doc",
  31. last-updated="editor.last_updated",
  32. cursor-position="editor.cursorPosition",
  33. goto-line="editor.gotoLine",
  34. resize-on="layout:main:resize,layout:pdf:resize,layout:review:resize,reviewPanel:toggle",
  35. annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
  36. read-only="!permissions.write",
  37. file-name="editor.open_doc_name",
  38. on-ctrl-enter="recompileViaKey",
  39. syntax-validation="settings.syntaxValidation",
  40. review-panel="reviewPanel",
  41. on-scroll="onScroll",
  42. scroll-events="scrollEvents",
  43. track-changes-enabled="trackChangesFeatureFlag"
  44. track-new-changes= "reviewPanel.trackNewChanges"
  45. )
  46. #review-panel
  47. .review-panel-toolbar
  48. | Track Changes
  49. input(type="checkbox", ng-model="reviewPanel.trackNewChanges")
  50. .review-panel-scroller
  51. .rp-entry-list(review-panel-sorted)
  52. .rp-entry-wrapper(
  53. ng-repeat="(entry_id, entry) in reviewPanel.entries"
  54. )
  55. .rp-entry-callout(
  56. ng-class="'rp-entry-callout-' + entry.type"
  57. style="top: {{ entry.screenPos.y + 15 }}px; height: {{ top - entry.screenPos.y }}px"
  58. )
  59. .rp-entry(
  60. ng-class="'rp-entry-' + entry.type"
  61. ng-style="{'top': top}"
  62. )
  63. div(ng-if="entry.type == 'insert' || entry.type == 'delete'")
  64. .rp-entry-header
  65. .rp-entry-action-icon(ng-switch="entry.type")
  66. i.fa.fa-pencil(ng-switch-when="insert")
  67. i.rp-icon-delete(ng-switch-when="delete")
  68. .rp-entry-metadata
  69. {{ users[entry.metadata.user_id].name }} {{ entry.metadata.ts }}
  70. .rp-entry-avatar(style="background-color: hsl({{ users[entry.metadata.user_id].hue }}, 70%, 50%);") {{ users[entry.metadata.user_id].avatar_text }}
  71. .rp-entry-body
  72. {{ entry.content }}
  73. .rp-entry-actions
  74. a(href, ng-click="acceptChange(entry_id)") Accept
  75. a(href, ng-click="rejectChange(entry_id)") Reject
  76. div(ng-if="entry.type == 'comment'")
  77. div(ng-repeat="comment in entry.thread", class="comment-thread__comment")
  78. div.small(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 50%)") {{ users[comment.user_id].name }}
  79. div.small {{ comment.ts }}
  80. | {{ comment.content }}
  81. div(ng-if="entry.replying")
  82. textarea(ng-model="entry.replyContent")
  83. a.btn.btn-sm.btn-primary(href, ng-click="submitReply(entry)") Submit
  84. a(href, ng-click="cancelReply(entry)") X
  85. a.btn.btn-sm.btn-primary(href, ng-click="startReply(entry)", ng-if="!entry.replying") Reply
  86. div(ng-if="entry.type == 'focus-position'")
  87. a.btn.btn-sm(href, ng-if="!commentState.adding", ng-click="startNewComment()") Add comment
  88. div(ng-if="commentState.adding")
  89. textarea(ng-model="commentState.content")
  90. a.btn.btn-sm.btn-primary(href, ng-click="submitNewComment()") Submit
  91. a(href, ng-click="cancelNewComment()") X
  92. .ui-layout-east
  93. div(ng-if="ui.pdfLayout == 'sideBySide'")
  94. include ./pdf
  95. .ui-layout-resizer-controls.synctex-controls(
  96. ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'"
  97. ng-controller="PdfSynctexController"
  98. )
  99. a.btn.btn-default.btn-xs(
  100. tooltip="#{translate('go_to_code_location_in_pdf')}"
  101. tooltip-placement="right"
  102. tooltip-append-to-body="true"
  103. ng-click="syncToPdf()"
  104. )
  105. i.fa.fa-long-arrow-right
  106. br
  107. a.btn.btn-default.btn-xs(
  108. tooltip-html="'#{translate('go_to_pdf_location_in_code')}'"
  109. tooltip-placement="right"
  110. tooltip-append-to-body="true"
  111. ng-click="syncToCode()"
  112. )
  113. i.fa.fa-long-arrow-left
  114. div.full-size(
  115. ng-if="ui.pdfLayout == 'flat'"
  116. ng-show="ui.view == 'pdf'"
  117. )
  118. include ./pdf