124 Commits

Author SHA1 Message Date
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
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
Luke Page
e45ec8a31e refactoring - add a env type to better organise its properties 2013-01-23 19:07:29 +00:00
Luke Page
905ccb8a0c make path matching more resiliant and parse file:/// 2013-01-02 20:21:39 +00:00
Luke Page
5b3851720a browser support for rootpath and relative urls, with test 2012-12-28 20:32:26 +00:00
Luke Page
eb5c9fbf5d Relative url's option for node lessc 2012-12-28 15:25:15 +00:00
Luke Page
addf87a75f Fix browser tests by moving url re-writing tests to urls.less. Also fix browser rootpath. 2012-12-28 12:38:49 +00:00
Salim Bensiali
e59a93b5fd Relative URLs in LESS files should be relative to the file that defines them.
It is up to the parser and compiler to rewrite them when those files are
imported by another LESS file.

- Modified and added test cases for import and import-once rules
- Fixed difference between client side and server side handling of relative urls
- Added a -rootpath option to lessc to specify another base path for the url
  rewriting. By default, rootpath=''
2012-12-27 20:40:16 +00:00
Luke Page
d0512b1ce2 Make import-once fix, but for the browser 2012-12-22 18:10:49 +00:00
Luke Page
8cfe7acdae make import-once use the full path, not the possibly relative path to determine if an import has already been included 2012-12-22 10:21:28 +00:00
Hakan Bilgin
26c450d344 Function "modifyVars" added
The function "modifyVars" the option to modify variables in the
less-file without reloading less-file, including potential
import-files declared with "@import".
2012-12-16 09:36:44 +00:00
Luke Page
6554117643 Add initial browser test suite using phantomjs for headless testing and jasmine 2012-12-16 08:45:51 +00:00
Luke Page
be2c938944 allow less files to have query paramaters. Fixes #788 2012-12-12 22:54:33 +00:00
Rok Garbas
abb6b999c6 less element (sheet) might not be located in head 2012-12-11 04:38:33 +01:00
Luke Page
2602833d38 Allow escaped charcaters in less filename url. Fixes #982 2012-12-09 16:11:08 +00:00
Jakob Stoeck
d5099742d4 only cache imported files when not in development mode, fixes #346, fixes #47 2012-10-28 14:30:41 +00:00
unknown
f7959b7190 call less.watch() in non dev mode FIXED 2012-10-25 07:56:11 +01:00
Simone Deponti
959e22f5ff Added media query support.
* env.dumpLineNumbers was being lost when doing "offline" compilation
   (within node.js)
 * Added documentation for the changed options
 * --line-numbers now takes a parameter
   (either "comments", "mediaquery" or "all")
 * The system can now again output mediaqueries for FireLESS
 * Moved comments tests in debug/comments, will duplicate
   for mediaquery and for "all"

Everything is still utterly broken though, tests still fail.
2012-10-07 12:16:03 +01:00
Vsevolod Vlasov
ccfa7402a1 Added ruleset source line number dumping support for debugging purposes. 2012-10-07 12:16:01 +01:00
Will
5eca0142c9 Check XHR return type appropriately
Asynchronous file XHRs need to listen for onreadystatechange.
2012-10-07 12:09:47 +01:00
Will
6bdd800bb6 Allow configuration of asynchronous XHR
Set less.async and/or less.fileAsync to true before including less.js to
force asynchronous XHR requests to be used.  fileAsync is introduced
as a separate setting to maintain existing semantics, as previously changing
less.async to true would only affect http protocol XHRs.
2012-10-07 12:09:47 +01:00
Luke Page
f6917c8fa6 At least catch no browser storage rather than balking 2012-09-01 17:12:32 +01:00
Luke Page
5f99bd22e9 Fix error messages in the browser for imported files with duplicate names (different directory) and links. Fixes #932 2012-09-01 16:45:46 +01:00
Luke Page
f020aae779 Make less more protocol agnostic. Fixes #428 and Fixes #742 and Fixes #706 2012-09-01 15:37:15 +01:00
Desmond Brand
56f11e9666 Fix #423 by preserving order of link/style elements
Appending generated css to the head element is confusing because it
changes the order of style declarations. If there are regular css link
or style elements after the less link element, less declarations with
equal specificity will override css declarations that come later in the
document.

This change preserves the original order by inserting the generated css
immediately after the less link element.
2012-08-18 11:29:35 +01:00
Colin
5f9cf904e7 Only set media type when one is present
Defaulting to media="screen" causes the
browser to ignore inline @media print
and other queries.

Fixes #612
2012-08-12 19:18:03 +01:00
Paulo Gaspar
66bbb9a44a Fix for issue 592. Additional removal of TODOs and Rhino support by
@agatronic.
2012-08-11 16:40:59 +01:00
Trey Shugart
acf65e0f5d Fixes #602 2012-01-31 13:50:26 +11:00
Alexis Sellier
b9dbfc08a4 fix imports on browser 2012-01-15 17:15:17 +01:00
Alexis Sellier
b5dd30f4d4 fix imports on browser 2012-01-15 16:44:03 +01:00
Alexis Sellier
9c344ba5a1 improve error reporting on browser 2012-01-15 16:39:51 +01:00
Cotton Hou
7a033af705 Use if rather than try 2011-12-12 15:57:50 +08:00
Cotton Hou
f255aefccf Shift the type setting in order to work with Webkit, and fix typo for IE. 2011-12-11 14:37:53 +08:00
Hargobind S. Khalsa
bddedfcd21 Accept 2xx statuses even for file requests 2011-09-06 16:04:49 -06:00
Miles
24cc747e5e Added a modified version of Felipe Gasper's IE<9 style injection error fix. 2011-08-03 14:52:35 -07:00
Alexis Sellier
4463e52227 (minor) ws 2011-05-11 14:33:55 -04:00
Alexis Sellier
38b60d8cdb Merge pull request #169 from alkemist/master
(fix) including .less files via absolute path with IE7
2011-05-11 08:54:30 -07:00
Alexis Sellier
1369b57c06 Merge pull request #189 from dz0ny/master
Google Chrome(Chromium) support for extensions
2011-05-11 08:50:09 -07:00
Matt Quail
08b2b353a5 fix implicit vars 2011-02-19 16:42:00 -05:00
Janez Troha
dc5a08014c Fix for Google Chrome(Chromium), so you can use less in extensions, apps. Adds protocol support but you have to use .json as file extension for css file, otherwise you get "Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101". 2011-02-01 09:49:51 -08:00