[Pkg-javascript-commits] [less.js] 30/285: get most of the browser tests running
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:23:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v2.0.0
in repository less.js.
commit 418af74c278bd8e360df6ea334f84547c7264cd0
Author: Luke Page <luke.a.page at gmail.com>
Date: Fri Feb 28 18:07:56 2014 +0000
get most of the browser tests running
---
lib/less/browser.js | 20 ++++++++++----------
lib/less/environments/browser.js | 3 +++
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/lib/less/browser.js b/lib/less/browser.js
index 3138c57..6ba6fa7 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -6,6 +6,13 @@
var less = require('./non-node-index.js'),
options = window.less;
+var logLevel = {
+ debug: 3,
+ info: 2,
+ errors: 1,
+ none: 0
+};
+
function log(str, level) {
if (typeof(console) !== 'undefined' && less.logLevel >= level) {
console.log('less: ' + str);
@@ -14,7 +21,7 @@ function log(str, level) {
var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);
-less.environment = require("./environments/browser.js")(less, isFileProtocol, log, 1/*TODO*/);
+less.environment = require("./environments/browser.js")(less, isFileProtocol, log, logLevel);
window.less = less;
less.env = options.env || (location.hostname == '127.0.0.1' ||
@@ -25,13 +32,6 @@ less.env = options.env || (location.hostname == '127.0.0.1' ||
isFileProtocol ? 'development'
: 'production');
-var logLevel = {
- debug: 3,
- info: 2,
- errors: 1,
- none: 0
-};
-
// The amount of logging in the javascript console.
// 3 - Debug, information and errors
// 2 - Information and errors
@@ -308,7 +308,7 @@ function loadStyles(modifyVars) {
for (var i = 0; i < styles.length; i++) {
style = styles[i];
if (style.type.match(typePattern)) {
- var env = new less.tree.parseEnv(less),
+ var env = new less.tree.parseEnv(options),
lessText = style.innerHTML || '';
env.filename = document.location.href.replace(/#.*$/, '');
@@ -339,7 +339,7 @@ function loadStyles(modifyVars) {
function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {
- var env = new less.tree.parseEnv(less);
+ var env = new less.tree.parseEnv(options);
env.mime = sheet.type;
if (modifyVars || options.globalVars) {
diff --git a/lib/less/environments/browser.js b/lib/less/environments/browser.js
index 15a967f..a8fe835 100644
--- a/lib/less/environments/browser.js
+++ b/lib/less/environments/browser.js
@@ -44,6 +44,8 @@ return {
alwaysMakePathsAbsolute: function alwaysMakePathsAbsolute() {
return true;
},
+ getCleanCSS: function () {
+ },
pathDiff: function pathDiff(url, baseUrl) {
// diff between two paths to create a relative path
@@ -128,6 +130,7 @@ return {
return returner;
},
doXHR: function doXHR(url, type, callback, errback) {
+
var xhr = getXMLHttpRequest();
var async = isFileProtocol ? less.fileAsync : less.async;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list