WebPage_wev8.js
5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
// vim: sw=4:ts=4:nu:nospell:fdc=4
/**
* @class WebPage
*
* WebPage Layout Generator
*
* @author Ing. Jozef Sakáloš
* @copyright (c) 2008, by Ing. Jozef Sakáloš
* @date 6. April 2008
* @version 1.0
* @revision $Id: WebPage_wev8.js 642 2009-03-20 21:25:51Z jozo $
*
* @license WebPage_wev8.js is licensed under the terms of the Open Source
* LGPL 3.0 license. Commercial use is permitted to the extent that the
* code/component(s) do NOT become part of another Open Source or Commercially
* licensed development library or toolkit without explicit permission.
*
*<p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
* target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
*/
/*global Ext, WebPage */
Ext.ns('WebPage');
WebPage = function(config) {
Ext.apply(this, config, {
autoRender:true
,autoTitle:true
,langCombo:false
,ctCreate:{tag:'div', id:'ct-wrap', cn:[{tag:'div', id:'ct'}]}
});
if(this.autoRender) {
this.render();
}
};
Ext.override(WebPage, {
navlinks:[{
text:'Home'
,href:'http://extjs.eu'
,target:'_self'
},{
text:'Blog'
,href:'http://blog.extjs.eu'
,target:'_self'
},{
text:'Examples'
,href:'http://examples.extjs.eu'
,target:'_blank'
},{
text:'ExtJS'
,href:'http://www.extjs.com'
,target:'_blank'
},{
text:'Forum'
,href:'http://www.extjs.com/forum'
,target:'_blank'
},{
text:'Learn'
,href:'http://www.extjs.com/learn'
,target:'_blank'
},{
text:'Docs'
,href:'http://www.extjs.com/deploy/dev/docs'
,target:'_blank'
},{
text:'UX-Docs'
,href:'http://www.extjs.eu/docs'
,target:'_blank'
},{
text:'Samples'
,href:'http://www.extjs.com/deploy/dev/examples'
,target:'_blank'
},{
text:'Profile'
,href:'http://www.extjs.com/forum/member.php?u=2178'
,target:'_blank'
}]
,navlinksTpl: new Ext.XTemplate(
'<ul>'
+'<tpl for="navlinks">'
+'<li><a href="{href}" target="{target}">{text}</a></li>'
+'</tpl>'
+'</ul><div class="cleaner"></div>'
)
,render:function() {
var body = Ext.getBody();
var dh = Ext.DomHelper;
// create wrap and container
this.wrap = dh.insertFirst(body, this.ctCreate, true);
this.ct = Ext.get('ct');
if(this.width) {
this.ct.setWidth(this.width);
}
this.north = dh.append(this.ct, {tag:'div', id:'north'}, true);
if(this.northHeight) {
this.north.setHeight(this.northHeight);
}
this.nav = dh.append(this.ct, {tag:'div', id:'navlinks'}, true);
if(this.navHeight) {
this.nav.setHeight(this.navHeight);
}
if(this.adRowContent) {
this.adrow = dh.append(this.ct, {tag:'div', id:'adrow'}, true);
if(this.adrowHeight) {
this.adrow.setHeight(this.adrowHeight);
}
}
this.west = dh.append(this.ct, {tag:'div', id:'west'}, true);
if(this.westWidth) {
this.west.setWidth(this.westWidth);
}
this.center = dh.append(this.ct, {tag:'div', id:'center'}, true);
if(this.westWidth && this.eastWidth) {
this.center.setWidth(this.ct.getWidth() - this.westWidth - this.eastWidth);
}
this.east = dh.append(this.ct, {tag:'div', id:'east'}, true);
if(this.eastWidth) {
this.east.setWidth(this.eastWidth);
}
this.south = dh.append(this.ct, {tag:'div', id:'south'}, true);
if(this.southHeight) {
this.south.setHeight(this.southHeight);
}
// {{{
// north content
if(this.northContent) {
this.north.appendChild(this.northContent);
this.northContent = Ext.get(this.northContent).removeClass('x-hidden');
}
else if(this.autoTitle) {
var title = Ext.fly('page-title');
if(title) {
title = title.dom.innerHTML;
title += this.version ? ' - ver.: ' + this.version : '';
}
this.north.createChild({tag:'h1', html:title});
}
// theme select combo
var themeCt = this.north.createChild({tag:'div', id:'themect', cls:'x-hidden'});
this.themeCombo = new Ext.ux.form.ThemeCombo({
renderTo:themeCt
,width:themeCt.getWidth()
});
// language select combo
if(this.langCombo) {
var langCt = this.north.createChild({tag:'div', id:'langct', cls:'x-hidden'});
this.langCombo = new Ext.ux.form.LangSelectCombo({
renderTo:langCt
,width:langCt.getWidth()
,editable:false
});
}
// }}}
if(this.navlinks) {
this.navlinksTpl.overwrite(this.nav, {navlinks:this.navlinks});
}
if(this.adrow) {
this.adrow.appendChild(this.adRowContent);
this.adRowContent = Ext.get(this.adRowContent).removeClass('x-hidden');
}
if(this.westContent) {
this.west.appendChild(this.westContent);
this.westContent = Ext.get(this.westContent).removeClass('x-hidden');
}
if(this.centerContent) {
this.center.appendChild(this.centerContent);
this.centerContent = Ext.get(this.centerContent).removeClass('x-hidden');
}
if(this.eastContent) {
this.east.appendChild(this.eastContent);
this.eastContent = Ext.get(this.eastContent).removeClass('x-hidden');
}
if(this.southContent) {
this.south.appendChild(this.southContent);
this.southContent = Ext.get(this.southContent).removeClass('x-hidden');
}
(function() {
themeCt.removeClass('x-hidden');
if(langCt) {
langCt.removeClass('x-hidden');
}
}).defer(250)
} // eo function render
});
// eof