use isFileProtocol variable for dryness

This commit is contained in:
cloudhead
2010-06-15 14:51:48 -04:00
parent 9b173bf6e4
commit 8a75acf40a

View File

@@ -1,10 +1,12 @@
(function () {
var isFileProtocol = location.protocol === 'file:';
less.env = location.hostname == '127.0.0.1' ||
location.hostname == '0.0.0.0' ||
location.hostname == 'localhost' ||
location.protocol == 'file:' ||
location.port.length > 0 ? 'development'
location.port.length > 0 ||
isFileProtocol ? 'development'
: 'production';
// Load styles asynchronously (default: false)
@@ -16,7 +18,7 @@ less.env = location.hostname == '127.0.0.1' ||
less.async = false;
// Interval between watch polls
less.poll = location.protocol == 'file:' ? 1000 : 1500;
less.poll = isFileProtocol ? 1000 : 1500;
//
// Watch mode