_on-edit.scss 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. body.on-edit {
  2. // hide unnecessary elements
  3. .navbar.navbar-static-top,
  4. .row.row-alerts,
  5. .row.page-list,
  6. .row.page-comments-row,
  7. .row.page-attachments-row,
  8. .row.not-found-message-row,
  9. .users-meta,
  10. .user-page-content-container,
  11. .portal-form-button,
  12. .alert-info.alert-moved,
  13. .alert-info.alert-unlinked,
  14. .like-button, .bookmark-link, .btn-edit,
  15. .authors,
  16. footer {
  17. display: none !important;
  18. }
  19. // hide unnecessary elements for growi layout
  20. .revision-toc-container {
  21. display: none;
  22. }
  23. // hide unnecessary elements for crowi layout
  24. #toggle-sidebar,
  25. .crowi-sidebar {
  26. display: none;
  27. }
  28. /*****************
  29. * Expand Editor
  30. *****************/
  31. .expand-by-flex {
  32. display: flex;
  33. flex-direction: column;
  34. flex: 1;
  35. }
  36. .container-fluid {
  37. padding-bottom: 0;
  38. }
  39. .main {
  40. width: 100vw;
  41. height: 100vh;
  42. margin-top: 0px !important;
  43. padding-top: 2px;
  44. padding-left: 0;
  45. padding-right: 0;
  46. // for growi layout
  47. > .row {
  48. margin: 0;
  49. > .col-lg-10, > .col-md-9 {
  50. width: 100vw;
  51. padding: 0;
  52. }
  53. }
  54. &,
  55. .content-main,
  56. .tab-content,
  57. .edit-form,
  58. .page-form {
  59. @extend .expand-by-flex;
  60. }
  61. .page-form {
  62. // calculate margin
  63. $header-plus-footer: 2px // .main padding-top
  64. + 42px // .nav height
  65. + 1px // .page-editor-footer border-top
  66. + 39px; // .page-editor-footer min-height
  67. $preview-margin: $header-plus-footer;
  68. $editor-margin: $header-plus-footer + 22px; // .btn-open-dropzone height
  69. #page-editor {
  70. // right(preview)
  71. &,
  72. .row,
  73. .page-editor-preview-container,
  74. .page-editor-preview-body {
  75. height: calc(100vh - #{$preview-margin});
  76. }
  77. // left(editor)
  78. .page-editor-editor-container,
  79. .react-codemirror2, .CodeMirror, .CodeMirror-scroll {
  80. height: calc(100vh - #{$editor-margin});
  81. }
  82. }
  83. .page-editor-footer {
  84. width: 100%;
  85. margin: 0;
  86. padding: 4px;
  87. min-height: 39px;
  88. border-top: solid 1px transparent;
  89. }
  90. // slack
  91. .input-group-slack {
  92. .input-group-addon {
  93. padding: 2px 8px;
  94. line-height: 1em;
  95. img, input {
  96. vertical-align: middle;
  97. }
  98. }
  99. }
  100. }
  101. }
  102. .row.bg-title {
  103. $left-margin: $nav-main-left-tab-width * 2 + 25px; // width of .nav-main-left-tab x 2 + some margin
  104. position: absolute;
  105. z-index: 1;
  106. left: $left-margin;
  107. min-width: calc(100% - #{$left-margin});
  108. // for crowi layout
  109. > .col-md-9, .col-xs-12 {
  110. padding: 0;
  111. width: 100%;
  112. }
  113. background: none;
  114. h1 {
  115. font-size: 20px;
  116. line-height: 1em;
  117. }
  118. }
  119. /*****************
  120. * Editor styles
  121. *****************/
  122. .page-editor-editor-container {
  123. border-right: 1px solid transparent;
  124. padding-right: 0;
  125. // override CodeMirror styles
  126. .CodeMirror {
  127. pre {
  128. font-family: $font-family-monospace-not-strictly;
  129. }
  130. .cm-matchhighlight {
  131. background-color: cyan;
  132. }
  133. .CodeMirror-selection-highlight-scrollbar {
  134. background-color: darkcyan;
  135. }
  136. }
  137. // for Dropzone
  138. .dropzone {
  139. @mixin insertFontAwesome($code) {
  140. &:before {
  141. margin-right: 0.2em;
  142. font-family: FontAwesome;
  143. content: $code;
  144. }
  145. }
  146. // default layout and style
  147. .dropzone-overlay {
  148. // layout
  149. display: flex;
  150. justify-content: center;
  151. align-items: center;
  152. // style
  153. margin: 0 15px;
  154. }
  155. .dropzone-overlay-content {
  156. font-size: 2em;
  157. padding: 0.2em;
  158. border-radius: 5px;
  159. }
  160. // unuploadable or rejected
  161. &.dropzone-unuploadable, &.dropzone-rejected {
  162. .dropzone-overlay {
  163. background: rgba(200,200,200,0.8);
  164. }
  165. .dropzone-overlay-content {
  166. color: #444;
  167. }
  168. }
  169. // uploading
  170. &.dropzone-uploading {
  171. .dropzone-overlay {
  172. background: rgba(255,255,255,0.5);
  173. }
  174. .dropzone-overlay-content {
  175. padding: 0.3em;
  176. background: rgba(200,200,200,0.5);
  177. color: #444;
  178. }
  179. }
  180. // unuploadable
  181. &.dropzone-unuploadable {
  182. .dropzone-overlay-content {
  183. // insert content
  184. @include insertFontAwesome("\f06a "); // fa-exclamation-circle
  185. &:after {
  186. content: "File uploading is disabled";
  187. }
  188. }
  189. }
  190. // uploadable
  191. &.dropzone-uploadable {
  192. // accepted
  193. &.dropzone-accepted:not(.dropzone-rejected) {
  194. .dropzone-overlay {
  195. border: 4px dashed #ccc;
  196. }
  197. .dropzone-overlay-content {
  198. // insert content
  199. @include insertFontAwesome("\f093"); // fa-upload
  200. &:after {
  201. content: "Drop here to upload";
  202. }
  203. // style
  204. color: #666;
  205. background: rgba(200,200,200,0.8);
  206. }
  207. }
  208. // file type mismatch
  209. &.dropzone-rejected:not(.dropzone-uploadablefile) .dropzone-overlay-content {
  210. // insert content
  211. @include insertFontAwesome("\f03e"); // fa-picture-o
  212. &:after {
  213. content: "Only an image file is allowed";
  214. }
  215. }
  216. // multiple files
  217. &.dropzone-accepted.dropzone-rejected .dropzone-overlay-content {
  218. // insert content
  219. @include insertFontAwesome("\f071"); // fa-fa-exclamation-triangle
  220. &:after {
  221. content: "Only 1 file is allowed";
  222. }
  223. }
  224. }
  225. } // end of.dropzone
  226. .btn-open-dropzone {
  227. z-index: 2;
  228. font-size: small;
  229. text-align: right;
  230. padding-top: 3px;
  231. padding-bottom: 0;
  232. border: none;
  233. border-radius: 0;
  234. border-top: 1px dotted #ccc;
  235. &:active {
  236. box-shadow: none;
  237. }
  238. }
  239. }
  240. .page-editor-preview-container {
  241. }
  242. .page-editor-preview-body {
  243. padding-top: 18px;
  244. padding-right: 15px;
  245. overflow-y: scroll;
  246. }
  247. #page-editor-options-selector {
  248. label {
  249. margin-right: 0.5em;
  250. }
  251. // configuration dropdown
  252. .configuration-dropdown {
  253. .icon-container {
  254. display: inline-block;
  255. width: 20px;
  256. }
  257. .dropdown-menu > li > a {
  258. display: flex;
  259. justify-content: space-between;
  260. align-items: center;
  261. .menuitem-label {
  262. flex: 1;
  263. margin-right: 10px;
  264. }
  265. }
  266. }
  267. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  268. display: none;
  269. }
  270. }
  271. } // }}}
  272. /*
  273. * for creating portal
  274. */
  275. .nav-tabs-create-portal {
  276. display: none;
  277. }
  278. .on-edit .nav-tabs-create-portal {
  279. display: block;
  280. }
  281. /*
  282. .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
  283. .close-button {
  284. display: none;
  285. }
  286. }
  287. .crowi.main-container .main .page-list.content-main.on-edit { // {{{ Edit Form of Page List
  288. .close-button {
  289. display: block;
  290. }
  291. .page-list-container {
  292. display: none;
  293. }
  294. .portal-form-header {
  295. height: 16px;
  296. padding: 8px;
  297. border-bottom: solid 1px #ccc;
  298. }
  299. } // }}}
  300. */
  301. /*
  302. @media (max-width: $screen-sm-max) { // {{{ less than tablet size
  303. .content-main.on-edit {
  304. .form-group.form-submit-group {
  305. select.form-control {
  306. display: inline-block;
  307. max-width: 50%;
  308. }
  309. }
  310. }
  311. } // }}}
  312. @media (max-width: $screen-xs-max) { // {{{ less than smartphone size
  313. #edit-form-submit {
  314. float: right;
  315. }
  316. } // }}}
  317. */
  318. // overwrite .CodeMirror-hints
  319. .CodeMirror-hints {
  320. // FIXME: required because .content-main.on-edit has 'z-index:1050'
  321. // z-index: 1060 !important;
  322. max-height: 30em !important;
  323. .CodeMirror-hint.crowi-emoji-autocomplete {
  324. font-family: $font-family-monospace-not-strictly;
  325. line-height: 1.6em;
  326. .img-container {
  327. display: inline-block;
  328. width: 30px;
  329. }
  330. }
  331. // active line
  332. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  333. .img-container {
  334. font-size: 15px; // adjust to .wiki
  335. padding-top: 0.3em;
  336. padding-bottom: 0.3em;
  337. }
  338. }
  339. }