/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/js/ace/mode-lucene.js

  • Committer: galaxyAbstractor
  • Date: 2013-04-10 15:49:32 UTC
  • mto: (19.1.5 lenasys)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: galaxyabstractor@gmail.com-20130410154932-4vizlzk0ar5gykvi
* Added an simple admin panel to the codeviewer-cmssy stuff
* Redesigned a bit like the mockups - still stuff to come
* Implemented the codeviewer + admin panel again using the Framework CodeIgniter instead 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
define('ace/mode/lucene', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lucene_highlight_rules'], function(require, exports, module) {
 
2
 
 
3
 
 
4
var oop = require("../lib/oop");
 
5
var TextMode = require("./text").Mode;
 
6
var Tokenizer = require("../tokenizer").Tokenizer;
 
7
var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules;
 
8
 
 
9
var Mode = function() {
 
10
    this.$tokenizer =  new Tokenizer(new LuceneHighlightRules().getRules());
 
11
};
 
12
 
 
13
oop.inherits(Mode, TextMode);
 
14
 
 
15
exports.Mode = Mode;
 
16
});define('ace/mode/lucene_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
 
17
 
 
18
 
 
19
var oop = require("../lib/oop");
 
20
var lang = require("../lib/lang");
 
21
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
 
22
 
 
23
var LuceneHighlightRules = function() {
 
24
    this.$rules = {
 
25
        "start" : [
 
26
            {
 
27
                token : "constant.character.negation",
 
28
                regex : "[\\-]"
 
29
            }, {
 
30
                token : "constant.character.interro",
 
31
                regex : "[\\?]"
 
32
            }, {
 
33
                token : "constant.character.asterisk",
 
34
                regex : "[\\*]"
 
35
            }, {
 
36
                token: 'constant.character.proximity',
 
37
                regex: '~[0-9]+\\b'
 
38
            }, {
 
39
                token : 'keyword.operator',
 
40
                regex: '(?:AND|OR|NOT)\\b'
 
41
            }, {
 
42
                token : "paren.lparen",
 
43
                regex : "[\\(]"
 
44
            }, {
 
45
                token : "paren.rparen",
 
46
                regex : "[\\)]"
 
47
            }, {
 
48
                token : "keyword",
 
49
                regex : "[\\S]+:"
 
50
            }, {
 
51
                token : "string",           // " string
 
52
                regex : '".*?"'
 
53
            }, {
 
54
                token : "text",
 
55
                regex : "\\s+"
 
56
            }
 
57
        ]
 
58
    };
 
59
};
 
60
 
 
61
oop.inherits(LuceneHighlightRules, TextHighlightRules);
 
62
 
 
63
exports.LuceneHighlightRules = LuceneHighlightRules;
 
64
});