File tree Expand file tree Collapse file tree 7 files changed +822
-37
lines changed Expand file tree Collapse file tree 7 files changed +822
-37
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ < title > Canvas Text Editor</ title >
7+ < meta name ="description " content ="">
8+ < meta name ="keywords " content ="">
9+ < script src ="./lib/index.js " type ="module "> </ script >
10+ </ head >
11+ < body >
12+ </ body >
13+ </ html >
Original file line number Diff line number Diff line change 11"use strict" ;
22
3- var FontMetrics = require ( 'FontMetrics' ) ,
4- Document = require ( 'Document' ) ,
5- Selection = require ( 'Selection' ) ;
3+ var FontMetrics = require ( './ FontMetrics' ) ,
4+ Document = require ( './ Document' ) ,
5+ Selection = require ( './ Selection' ) ;
66
77/**
88 * Simple plain-text text editor using html5 canvas.
Original file line number Diff line number Diff line change 1+ import CanvasTextEditor from "./CanvasTextEditor.js" ;
2+ import Document from "./Document.js" ;
3+
4+ document . addEventListener (
5+ "DOMContentLoaded" ,
6+ function ( ) {
7+ var text = "" ,
8+ characterCount = 0 ,
9+ aCharCode = "a" . charCodeAt ( 0 ) ;
10+ for ( var i = 0 ; i < 100 ; i ++ ) {
11+ characterCount = Math . floor ( Math . random ( ) * 120 ) ;
12+ for ( var j = 0 ; j < characterCount ; j ++ ) {
13+ text += String . fromCharCode ( aCharCode + Math . floor ( Math . random ( ) * 26 ) ) ;
14+ }
15+ text += "\n" ;
16+ }
17+ var doc = new Document ( text ) ,
18+ editor = new CanvasTextEditor ( doc ) ;
19+ document . body . appendChild ( editor . getEl ( ) ) ;
20+ editor . focus ( ) ;
21+ } ,
22+ false
23+ ) ;
Original file line number Diff line number Diff line change 66 "engines" : {
77 "node" : " >= 0.4.x < 0.7.0"
88 },
9+ "scripts" : {
10+ "dev" : " vite"
11+ },
912 "devDependencies" : {
1013 "coffee-script" : " latest" ,
14+ "express" : " latest" ,
1115 "stitch" : " latest" ,
1216 "uglify-js" : " latest" ,
13- "express" : " latest"
17+ "vite" : " ^4.3.8" ,
18+ "vite-plugin-commonjs" : " ^0.7.1"
1419 }
1520}
Original file line number Diff line number Diff line change 1+ import { defineConfig } from "vite" ;
2+ import commonjs from "vite-plugin-commonjs" ;
3+
4+ export default defineConfig ( {
5+ plugins : [ commonjs ( /* options */ ) ] ,
6+ } ) ;
You can’t perform that action at this time.
0 commit comments