rsence 2.0.0.pre → 2.0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +295 -0
- data/LICENSE +622 -0
- data/README.rdoc +87 -0
- data/VERSION +1 -0
- data/bin/rsence +5 -101
- data/conf/config.yaml +4 -0
- data/conf/default_conf.yaml +6 -4
- data/conf/{local_conf.yaml → local_conf.yaml.devel} +2 -1
- data/js/comm/comm/autosync/autosync.js +0 -1
- data/js/comm/comm/queue/queue.js +1 -1
- data/js/comm/comm/urlresponder/urlresponder.js +58 -35
- data/js/comm/comm/values/values.js +13 -3
- data/js/comm/jsloader/jsloader.js +29 -12
- data/js/controls/button/themes/default/button_parts1-ie6.gif +0 -0
- data/js/controls/checkbox/themes/default/checkbox_parts1-ie6.gif +0 -0
- data/js/controls/datetime/timesheet/timesheet.js +2 -2
- data/js/controls/dialogs/sheet/themes/default/sheet_bg-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts1-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_parts2-ie6.gif +0 -0
- data/js/controls/dialogs/sheet/themes/default/sheet_warning-ie6.gif +0 -0
- data/js/controls/passwordcontrol/themes/default/passwordcontrol.html +1 -1
- data/js/controls/radiobutton/themes/default/radiobutton_parts1-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/hslider_tracks-ie6.gif +0 -0
- data/js/controls/sliders/slider/themes/default/slider.css +2 -0
- data/js/controls/sliders/slider/themes/default/slider_thumbs-ie6.gif +0 -0
- data/js/controls/sliders/vslider/themes/default/vslider.css +2 -0
- data/js/controls/sliders/vslider/themes/default/vslider_tracks-ie6.gif +0 -0
- data/js/controls/stepper/themes/default/stepper-ie6.gif +0 -0
- data/js/controls/tab/tab.js +2 -6
- data/js/controls/tab/themes/default/tab.css +1 -0
- data/js/controls/tab/themes/default/tab.html +1 -1
- data/js/controls/tab/themes/default/tab_border_pattern-ie6.gif +0 -0
- data/js/controls/tab/themes/default/tab_parts1-ie6.gif +0 -0
- data/js/controls/textarea/themes/default/textarea.css +21 -0
- data/js/controls/textarea/themes/default/textarea.html +2 -2
- data/js/controls/textcontrol/textcontrol.js +56 -69
- data/js/controls/textcontrol/themes/default/textcontrol.css +23 -20
- data/js/controls/textcontrol/themes/default/textcontrol.html +1 -1
- data/js/controls/window/themes/default/window.css +1 -0
- data/js/controls/window/themes/default/window_bg_active-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_bg_inactive-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_buttons-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts1-ie6.gif +0 -0
- data/js/controls/window/themes/default/window_parts2-ie6.gif +0 -0
- data/js/controls/window/window.js +28 -7
- data/js/core/class/class.js +31 -30
- data/js/core/elem/elem.js +94 -71
- data/js/core/event/event.js +34 -26
- data/js/core/iefix/iefix.js +46 -31
- data/js/debugg/debugg.js +43 -0
- data/js/debugg/js.inc +0 -0
- data/js/foundation/application/application.js +3 -1
- data/js/foundation/control/dyncontrol/dyncontrol.js +1 -0
- data/js/foundation/control/eventresponder/eventresponder.js +1 -1
- data/js/foundation/json_renderer/json_renderer.js +1 -3
- data/js/foundation/system/system.js +4 -4
- data/js/foundation/thememanager/thememanager.js +3 -3
- data/js/foundation/view/view.js +71 -1
- data/lib/conf/argv.rb +664 -0
- data/lib/conf/default.rb +51 -52
- data/lib/daemon/daemon.rb +281 -195
- data/lib/plugins/plugin_plugins.rb +47 -0
- data/lib/plugins/pluginmanager.rb +17 -12
- data/lib/transporter/transporter.rb +6 -9
- data/plugins/client_pkg/client_pkg.rb +12 -9
- data/plugins/client_pkg/lib/client_pkg_build.rb +1 -1
- data/plugins/index_html/tmpl/index.html +3 -3
- data/plugins/main/main.rb +1 -0
- metadata +16 -14
- data/bin/build_client.rb +0 -254
- data/bin/help +0 -6
- data/bin/launch.rb +0 -120
- data/bin/rdoc.sh +0 -2
- data/bin/restart +0 -6
- data/bin/run +0 -6
- data/bin/run.rb +0 -6
- data/bin/save +0 -6
- data/bin/start +0 -6
- data/bin/status +0 -6
- data/bin/stop +0 -6
data/js/core/event/event.js
CHANGED
@@ -46,7 +46,7 @@ Event = {
|
|
46
46
|
**/
|
47
47
|
isLeftClick: function(e) {
|
48
48
|
// IE: left 1, middle 4, right 2
|
49
|
-
if (
|
49
|
+
if (BROWSER_TYPE.ie || BROWSER_TYPE.safari) {
|
50
50
|
return (e.button === 1);
|
51
51
|
}
|
52
52
|
else {
|
@@ -141,7 +141,7 @@ Event = {
|
|
141
141
|
|
142
142
|
// Activates the garbage collector of Internet Explorer
|
143
143
|
// when the document is unloaded:
|
144
|
-
if (
|
144
|
+
if (BROWSER_TYPE.ie) {
|
145
145
|
Event.observe(window, "unload", Event.unloadCache, false);
|
146
146
|
}
|
147
147
|
|
@@ -262,24 +262,24 @@ EVENT = {
|
|
262
262
|
/** Starts event listening.
|
263
263
|
**/
|
264
264
|
start: function() {
|
265
|
-
var _globalEventTargetElement =
|
266
|
-
_this = EVENT
|
267
|
-
_eventMap = [
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
],
|
279
|
-
i = 0;
|
280
|
-
for (; i !== _eventMap.length; i++) {
|
281
|
-
|
282
|
-
}
|
265
|
+
var _globalEventTargetElement = BROWSER_TYPE.ie?document:window,
|
266
|
+
_this = EVENT;
|
267
|
+
// _eventMap = [
|
268
|
+
Event.observe( _globalEventTargetElement, 'mousemove', _this.mouseMove );
|
269
|
+
Event.observe( _globalEventTargetElement, 'mouseup', _this.mouseUp );
|
270
|
+
Event.observe( _globalEventTargetElement, 'mousedown', _this.mouseDown );
|
271
|
+
Event.observe( _globalEventTargetElement, 'click', _this.click );
|
272
|
+
Event.observe( _globalEventTargetElement, 'keyup', _this.keyUp );
|
273
|
+
Event.observe( _globalEventTargetElement, 'keydown', _this.keyDown );
|
274
|
+
Event.observe( _globalEventTargetElement, 'keypress', _this.keyPress );
|
275
|
+
Event.observe( _globalEventTargetElement, 'contextmenu', _this.contextMenu );
|
276
|
+
Event.observe( _globalEventTargetElement, 'resize', _this.resize );
|
277
|
+
Event.observe( _globalEventTargetElement, 'mousewheel', _this.mouseWheel );
|
278
|
+
// ],
|
279
|
+
// i = 0;
|
280
|
+
// for (; i !== _eventMap.length; i++) {
|
281
|
+
// Event.observe(_globalEventTargetElement, _eventMap[i][0], _eventMap[i][1]);
|
282
|
+
// }
|
283
283
|
if (window.addEventListener) {
|
284
284
|
window.addEventListener('DOMMouseScroll', EVENT.mouseWheel, false);
|
285
285
|
window.addEventListener('resize', EVENT.resize, false);
|
@@ -338,7 +338,7 @@ EVENT = {
|
|
338
338
|
// Binds the class to the element (so it can be called on the event)
|
339
339
|
_elemId = _ctrl.elemId;
|
340
340
|
_elem = ELEM.get(_elemId);
|
341
|
-
if (
|
341
|
+
if (BROWSER_TYPE.ie) {
|
342
342
|
_elem.setAttribute('ctrl', _ctrl);
|
343
343
|
}
|
344
344
|
else {
|
@@ -380,16 +380,24 @@ EVENT = {
|
|
380
380
|
**/
|
381
381
|
unreg: function(_ctrl) {
|
382
382
|
var _this = EVENT,
|
383
|
-
|
384
|
-
|
383
|
+
_elemId,
|
384
|
+
_elem;
|
385
385
|
if (_ctrl === this.activeControl) {
|
386
386
|
_this.changeActiveControl(null);
|
387
387
|
}
|
388
388
|
_elemId = _ctrl.elemId;
|
389
389
|
_elem = ELEM.get(_elemId);
|
390
|
-
|
391
|
-
|
392
|
-
|
390
|
+
|
391
|
+
_this._coordCache[_elemId] = null;
|
392
|
+
|
393
|
+
_this.listeners[_elemId] = false;
|
394
|
+
_this.focused[_elemId] = false;
|
395
|
+
_this.focusOptions[_elemId] = { ctrl: _ctrl };
|
396
|
+
var _coordListenIdx = _this.coordListeners.indexOf(_elemId);
|
397
|
+
if (_coordListenIdx !== -1) {
|
398
|
+
_this.coordListeners.splice(_coordListenIdx, 1);
|
399
|
+
}
|
400
|
+
|
393
401
|
var _textEnterIndex = _this.textEnterCtrls.indexOf(_ctrl.viewId);
|
394
402
|
if (_textEnterIndex !== -1) {
|
395
403
|
_this.textEnterCtrls.splice(_textEnterIndex, 1);
|
data/js/core/iefix/iefix.js
CHANGED
@@ -41,13 +41,17 @@ iefix = {
|
|
41
41
|
// finds the next parent with fixed or absolute positioning:
|
42
42
|
// NOTICE: .init() makes ._layoutHeight() from this by replacing width with height
|
43
43
|
layoutWidth: function(_element) {
|
44
|
-
var _this=iefix,
|
44
|
+
var _this=iefix,
|
45
|
+
_parent,
|
46
|
+
i=0,
|
45
47
|
// gets the parent from which the width is calculated
|
46
48
|
_layoutParent=_element.offsetParent;
|
47
49
|
while(_layoutParent&&!_this._hasLayout(_layoutParent)){
|
48
50
|
_layoutParent=_layoutParent.offsetParent;
|
49
51
|
}
|
50
|
-
if(!_layoutParent._resizewidthElements){
|
52
|
+
if(!_layoutParent._resizewidthElements){
|
53
|
+
_layoutParent._resizewidthElements=[];
|
54
|
+
}
|
51
55
|
if(!_element._addedResizewidthFix){
|
52
56
|
_layoutParent._resizewidthElements.push(_element);
|
53
57
|
_parent=_layoutParent;
|
@@ -71,11 +75,11 @@ iefix = {
|
|
71
75
|
return (_layoutParent||document.documentElement).clientWidth;
|
72
76
|
},
|
73
77
|
|
74
|
-
// calculates the border width of the _element:
|
75
|
-
// NOTICE: .init() makes ._getBorderHeight() from this by replacing Width with Height
|
76
|
-
getBorderWidth: function(_element){
|
77
|
-
|
78
|
-
},
|
78
|
+
// // calculates the border width of the _element:
|
79
|
+
// // NOTICE: .init() makes ._getBorderHeight() from this by replacing Width with Height
|
80
|
+
// getBorderWidth: function(_element){
|
81
|
+
// return _element.offsetWidth-_element.clientWidth;
|
82
|
+
// },
|
79
83
|
|
80
84
|
// calculates the actual value in pixels from _value:
|
81
85
|
getPixelValue: function(_element,_value) {
|
@@ -103,13 +107,13 @@ iefix = {
|
|
103
107
|
return _this.getPixelValue(_element, _value);
|
104
108
|
},
|
105
109
|
|
106
|
-
// calculates padding width of the _element:
|
107
|
-
// NOTICE: .init() makes .getPaddingHeight() from this by replacing Left/Right/Width with Top/Bottom/Height
|
108
|
-
// NOTICE: .init() also makes ._getMarginWidth() and ._getMarginHeight from this.
|
109
|
-
getPaddingWidth: function(_element) {
|
110
|
-
|
111
|
-
|
112
|
-
},
|
110
|
+
// // calculates padding width of the _element:
|
111
|
+
// // NOTICE: .init() makes .getPaddingHeight() from this by replacing Left/Right/Width with Top/Bottom/Height
|
112
|
+
// // NOTICE: .init() also makes ._getMarginWidth() and ._getMarginHeight from this.
|
113
|
+
// getPaddingWidth: function(_element) {
|
114
|
+
// var _this=iefix;
|
115
|
+
// return _this.getPixelWidth(_element,_element.currentStyle.paddingLeft)+_this.getPixelWidth(_element,_element.currentStyle.paddingRight);
|
116
|
+
// },
|
113
117
|
|
114
118
|
// calculates element's position from the right edge of the parent:
|
115
119
|
// NOTICE: .init() makes _resizeBottom() from this by replacing left/width with top/height
|
@@ -122,7 +126,8 @@ iefix = {
|
|
122
126
|
if(parseInt(_element.runtimeStyle.width,10)===_width){return;}
|
123
127
|
_element.runtimeStyle.width="";
|
124
128
|
if(_element.offsetWidth<_width){
|
125
|
-
|
129
|
+
// Disabled, because no-one uses quirks mode anymore, right?
|
130
|
+
// _width-=_this.getBorderWidth(_element)+_this.getPaddingWidth(_element);
|
126
131
|
if(_width<0){_width=0;}
|
127
132
|
_element.runtimeStyle.width=_width;
|
128
133
|
}
|
@@ -185,29 +190,39 @@ iefix = {
|
|
185
190
|
}
|
186
191
|
},
|
187
192
|
|
188
|
-
_noStyleTagNames: ['PARAM'],
|
193
|
+
_noStyleTagNames: ['PARAM','HTML'],
|
189
194
|
// applies fixes to the _element
|
190
195
|
inlineStyleChanged: function(_element){
|
191
|
-
var _this=iefix,
|
192
|
-
|
193
|
-
if(_this._noStyleTagNames.indexOf(_element.tagName)!==-1){
|
196
|
+
var _this=iefix,
|
197
|
+
_currentStyle=_element.currentStyle;
|
198
|
+
if(_this._noStyleTagNames.indexOf(_element.tagName)!==-1){
|
199
|
+
return;
|
200
|
+
}
|
194
201
|
// check if element needs to be positioned from the right
|
195
202
|
try{
|
196
|
-
|
203
|
+
var _posMatch = (_currentStyle.position==="absolute"||_currentStyle.position==="fixed"),
|
204
|
+
_resizeWidth = _element._resizewidth,
|
205
|
+
_resizeHeight = _element._resizeheight,
|
206
|
+
_autoRight = _currentStyle.right==="auto",
|
207
|
+
_autoBottom = _currentStyle.bottom==="auto";
|
208
|
+
if(_resizeWidth||(_posMatch&&!_autoRight)){
|
197
209
|
_this.resizeRight(_element);
|
198
210
|
}
|
199
|
-
|
200
211
|
// check if element needs to be positioned from the bottom
|
201
|
-
if((
|
212
|
+
if(_resizeHeight||(_posMatch&&!_autoBottom)){
|
202
213
|
_this.resizeBottom(_element);
|
203
|
-
|
214
|
+
if(parseInt(_element.height)>parseInt(_element.fontSize,10)){
|
215
|
+
// TODO: needs line height calculation here too for elements smaller than the line height or font size
|
216
|
+
_element.fontSize = _element.height;
|
217
|
+
_element.lineHeight = _element.height;
|
218
|
+
}
|
204
219
|
}
|
205
220
|
|
206
221
|
// check if opacity needs to be fixed:
|
207
222
|
if(_element.currentStyle.opacity){_this.fixOpacity(_element);}
|
208
223
|
|
209
224
|
} catch(e) {
|
210
|
-
|
225
|
+
console.log("iefix error! element:",_element);
|
211
226
|
}
|
212
227
|
|
213
228
|
// check if background image needs to be fixed:
|
@@ -228,7 +243,7 @@ iefix = {
|
|
228
243
|
_traverseTree: function(_element){
|
229
244
|
var _this=iefix;
|
230
245
|
_this._traverseCount++;
|
231
|
-
//
|
246
|
+
// console.log( 'traversecount: '+_this._traverseCount );
|
232
247
|
_element=_element||document.documentElement;
|
233
248
|
while(_element){
|
234
249
|
if(_element.nodeType===1){
|
@@ -259,10 +274,10 @@ iefix = {
|
|
259
274
|
//this.pngCheck = new RegExp("((\.gif)|(\.jpg))$", "i"); // needs more work
|
260
275
|
// needed for png hack
|
261
276
|
_this.blankGifPath=ie_htc_path+"0.gif";
|
262
|
-
eval("_this.getMarginWidth="+String(_this.getPaddingWidth).replace(/padding/g,"margin"));
|
263
|
-
eval("_this.getPaddingHeight="+String(_this.getPaddingWidth).replace(/Width/g,"Height").replace(/Left/g,"Top").replace(/Right/g,"Bottom"));
|
264
|
-
eval("_this.getMarginHeight="+String(_this.getPaddingHeight).replace(/padding/g,"margin"));
|
265
|
-
eval("_this.getBorderHeight="+String(_this.getBorderWidth).replace(/Width/g,"Height"));
|
277
|
+
// eval("_this.getMarginWidth="+String(_this.getPaddingWidth).replace(/padding/g,"margin"));
|
278
|
+
// eval("_this.getPaddingHeight="+String(_this.getPaddingWidth).replace(/Width/g,"Height").replace(/Left/g,"Top").replace(/Right/g,"Bottom"));
|
279
|
+
// eval("_this.getMarginHeight="+String(_this.getPaddingHeight).replace(/padding/g,"margin"));
|
280
|
+
// eval("_this.getBorderHeight="+String(_this.getBorderWidth).replace(/Width/g,"Height"));
|
266
281
|
eval("_this.layoutHeight="+String(_this.layoutWidth).replace(/Width/g,"Height").replace(/width/g,"height").replace(/Right/g,"Bottom"));
|
267
282
|
eval("_this.getPixelHeight="+String(_this.getPixelWidth).replace(/Width/g,"Height"));
|
268
283
|
eval("_this.resizeBottom="+String(_this.resizeRight).replace(/Width/g,"Height").replace(/width/g,"height").replace(/left/g,"top").replace(/right/g,"bottom"));
|
@@ -277,7 +292,7 @@ iefix = {
|
|
277
292
|
}
|
278
293
|
},
|
279
294
|
|
280
|
-
_traverseStyleProperties: ['width','height','left','top','right','bottom','display','position'],
|
295
|
+
_traverseStyleProperties: ['width','height','left','top','right','bottom','display','position','visibility'],
|
281
296
|
//_traverseStyleProperties: ['right','bottom','width','height'],
|
282
297
|
|
283
298
|
//_elemEntryCount: 0,
|
@@ -338,7 +353,7 @@ ie_fixes=function(){
|
|
338
353
|
}
|
339
354
|
};
|
340
355
|
ie_fixes();
|
341
|
-
window.onresize=function(){iefix.setWinSize();iefix._traverseTree();};
|
356
|
+
// window.onresize=function(){iefix.setWinSize();iefix._traverseTree();};
|
342
357
|
|
343
358
|
|
344
359
|
|
data/js/debugg/debugg.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
LOAD(function(){
|
2
|
+
debugg = HApplication.extend({
|
3
|
+
constructor: function(){
|
4
|
+
this.base(20,'Debugg');
|
5
|
+
this.view = HScrollView.extend({
|
6
|
+
onIdle: function(){
|
7
|
+
this.base();
|
8
|
+
this.bringToFront();
|
9
|
+
}
|
10
|
+
}).nu(
|
11
|
+
[0,720,null,400,0,null],
|
12
|
+
this
|
13
|
+
// , {
|
14
|
+
// // styles: [
|
15
|
+
// // ['background-color','#ccc']
|
16
|
+
// // ]
|
17
|
+
// }
|
18
|
+
);
|
19
|
+
this.debugHtml = '';
|
20
|
+
},
|
21
|
+
log: function(){
|
22
|
+
if(arguments.length === 1){
|
23
|
+
this.debugHtml += '<br>'+this.view.escapeHTML(arguments[0]);
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
this.debugHtml += '<br>'+this.view.escapeHTML(COMM.Values.encode(arguments));
|
27
|
+
}
|
28
|
+
this.view.setHTML(this.debugHtml);
|
29
|
+
},
|
30
|
+
obj_log: function(_obj){
|
31
|
+
var _html = '{<br>';
|
32
|
+
for(var o in _obj){
|
33
|
+
_html += o+': '+_obj[o]+'<br>';
|
34
|
+
}
|
35
|
+
_html += '}';
|
36
|
+
this.log(_html);
|
37
|
+
}
|
38
|
+
}).nu();
|
39
|
+
if(window['console'] === undefined){
|
40
|
+
console = debugg;
|
41
|
+
}
|
42
|
+
debugg.log('Debugg start.');
|
43
|
+
});
|
data/js/debugg/js.inc
ADDED
File without changes
|
@@ -35,6 +35,8 @@ HApplication = HClass.extend({
|
|
35
35
|
|
36
36
|
componentBehaviour: ['app'],
|
37
37
|
|
38
|
+
elemId: 0,
|
39
|
+
|
38
40
|
/** = Description
|
39
41
|
*
|
40
42
|
* = Parameters
|
@@ -204,4 +206,4 @@ HApplication = HClass.extend({
|
|
204
206
|
/* Your code here */
|
205
207
|
}
|
206
208
|
});
|
207
|
-
|
209
|
+
HApplication.implement(HValueResponder.nu());
|
@@ -488,6 +488,7 @@ HDynControl = HControl.extend({
|
|
488
488
|
}
|
489
489
|
this.setStyle('cursor','default');
|
490
490
|
this._initActionFlag();
|
491
|
+
EVENT.resize(); // Triggers the window resize event (automatic event for the browser's window).
|
491
492
|
return true; // prevents text selection
|
492
493
|
}
|
493
494
|
});
|
@@ -48,7 +48,6 @@ COMM.JSONRenderer = HClass.extend({
|
|
48
48
|
this.view = this.renderNode( this.data, this.parent );
|
49
49
|
},
|
50
50
|
defineInScope: function( _definition ){
|
51
|
-
console.log('definedInScope(',_definition,')');
|
52
51
|
var _isArr = (_definition instanceof Array),
|
53
52
|
_isObj = (_definition instanceof Object);
|
54
53
|
if( _isArr || !_isObj ){
|
@@ -132,7 +131,7 @@ COMM.JSONRenderer = HClass.extend({
|
|
132
131
|
// Currently only HView -derived classes are supported, so
|
133
132
|
// the rect is mandatory.
|
134
133
|
_rect = _dataNode['rect'],
|
135
|
-
_hasRect = (_rect !== undefined) && (_rect instanceof Array),
|
134
|
+
_hasRect = (_rect !== undefined) && (_rect instanceof Array || typeof _rect === 'string'),
|
136
135
|
|
137
136
|
// Checks, if any sub-views are defined.
|
138
137
|
_hasSubviews = _dataNode['subviews'] !== undefined,
|
@@ -157,7 +156,6 @@ COMM.JSONRenderer = HClass.extend({
|
|
157
156
|
|
158
157
|
_subView;
|
159
158
|
// console.log('className:',_className,' class:',_class);
|
160
|
-
|
161
159
|
this.scopeDepth ++;
|
162
160
|
this.scopes.push({});
|
163
161
|
try{
|
@@ -16,7 +16,7 @@
|
|
16
16
|
** so there is no real need to access +HSystem+ directly from user-level code.
|
17
17
|
**
|
18
18
|
***/
|
19
|
-
HSystem =
|
19
|
+
HSystem = {
|
20
20
|
|
21
21
|
/** When the focus behaviour is 1, clicking on any subview brings
|
22
22
|
* the window to front, if attached to a HWindow instance.
|
@@ -27,7 +27,7 @@ HSystem = HClass.extend({
|
|
27
27
|
windowFocusBehaviour: 1,
|
28
28
|
|
29
29
|
/** Singleton class; has no constructor **/
|
30
|
-
constructor: null,
|
30
|
+
// constructor: null,
|
31
31
|
|
32
32
|
/** An array of HApplication instances, index is the appId **/
|
33
33
|
apps: [],
|
@@ -357,9 +357,9 @@ HSystem = HClass.extend({
|
|
357
357
|
}
|
358
358
|
}
|
359
359
|
}
|
360
|
-
|
360
|
+
};
|
361
361
|
|
362
|
-
});
|
362
|
+
// });
|
363
363
|
|
364
364
|
// Starts the ticking, when the document is loaded:
|
365
365
|
LOAD(
|
@@ -132,7 +132,7 @@ HThemeManager = HClass.extend({
|
|
132
132
|
**/
|
133
133
|
getCssFilePath: function( _fileName ){
|
134
134
|
var _themeName = this._cssEvalParams[0];
|
135
|
-
if((HThemeHasIE6GifsInsteadOfPng.indexOf(_themeName)!==-1) &&
|
135
|
+
if((HThemeHasIE6GifsInsteadOfPng.indexOf(_themeName)!==-1) && (BROWSER_TYPE.ie6 || BROWSER_TYPE.symbian) ){
|
136
136
|
return "url('"+this._joinPath( this.getThemeGfxPath(), _fileName.replace('.png','-ie6.gif') )+"')";
|
137
137
|
}
|
138
138
|
else {
|
@@ -171,7 +171,7 @@ HThemeManager = HClass.extend({
|
|
171
171
|
|
172
172
|
var _style, _styleSheet, _head;
|
173
173
|
|
174
|
-
if(
|
174
|
+
if(BROWSER_TYPE.ie) {
|
175
175
|
// Internet Explorer (at least 6.x; check what 7.x does)
|
176
176
|
_style = document.createStyleSheet();
|
177
177
|
_style.cssText = _cssText;
|
@@ -331,7 +331,7 @@ HThemeManager = HClass.extend({
|
|
331
331
|
return _url;
|
332
332
|
},
|
333
333
|
_componentGfxFile: function( _themeName, _componentName, _themePath, _fileName ){
|
334
|
-
if((HThemeHasIE6GifsInsteadOfPng.indexOf(_themeName)!==-1) &&
|
334
|
+
if((HThemeHasIE6GifsInsteadOfPng.indexOf(_themeName)!==-1) && BROWSER_TYPE.ie6){
|
335
335
|
return this._joinPath( this._componentGfxPath(_themeName, _componentName, _themePath), _fileName.replace('.png','-ie6.gif') );
|
336
336
|
}
|
337
337
|
return this._joinPath( this._componentGfxPath(_themeName, _componentName, _themePath), _fileName );
|
data/js/foundation/view/view.js
CHANGED
@@ -57,6 +57,10 @@ HView = HClass.extend({
|
|
57
57
|
**/
|
58
58
|
refreshOnLabelChange: true,
|
59
59
|
|
60
|
+
/** Escapes HTML in the label when true.
|
61
|
+
**/
|
62
|
+
escapeLabelHTML: false,
|
63
|
+
|
60
64
|
/** True, if the coordinates are right-aligned.
|
61
65
|
* False, if the coordinates are left-aligned.
|
62
66
|
* Uses flexRightOffset if true. Defined with 6-item arrays
|
@@ -692,6 +696,7 @@ HView = HClass.extend({
|
|
692
696
|
var _isDrawn = this.drawn;
|
693
697
|
this.drawRect();
|
694
698
|
if(!_isDrawn){
|
699
|
+
this.firstDraw();
|
695
700
|
if(this['componentName']!==undefined){
|
696
701
|
this.drawMarkup();
|
697
702
|
}
|
@@ -707,6 +712,9 @@ HView = HClass.extend({
|
|
707
712
|
this.setStyle(_styleKey,_styleValue);
|
708
713
|
}
|
709
714
|
}
|
715
|
+
if(this.options.html){
|
716
|
+
this.setHTML(this.options.html);
|
717
|
+
}
|
710
718
|
if(!this.isHidden){
|
711
719
|
this.show();
|
712
720
|
}
|
@@ -715,6 +723,14 @@ HView = HClass.extend({
|
|
715
723
|
return this;
|
716
724
|
},
|
717
725
|
|
726
|
+
/** = Description
|
727
|
+
* Called once, before the layout of the view is initially drawn.
|
728
|
+
* Doesn't do anything by itself, but provides an extension point.
|
729
|
+
*
|
730
|
+
**/
|
731
|
+
firstDraw: function(){
|
732
|
+
},
|
733
|
+
|
718
734
|
/** = Description
|
719
735
|
* Called once, when the layout of the view is initially drawn.
|
720
736
|
* Doesn't do anything by itself, but provides an extension point for making
|
@@ -791,6 +807,34 @@ HView = HClass.extend({
|
|
791
807
|
return this;
|
792
808
|
},
|
793
809
|
|
810
|
+
/** = Description
|
811
|
+
* Wrapper for setHTML, sets escaped html, if tags and such are present.
|
812
|
+
*
|
813
|
+
* = Parameters
|
814
|
+
* +_text+:: The text to set. If it contains any html, it's escaped.
|
815
|
+
*
|
816
|
+
* = Returns
|
817
|
+
* +self+
|
818
|
+
**/
|
819
|
+
setText: function( _text ) {
|
820
|
+
return this.setHTML( this.escapeHTML( _text ) );
|
821
|
+
},
|
822
|
+
|
823
|
+
/** = Description
|
824
|
+
* Method to escape HTML from text.
|
825
|
+
*
|
826
|
+
* Converts < to < and > to > and & to &
|
827
|
+
*
|
828
|
+
* = Parameters
|
829
|
+
* +_html+:: The html to escape.
|
830
|
+
*
|
831
|
+
* = Returns
|
832
|
+
* A string with the html escaped.
|
833
|
+
**/
|
834
|
+
escapeHTML: function( _html ) {
|
835
|
+
return _html.replace(/&/gmi, '&').replace(/>/gmi, '>').replace(/</gmi, '<');
|
836
|
+
},
|
837
|
+
|
794
838
|
/** = Description
|
795
839
|
*
|
796
840
|
* This method should be extended in order to redraw only specific parts. The
|
@@ -815,7 +859,27 @@ HView = HClass.extend({
|
|
815
859
|
}
|
816
860
|
return this;
|
817
861
|
},
|
818
|
-
|
862
|
+
|
863
|
+
/** Gets the size of the parent. If the parent is the document body, uses the browser window size.
|
864
|
+
**/
|
865
|
+
parentSize: function(){
|
866
|
+
if(this.parent.elemId === 0){
|
867
|
+
var _winSize = ELEM.windowSize();
|
868
|
+
return [ _winSize[0], _winSize[1] ];
|
869
|
+
}
|
870
|
+
else{
|
871
|
+
var _rect = this.parent.rect;
|
872
|
+
return [ _rect.width, _rect.height ];
|
873
|
+
}
|
874
|
+
},
|
875
|
+
|
876
|
+
/** Returns the maximum rect using the #parentSize.
|
877
|
+
**/
|
878
|
+
maxRect: function(){
|
879
|
+
var _parentSize = this.parentSize();
|
880
|
+
return [ 0, 0, _parentSize[0], _parentSize[1] ];
|
881
|
+
},
|
882
|
+
|
819
883
|
/** = Description
|
820
884
|
* Replaces the rect of the component with a new HRect instance and
|
821
885
|
* then refreshes the display.
|
@@ -832,6 +896,9 @@ HView = HClass.extend({
|
|
832
896
|
if (this.rect) {
|
833
897
|
this.rect.release(this);
|
834
898
|
}
|
899
|
+
if(typeof _rect === 'string'){
|
900
|
+
_rect = this[_rect]();
|
901
|
+
}
|
835
902
|
if(_rect instanceof Array){
|
836
903
|
var _arrLen = _rect.length,
|
837
904
|
_throwPrefix = 'HView.setRect: If the HRect instance is replaced by an array, ';
|
@@ -1605,6 +1672,9 @@ HView = HClass.extend({
|
|
1605
1672
|
*
|
1606
1673
|
**/
|
1607
1674
|
setLabel: function(_label) {
|
1675
|
+
if(this.escapeLabelHTML){
|
1676
|
+
_label = this.escapeHTML( _label );
|
1677
|
+
}
|
1608
1678
|
var _this = this,
|
1609
1679
|
_differs = (_label !== _this.label);
|
1610
1680
|
if(_differs){
|