Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> FCKeditor/WYSIWYG Issues
Author Message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Feb 01, 2012 3:48 pm Reply with quote

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.
 
View user's profile Send private message Send e-mail
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Wed Feb 01, 2012 5:21 pm Reply with quote

Guardian2003, I think you need to sleep on this Wink 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. 
View user's profile Send private message
Guardian2003







PostPosted: Thu Feb 02, 2012 2:22 am Reply with quote

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







PostPosted: Thu Feb 02, 2012 5:59 am Reply with quote

We really just need to move on to ckeditor.
 
Guardian2003







PostPosted: Thu Feb 02, 2012 6:31 am Reply with quote

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; [ Only registered users can see links on this board! Get registered or login! ]
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Feb 04, 2012 7:05 am Reply with quote

+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.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> FCKeditor/WYSIWYG Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©