68 Commits

Author SHA1 Message Date
Matthew Dean
a577abf8e1 Clean up log messages 2016-03-25 14:45:20 -07:00
Andrej
8feb269e8e Fix both issues of the refresh() function: #2844 (promise called sometimes too soon) and #2812 (promise never called if no less files were declared). 2016-03-24 15:20:00 +01:00
Luke Page
29f8ae22cc upgrade jshint and fix new errors 2016-01-30 08:29:47 +00:00
Matthew Dean
809f1b1862 Merge pull request #2735 from less/browser-cache
Fix for #2384 and caching enabled with modifyVars set
2016-01-26 09:54:39 -08:00
Marko Pukari
c731fe0dc1 Fail when image-size functions are used in browser-less. 2015-11-27 13:20:07 +02:00
Matthew Dean
b50a7abf98 Fix: Always restore page visibility even if Less generates an error 2015-11-26 10:19:44 -08:00
Matthew Dean
65404cb506 Allows stylesheets to cache even with modifyVars
- Basically, compares assigned vars to vars in localStorage. If they match (and all the other cache criteria pass), then loads from cache
2015-11-25 22:53:36 -08:00
Matthew Dean
c5283bb8d1 Fix for #2384 - fakes "sync" loading of web page by hiding it until styles are done
/ The actual XHR requests are changed to async for a speed boost for "sync" loading of orders of magnitude
2015-11-25 22:52:24 -08:00
Christian Hammond
f66757554f Fix synchronously loading/applying stylesheets on page load.
Starting in 2.0, stylesheet loading became asynchronous, through the
usage of promises for both calculating the list of stylesheets and the
initial call to less.refresh(). This resulted in visual issues while
loading on some browsers (noticed in Firefox and Safari), along with
breakages of any custom JavaScript that depended on the computed style
of elements on the page, due to race conditions.

This change preserves the promise for initial page loading, in order to
retain support for less.pageLoadFinished, but immediately executes the
stylesheet scan (through a new less.registerStylesheetsImmediately
function) and the less.refresh() call. That resulting behavior matches
versions of less prior to 2.0.

This unveiled a regression in registering functions, both in the browser
and in unit tests, that was not previously noticed due to the
asynchronous load. Registered functions would have a 'less' variable set
to the less options, and not less itself, when not going through the
asynchronous loading mode. This meant that both unit tests and
real-world function registration would break when the sync page loading
was fixed. Overriding window.less to point to the actual less module and
not less.options during bootstrap fixes this.

This fixes #2317.
2015-04-28 02:08:39 -07:00
Bass Jobsen
296014a632 add more plugin tests 2015-03-03 22:52:54 +01:00
Luke Page
8e7c285de7 Fix jscs violations, happening on travis 2015-02-07 11:29:52 +00:00
Luke Page
604c911441 style cop 2 - indentation 2015-01-30 20:41:25 +00:00
Luke Page
1494e25ef0 More style cop.. 2015-01-30 18:28:02 +00:00
Luke Page
d206167c84 enforce spaces between operators for consistency 2015-01-27 22:24:12 +00:00
Luke Page
31c3d04980 jscs style checking. Fixed whitespace issues. 2015-01-26 23:34:35 +00:00
Luke Page
43773dd550 Pass the css from the cache into the callback. Fixes #2381 2015-01-12 19:39:51 +00:00
Luke Page
9e279a69d8 Some simplification in the browser and do not cache if modify vars is se. Fixes #2054 2015-01-04 08:11:48 +00:00
Luke Page
e9b227c9ac add an onReady option that disables less running on page load. Fixes #2327 2015-01-03 09:12:37 +00:00
Bass Jobsen
e45f7eb624 Change error message when caching fails
see also: http://stackoverflow.com/questions/27722349/less-js-error-msg-failed-to-save/27750286
2015-01-03 01:18:53 +01:00
Luke Page
29eb4263fe support safari extension. Fixes #2358 2015-01-01 21:48:02 +00:00
Guy Bedford
2c1172df21 Support non-JSON script attributes 2014-11-28 15:08:08 +02:00
Luke Page
b51691ccee missing return statement causing failing tests 2014-11-22 18:46:02 +00:00
Luke Page
89c95af070 Fix isSync option, turn browser back to running sychronously and fix many issues that came up 2014-11-22 18:30:36 +00:00
Chris Gross
54ee4fa20c Remove livereload cache buster param in extractId 2014-11-09 12:02:31 -05:00
Veres Lajos
73f3fc4468 typo fixes 2014-11-02 23:18:29 +00:00
Luke Page
1ab7bbce41 Merge branch 'master' into sauce
Conflicts:
	package.json
2014-11-01 18:51:21 +00:00
Luke Page
9ddd81fc07 seperate out bootstrapping less and the browser api 2014-11-01 17:05:21 +00:00
Luke Page
d48fd51661 change default for useFileCache. Fixes #2261 2014-11-01 14:30:29 +00:00
Luke Page
062afacfe0 Fix browserify to be the one to expose less to window 2014-11-01 12:04:54 +00:00
Moez Bouhlel
815e977b0b add support to read options from less file link tag data attr 2014-10-22 19:20:20 +01:00
Moez Bouhlel
e2b30eb1b3 improve support to read options from script tag data attr - part 2 2014-10-22 18:57:29 +01:00
Moez Bouhlel
0681e59d3d improve support to read options from script tag data attr 2014-10-22 18:00:33 +01:00
Moez Bouhlel
e5b18c08ce add support to read options from script tag data attr 2014-10-22 16:08:38 +01:00
Luke Page
f24db033de ie support in the tests 2014-10-22 12:46:22 +01:00
Luke Page
d436b83c06 put the built-in cache on the less object 2014-10-19 18:42:07 +01:00
Luke Page
9d535c0470 Whitespace - undo unusual new() syntax 2014-10-19 16:57:22 +01:00
Luke Page
845ec72131 improve error reporting 2014-10-19 16:48:04 +01:00
Luke Page
114d3e59e8 Tidy up after solving problem when building in linux 2014-10-19 09:47:39 +01:00
Luke Page
545ee85a25 travis CI test 3 2014-10-19 08:44:56 +01:00
Luke Page
7b84a9fe54 another travis ci test 2014-10-19 08:40:14 +01:00
Luke Page
6913f305b5 Test why travis CI is failing 2014-10-19 08:34:49 +01:00
Luke Page
5796cf29e0 upgrade browserify. Use the promise shim instead of the full node version in the browser. 2014-10-18 08:34:54 +01:00
Luke Page
8b42ae3883 A few tweaks to browser loading 2014-10-17 08:12:52 +01:00
Luke Page
659bf74777 Merge pull request #2233 from levithomason/feature/reload-stylesheets
Method to scan for and register stylesheets
2014-10-17 08:02:21 +01:00
Levi Thomason
0e821f1a4f cleanup callback 2014-10-15 23:03:55 -07:00
Levi Thomason
89358faefe more sane resolve 2014-10-15 23:02:11 -07:00
Levi Thomason
d31be578a3 Fixes #713, #771, #1161 2014-10-15 22:58:15 -07:00
Levi Thomason
999af91bb3 set less.hasFinished to refresh() promise
fix white space

return promise on modifyVars
2014-10-14 00:30:35 -07:00
Levi Thomason
a0b1b2f4bd refresh returns promise
pass the error to reject()
2014-10-12 17:28:03 -07:00
Luke Page
b966cf1d1b some renames, tidy ups and bugfixes whilst adding npm plugin 2014-10-11 17:51:08 +01:00