GithubHelp home page GithubHelp logo

gamesedu / elevatorsaga-gr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from magwo/elevatorsaga

0.0 0.0 0.0 1.32 MB

The elevator programming game!

Home Page: http://elevator.dimotiko.tk

License: MIT License

JavaScript 91.45% Shell 0.02% HTML 5.13% CSS 3.41%

elevatorsaga-gr's People

Contributors

banterability avatar biinari avatar bumbu avatar christiangenco avatar cyclobs avatar gernberg avatar lexicality avatar magwo avatar mattmazzola avatar mhelsley avatar plirof avatar pokeylope avatar reversefold avatar roryokane avatar signpostmarv avatar sim642 avatar wooliet avatar

Watchers

 avatar  avatar

elevatorsaga-gr's Issues

make some lines/parts read only/uneditable (codemirror)

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.