Digital Handyman

Google Summer of Code proposal - Drag Drop and Sort API

Drupal stresses ease of use. To that end, I will submit APIs to offer dragging, dropping, and sorting functionality to modules. This will greatly enhance not only the ease of making changes to the user interface, but also the development of associated drag and drop projects (see below). To highlight the abilities of these APIs, I will also create a module to drag and drop blocks.

Project specifics

This project will focus on providing support within Drupal for the drag, drop, and sort functions of Interface Elements for JQuery (http://interface.eyecon.ro/). In doing so, I would be creating a standard interface structure so that developers and users alike can count on consistent results. And of course it will be completely themeable.

One of my main considerations in designing the Drag, Drop and Sort APIs is flexibility. Namely, the APIs need to be usable by all content items within Drupal. This includes but is not limited to: Blocks, Nodes, Tables, etc. These modules will allow users to choose which types of content they want to be draggable, droppable, and sortable. Here is basically how it will work:

The Drag API will handle assigning class information to items that are eligible to be dragged.

The Drop API will handle assigning container ids to areas that are eligible for draggable items to be dropped into.

Appropriate javascript will be inserted into the pages that are dnd-active. This javascipt will open certain classes and ids to be actively dragged and dropped.

All of these classes and ids will be available to be themed by the user, so the look of the drag and drop will be customizable.

The actual drop of an object will trigger the sort API to query the database for position information, recalculate weights based on new positioning, and update the database with these new values.

The sort API will optionally have both an ajax submit option or a option.

In order to test these APIs, I will create a Blocks DnD module. This lightweight module would allow users to drag and drop blocks within each region, as well as moving blocks from region to region. It would not require additional database tables.

The Drupal community and the broader developing community is very interested in drag and drop features. I have come across several projects that are either considering or have already implemented some form of this functionality. Please review the following links to judge for yourself.

By enhancing ease of use, we open the door to a wider range of would-be users and developers.

By de-emphasizing the need for complex programming, we allow users and developers to focus on style and content.

Easily integrated Web 2.0 features makes for an easier sell to prospective clients or a boss.

Since drag and drop features mimic such popular operating systems as Windows and OS X, it makes the user interface more familiar and intuitive to users that are already familiar with functionality.

Many projects are already looking at including this type of functionality.

And let's be honest: Drag and drop is really cool!

Criteria for Success

Creation of the above specified modules.

Successful functionality on all the most widely used browsers, including Internet Explorer 6 and 7, Mozilla Firefox and other similar browsers, Opera 8 and up, as well as Safari.

Flawless integration between the Drag, Drop and Sort APIs and the Blocks DnD module.

Graceful degradation in browsers that don't support these features.

Roadmap

Now to the end of April - Submit my plans to the Drupal community to generate feedback and suggestions on how I might enhance this project and make it truly universal in scope. Completely familiarize myself with the Drupal structure to ensure that my code is in line with Drupal coding standards, and to enhance continuity with the core. Discuss my proposal with developers who engaged in similar or complimentary work. Examples include the Panels module, Mysite module, and any other projects that might be affected or enhanced by this project.

Beginning of May to the end of June - Complete initial development of Drag Drop and Sort API and Blocks DnD module. Release for testing and improvement.

Beginning of July to the end of August - Implement bug fixes and any improvements.

Who am I?

Ever since I was young, I have been fascinated with web design. Having no skill in building things with my hands, I loved the idea of being able to manipulate a virtual space to suit my fancy or needs. Ever since then, I have tried to hone my skills and reach for ever greater control over the virtual environment.

My love affair with Drupal began more than a year ago. After building many websites with straight html and a little javascript here and there, I discovered the concept of a CMS. I began searching for the best CMS to build my online t-shirt store with. I quickly learned that although a CMS can greatly enhance productivity, they can also be very difficult to learn. Then I discovered Drupal. Within a couple of days, I was able to build an initial test store that I was quite happy with. Since then I have honed my skills and endeavored to learn as much about Drupal as I could. I have provided feedback for several projects and have been aching for some time to get my hands dirty with actually developing a module for Drupal.

I now run several websites off the same code base (a feature I am quite enamored with). I am ready to take the next step and ride the web 2.0 tidal wave that is sweeping the internet. I am interested in making Drupal easier to use so that more people will have the opportunity that I have had to work with such amazing software. I think that my success in creating the above mentioned enhancements to Drupal will help me accomplish that goal.