File tree Expand file tree Collapse file tree 3 files changed +39
-3
lines changed Expand file tree Collapse file tree 3 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ VERSION = `cat VERSION`
21
21
22
22
less :
23
23
@@mkdir -p build
24
- @@cat ${SRC} /parser.js\
24
+ @@cat lib/ext/* .js\
25
+ ${SRC} /parser.js\
25
26
${SRC} /functions.js\
26
- ${SRC} /tree/* .js > ${BUILD}
27
+ ${SRC} /tree/* .js\
28
+ ${SRC} /browser.js > ${BUILD}
27
29
@@echo ${BUILD} built.
28
30
29 31
min : less
Original file line number Diff line number Diff line change
1
+ //
2
+ // Select all links with the 'rel' attribute set to "less"
3
+ //
4
+ var sheets = document . querySelectorAll ( "link[rel=less]" ) ;
5
+
6
+ for ( var i = 0 ; i < sheets . length ; i ++ ) {
7
+ xhr ( sheets [ i ] . href , function ( data ) {
8
+ new ( less . Parser ) ( { optimizations : 3 } ) . parse ( data , function ( e , root ) {
9
+ document . styleSheets [ 0 ] . insertRule ( root . toCSS ( ) ) ;
10
+ } ) ;
11
+ } ) ;
12
+ }
13
+
14
+ function xhr ( url , callback , errback ) {
15
+ var xhr = new ( XMLHttpRequest ) ;
16
8000
code>
+ var headers = {
17
+ 'X-Requested-With' : 'XMLHttpRequest' ,
18
+ 'Accept' : 'text/*'
19
+ } ;
20
+
21
+ xhr . open ( 'get' , url , true ) ;
22
+ xhr . onreadystatechange = function ( ) {
23
+ if ( this . readyState != 4 ) { return }
24
+
25
+ if ( this . status >= 200 && this . status < 300 ) {
26
+ callback ( this . responseText ) ;
27
+ } else if ( typeof ( errback ) === 'function' ) {
28
+ errback ( this . responseText ) ;
29
+ }
30
+ } ;
31
+ xhr . send ( ) ;
32
+ }
Original file line number Diff line number Diff line change 1
1
if ( typeof ( require ) !== 'undefined' ) {
2
- var less = exports || { } ;
2
+ var less = exports ;
3
3
var tree = require ( 'less/tree' ) ;
4
+ } else {
5
+ var less = tree = { } ;
4
6
}
5
7
//
6
8
// less.js - parser
You can’t perform that action at this time.
0 commit comments