1- <!DOCTYPE html>
2- < html >
3- < head >
4- < title > Themes Demo</ title >
5-
6- < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
7- < meta name ="viewport " content ="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0 " />
8- < meta name ="apple-mobile-web-app-capable " content ="yes " />
9- < meta name ="apple-mobile-web-app-status-bar-style " content ="black " />
10-
11- < link href ="../style.css " rel ="stylesheet " type ="text/css " />
12-
13-
14- < script src ="../../src/tabpanel/TabPanel.js "> </ script >
15- < script src ="../../src/window/Window.js "> </ script >
16- < script src ="../../src/utils/Utils.js "> </ script >
17-
18- < script src ="../../themes/default.js "> </ script >
19-
20- < script src ="demo.js "> </ script >
21-
22- </ head >
23- < body >
24- < div class ="demo-container ">
25-
26-
27-
28- < h1 > Themes Demo</ h1 >
29- < p > A sampling of various JavaXT components in different styles/themes.</ p >
30-
31- < h2 > No Theme</ h2 >
32- < p >
33- All JavaXT components have embedded style rules so you can use them out of-the-box.
34- In other words, you don't need to define any classes or style rules or include
35- any CSS file in order to render the components. This is what the components
36- look like with no styling.
37- </ p >
38- < div id ="demo1 "> </ div >
39-
40-
41- < h2 > Default Theme</ h2 >
42- < p >
43- You can customize the look and feel of any component by providing your own
44- style rules when you instantiate the JavaXT components via the "style" config.
45- In the themes folder, there is a CSS file called "default.css". This is
46- what the components look like with the "default.css" theme.
47- </ p >
48- < div id ="demo2 "> </ div >
49-
50-
51- < h2 > Dark Theme</ h2 >
52- < p >
53- And of course, we have a dark mode! In the themes folder, there is a CSS file
54- called "dark.css". This is what the components look like with the "dark.css" theme.
55- </ p >
56- < div id ="demo3 "> </ div >
57-
58-
59-
60-
61- < script >
62- window . onload = function ( ) {
63-
64- var html = document . getElementsByTagName ( "html" ) [ 0 ] . cloneNode ( true ) ;
65- html . getElementsByTagName ( "body" ) [ 0 ] . innerHTML = "" ;
66-
67-
68- for ( var i = 0 ; i < 3 ; i ++ ) {
69- var div = document . getElementById ( "demo" + ( i + 1 ) ) ;
70- div . style . height = "400px" ;
71-
72-
73- //Define a theme
74- var theme = "" ;
75- if ( i === 1 ) {
76- theme = "../../themes/default.css" ;
77- }
78- else if ( i === 2 ) {
79- theme = "../../themes/dark.css" ;
80- }
81-
82-
83- //Create iFrame
84- var iframe = document . createElement ( "iframe" ) ;
85- iframe . style . width = "100%" ;
86- iframe . style . height = "100%" ;
87- iframe . theme = theme ;
88- div . appendChild ( iframe ) ;
89-
90-
91- //Update iFrame and render components
92- iframe . onload = function ( ) {
93- if ( this . theme ) {
94- var h = this . contentWindow . document . getElementsByTagName ( "head" ) [ 0 ] ;
95- var l = h . getElementsByTagName ( "link" ) [ 0 ] ;
96- l . href = this . theme ;
97- }
98- var b = this . contentWindow . document . getElementsByTagName ( "body" ) [ 0 ] ;
99- b . style . padding = 0 ; //override demos/style.css
100- renderComponents ( b , this . theme ? javaxt . dhtml . style . default : false ) ;
101- } ;
102- iframe . contentWindow . document . open ( ) ;
103- iframe . contentWindow . document . write ( html . innerHTML ) ;
104- iframe . contentWindow . document . close ( ) ;
105-
106- }
107- } ;
108- </ script >
109-
110- </ div >
111- </ body >
1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < title > Themes Demo</ title >
5+
6+ < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
7+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0 " />
8+ < meta name ="apple-mobile-web-app-capable " content ="yes " />
9+ < meta name ="apple-mobile-web-app-status-bar-style " content ="black " />
10+
11+ < link href ="../style.css " rel ="stylesheet " type ="text/css " />
12+
13+
14+ < script src ="../../src/tabpanel/TabPanel.js "> </ script >
15+ < script src ="../../src/window/Window.js "> </ script >
16+ < script src ="../../src/utils/Utils.js "> </ script >
17+
18+ < script src ="../../themes/default.js "> </ script >
19+
20+ < script src ="demo.js "> </ script >
21+
22+ </ head >
23+ < body >
24+ < div class ="demo-container ">
25+
26+
27+
28+ < h1 > Themes Demo</ h1 >
29+ < p > A sampling of various JavaXT components in different styles/themes.</ p >
30+
31+ < h2 > No Theme</ h2 >
32+ < p >
33+ All JavaXT components have embedded style rules so you can use them out of-the-box.
34+ In other words, you don't need to define any classes or style rules or include
35+ any CSS file in order to render the components. This is what the components
36+ look like with no styling.
37+ </ p >
38+ < div id ="demo1 "> </ div >
39+
40+
41+ < h2 > Default Theme</ h2 >
42+ < p >
43+ You can customize the look and feel of any component by providing your own
44+ style rules when you instantiate the JavaXT components via the "style" config.
45+ In the themes folder, there is a CSS file called "default.css". This is
46+ what the components look like with the "default.css" theme.
47+ </ p >
48+ < div id ="demo2 "> </ div >
49+
50+
51+ < h2 > Dark Theme</ h2 >
52+ < p >
53+ And of course, we have a dark mode! In the themes folder, there is a CSS file
54+ called "dark.css". This is what the components look like with the "dark.css" theme.
55+ </ p >
56+ < div id ="demo3 "> </ div >
57+
58+
59+
60+
61+ < script >
62+ window . onload = function ( ) {
63+
64+ var html = document . getElementsByTagName ( "html" ) [ 0 ] . cloneNode ( true ) ;
65+ html . getElementsByTagName ( "body" ) [ 0 ] . innerHTML = "" ;
66+
67+
68+ for ( var i = 0 ; i < 3 ; i ++ ) {
69+ var div = document . getElementById ( "demo" + ( i + 1 ) ) ;
70+ div . style . height = "400px" ;
71+
72+
73+ //Define a theme
74+ var theme = "" ;
75+ if ( i === 1 ) {
76+ theme = "../../themes/default.css" ;
77+ }
78+ else if ( i === 2 ) {
79+ theme = "../../themes/dark.css" ;
80+ }
81+
82+
83+ //Create iFrame
84+ var iframe = document . createElement ( "iframe" ) ;
85+ iframe . style . width = "100%" ;
86+ iframe . style . height = "100%" ;
87+ iframe . theme = theme ;
88+ div . appendChild ( iframe ) ;
89+
90+
91+ //Update iFrame and render components
92+ iframe . onload = function ( ) {
93+ if ( this . theme ) {
94+ var h = this . contentWindow . document . getElementsByTagName ( "head" ) [ 0 ] ;
95+ var l = h . getElementsByTagName ( "link" ) [ 0 ] ;
96+ l . href = this . theme ;
97+ }
98+
99+ var body = this . contentWindow . document . getElementsByTagName ( "body" ) [ 0 ] ;
100+ body . style . padding = 0 ; //override demos/style.css
101+
102+ var div = document . createElement ( "div" ) ;
103+ div . style . width = "100%" ;
104+ div . style . height = "100%" ;
105+ div . style . position = "relative" ;
106+ body . appendChild ( div ) ;
107+
108+ renderComponents ( div , this . theme ? javaxt . dhtml . style . default : false ) ;
109+ } ;
110+ iframe . contentWindow . document . open ( ) ;
111+ iframe . contentWindow . document . write ( html . innerHTML ) ;
112+ iframe . contentWindow . document . close ( ) ;
113+
114+ }
115+ } ;
116+ </ script >
117+
118+ </ div >
119+ </ body >
112120</ html >
0 commit comments