_on-edit.scss 8.9 KB

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