From d15752ff5fe352e0e3d3b397a6dde5803d95ea4d Mon Sep 17 00:00:00 2001 From: cloudhead Date: Sun, 15 Aug 2010 10:58:52 -0400 Subject: [PATCH] basic ability to overwrite some config options in browser --- lib/less/browser.js | 5 +++-- lib/less/parser.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/less/browser.js b/lib/less/browser.js index db6d77e6..d31143e8 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -6,7 +6,8 @@ var isFileProtocol = (location.protocol === 'file:' || location.protocol === 'chrome:' || location.protocol === 'resource:'); -less.env = location.hostname == '127.0.0.1' || +less.env = less.env || + location.hostname == '127.0.0.1' || location.hostname == '0.0.0.0' || location.hostname == 'localhost' || location.port.length > 0 || @@ -22,7 +23,7 @@ less.env = location.hostname == '127.0.0.1' || less.async = false; // Interval between watch polls -less.poll = isFileProtocol ? 1000 : 1500; +less.poll = less.poll || (isFileProtocol ? 1000 : 1500); // // Watch mode diff --git a/lib/less/parser.js b/lib/less/parser.js index 0704e945..08c00fdc 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -4,7 +4,8 @@ if (typeof(window) === 'undefined') { less = exports, tree = require('less/tree'); } else { - less = window.less = {}, + if (typeof(window.less) === 'undefined') { window.less = {} } + less = window.less, tree = window.less.tree = {}; } //