Author |
Message |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Feb 01, 2012 3:48 pm |
|
First off, this isn't an RN issue, I believe it's a bug with fckeditor code itself.
Secondly, I've been awake for 30 hours so I'll probably come back tomorrow with "doh! - see the problem now" but I'm recording it here because the best people to look at this are here.
As part of a personal project to get RN HTML 5 valide, I've moved into the territory of validating the presentational markup of fckeditor.
In the file includes/fckeditor/fckeditor_php5.php we have the following code
( i frame tags removed)Code:
$Html .= ".... id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"0\" scrolling=\"no\"></.....>" ;
}
else
{
if ( strpos( $this->Width, '%' ) === false )
$WidthCSS = $this->Width . 'px' ;
else
$WidthCSS = $this->Width ;
if ( strpos( $this->Height, '%' ) === false )
$HeightCSS = $this->Height . 'px' ;
else
$HeightCSS = $this->Height ;
$Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ;
}
|
This gives us the viewed source of Code:
Toolbar=NukeUser" width="100%" height="280" frameborder="0" scrolling="no">
|
As you can see from the code snippet, it appears strpos is being applied so that if the size attributes are not a percentage, it should add pixel (PX) to the size attribute, which it clearly isn't doing when you look at the viewed source (see the height attribute).
If I'm seeing this right, it looks like the strpos logic needs to me moved higher up; before the $Html applied. |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Wed Feb 01, 2012 5:21 pm |
|
Guardian2003, I think you need to sleep on this The strpos use is in the second part of an IF ELSE statement. The $Html variable at the top of the code snippet is part of the IF and the strpos function is part of the ELSE. The ELSE portion of the statement has its own $Html variables which you can see is at the bottom. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
Guardian2003

|
Posted:
Thu Feb 02, 2012 2:22 am |
|
Exactly. Leaving aside the fact that 'frameborder' and 'scrolling' are obsolete and attributes need to be wrapped in style="..." for the moment, the determination on whether to output the height and width using either a percentage or px should be before it assigns iframe and/or textarea to the $Html variable. At the moment it only assigns it for textarea only (even though it doesn't actually output it if it's PX, which seems to indicate it isn't working for that either).
Now I've had my first coffee, I see that you cannot use % in this context any way for html5
Quote: |
Bad value 100% for attribute width on element iframe: Expected a digit but saw % instead.
…ar=NukeUser" width="100%" height="280" frameborder="0" scrolling="no"></iframe>
Syntax; should only use non-negative integer: One or more digits (0–9). |
Oh well, back to the drawing board on that one as I'll have to add some additional logic there based on the doctype being used for backward compatibility.
I'll have to hard code an abitrary width, possibly based on the textarea size if WIDTH will only accept digits. |
|
|
|
 |
Palbin

|
Posted:
Thu Feb 02, 2012 5:59 am |
|
We really just need to move on to ckeditor. |
|
|
|
 |
Guardian2003

|
Posted:
Thu Feb 02, 2012 6:31 am |
|
CKEditor would be better for HTML 5 but it doesn't have a built in file upload ability like FCKEditor. There add-on CKFinder is about $50.
Having said that, users don't normally have access to image upload capability using our implementation FCKEditor so I'm wondering what the *real* impact would be. It might be better to just have a dedicated 'file handler' module for webmasters who need to maintain their sites but don't always have access to FTP - maybe they are at work etc.
Any way, I resolved the problem I was having;
http://www.code-authors.com/ftopicp-5611.html#5611 |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sat Feb 04, 2012 7:05 am |
|
+1 for CKEditor! Isn't it the only active branch of the project?
@Guardian, I'm with you on separating the file uploaded if that is the only problem. Have an admin module for it or possibly create our own "modal" to pop-up. Also, I really wonder if there aren't replacement uploaders out there by now. I remember us talking about this more than a year back it seems. Gotta be something reasonably good out there by now which can plug into CKE. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
|