Project description
Implementing a persistent audio player on a Drupal website has long been a frustrating task. (See here, here, here, here and here, among others.) Ajax pages solves this problem by implementing full page reloads via Ajax, with the possibility to create region(s) that will be exempt from such loading. An audio player can be put in such a region to implement continuous audio playback as the user browses the website's pages.
Live demos: Mediazoic, New Canadian Music
Features
- Works inobtrusively out of the box
- Requires only minimal theme modifications
- Browser address bar updating using HTML5's
history.pushState() - Full page reloading (
page_top,pageandpage_bottomregions) - Transparently ajaxifies forms, including GET ones
- Handles redirects
- Loads additional CSS and JS files as required
- JS/CSS preprocessors and aggregation friendly
- Ajax requests are GET and fully cacheable (also with Boost!)
Similar projects
AJAXify pages attempts to solve a similar problem but it uses a generic, client-side based approach to reloading page content. While this makes for simpler code, this also brings important problems that prevent AJAXify pages from being a truly generic solution:
- No redirect handling
- No loading of extra CSS and JS files with aggregation/compression enabled
- No ajaxifying of forms
- No Drupal.settings updating (would have to resort to brutally parsing HTML?)
Ajax pages, on the other hand, relies heavily on the Drupal Ajax framework and intelligent processing of Ajax requests on the server side. This helps make the above functionality possible, and more.
Links
Project page: http://drupal.org/sandbox/jamix/1988012
Git repository: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jamix/1988012.git ajax_pages
Comments
Comment #1
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
yandex-plugins commentedHello,
Please check http://ventral.org/pareview/httpgitdrupalorgsandboxjamix1988012git-7x-1x
Regards
Comment #3
jamix commentedThank you. Just for a record, here is what yandex-plugins is referring to:
I am aware of both issues and not fixing them is deliberate. For #1, there's no way to sensibly break that line since it's a string of PHP code. #2 is a nearly verbatim quote from core (block_admin_configure()) with formatting preserved.
Comment #4
Dalay commentedHi, jamix.
No errors found, just don't understand some thing.
From README.txt:
Why force the user to perform extra steps? I would rather implement this functionality with a hook_preprocess_html() in the module. The same goes for "Adding a persistent region".
Comment #5
jamix commentedHi Dalay, thank you for the comments. How exactly would you implement wrapping the output of the
page_top,pageandpage_bottomregions viahook_preprocess_html()? And, more importantly, if we were to do such things for the end user, how would we know a). How many persistent regions they want, b). Where they should be output in relation to the page wrapper (before or after, with some other div's inbetween perhaps) and c). How they should be ordered?There's just too many variables here so all these are best solved on the theme level by the end user. Trying to automate these tasks would bring unnecessary complexity to the module.
Comment #6
Dalay commentedI hurried. It will be easier with using hook_page_build(), like:
Yes, perhaps you're right here, Artem.
Comment #7
Dalay commentedI hurried. It will be easier with using hook_page_build(), like:
Yes, perhaps you're right here, Artem.
Comment #8
Dalay commentedRemove repost, please. )
Comment #9
jamix commentedUsing
#prefixand#suffixon$page['page_top']and$page['page_bottom']looks a bit hacky to me. Sure, in most cases the order of the regions in html.tpl.php will be what we expect it to be (page_top,page,page_bottom) and thus such wrapping will work, but in some whacky situations where the user alters their html.tpl.php, that may lead to unforeseen and hard to trace bugs.Comment #10
Dalay commentedWhy? Using Render API is a hacky for you?))
In this case, and your code will not work:
line 232, ajax_pages.module
Comment #11
jamix commentedNo, but it's hacky to assume a certain order in which the elements will be output.
Good point. I think it will make sense to add a template for that bit so that if necessary, it could be modified to correspond to what's inside the html.tpl.php wrapper. This is hardly a review blocker though and can be dealt with in the module's issue queue.
Comment #12
petu commentedHello jamix!
I reviewed your module:
FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
54 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------------
FILE: /var/www/drupal-7-pareview/pareview_temp/ajax_pages.module
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
130 | ERROR | If the line declaring an array spans longer than 80 characters,
| | each element should be broken into its own line
--------------------------------------------------------------------------------
BTW: I'm going to use your module in my client's project. So it would be great to add a feature to apply your module just for several pages in addition for suppression Ajax pages. Like it does for blocks for example.
Thank you for your module!
Comment #13
petu commentedComment #14
klausiminor coding standard errors are not application blockers, please do a manual review.
and do not use t() in hook_menu().
Comment #15
petu commentedHello Klaus!
You are right about t() in hook_menu(). Шэму corrected my previous post.
I've reviewed the code manually, installed the module on my project.
I suppose the code is ok.
Comment #16
mlncn commentedThanks for your contribution, jamix! You are now a vetted Git user. You can promote this to a full project and also create new projects as either a sandbox or a full project.
This is a solid project and i'm not going to set it back to needs work after a month at RTBC, but please do remove that t() in hook_menu().
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
And thanks to the reviewers!
Comment #17
kscheirerfixed in #16.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #18
jamix commentedThank you, and thanks to all of the reviewers for helping make Ajax pages a full project!
Comment #19.0
(not verified) commentedFormatting changes