Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.html 4.7KB

il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  7. <meta name="HandheldFriendly" content="True" />
  8. <title>Editor</title>
  9. <style type="text/css" media="screen">
  10. body {
  11. overflow: hidden;
  12. background: #232B30; /* old browsers */
  13. background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
  14. background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
  15. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
  16. }
  17. .inner {
  18. margin-top: 36px;
  19. position: absolute;
  20. top: 0;
  21. bottom: 0;
  22. left: 0;
  23. right: 0;
  24. }
  25. .btn {
  26. outline: 0;
  27. padding: 3px 8px;
  28. color: #9fa8b0;
  29. font-weight: bold;
  30. text-shadow: 1px 1px #1f272b;
  31. border: 1px solid #1c252b;
  32. border-radius: 3px;
  33. -moz-border-radius: 3px;
  34. -webkit-border-radius: 3px;
  35. background: #232B30; /* old browsers */
  36. background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
  37. background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
  38. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
  39. box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
  40. -moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
  41. -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
  42. }
  43. .btn_g {
  44. margin-right: 10px;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <div class="toolbar">
  50. <!--<button id="btnSave" onClick="save()" class="btn btn_g">save</button>-->
  51. <button id="btnUndo" onClick="editor.undo()" class="btn">↶</button>
  52. <button id="btnRedo" onClick="editor.redo()" class="btn_g">↷</button>
  53. <button id="btnFs" onclick="openFullscreen();">◻</button>
  54. </div>
  55. <div class="inner" id="editor"></div>
  56. <script src="src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
  57. <script>
  58. var buildDom = ace.require("ace/lib/dom").buildDom;
  59. var editor = ace.edit("editor");
  60. editor.setOptions({
  61. mode: "ace/mode/text",
  62. theme: "ace/theme/ambiance",
  63. showPrintMargin: false,
  64. wrap: true,
  65. indentedSoftWrap: true,
  66. showFoldWidgets: false,
  67. showLineNumbers: true,
  68. showGutter: false,
  69. autoScrollEditorIntoView: true
  70. });
  71. function updateToolbar() {
  72. document.getElementById("btnUndo") = !editor.session.getUndoManager().hasUndo();
  73. document.getElementById("btnRedo") = !editor.session.getUndoManager().hasRedo();
  74. }
  75. editor.on("input", updateToolbar);
  76. if (localStorage.getItem("acetest") !== null) {
  77. editor.setValue(localStorage.getItem("acetest"));
  78. editor.clearSelection();
  79. }
  80. editor.getSession().on('change', function () {
  81. localStorage.setItem("acetest", editor.getSession().getValue());
  82. });
  83. function save() {
  84. alert("not yet implemented");
  85. }
  86. editor.commands.addCommand({
  87. name: "save",
  88. exec: save,
  89. bindKey: {
  90. win: "ctrl-s",
  91. mac: "cmd-s"
  92. }
  93. });
  94. function openFullscreen() {
  95. var elem = document.documentElement;
  96. if (elem.requestFullscreen) {
  97. elem.requestFullscreen();
  98. } else if (elem.mozRequestFullScreen) { /* Firefox */
  99. elem.mozRequestFullScreen();
  100. } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
  101. elem.webkitRequestFullscreen();
  102. } else if (elem.msRequestFullscreen) { /* IE/Edge */
  103. elem.msRequestFullscreen();
  104. }
  105. }
  106. window.editor = editor;
  107. </script>
  108. </body>
  109. </html>