Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
Parser.js
01 config.generics.forEach(function(entry)
02 {
03 var tagName = entry[0],
04 regexp = entry[1],
05 passthroughIdx = entry[2],
06 map = entry[3],
07 m;
08
09 // Reset the regexp
10 regexp.lastIndex = 0;
11
12 while (m = regexp.exec(text))
13 {
14 var startTagPos = m['index'],
15 matchLen = m[0].length,
16 tag;
17
18 if (HINT.PREG_HAS_PASSTHROUGH && passthroughIdx && m[passthroughIdx] !== '')
19 {
20 // Compute the position and length of the start tag, end tag, and the content in
21 // between. m.index gives us the position of the start tag but we don't know its length.
22 // We use indexOf() to locate the content part so that we know how long the start tag
23 // is. It is an imperfect solution but it should work well enough in most cases.
24 var contentPos = text.indexOf(m[passthroughIdx], startTagPos),
25 contentLen = m[passthroughIdx].length,
26 startTagLen = contentPos - startTagPos,
27 endTagPos = contentPos + contentLen,
28 endTagLen = matchLen - (startTagLen + contentLen);
29
30 tag = addTagPair(tagName, startTagPos, startTagLen, endTagPos, endTagLen, -100);
31 }
32 else
33 {
34 tag = addSelfClosingTag(tagName, startTagPos, matchLen, -100);
35 }
36
37 map.forEach(function(attrName, i)
38 {
39 // NOTE: subpatterns with no name have an empty entry to preserve the array indices
40 if (attrName && typeof m[i] !== 'undefined')
41 {
42 tag.setAttribute(attrName, m[i]);
43 }
44 });
45 }
46 });