Use full screen by default in codemirror - Javascript CodeMirror

Javascript examples for CodeMirror:Configuration

Description

Use full screen by default in codemirror

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <link rel="stylesheet" href="https://codemirror.net/doc/docs.css"> 
      <link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css"> 
      <link rel="stylesheet" href="https://codemirror.net/theme/night.css"> 
      <script src="https://codemirror.net/lib/codemirror.js"></script> 
      <script src="https://codemirror.net/mode/htmlmixed/htmlmixed.js"></script> 
      <script src="https://codemirror.net/mode/xml/xml.js"></script> 
      <style type="text/css">

.CodeMirror {float: left; width: 100%; height: 100%; }


      </style> 
   </head> 
   <body> 
      <div style="padding: 1px; position: absolute; margin: 0px; left: 0px; right: 0px; top: 0px; bottom: 0px; width: auto; height: auto; "> 
         <textarea id="content" name="content" style="display: none;">&lt;dl&gt;
  &lt;dt id="option_indentWithTabs"&gt;&lt;code&gt;&lt;strong&gt;indentWithTabs&lt;/strong&gt;: boolean&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Whether, when indenting, the first N*&lt;code&gt;tabSize&lt;/code&gt;
  spaces should be replaced by N tabs. Default is false.&lt;/dd&gt;
  &lt;dt id="option_electricChars"&gt;&lt;code&gt;&lt;strong&gt;electricChars&lt;/strong&gt;: boolean&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Configures whether the editor should re-indent the current
  line when a character is typed that might change its proper
  indentation (only works if the mode supports indentation).
  Default is true.&lt;/dd&gt;
  &lt;dt id="option_specialChars"&gt;&lt;code&gt;&lt;strong&gt;specialChars&lt;/strong&gt;: RegExp&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;A regular expression used to determine which characters
  should be replaced by a
  special &lt;a href="#option_specialCharPlaceholder"&gt;placeholder&lt;/a&gt;.
  Mostly useful for non-printing special characters. The default
  is &lt;code&gt;/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/&lt;/code&gt;.&lt;/dd&gt;
  &lt;dt id="option_specialCharPlaceholder"&gt;&lt;code&gt;&lt;strong&gt;specialCharPlaceholder&lt;/strong&gt;: function(char)&nbsp;?&nbsp;Element&lt;/code&gt;&lt;/dt&gt;
  right in right-to-left text). The default is &lt;code&gt;false&lt;/code&gt;
  on Windows, and &lt;code&gt;true&lt;/code&gt; on other platforms.&lt;/dd&gt;
&lt;/dl&gt;
</textarea> 
      </div> 
      <script>
      var editor = CodeMirror.fromTextArea(document.getElementById('content'), {
        mode: 'application/xml',
        lineNumbers: true,//from   w  ww.ja  v  a  2  s . c  om
        theme: "night"
      });
    
      </script>  
   </body>
</html>

Related Tutorials