1 | ( function( ) |
---|
2 | { |
---|
3 | var _configuration = ExpressoLivre( ).JSON( ); |
---|
4 | |
---|
5 | var _xconnector = null; |
---|
6 | var _xlink = null; |
---|
7 | |
---|
8 | function _go( ) |
---|
9 | { |
---|
10 | _xconnector.go.apply( _xconnector, arguments ); |
---|
11 | } |
---|
12 | |
---|
13 | function _link( ) |
---|
14 | { |
---|
15 | _xlink.click.apply( _xlink, arguments ); |
---|
16 | } |
---|
17 | |
---|
18 | function _path( ) |
---|
19 | { |
---|
20 | return window.location.protocol + "//" + window.location.host + _configuration.url; |
---|
21 | } |
---|
22 | |
---|
23 | function _template( ) |
---|
24 | { |
---|
25 | return _configuration.template; |
---|
26 | } |
---|
27 | |
---|
28 | function _theme( ) |
---|
29 | { |
---|
30 | return _configuration.theme; |
---|
31 | } |
---|
32 | |
---|
33 | function _ExpressoLivre( ) |
---|
34 | { |
---|
35 | return ( new function( ) |
---|
36 | { |
---|
37 | this.go = _go; |
---|
38 | this.link = _link; |
---|
39 | this.path = _path; |
---|
40 | this.theme = _theme; |
---|
41 | this.template = _template; |
---|
42 | } ); |
---|
43 | } |
---|
44 | |
---|
45 | window.ExpressoLivre = _ExpressoLivre( ); |
---|
46 | |
---|
47 | _xlink = new XLink( ExpressoLivre.path( ) ); |
---|
48 | |
---|
49 | _xconnector = new XConnector( { |
---|
50 | "path" : ExpressoLivre.path( ), |
---|
51 | "controller" : "?menuaction=" |
---|
52 | } ); |
---|
53 | |
---|
54 | XEvents.add( window, 'onload', function( ) |
---|
55 | { |
---|
56 | document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll'; |
---|
57 | |
---|
58 | var _scripts = document.getElementsByTagName( 'head' ).item( 0 ).getElementsByTagName( 'script' ); |
---|
59 | var _loaded = [ ]; |
---|
60 | |
---|
61 | for ( var i = 0; i < _scripts.length; i++ ) |
---|
62 | if ( _scripts.item( i ).getAttribute( 'src' ) != null ) |
---|
63 | _loaded[ _loaded.length ] = _scripts.item( i ).getAttribute( 'src' ).substr( |
---|
64 | _path.length - 1, |
---|
65 | _scripts.item( i ).getAttribute( 'src' ).indexOf( '?' ) - _path.length + 1 |
---|
66 | ); |
---|
67 | |
---|
68 | new XScript( _loaded ); |
---|
69 | |
---|
70 | var _links = document.getElementsByTagName( 'a' ); |
---|
71 | for ( var i = 0; i < _links.length; i++ ) |
---|
72 | _xlink.intercept( _links.item( i ) ); |
---|
73 | } ); |
---|
74 | } )( ); |
---|