_on-edit.scss 8.7 KB

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