Changeset 1659 in ExiteCMS
- Timestamp:
- 08/19/08 19:20:49 (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
includes/jscripts/core_functions.js (modified) (1 diff)
-
includes/templates/forum.viewthread.tpl (modified) (2 diffs)
-
news.php (modified) (1 diff)
-
themes/ExiteCMS/exitecms.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/jscripts/core_functions.js
r1655 r1659 251 251 function eraseCookie(name) { 252 252 createCookie(name,"",-1); 253 } 254 255 function findPosX(obj) { 256 if (obj == null) return false; 257 var curleft = 0; 258 if(obj.offsetParent) { 259 while(1) { 260 curleft += obj.offsetLeft; 261 if(!obj.offsetParent) break; 262 obj = obj.offsetParent; 263 } 264 } else { 265 if(obj.x) curleft += obj.x; 266 } 267 return curleft; 268 } 269 270 function findPosY(obj) { 271 if (obj == null) return false; 272 var curtop = 0; 273 if(obj.offsetParent) { 274 while(1) { 275 curtop += obj.offsetTop; 276 if(!obj.offsetParent) break; 277 obj = obj.offsetParent; 278 } 279 } else { 280 if(obj.y) curtop += obj.y; 281 } 282 return curtop; 253 283 } 254 284 -
trunk/includes/templates/forum.viewthread.tpl
r1651 r1659 21 21 </script> 22 22 {include file="_opentable.tpl" name=$_name title=$locale.500 state=$_state style=$_style} 23 <table id='width_check'cellspacing='0' cellpadding='0' width='100%'>23 <table cellspacing='0' cellpadding='0' width='100%'> 24 24 <tr> 25 25 <td class='smallalt'> … … 199 199 if (_timer) clearInterval(_timer); 200 200 201 // calculate the width of a code block 202 var blockwidth = document.getElementById("width_check").offsetWidth-141; 203 var block_a = 0; 204 var block_b = 0; 201 // needed inside the loop 202 var parent_left = 0; 203 var parent_width = 0; 204 var obj = 1; 205 var i = 1; 205 206 206 207 // loop through all blocks found, and set the width correctly 207 var i = 1;208 208 while (document.getElementById("codeblock"+i+"a") != null && document.getElementById("codeblock"+i+"b") != null) { 209 // need to check and do something dynamic with margins and padding here... 210 block_a = blockwidth - 40 + "px"; 211 block_b = blockwidth - 50 + "px"; 212 document.getElementById("codeblock"+i+"a").style.width = block_a; 213 document.getElementById("codeblock"+i+"b").style.width = block_b; 209 // get the info about the objects parent 210 obj = document.getElementById("codeblock"+i+"a").parentNode; 211 // fall back gracefully if the parentNode can not be found 212 if (obj == null) obj = document.getElementById("codeblock"+i+"a").offsetParent; 213 parent_left = findPosX(obj); 214 parent_width = obj.offsetWidth; 215 // alert(parent_left + " : " + parent_width); 216 // calculate the new width of the block, leave plenty of space to handle browser subtleties 217 block_width = parent_left + parent_width - findPosX(document.getElementById("codeblock"+i+"a")) - 30; 218 // adjust the width of the code blocks 219 document.getElementById("codeblock"+i+"a").style.width = block_width + "px"; 220 document.getElementById("codeblock"+i+"b").style.width = block_width - 10 + "px"; 214 221 i++; 215 222 } -
trunk/news.php
r1637 r1659 1 <?php1 <?php 2 2 /*---------------------------------------------------+ 3 3 | ExiteCMS Content Management System | -
trunk/themes/ExiteCMS/exitecms.css
r1648 r1659 158 158 159 159 /* code sections within the message body (note: total number of px for padding+margin must remain the same, the code expects this!!!) */ 160 .codeblock_source { width: 380px; margin-left:10px; border:1px #bbb solid; background-color:#fff; padding:0px; white-space:nowrap; overflow-x:auto; }161 .codeblock_cmds { width: 370px; margin-left:10px; border:1px #bbb solid; background-color:#fff; padding:0px 5px 0px 5px; border-top:0px; text-align:right; }160 .codeblock_source { width:250px; margin-left:10px; border:1px #bbb solid; background-color:#fff; padding:0px; white-space:nowrap; overflow-x:auto; } 161 .codeblock_cmds { width:240px; margin-left:10px; border:1px #bbb solid; background-color:#fff; padding:0px 5px 0px 5px; border-top:0px; text-align:right; } 162 162 163 163 /* thumbnail caption in the message body */
Note: See TracChangeset
for help on using the changeset viewer.
