jbroadway / elefant

Elefant, the refreshingly simple PHP CMS and web framework.
http://www.elefantcms.com
MIT License
209 stars 39 forks source link

Async wrapper utility #261

Closed techanon closed 9 years ago

techanon commented 9 years ago

About time I PR this utility. [Summary] A very basic AJAX script setup that fetches the {{body}} content and related scripts/styles from a page request and injects it into the DOM, replacing existing content, based on the given CSS selector.

NOT recommended for use as a drop-in addition even though it is very simple to add. A proper layout structure should be built around this utility.

[Documentation] Options:

Events (via $(document).trigger()):

Special Behaviour:

techanon commented 9 years ago

Two things concern me:

First, the returned content. Should the entire page object be returned or do you think it should be filtered? Are there any missing values that should be returned which currently aren't?

Secondly, does the cookie need to be set client-side? I wasn't sure so I added it just in case.

jbroadway commented 9 years ago

Finally taking some time to get back on track. Merging this one now :)