Code Editor - Code Mirror

Code Editor - Basic example

CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.

 
1
<script>
2
    // Code goes here
3
4
    // For demo purpose - animation css script
5
    function animationHover(element, animation){
6
        element = $(element);
7
        element.hover(
8
                function(){
9
                    element.addClass('animated ' + animation);
10
                },
11
                function(){
12
                    //wait for animation to finish before removing classes
13
                    window.setTimeout( function(){
14
                        element.removeClass('animated ' + animation);
15
                    }, 2000);
16
                });
17
    }
18
</script>
19
Code Editor - Theme Example

A rich programming API and a CSS theming system are available for customizing CodeMirror to fit your application, and extending it with new functionality. For mor info go to http://codemirror.net/

26
 
1
    var SpeechApp = angular.module('SpeechApp', []);
2
3
    function VoiceCtrl($scope)
4
5
        $scope.said='...';
6
7
        $scope.helloWorld = function()
8
            $scope.said = "Hello world!";
9
        }
10
11
        $scope.commands =
12
            'hello (world)': function()
13
                if (typeof console !== "undefined") console.log('hello world!')
14
                $scope.$apply($scope.helloWorld);
15
            },
16
            'hey': function()
17
                if (typeof console !== "undefined") console.log('hey!')
18
                $scope.$apply($scope.helloWorld);
19
            }
20
        };
21
22
        annyang.debug();
23
        annyang.init($scope.commands);
24
        annyang.start();
25
    }
26