.htaccess editor: code highlighting fixed
This commit is contained in:
parent
09f9a7943d
commit
19b52f025c
3 changed files with 13 additions and 20 deletions
|
@ -34,7 +34,7 @@
|
|||
border: 1px solid #444;
|
||||
padding: 2px;
|
||||
font-family: Consolas, monospace;
|
||||
font-size: 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
<div class="FormBody">
|
||||
|
|
|
@ -35,8 +35,12 @@ CodeMirror.defineMode('htaccess', function() {
|
|||
return 'comment';
|
||||
}
|
||||
if (ch === '$') {
|
||||
state.tokens.unshift(tokenDollar);
|
||||
return tokenize(stream, state);
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return 'def';
|
||||
}
|
||||
if (ch === '%') {
|
||||
stream.eatWhile(/[\w\_{}]/);
|
||||
return 'tag';
|
||||
}
|
||||
if (ch === '+' || ch === '=') {
|
||||
return 'operator';
|
||||
|
@ -65,7 +69,6 @@ CodeMirror.defineMode('htaccess', function() {
|
|||
}
|
||||
stream.eatWhile(/\w/);
|
||||
var cur = stream.current();
|
||||
if (stream.peek() === '=' && /\w+/.test(cur)) return 'def';
|
||||
return words.hasOwnProperty(cur) ? words[cur] : null;
|
||||
}
|
||||
|
||||
|
@ -92,22 +95,6 @@ CodeMirror.defineMode('htaccess', function() {
|
|||
};
|
||||
};
|
||||
|
||||
var tokenDollar = function(stream, state) {
|
||||
if (state.tokens.length > 1) stream.eat('$');
|
||||
var ch = stream.next(), hungry = /\w/;
|
||||
if (ch === '{') hungry = /[^}]/;
|
||||
if (ch === '(') {
|
||||
state.tokens[0] = tokenString(')');
|
||||
return tokenize(stream, state);
|
||||
}
|
||||
if (!/\d/.test(ch)) {
|
||||
stream.eatWhile(hungry);
|
||||
stream.eat('}');
|
||||
}
|
||||
state.tokens.shift();
|
||||
return 'def';
|
||||
};
|
||||
|
||||
function tokenize(stream, state) {
|
||||
return (state.tokens[0] || tokenBase) (stream, state);
|
||||
};
|
||||
|
|
|
@ -17,6 +17,12 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
|||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . index.php [NC,L]
|
||||
|
||||
RewriteRule .*\.png$ crm.png [L]
|
||||
Header set CacheControl max-age=13,public
|
||||
|
||||
RewriteRule (.*)\.png$ $1.png [L]
|
||||
|
||||
|
||||
<Location index.php>
|
||||
ExpiresByType "text/html; charset=UTF-8" A30
|
||||
CacheEnable mem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue