File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ function µ(id, elem) {
10
10
ret = document . createElement ( spl [ 0 ] . substring ( 1 ) ) ;
11
11
if ( elem ) elem . appendChild ( ret ) ;
12
12
break ;
13
- default :
13
+ case '#' :
14
14
ret = root . querySelector ( spl [ 0 ] ) ;
15
15
break ;
16
+ default :
17
+ ret = root . querySelectorAll ( spl [ 0 ] ) ;
18
+ break ;
16
19
}
17
20
if ( spl . length <= 1 ) return ret ;
18
21
else return ret . getAttribute ( spl [ 1 ] ) ;
@@ -277,6 +280,25 @@ function zeroPad(num, size) {
277
280
return s ;
278
281
}
279
282
283
+ function position ( elem ) {
284
+ var offset = { x :0 , y :0 } ;
285
+ while ( elem )
286
+ {
287
+ offset . x += elem . offsetLeft ;
288
+ offset . y += elem . offsetTop ;
289
+ elem = elem . offsetParent ;
290
+ }
291
+
292
+ return offset ;
293
+ }
294
+
295
+ function extractNumber ( value )
296
+ {
297
+ var n = parseInt ( value ) ;
298
+
299
+ return n == null || isNaN ( n ) ? 0 : n ;
300
+ }
301
+
280
302
// Reduce a fraction by finding the Greatest Common Divisor and dividing by it.
281
303
function reduce ( numerator , denominator ) {
282
304
var gcd = function gcd ( a , b ) {
Original file line number Diff line number Diff line change 1
- include ( [ ] , function ( ) {
2
-
3
1
var websocket = function ( ) {
4
- this . address = 'ws://' + window . location . host + '/' ;
2
+ this . address = 'ws://' + window . location . host + ':8080 /' ;
5
3
this . connectInterval = null ;
6
4
this . serialport = '' ;
7
5
var ws = null ;
@@ -44,4 +42,3 @@ include([], function() {
44
42
} ;
45
43
46
44
window . wsClient = new websocket ( ) ;
47
- } ) ;
You can’t perform that action at this time.
0 commit comments