index.ts 691 B

1234567891011121314151617181920212223242526
  1. /*-----------------------------------------------------------------------------
  2. | Copyright (c) 2014-2015, PhosphorJS Contributors
  3. |
  4. | Distributed under the terms of the BSD 3-Clause License.
  5. |
  6. | The full license is in the file LICENSE, distributed with this software.
  7. |----------------------------------------------------------------------------*/
  8. 'use strict';
  9. import {
  10. EditorModel, CodeMirrorWidget
  11. } from '../lib/index';
  12. function main(): void {
  13. var model = new EditorModel();
  14. var view = new CodeMirrorWidget(model);
  15. view.attach(document.getElementById('main'));
  16. model.filename = 'test.js'
  17. view.update();
  18. window.onresize = () => view.update();
  19. }
  20. window.onload = main;