|
0
|
1 |
// contains code that proposed by the text_view_comment frame to its parent frame |
|
|
2 |
|
|
|
3 |
|
|
|
4 |
c_persistPreference = function(key1, key2, val) { |
|
341
|
5 |
gPrefs.persist(key1, key2, val) ; |
|
0
|
6 |
} |
|
|
7 |
|
|
|
8 |
c_readDefaultPreference = function(key1, key2) { |
|
341
|
9 |
return gConf['defaultPrefs'][key1][key2] ; |
|
0
|
10 |
} |
|
|
11 |
|
|
|
12 |
c_readPreference = function(key1, key2) { |
|
341
|
13 |
return gPrefs.get(key1,key2) ; |
|
0
|
14 |
} |
|
|
15 |
|
|
|
16 |
c_resetPreferences = function(entries) { |
|
341
|
17 |
gPrefs.reset(entries) ; |
|
0
|
18 |
} |
|
|
19 |
|
|
|
20 |
c_applyTextStyle = function(val) { |
|
341
|
21 |
CY.use(val) ; |
|
0
|
22 |
} |
|
|
23 |
|
|
|
24 |
sliderValToPx = function (val) { |
|
341
|
25 |
var winWidth = CY.DOM.winWidth() ; |
|
|
26 |
if (gLayout.isInFrame()) |
|
|
27 |
winWidth = parent.$(parent).width() ; |
|
|
28 |
var theta = val / 100 ; |
|
|
29 |
theta = Math.min(theta, gConf['sliderFixedMin']) ; |
|
|
30 |
theta = Math.max(theta, gConf['sliderFixedMax']) ; |
|
|
31 |
var colWidth = theta * winWidth ; |
|
|
32 |
return Math.floor(colWidth) ; |
|
0
|
33 |
} |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
c_setCommentsColWidth = function(val) { |
|
341
|
37 |
var colWidth = sliderValToPx(val) ; |
|
|
38 |
gLayout.setLeftColumnWidth(colWidth) ; |
|
0
|
39 |
|
|
341
|
40 |
var iCommentWidth = gLayout.getTopICommentsWidthFromWidth(colWidth) ; |
|
0
|
41 |
|
|
341
|
42 |
// icomments |
|
|
43 |
gIComments.setWidth(iCommentWidth) ; |
|
0
|
44 |
|
|
341
|
45 |
//forms |
|
|
46 |
gICommentForm['overlay'].get('boundingBox').setStyle('width', iCommentWidth + 'px') ; |
|
|
47 |
changeFormFieldsWidth(gICommentForm['formId'], iCommentWidth) ; |
|
|
48 |
|
|
421
|
49 |
//toc |
|
|
50 |
//For some reasons: gToc['overlay'].get('boundingBox').setStyle('width', iCommentWidth + 'px'); |
|
|
51 |
// does not work when the div.c-toc has a fixed position. |
|
468
|
52 |
document.getElementById('the-toc').style.width = iCommentWidth + 'px'; |
|
421
|
53 |
|
|
341
|
54 |
if (gNewReply) |
|
|
55 |
changeFormFieldsWidth(gNewReply['ids']['formId'], iCommentWidth) ; |
|
|
56 |
if (gEdit) |
|
|
57 |
changeFormFieldsWidth(gEdit['ids']['formId'], iCommentWidth) ; |
|
0
|
58 |
} |