Merge branch 'master' of github.com:cloudhead/less.js

This commit is contained in:
cloudhead 2010-06-30 20:00:16 +02:00
commit ca561a7c2c
2 changed files with 17 additions and 3 deletions

View File

@ -2,7 +2,9 @@
// browser.js - client-side engine
//
var isFileProtocol = location.protocol === 'file:';
var isFileProtocol = (location.protocol === 'file:' ||
location.protocol === 'chrome:' ||
location.protocol === 'resource:');
less.env = location.hostname == '127.0.0.1' ||
location.hostname == '0.0.0.0' ||
@ -47,7 +49,12 @@ if (less.env === 'development') {
less.optimization = 3;
}
var cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
var cache;
try {
cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
} catch (e) {
cache = null;
}
//
// Get all <link> tags with the 'rel' attribute set to "stylesheet/less"
@ -167,6 +174,9 @@ function xhr(url, callback, errback) {
var xhr = getXMLHttpRequest();
var async = isFileProtocol ? false : less.async;
if (typeof xhr.overrideMimeType === 'function') {
xhr.overrideMimeType('text/css');
}
xhr.open('GET', url, async);
xhr.send(null);

View File

@ -229,7 +229,11 @@ less.Parser = function Parser(env) {
chunks[++j] = [];
} else {
if (c === '"' || c === "'") {
inString = inString === c ? false : c;
if (!inString) {
inString = c;
} else {
inString = inString === c ? false : inString;
}
}
chunk.push(c);
}