Javascript

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.

All you Javascript crazed developers out there, this is the group for you.

Drupal is in need of some usability improvements and after a few meetings and a lot of discussion, it is now time to take advantage of our new JQuery library in Drupal.

nedjo's picture

Step by step or all at once?

Big question #2: do we rewrite drupal.js all at once, or do we do it in a (long) series of small patches?

The issues to be addressed are many. There's the basic restructuring from its current form to an object-based structure. There's incremental and larger improvements to the methods:

  • improve the add/remove classes, as Konstantin has shown
  • improve the model for registering events--addEventListener rather than our somewhat clunky workaround in addSubmitEvent
  • gather a form input and submit it via AJAX, rather than the current hidden iframe
  • improve effects (collapse, resize) and expose them
Read more
nedjo's picture

Build on an external library? jQuery?

Major question #1 as we improve our js implementation: can/should we build on one of the leading external JS/AJAX libraries?

The impressive jQuery library might be a prime candidate. jQuery author John Resig has generously indicated his openness to making jQuery available to Drupal through a GPL license, see his post http://jquery.com/discuss/2006-May/001448/ (and the full thread, http://jquery.com/discuss/2006-May/), provided some concerns and issues could be addressed.

Advantages:
* jQuery would meet most of our needs, covering existing drupal.js functionality and more.

Read more
nedjo's picture

SoC Form Builder group

Announcing the http://groups.drupal.org/soc-ajax-form-builder group to help guide and support Avi Mehta in his Form Builder work for SoC. Please consider joining!

Read more
nedjo's picture

Let's plan a bit before wading too far into coding

[Adapted from a comment]

There are some early decisions to make that will have a big impact on what directions we take. If we work these through first, we'll can probably save time in the end by not coding solutions that don't fit. A DEP is the process we've set up as a community for working through large proposed changes or new initiatives, and it seems to fit this case.

I've created an issue on drupal.org, http://drupal.org/node/66148 (and also posted to the jQuery list to see if there's a possibility of getting jQuery under GPL.) I propose that we (a) work out the general approach in the DEP post http://groups.drupal.org/node/603over the next week or two, (b) post a draft DEP for the initiative on drupal.org, and then (c) move the actual implementation to http://groups.drupal.org/drupal-js. How does that sound?

Read more
nedjo's picture

Templates or XSLT: How to structure data transfers and client-side content generation?

A key AJAX design choice is how we are going to handle client-server data transfers and client-side content rendering.

The two most obvious choices are:

  1. Data exchanges are in XML and content is rendered client-side via XSLT.
  2. Data exchanges are in JSON and content is rendered client-side via templates.

Each has its relative merits, and each will require some development on our part to implement. It might make sense to make a community decision around which of these options to pursue, as then we could pool efforts. For some SoC projects, e.g., the Form Builder, the data and content rendering model is a key early decision that will shape much of how the project is developed.

Read more
nedjo's picture

A Drupal Enhancement Proposal for core Javascript improvements

There's broad interest here I think in improving the core Drupal Javascript. Shall we channel this into a Drupal Enhancement Proposal (DEP), http://drupal.org/node/39407? Here's some rough beginnings, please jump in.

Title: Javascript Library Improvements
Status: Early draft for discussion
Reference: See http://groups.drupal.org/ajax-developers

Introduction

This DEP aims to improve Drupal's built-in Javascript library, making it extensible and introducing a Drupal Javascript namespace to prevent namespace collisions.

Motivation

Drupal 4.7 introduced a slim and well designed set of Javascript utility functions (drupal.js) and behaviors (autocomplete, collapse, etc.). As Drupal contributors continue to develop Javascript and AJAX behaviors, there is an emerging consensus around ways we could make Drupal's Javascript library more readily extensible while solving issues such as namespace collisions. There is also interest in the possibility of adopting or piggybacking on one of the several leading Javascript/AJAX utility libraries (jQuery, Prototype, etc.).

Read more
kkaefer's picture

AJAX or JavaScript?

One question: Is this SIG just for AJAX or also for JavaScript issues? If so, I'd suggest renaming this group to "JavaScript & AJAX" or something similar.

Read more
peterx's picture

Ajax statistics

How useful is Ajax? I am working on a module to record who allows Javascript, who has xmlhttp available for Ajax and to give users control over Ajax. Part of the project is described in Statistics visitor enhancement. The rest is described here.

Read more
nedjo's picture

Drupal AJAX manifesto (working copy)

Drawing on recent discussions, here's a draft AJAX manifesto. The idea is to sum up a shared approach and plans. Please wade in and edit, change, expand, comment, etc.

Read more
robertDouglass's picture

Activeforms module

Hi Nedjo,

did you get a chance to review my activeforms module?

I couldn't attach it here so you can download it from here.

The point of the module is to be able to use your forms api definition to attach event listeners to any DOM object, and to use the fapi form to repopulate client side elements via AJAX. This eliminates having to define separate callback functions for AJAX.

I'll see if I can improve the activeforms_test.module some (the text example is dumb and broken).

I don't know how or if this intersects with the other initiatives.

Read more
nedjo's picture

'Battle plans'

How best to move forward implementing priority AJAX functionality?

We've got a lot of pieces in the works.

  • Drupal.js helpers and the existing core behaviours (collapse, autocomplete, etc.)
  • Thox's contributions beyond existing core pieces, including AJAX spellcheck
  • Steven's contributions beyond existing core pieces, including tablesorting
  • Jaza's Activeselect
  • Jjeff has 'prototyped' methods for scriptaculiousifying Drupal in S/P Ajax.
  • Based on his Moo module, Steve McKenzie has roughed in a very cool edit in place behaviour.
  • I've recently sketched in a number of behaviours (AJAX form submitting with preview, dynamically loading content into a block, etc.) as Javascript Tools
  • etc.
Read more
sime's picture

DHTML image cropping

On the dev list Adrian posted a link to a DHTML cropping tool.
http://www.speedingrhino.com/cropper.htm

I have been aware of this for a while, as I have a similar tool which I created before I came to Drupal. My goal has been to bring this into drupal, but the reality is I have a lot to learn about the drupal way first.

http://urbits.com/_/demos/insizer_demo_page4.php
(Click the clown)

Read more
Subscribe with RSS Syndicate content