editor.jade 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. allow-overflow-on="'center'"
  11. )
  12. .ui-layout-center(ng-controller="ReviewPanelController", ng-class="{'has-review-panel': ui.reviewPanelOpen}")
  13. .loading-panel(ng-show="!editor.sharejs_doc || editor.opening")
  14. span(ng-show="editor.open_doc_id")
  15. i.fa.fa-spin.fa-refresh
  16. |   #{translate("loading")}...
  17. span(ng-show="!editor.open_doc_id")
  18. i.fa.fa-arrow-left
  19. |   #{translate("open_a_file_on_the_left")}
  20. #editor(
  21. ace-editor="editor",
  22. ng-show="!!editor.sharejs_doc && !editor.opening"
  23. theme="settings.theme",
  24. keybindings="settings.mode",
  25. font-size="settings.fontSize",
  26. auto-complete="settings.autoComplete",
  27. spell-check="!anonymous",
  28. spell-check-language="project.spellCheckLanguage",
  29. highlights="onlineUserCursorHighlights[editor.open_doc_id]"
  30. show-print-margin="false",
  31. sharejs-doc="editor.sharejs_doc",
  32. last-updated="editor.last_updated",
  33. cursor-position="editor.cursorPosition",
  34. goto-line="editor.gotoLine",
  35. resize-on="layout:main:resize,layout:pdf:resize,layout:review:resize,reviewPanel:toggle",
  36. annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
  37. read-only="!permissions.write",
  38. file-name="editor.open_doc_name",
  39. on-ctrl-enter="recompileViaKey",
  40. syntax-validation="settings.syntaxValidation",
  41. review-panel="reviewPanel",
  42. on-scroll="onScroll",
  43. scroll-events="scrollEvents",
  44. track-changes-enabled="trackChangesFeatureFlag"
  45. track-new-changes= "reviewPanel.trackNewChanges"
  46. )
  47. #review-panel
  48. .review-panel-toolbar
  49. | Track Changes
  50. input(type="checkbox", ng-model="reviewPanel.trackNewChanges")
  51. .review-panel-scroller
  52. .rp-entry-list(review-panel-sorted)
  53. .rp-entry-wrapper(
  54. ng-repeat="(entry_id, entry) in reviewPanel.entries"
  55. )
  56. .rp-entry-callout(
  57. ng-class="'rp-entry-callout-' + entry.type"
  58. )
  59. .rp-entry-indicator(ng-switch="entry.type")
  60. i.fa.fa-pencil(ng-switch-when="insert")
  61. i.rp-icon-delete(ng-switch-when="delete")
  62. i.fa.fa-comment(ng-switch-when="comment")
  63. .rp-entry(
  64. ng-class="[ 'rp-entry-' + entry.type, (commentState.adding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
  65. )
  66. div(ng-if="entry.type == 'insert' || entry.type == 'delete'")
  67. .rp-entry-header
  68. .rp-entry-action-icon(ng-switch="entry.type")
  69. i.fa.fa-pencil(ng-switch-when="insert")
  70. i.rp-icon-delete(ng-switch-when="delete")
  71. .rp-entry-metadata
  72. p.rp-entry-metadata-line(style="color: hsl({{ users[entry.metadata.user_id].hue }}, 70%, 50%);") {{ users[entry.metadata.user_id].name }}
  73. p.rp-entry-metadata-line {{ entry.metadata.ts | date : 'MMM d, y h:mm a' }}
  74. .rp-avatar(style="background-color: hsl({{ users[entry.metadata.user_id].hue }}, 70%, 50%);") {{ users[entry.metadata.user_id].avatar_text }}
  75. .rp-entry-body(ng-switch="entry.type")
  76. span(ng-switch-when="insert") Added 
  77. ins.rp-content-highlight {{ entry.content }}
  78. span(ng-switch-when="delete") Delete 
  79. del.rp-content-highlight {{ entry.content }}
  80. .rp-entry-actions
  81. a.rp-entry-button(href, ng-click="acceptChange(entry_id)")
  82. i.fa.fa-check
  83. |  Accept
  84. a.rp-entry-button(href, ng-click="rejectChange(entry_id)")
  85. i.fa.fa-times
  86. |  Reject
  87. div(ng-if="entry.type == 'comment'")
  88. .rp-comment(
  89. ng-repeat="comment in entry.thread"
  90. ng-class="users[comment.user_id].isSelf ? 'rp-comment-self' : '';"
  91. )
  92. .rp-avatar(
  93. ng-if="!users[comment.user_id].isSelf;"
  94. style="background-color: hsl({{ users[comment.user_id].hue }}, 70%, 50%);"
  95. ) {{ users[comment.user_id].avatar_text }}
  96. .rp-comment-body(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 90%);")
  97. p.rp-comment-content {{ comment.content }}
  98. p.rp-comment-metadata
  99. | {{ comment.ts | date : 'MMM d, y h:mm a' }}
  100. |  • 
  101. span(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 40%);") {{ users[comment.user_id].name }}
  102. .rp-comment-reply
  103. textarea.rp-comment-input(
  104. ng-model="entry.replyContent"
  105. ng-keypress="handleCommentReplyKeyPress($event, entry);"
  106. placeholder="Hit \"Enter\" to reply"
  107. )
  108. .rp-entry-actions
  109. a.rp-entry-button(href)
  110. i.fa.fa-check
  111. |  Mark as resolved
  112. div(ng-if="entry.type == 'add-comment'")
  113. a.rp-add-comment-btn(
  114. href
  115. ng-if="!commentState.adding"
  116. ng-click="startNewComment()"
  117. )
  118. i.fa.fa-comment
  119. |  Add comment
  120. div(ng-if="commentState.adding")
  121. .rp-new-comment
  122. textarea.rp-comment-input(
  123. ng-model="commentState.content"
  124. placeholder="Add your comment here"
  125. )
  126. .rp-entry-actions
  127. a.rp-entry-button(href, ng-click="submitNewComment()")
  128. i.fa.fa-comment
  129. |  Comment
  130. a.rp-entry-button(href, ng-click="cancelNewComment()")
  131. i.fa.fa-times
  132. |  Cancel
  133. .ui-layout-east
  134. div(ng-if="ui.pdfLayout == 'sideBySide'")
  135. include ./pdf
  136. .ui-layout-resizer-controls.synctex-controls(
  137. ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'"
  138. ng-controller="PdfSynctexController"
  139. )
  140. a.btn.btn-default.btn-xs(
  141. tooltip="#{translate('go_to_code_location_in_pdf')}"
  142. tooltip-placement="right"
  143. tooltip-append-to-body="true"
  144. ng-click="syncToPdf()"
  145. )
  146. i.fa.fa-long-arrow-right
  147. br
  148. a.btn.btn-default.btn-xs(
  149. tooltip-html="'#{translate('go_to_pdf_location_in_code')}'"
  150. tooltip-placement="right"
  151. tooltip-append-to-body="true"
  152. ng-click="syncToCode()"
  153. )
  154. i.fa.fa-long-arrow-left
  155. div.full-size(
  156. ng-if="ui.pdfLayout == 'flat'"
  157. ng-show="ui.view == 'pdf'"
  158. )
  159. include ./pdf