| author | rbernard |
| Mon, 22 Feb 2010 22:30:38 +0100 | |
| changeset 190 | faf3a87a7d73 |
| parent 112 | f52aeba468f8 |
| child 217 | 613b2f29be54 |
| permissions | -rw-r--r-- |
| 0 | 1 |
// globals used: gConf, gPrefs |
2 |
||
3 |
Layout = function() { |
|
4 |
} |
|
5 |
||
6 |
Layout.prototype = { |
|
7 |
init : function () { |
|
8 |
}, |
|
9 |
|
|
10 |
isInFrame : function () { |
|
11 |
return (!CY.Lang.isUndefined(parent) && parent.location != location && CY.Lang.isFunction(parent.f_getFrameFilterData)); ; |
|
12 |
}, |
|
13 |
|
|
14 |
isInComentSite : function () { |
|
|
59
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
15 |
var ret = false; |
|
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
16 |
try { |
|
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
17 |
if (!CY.Lang.isUndefined(sv_site_url) && !CY.Lang.isUndefined(parent) && !CY.Lang.isUndefined(parent.parent)) { |
|
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
18 |
var parentParentLocation = new String(parent.parent.location) ; |
| 112 | 19 |
// TODO warn server |
| 111 | 20 |
//CY.log(parentParentLocation) ; |
|
59
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
21 |
ret = (parentParentLocation.indexOf(sv_site_url) == 0); |
|
8a2d933209aa
BUG FIX : in text history tab text view frame now expands to maximum
reno
parents:
0
diff
changeset
|
22 |
} |
| 0 | 23 |
} |
24 |
catch (e) { |
|
25 |
ret=false; |
|
| 111 | 26 |
//CY.log("error thrown while trying to access parent.parent.location") ; |
| 0 | 27 |
} |
| 111 | 28 |
//CY.log("inComentSite returned : " + ret) ; |
| 0 | 29 |
return ret ; |
30 |
}, |
|
31 |
|
|
32 |
sliderValToPx : function (val) { |
|
33 |
var winWidth = CY.DOM.winWidth() ; |
|
34 |
if (this.isInFrame()) |
|
35 |
winWidth = parent.$(parent).width() ; |
|
36 |
var theta = val / 100 ; |
|
37 |
theta = Math.min(theta, gConf['sliderFixedMin']) ; |
|
38 |
theta = Math.max(theta, gConf['sliderFixedMax']) ; |
|
39 |
var colWidth = theta * winWidth ; |
|
40 |
return Math.floor(colWidth) ; |
|
41 |
}, |
|
42 |
||
43 |
getTopICommentsWidth : function() { |
|
44 |
return this.getTopICommentsWidthFromWidth(this.sliderValToPx(gPrefs.get('layout','comments_col_width'))) ; |
|
45 |
}, |
|
46 |
|
|
47 |
getTopICommentsWidthFromWidth : function(val) { |
|
48 |
return val - 7; |
|
49 |
}, |
|
50 |
|
|
51 |
setLeftColumnWidth : function (colWidth) { |
|
52 |
CY.get('#contentcolumn').setStyle('marginLeft', colWidth + 'px'); |
|
53 |
CY.get('#leftcolumn').setStyle('width', colWidth + 'px'); |
|
54 |
}, |
|
55 |
parentInterfaceUnfreeze : function() { |
|
56 |
if (this.isInFrame()) |
|
57 |
parent.f_interfaceUnfreeze() ; |
|
58 |
} |
|
59 |
|
|
60 |
} |