_on-edit.scss 8.7 KB

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