PageSourceSearch

https://www.american-stone.com/web/static/lib/ace/mode-qweb.js

js american-stone.com collected 2026-10-08 20:38:16 UTC 7,359 bytes, 143 lines download raw bytes

1define("ace/mode/qweb_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/xml_highlight_rules"], function (require, exports, module) {
2    "use strict";
3
4    var oop = require("../lib/oop");
5    var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
6
7    var QWebHighlightRules = function () {
8        XmlHighlightRules.call(this);
9        const xmlRules = this.$rules;
10
11        const tagRegex = xmlRules.attributes[0].regex;
12
13        this.$rules = Object.assign({},
14            xmlRules,
15            {
16                attributes: [{
17                    include: "attributes_odoo",
18                }, {
19                    include: "attributes_qweb",
20                }, {
21                    include: "attributes_groups",
22                }, {
23                    include: "attributes_sample",
24                }],
25
26                attributes_odoo: [{
27                    token: ["entity.other.attribute-name.xml.odoo", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml.code", "string.attribute-value.xml.end"],
28                    regex: '(domain|attrs|options)(=)(\\s*)(")([^"]*)(")',
29                }, {
30                    token: ["entity.other.attribute-name.xml.odoo", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml.code", "string.attribute-value.xml.end"],
31                    regex: "(domain|attrs|options)(=)(\\s*)(')([^']*)(')",
32                }],
33
34                attributes_qweb: [{
35                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml", "string.attribute-value.xml.end"],
36                    regex: '(t-name|t-call-assets|t-js|t-css)(=)(\\s*)(")([^"]*)(")',
37                }, {
38                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml", "string.attribute-value.xml.end"],
39                    regex: "(t-name|t-call-assets|t-js|t-css)(=)(\\s*)(')([^']*)(')",
40                }, {
41                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml", "string.attribute-value.xml", "string.attribute-value.xml.code", "string.attribute-value.xml", "string.attribute-value.xml", "string.attribute-value.xml.end"],
42                    regex: '(t-call|t-attf-(?:' + tagRegex + '))(=)(\\s*)(")([^"#{]*)(?:([#{]\\{)([^"}]+)(\\}[}]?))?([^"]*)(")',
43                }, {
44                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml", "string.attribute-value.xml", "string.attribute-value.xml.code", "string.attribute-value.xml", "string.attribute-value.xml", "string.attribute-value.xml.end"],
45                    regex: "(t-call|t-attf-(?:" + tagRegex + "))(=)(\\s*)(')([^'#{]*)(?:([#{]\\{)([^'}]+)(\\}[}]?))?([^']*)(')",
46                }, {
47                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml.code", "string.attribute-value.xml.end"],
48                    regex: '(t-(?:' + tagRegex + '))(=)(\\s*)(")([^"]*)(")',
49                }, {
50                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml.code", "string.attribute-value.xml.end"],
51                    regex: "(t-(?:" + tagRegex + "))(=)(\\s*)(')([^']*)(')",
52                }],
53
54                attributes_groups: [{
55                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.start", "string.attribute-value.xml", "string.attribute-value.xml.end"],
56                    regex: '(groups)(=)(\\s*)(")([\\s\\na-zA-Z0-9.,_-]*)(")',
57                }, {
58                    token: ["entity.other.attribute-name.xml.qweb", "keyword.operator.attribute-equals.xml", "text", "string.attribute-value.xml.
58start", "string.attribute-value.xml", "string.attribute-value.xml.end"],
59                    regex: "(groups)(=)(\\s*)(')((?:[\\s\\na-zA-Z0-9.,_-]*)*)(')",
60                }],
61
62                attributes_sample: [{
63                    token: "entity.other.attribute-name.xml",
64                    regex: tagRegex,
65                }, {
66                    token: "keyword.operator.attribute-equals.xml",
67                    regex: "=",
68                }, {
69                    include: "tag_whitespace",
70                }, {
71                    include: "attribute_value",
72                }],
73
74                tag: [{
75                    token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
76                    regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
77                    next: [{
78                            include: "attributes",
79                        }, {
80                            token: ["meta.tag.punctuation.end-tag-close.xml", "meta.tag.punctuation.tag-close.xml"],
81                            regex: "(/>)|(>)",
82                            next: "start",
83                        },
84                    ],
85                }],
86            },
87        );
88
89        if (this.constructor === QWebHighlightRules) {
90            this.normalizeRules();
91        }
92    };
93
94    oop.inherits(QWebHighlightRules, XmlHighlightRules);
95
96    exports.QWebHighlightRules = QWebHighlightRules;
97});
98
99define("ace/mode/qweb",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/qweb_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) {
100    "use strict";
101
102    var oop = require("../lib/oop");
103    var lang = require("../lib/lang");
104    var TextMode = require("./text").Mode;
105    var QWebHighlightRules = require("./qweb_highlight_rules").QWebHighlightRules;
106    var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
107    var XmlFoldMode = require("./folding/xml").FoldMode;
108    var WorkerClient = require("../worker/worker_client").WorkerClient;
109
110    var Mode = function() {
111       this.HighlightRules = QWebHighlightRules;
112       this.$behaviour = new XmlBehaviour();
113       this.foldingRules = new XmlFoldMode();
114    };
115
116    oop.inherits(Mode, TextMode);
117
118    (function() {
119
120        this.voidElements = lang.arrayToMap([]);
121
122        this.blockComment = {start: "<!--", end: "-->"};
123
124        this.createWorker = function(session) {
125            var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
126            worker.attachToDocument(session.getDocument());
127
128            worker.on("error", function(e) {
129                session.setAnnotations(e.data);
130            });
131
132            worker.on("terminate", function() {
133                session.clearAnnotations();
134            });
135
136            return worker;
137        };
138
139        this.$id = "ace/mode/xml";
140    }).call(Mode.prototype);
141
142    exports.Mode = Mode;
143});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.