You are not logged in.
Hi, I was hoping somebody here would be willing to help me out with something. I would like to change Xinha so when I insert an image through image manager and align the image left or right it uses "float" tags instead of "align" tags. The current align tags aren't working with part of my css. Is there a semi-easy way to change xinha so it does this?
Any help is appreciated. Thanks
Jesse
Offline
I've done this in an edited XinhaCore.js - where it changes them to float on save, but the better option would be to edit the files in modules/InsertImage so that instead of assigning the value to align it assigns 'float: + f_align' to style, though for editing an already inserted image that does mean parsing the style tag contents instead to get it's value.
Last edited by jedi58 (2007-01-30 06:31:56)
David G. Paul
[url]http://www.newearthonline.co.uk[/url]
Offline
Using the extended file manager, here's how i did it:
File: extended-file-manager.js
Search for: f_alt:_6.alt (should be line 25), alter so it reads
....f_align:_6.align,f_float:_6.style.cssFloat,f_width:_6.width....
Search for case "f_align": (should be line 102), add this code after the break; on line 104
case "f_float":
_c.style.cssFloat=_f;
_c.style.styleFloat=_f;
break;
---
File: assets\manager.js
Seacrh for function setAlign(_7){(should be line 12), add code after the third }
function setFloat(_7){
var _8=document.getElementById("f_float");
for(var i=0;i<_8.length;i++){
if(_8.options[i].value==_7){
_8.selectedIndex=i;
break;
}
}
}
Search for setAlign(_e["f_align"]); (should be line 81 now), add this code:
setFloat(_e["f_float"]);
Seacrh for var _21=["f_url", (should be line 221), alter so it reads:
..."f_align","f_float","f_border",...
---
And now for the user interface
File: manager.php
Search for $hidden_fields[] = 'f_align'; (should be line 44), add the following underneath
$hidden_fields[] = 'f_float';
Search for <select size="1" id="f_align" (should be line 247), alter so it reads:
<td colspan="2"><?php if($insertMode=='image' && $IMConfig['images_enable_align'] !== false) { ?>
<select size="1" id="f_align" title="Positioning of this image">
<option value="" selected="selected" >Not set</option>
<option value="left" >Left</option>
<option value="right" >Right</option>
<option value="texttop" >Texttop</option>
<option value="absmiddle" >Absmiddle</option>
<option value="baseline" >Baseline</option>
<option value="absbottom" >Absbottom</option>
<option value="bottom" >Bottom</option>
<option value="middle" >Middle</option>
<option value="top" >Top</option>
</select>
Float / Wrap :
<select size="1" name="float" id="f_float" title="Float/Wrapping of the image">
<option value="" >Not set</option>
<option value="left" >Left</option>
<option value="right" >Right</option>
</select>
<?php } ?>
</td>
Tested in Firefox and Internet Explorer.
Last edited by iamalsohere (2007-05-24 12:06:43)
Offline