FCKEditor and Ajax Requests

This took me a while to figure out, so I hope this little tidbit helps someone…

If you want to send XHTML over GET or POST in an Ajax request with FCKEditor, be sure to do something like this:

var pars = 'page_content=' + escape(FCKeditorAPI.GetInstance('page_content').GetXHTML());

The critical part of this is escape() – it is the javascript equivalent of PHP’s urlencode.

Advertisements

Some Answers

Lee asked a few questions about the app, so I’ll answer ’em here…

How do you handle interactive elements – like forms?

At the moment, it’s really only for static pages. Currently the way I’m doing this is keeping the “content” and the interactive parts of the site separated.

Will it be designed to handle add-ons?

Add-ons is a big term. I don’t see why someone would not be able to extend it, but currently writing the ability in for add-ons like mambots is a little overkill for my purpose.

Will you be able to make “on-the-fly” changes to the html/css with certain permissions?

Nope. Let me explain the permissions a little more in depth when you ask about users. There’s going to be one CSS file powering the entire site that the app uses (and that is all set up by me)

Is there a permissions scheme for users?

See the next answer.

How do you handle users?

Currently I am doing it through something called LDAP. Think about it like this – the username and password you have for logging in to your computer, checking your email, and file server permissions is all the same. Why give users another account to deal with? Also, our LDAP system forces passwords to be changed at a specified interval.

In an LDAP setup, there are also user groups or “organizational units”. The way our system is set up is that each department/entity has it’s own group. Instead of dealing with a lot of permissions, I give everyone in the “Group A” group the ability to do whatever they want to do to Group A’s website.

There is a global admin — and it’s pretty easy to change. Think of it like editing a config file. I have a control panel that lists all of our user groups and links to edit their sites.

What about images? I uploaded an image, but now I don’t know how to link it… and does it make automatic thumbnails? (edit – n/m – I found it, it’s just not graphical)

Images are a big concern. I will be thinking about how I want to handle this…

Why is the sky blue?

Answer.

Clicking on a child page does not keep the parent/child expanded menu open in nav

Right. Thank you. Will work on it.

LOVE THE RE-ORDER NAV THING. HOLY CRAP, THAT IS COOL.

Thanks. Here’s how I did it.

I did break it. I applied styles (custom bold, title) then de-applied them. Text disappeared. Plus, the text “here are the real questions” has the style “Code” applied – yet it doesn’t appear as such on the page.

I haven’t really done a lot of playing with the WYSIWYG except for pasting material in from MS Word with the “Paste from Word” button.

The Demo At Last

If you’re interested in a demo of what I’ve been referring to as “the app”, figure out a way to contact me about getting a URL and a Login/Pass.

Some more notes about it:

– Moving it to the server was a great learning experience. I’ve already made substantial improvements in performance and future compatibility which unfortunately are not in the version that I have somewhere on the web for demonstration purposes.

– The application’s purpose is becoming a lot more clear. It’s designed for the end users who need to be able to easily maintain the static parts of sites. It seems that everyone around here needs some type of database functionality. The directory structure I’ve been using is “site_url/content/page” for the static types of pages and “site_url/app/application” for others. I think it’s going to be pretty nice.

– It’s still early. I haven’t decided on a good way for users to include images in their pages. I originally wanted them to use some sort of 3rd photo gallery option, but that is not really sufficient regular inline images. Suggestions/ideas are welcome. I’d rather not do the uploading and thumbnailing on the server. =)

– The idea behind this is that I still maintain 100% of the control of the site’s “structure”/”look” while someone (typically a departmental secretary) maintains the content without having to talk to me. It’s very easy for me to make a new site with XHTML/CSS that uses content from this system.

They Upgraded, I’m getting it out there

So I’m working on getting everything working so I can test.

Lessons learned so far:

-Develop on the platform you’re implement on. Since I was developing this entirely locally with a WAMP server, I’ve run into a few quirks. Mainly with my inconsistent instantiation $nav = new Navigation(); versus $nav = new navigation(); — with PHP’s autoload function it was causing my stuff to die.

– Again with platform… backslashes versus forward slashes … ugh. Let’s also remember some servers have magic quotes enabled and some do not, in case you’re inserting to a database…

– Load times are a little slower than I was hoping for… I am going to try it later tonight to see if it’s an issue here, an application issue, or a dreamhost issue.

Google Maps MouseWheel Subtlety

It’s not much of a secret that you can use your Mouse Wheel with Google Maps… but you have to love the sense of direction even the smallest UI cue gives you:

Zooming Out:

zoom-out.gif

Zooming In:

zoom-in.gif

The Last 5%

A couple of days ago I mentioned the first indoctrination of “the app” is 95% done. The last 5% is hard. I’m actually spending this time removing a couple of those oh-so-nifty AJAX features.

The problem is they were taking away from page loads. I originally wanted to “deep link” to a couple of features, such as “Edit Content for this Page” and that wasn’t too possible because the WYSIWYG interface was being pulled up through an AJAX response.

So… I’m taking that (and a couple of others) out and fixing them.

I maaaaaaaay have a demo online by the beginning of the next week for review/suggestions. Wouldn’t that be special?

Rewrite’s Complete

That wasn’t too bad. It took me probably two days total to completely overhaul the app’s model to an object based design. Those two days are going to save me many many days down the road.

More updates today… lunch time.