_on-edit.scss 7.8 KB

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