manualsave.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <div id="snippet-manual">
  2. <p>Change the content of this editor, then save it on the server.</p>
  3. </div>
  4. <div class="snippet-manual-save-header">
  5. <div class="snippet-manual-save-server">
  6. <div class="snippet-manual-save-server_label">HTTP server lag (ms):</div>
  7. <input id="snippet-manual-lag" type="number" value="500" step="100" min="0" max="9000">
  8. </div>
  9. <div class="snippet-manual-save-submit">
  10. <input id="snippet-manual-save" type="submit" value="Save">
  11. </div>
  12. </div>
  13. <p>Server data:</p>
  14. <pre>
  15. <code id="snippet-manual-save-console">&#x3C;p&#x3E;Change the content of this editor, then save it on the server.&#x3C;/p&#x3E;</code>
  16. </pre>
  17. <style>
  18. .snippet-manual-save-header {
  19. display: flex;
  20. justify-content: space-between;
  21. align-items: center;
  22. background: var(--ck-color-toolbar-background);
  23. border: 1px solid var(--ck-color-toolbar-border);
  24. padding: 10px;
  25. border-radius: var(--ck-border-radius);
  26. margin-top: -1.5em;
  27. margin-bottom: 1.5em;
  28. border-top: 0;
  29. border-top-left-radius: 0;
  30. border-top-right-radius: 0;
  31. }
  32. .snippet-manual-save-server,
  33. .snippet-manual-save-submit {
  34. display: flex;
  35. align-items: center;
  36. }
  37. .snippet-manual-save-server_label,
  38. .snippet-manual-save-status_label {
  39. font-weight: bold;
  40. margin-right: var(--ck-spacing-medium);
  41. }
  42. #snippet-manual + .ck.ck-editor .ck-editor__editable {
  43. border-bottom-right-radius: 0;
  44. border-bottom-left-radius: 0;
  45. }
  46. #snippet-manual-save-lag {
  47. padding: 4px;
  48. }
  49. #snippet-manual-save {
  50. color: #fff;
  51. background: hsl( 88, 73%, 39% );
  52. opacity: 0.5;
  53. padding: 4px 20px;
  54. display: block;
  55. border: 0;
  56. border-radius: 2px;
  57. font-weight: bold;
  58. outline: none;
  59. transition: 300ms ease background;
  60. box-shadow: 0 2px 0 rgb(68, 117, 10);
  61. }
  62. #snippet-manual-save:hover {
  63. background: hsl( 88, 73%, 42% );
  64. }
  65. #snippet-manual-save:active,
  66. #snippet-manual-save:focus {
  67. box-shadow: 0 1px 0 rgb(68, 117, 10);
  68. }
  69. #snippet-manual-save.active {
  70. cursor: pointer;
  71. opacity: 1;
  72. }
  73. #snippet-manual-save.saving {
  74. background: hsl( 88, 73%, 34% );
  75. }
  76. #snippet-manual-save-console {
  77. /* Lets wrap content. */
  78. max-height: 300px;
  79. overflow: auto;
  80. white-space: normal;
  81. background: #2b2c26;
  82. transition: 300ms;
  83. }
  84. #snippet-manual-save-console.received {
  85. animation: autosave-received 1s ease 1;
  86. }
  87. @keyframes autosave-received {
  88. from { background: green; }
  89. to { background: #2b2c26; }
  90. }
  91. </style>