Page 1 of 1
Javascript/AJAX libraries plugin
Posted: Tue Aug 07, 2007 4:51 pm
by mattsches
I've been playing around with JS libraries/frameworks a lot recently, e.g.
jQuery and
Mootools among others. You can pretty amazing things pretty quickly with the help of these libs. I've also been thinking of one feature or another that could be useful for s9y. Also, I'm sure that more and more plugins will depend on those frameworks in the future.
So my question is: Would it make sense to write a plugin that simply functions as a helper to installing those libs? So that different plugins can share the same (ideally, the most current) version? Not only frontend, but especially backend plugins could use this.
I'm thinking of a list that contains the most important libs, and the user can enable them by checking a box. Only thing we would also need is some kind of mechanism that checks for dependencies.
What do you think?
- Mattsches
Re: Javascript/AJAX libraries plugin
Posted: Wed Aug 08, 2007 11:04 am
by garvinhicking
Hi!
Yeah, I'm in favor of that helper plugin facility. Plus, any plugins using jquery etc. could check if the library exists in the bundled-libs/ directory, so that admins could install a library there easily.
I'd like to not bundle them with s9y core because of licensing and filesize issues.
Regards,
Garvin
Posted: Wed Aug 08, 2007 4:23 pm
by mattsches
Hi Garvin, you're right, bundling the libs with s9y wouldn't be a good idea. I will try to piece something together and post it to the board.
Where will we store the libs, by the way? bundled-libs/LIBNAME/ I guess?
We already have bundled-libs/YahooUI/, so jQuery should go to bundled-libs/jQuery/ or sth. like that, right? Or do we put them into the upload dir?
Posted: Wed Aug 08, 2007 4:55 pm
by garvinhicking
Hi!
The plugin can'T put it into bundled-libs, a user would need to manually do this.
A helper plugin could only put the libs into its own directory, but any plugin requiring this helper plugin should also look into bundled-libs if the directory is existing there. Only if it isn't it should depend on the helper plugin, which would autonatically include the libraries on its own?
bundled-libs is not an option because plugins don'T have write permissions there.
REgards,
Garvin
Posted: Wed Aug 22, 2007 12:11 pm
by mattsches
Ok, I've been putting together a first draft. One thing I keep asking myself, yet couldn't find an answer, is if we can include the JS libs in all backend pages with one single event hook?
Do we have an event hook for this, would this have to go into the admin template, or should we say, ok, let's put the JS includes on some backend pages only (backend_display, backend_plugins_event_header, backend_plugins_sidebar_header, backend_frontpage_display)?
Because if we can enable JS libs in the backend, there might be some wonderful things we can do

I'm currently thinking about tab switching between entry body and extended entry and stuff like that ...
- Mattsches
Posted: Wed Aug 22, 2007 12:54 pm
by garvinhicking
Hi!
'backend_display' should work fot that?
Regards,
Garvin
Posted: Wed Aug 22, 2007 9:54 pm
by mattsches
Ok, I will try that

Posted: Sun Aug 26, 2007 4:05 pm
by mattsches
Please download, install, test, and give feedback on
serendipity_event_jslibs.
Thx
- Mattsches
Posted: Mon Aug 27, 2007 11:38 pm
by stm999999999
the video looks great - nice features!
perhaps a suggestion: some times ago I found some ajax tools with some benefits to s9y:
http://www.yvoschaap.com/index.php/webl ... e_text_20/
an instant editing software - no need to click on preview in the editor. Just type html (or our textile/bbcode/...-elements) into the editor and make a click outside the editor-field, voila there is the preview.
Perhaps a worthwhile idea for us?
and much more ajax-stuff:
http://miniajax.com/
Posted: Tue Aug 28, 2007 3:21 pm
by mattsches
Thanks, stm999999999!
The instant editing feature you pointed to is really nice.
I also tried to get some sort of "instant preview" by loading the formatted preview not in an iframe but into a <div/> (no reloading of the page) with the help of jQuery. It even worked kind of, but I couldn't update the preview because that would've meant to capture all the POST data, update it, and send it to the output. Not an impossible task, just lack of time on my behalf
As for the demos on miniajax.com: Many of these are based on the libraries that are included with serendipity_event_jslib, so they could be regarded as "plugins" to these libraries and easily added, too.
For those of you who want to know a little more about my plugin before they install it, I will give a rough outline of what it does:
- It comes with jQuery, mootools, and Prototype libs in a subfolder
- In the setup, you can choose if you want to put any of the three libs on the frontend (the blog), the backend (edit entries), or both
- You can also define which plugins should be loaded additionally (jQuery only for the time being)
So, if want to add some cool FX to your blog, simply add the appropriate lib, and then add some nifty JS code into a head nugget, for example. Same goes for the backend. For my demo video, I just added a few lines of JS code to the entries.tpl file.
Anytime there are new releases of jQuery, mootools, and so on, I/we only have to commit the new release to CVS, and users can get them with a single click. For example, jQuery gets huge speed increases with each release.
- Mattsches