editor.jade 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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, 'has-entries': reviewPanel.hasEntries }")
  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. changes-tracker="reviewPanel.changesTracker"
  47. )
  48. #review-panel
  49. .review-panel-toolbar
  50. | Track Changes
  51. input(type="checkbox", ng-model="reviewPanel.trackNewChanges")
  52. .review-panel-scroller
  53. .rp-entry-list(review-panel-sorted)
  54. .rp-entry-wrapper(
  55. ng-repeat="(entry_id, entry) in reviewPanel.entries"
  56. )
  57. .rp-entry-callout(
  58. ng-class="'rp-entry-callout-' + entry.type"
  59. )
  60. div(ng-switch="entry.type")
  61. .rp-entry-indicator(ng-switch-when="insert")
  62. i.fa.fa-pencil
  63. .rp-entry-indicator(ng-switch-when="delete")
  64. i.rp-icon-delete
  65. .rp-entry-indicator(ng-switch-when="comment")
  66. i.fa.fa-comment
  67. .rp-entry-indicator(
  68. ng-switch-when="add-comment"
  69. ng-if="!commentState.adding"
  70. ng-click="startNewComment(); toggleReviewPanel();"
  71. )
  72. i.fa.fa-commenting
  73. .rp-entry(
  74. ng-class="[ 'rp-entry-' + entry.type, (commentState.adding ? 'rp-entry-adding-comment' : ''), (entry.focused ? 'rp-entry-focused' : '')]"
  75. )
  76. div(ng-if="entry.type == 'insert' || entry.type == 'delete'")
  77. .rp-entry-header
  78. .rp-entry-action-icon(ng-switch="entry.type")
  79. i.fa.fa-pencil(ng-switch-when="insert")
  80. i.rp-icon-delete(ng-switch-when="delete")
  81. .rp-entry-metadata
  82. p.rp-entry-metadata-line(style="color: hsl({{ users[entry.metadata.user_id].hue }}, 70%, 50%);") {{ users[entry.metadata.user_id].name }}
  83. p.rp-entry-metadata-line {{ entry.metadata.ts | date : 'MMM d, y h:mm a' }}
  84. .rp-avatar(style="background-color: hsl({{ users[entry.metadata.user_id].hue }}, 70%, 50%);") {{ users[entry.metadata.user_id].avatar_text }}
  85. .rp-entry-body(ng-switch="entry.type")
  86. span(ng-switch-when="insert") Added 
  87. ins.rp-content-highlight {{ entry.content }}
  88. span(ng-switch-when="delete") Delete 
  89. del.rp-content-highlight {{ entry.content }}
  90. .rp-entry-actions
  91. a.rp-entry-button(href, ng-click="acceptChange(entry_id)")
  92. i.fa.fa-check
  93. |  Accept
  94. a.rp-entry-button(href, ng-click="rejectChange(entry_id)")
  95. i.fa.fa-times
  96. |  Reject
  97. div(ng-if="entry.type == 'comment'")
  98. .rp-comment(
  99. ng-repeat="comment in entry.thread"
  100. ng-class="users[comment.user_id].isSelf ? 'rp-comment-self' : '';"
  101. )
  102. .rp-avatar(
  103. ng-if="!users[comment.user_id].isSelf;"
  104. style="background-color: hsl({{ users[comment.user_id].hue }}, 70%, 50%);"
  105. ) {{ users[comment.user_id].avatar_text }}
  106. .rp-comment-body(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 90%);")
  107. p.rp-comment-content {{ comment.content }}
  108. p.rp-comment-metadata
  109. | {{ comment.ts | date : 'MMM d, y h:mm a' }}
  110. |  • 
  111. span(style="color: hsl({{ users[comment.user_id].hue }}, 70%, 40%);") {{ users[comment.user_id].name }}
  112. .rp-comment-reply
  113. textarea.rp-comment-input(
  114. ng-model="entry.replyContent"
  115. ng-keypress="handleCommentReplyKeyPress($event, entry);"
  116. placeholder="Hit \"Enter\" to reply"
  117. )
  118. .rp-entry-actions
  119. a.rp-entry-button(href)
  120. i.fa.fa-check
  121. |  Mark as resolved
  122. div(ng-if="entry.type == 'add-comment'")
  123. a.rp-add-comment-btn(
  124. href
  125. ng-if="!commentState.adding"
  126. ng-click="startNewComment()"
  127. )
  128. i.fa.fa-comment
  129. |  Add comment
  130. div(ng-if="commentState.adding")
  131. .rp-new-comment
  132. textarea.rp-comment-input(
  133. ng-model="commentState.content"
  134. placeholder="Add your comment here"
  135. )
  136. .rp-entry-actions
  137. a.rp-entry-button(href, ng-click="submitNewComment()")
  138. i.fa.fa-comment
  139. |  Comment
  140. a.rp-entry-button(href, ng-click="cancelNewComment()")
  141. i.fa.fa-times
  142. |  Cancel
  143. .ui-layout-east
  144. div(ng-if="ui.pdfLayout == 'sideBySide'")
  145. include ./pdf
  146. .ui-layout-resizer-controls.synctex-controls(
  147. ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'"
  148. ng-controller="PdfSynctexController"
  149. )
  150. a.btn.btn-default.btn-xs(
  151. tooltip="#{translate('go_to_code_location_in_pdf')}"
  152. tooltip-placement="right"
  153. tooltip-append-to-body="true"
  154. ng-click="syncToPdf()"
  155. )
  156. i.fa.fa-long-arrow-right
  157. br
  158. a.btn.btn-default.btn-xs(
  159. tooltip-html="'#{translate('go_to_pdf_location_in_code')}'"
  160. tooltip-placement="right"
  161. tooltip-append-to-body="true"
  162. ng-click="syncToCode()"
  163. )
  164. i.fa.fa-long-arrow-left
  165. div.full-size(
  166. ng-if="ui.pdfLayout == 'flat'"
  167. ng-show="ui.view == 'pdf'"
  168. )
  169. include ./pdf