gamesedu / elevatorsaga-gr Goto Github PK
View Code? Open in Web Editor NEWThis project forked from magwo/elevatorsaga
The elevator programming game!
Home Page: http://elevator.dimotiko.tk
License: MIT License
This project forked from magwo/elevatorsaga
The elevator programming game!
Home Page: http://elevator.dimotiko.tk
License: MIT License
make some lines/parts read only/uneditable (codemirror)
eg1:
With codemirror version 3 support for on and beforeChange was added; simply catching the change before it happens and canceling should do the trick:
// the line numbers to be "readonly"
var readOnlyLines = [0,1,2,3];
// create the CodeMirror instance
var editor = CodeMirror.fromTextArea(document.getElementById('input'));
// listen for the beforeChange event, test the changed line number, and cancel
editor.on('beforeChange',function(cm,change) {
if ( ~readOnlyLines.indexOf(change.from.line) ) {
change.cancel();
}
});
http://codemirror.net/doc/manual.html#markText
Text-marking methods
doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) โ TextMarker
Can be used to mark a range of text with a specific CSS class name. from and to should be {line, ch} objects. The options parameter is optional. When given, it should be an object that may contain the following configuration options:
...
readOnly: boolean
A read-only span can, as long as it is not cleared, not be modified except by calling setValue to reset the whole document. Note: adding a read-only span currently clears the undo history of the editor, because existing undo events being partially nullified by read-only spans would corrupt the history (in the current implementation).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.