162 Commits

Author SHA1 Message Date
Luke Page
fce001e088 use the right xml http request for local file access. from @Scorpin 2014-02-23 16:41:39 +00:00
Luke Page
18c49e7a0f re-implement pull request #1701 - still allow log level to be configurable in dev mode 2014-02-23 16:12:27 +00:00
Luke Page
2a194e03d0 Merge branch 'master' of https://github.com/cloudchen/less.js
Conflicts:
	lib/less/browser.js
2014-02-23 08:30:50 +00:00
Luke Page
6f3f59cd57 tweak the log levels. Fixes #1856 2014-02-23 08:26:18 +00:00
Cloud Chen
0a7954355a Implement postProcessor callback feature for less.ls browser environment #1835
Add `jasmine:postProcessor` task and corresponding spec as well
2014-02-03 00:07:38 +08:00
Luke Page
6dfb00751c Fix for in without hasOwnProperty 2014-01-10 20:09:36 +00:00
Luke Page
cc385886e0 use new parser options in the browser 2013-12-21 22:31:51 +00:00
Luke Page
9fccf9643f Merge branch 'parse-add-variables' of https://github.com/joscha/less.js
Conflicts:
	lib/less/parser.js
	test/less-test.js
2013-12-20 16:41:27 +00:00
Luke Page
3818727bf7 jshint: boss 2013-12-16 23:23:34 +00:00
Joscha Feth
723cdb501e This adds an additional vars parameter to the parse method. It allows a user to inject variables into a less string before compiling. 2013-12-08 22:50:54 +01:00
Luke Page
7869d46f20 Merge pull request #1643 from matthewp/location-port
Check location.port for truthiness
2013-11-15 11:37:20 -08:00
Christian Hammond
daec7dff1c Support specifying custom variables when calling lessc and less.js.
Both lessc and less.js can now be provided with global variables that
all .less files will have immediate access to. This can be used to
provide, for example, a base path for an @import, signed URLs offering
temporary access to an image on S3, or anything else.

lessc has two new parameters, --global-var and --modify-var. Both take
a value of the form "varname=value". --global-var declares variables
immediately before the content of the .less files, and --modify-var
declares them after.

--global-var is used when rules, imports, or other variables will depend
on the provided variable.

--modify-var is used to override a variable declared within the .less
file.

less.js's equivalent for global variables is less.globalVars. This can
be set before loading less.js. There is no new requivalent to
--modify-var, as less.modifyVars can be used for that purpose.
2013-11-14 02:58:34 -08:00
Matthew Phillips
de92480b8c Check location.port for truthiness
According to the w3 spec for Window:

http://www.w3.org/TR/Window/#location

`location.port` might be null. This PR checks that it is truthy before checking for the port's length.

One place where location.port is null is within [jsdom](https://github.com/tmpvar/jsdom), so if you run less within Node, within jsdom, it throws an exception in this code.
2013-11-07 10:59:25 -05:00
Luke Page
9447421258 switch on latedef option and fix issues. Fixes #1521 2013-09-01 12:34:20 +01:00
Luke Page
6fe1174382 rename log_level to logLevel and update some of the changelog 2013-08-22 19:30:15 +01:00
Luke Page
2ed6f34afb Use the log method for logging errors and turn the number into an
enumeration.
2013-08-22 19:11:23 +01:00
Luke Page
a63903cfff Merge branch '1.5.0-wip' of https://github.com/gitaarik/less.js into 1.5.0-wip
Conflicts:
	lib/less/browser.js
2013-08-22 19:06:09 +01:00
Luke Page
03a7183637 add tests and fix log to console feature 2013-08-21 20:35:32 +01:00
Luke Page
6c5072ebbc implement log to console and fix browser tests 2013-08-21 19:35:28 +01:00
Oliver Wong
0bf2354f12 use already existing head var 2013-08-15 20:46:00 +01:00
Oliver Wong
ee1d54a173 fix dom manipulation 2013-08-15 20:45:37 +01:00
Rik
adf55b225e added semi-colons to end of lines where missing 2013-07-24 11:03:05 +02:00
Rik
3a4a2074aa created less.log_level setting
This will control the amount of logging in the javascript console that
less will do while parsing.

Options are:
    2 - Information and errors
    1 - Errors
    0 - None

Defaults to 2
2013-07-24 10:52:04 +02:00
Luke Page
0c41e06ff8 Merge branch '1.5.0-wip' into sourcemaps-wip 2013-07-20 22:18:54 +01:00
Luke Page
4c51ff1914 Merge branch 'lessmaster' into 1.5.0-wip 2013-07-20 22:17:39 +01:00
SLaks
4b0795dc79 Windows path fixes
Fix uppercase drive letters, paths with multiple backslashes.

string.replace(string, string) only replaces the first match.
2013-07-17 14:03:58 -04:00
Daniel Stockman
8eeaf87a79 JSHint lib/* and test runners. 2013-07-08 19:09:03 -07:00
Luke Page
cc277d4f03 move call to initiate loading of styles to the end of browser.js in case of syncronous load - make sure all the functions have been assigned before starting up 2013-07-05 06:51:48 +01:00
Byron Wong
8ed519fd98 simplify by saving reference to style tag instead of saving index 2013-07-05 06:51:48 +01:00
Byron Wong
cd45ac90a3 take out log 2013-07-05 06:51:46 +01:00
Byron Wong
bf88f660f2 initial fix in browser.js and a small test addition 2013-07-05 06:51:45 +01:00
Luke Page
b726b0d96c Fix modifyVars to use a per file cache so less is re-evaluated properly. Also add tests and \n in case of comment on the last line 2013-07-05 06:49:09 +01:00
Luke Page
6fc6dc2301 Add import inline option. Fixes #1209 2013-07-05 06:48:47 +01:00
Luke Page
08fca7a7cc Align the callback param orders 2013-07-05 06:48:46 +01:00
Luke Page
e82536bfca Simplify more of loadFile and make more of the env creation common between node and browser 2013-07-05 06:48:44 +01:00
Luke Page
c391e72c5e seperate sheet and env 2013-07-05 06:48:43 +01:00
Luke Page
ede491b02d move browser to parse inside parser 2013-07-05 06:48:43 +01:00
Luke Page
d907cccf6f Move parsing into loadStylesheet from loadFile 2013-07-05 06:48:42 +01:00
Luke Page
806ddb64e6 start seperating browser load stylesheet and loadFile 2013-07-05 06:48:41 +01:00
Luke Page
7843e7767c global var fix 2013-07-05 06:12:55 +01:00
agatronic
46e1613ba7 Handle ./ paths in the browser when relative correctly. Fixes #1238 2013-04-30 15:17:05 +01:00
Nir Azuelos
ef6f9123ec Fix for local paths with Unix / Windows Support
Second try at fixing issue #1272, now with added Unix support.
2013-04-16 23:21:54 +03:00
Nir Azuelos
bd31c7a4c3 Fixed issue cloudhead/less.js#1272
Local path should now work correctly.
2013-04-16 00:27:54 +03:00
Luke Page
5d54af2039 import interpolation finished. refactored the import phase to occur only within the import visitor - so that the import eval env can be passed between imports. 2013-03-01 13:40:54 +00:00
Ben Loveridge
a7c9a853e9 patch for issue 163 2013-02-26 20:27:35 +00:00
Luke Page
156911aa11 make root slash non greedy 2013-02-16 14:54:13 +00:00
cahnory
8ef5043b78 Update lib/less/browser.js
Add support to "file:///" url which could be useful using "--disable-web-security" without a web server.
2013-02-16 14:48:44 +00:00
Luke Page
914eb404d7 Fix import errors in browser mode. Fixes #1117 and fixes #1118 2013-02-10 12:47:25 +00:00
Luke Page
88f3f02213 Correct some error inconsistancies. Add browser testing of errors - import missing error fails because of #1117 2013-02-05 22:38:43 +00:00
Luke Page
988d378922 add evalEnv class and strictMaths option 2013-01-25 20:05:37 +00:00