mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-06 08:44:02 +01:00
New regex for efficiency
More specific regex used to ensure efficiency & speed are optimal Syntax spacing adjusts on couple of other lines
This commit is contained in:
@@ -1304,13 +1304,13 @@ var ICEcoder = {
|
||||
|
||||
// Show a CSS color block next to our text cursor
|
||||
cssColorPreview: function() {
|
||||
var cM,string,rx,match,oldBlock,newBlock;
|
||||
var cM, string, rx, match, oldBlock, newBlock;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
string = cM.getLine(cM.getCursor().line);
|
||||
rx = /(#[\da-f]{3,6}\b|(?:rgb|hsl)a?\([^)]*\)|[a-z]+\b)/gi;
|
||||
rx = /(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;
|
||||
|
||||
while((match = rx.exec(string)) && cM.getCursor().ch > match.index + match[0].length);
|
||||
while((match = rx.exec(string)) && cM.getCursor().ch > match.index+match[0].length);
|
||||
|
||||
oldBlock = top.document.getElementById('content').contentWindow.document.getElementById('cssColor');
|
||||
if (oldBlock) {oldBlock.parentNode.removeChild(oldBlock)};
|
||||
|
||||
Reference in New Issue
Block a user