Javascript

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.

How to make a jQuery plugin work?

NonProfit@drupal.org's picture
public
group: Javascript
NonProfit@drupal.org - Tue, 2008-06-24 23:34

I begin this discussion knowing full well this is a question only a themer could ask, but how do you get a jQuery plugin to function?


Looking for Szeged co-presenters for jQuery Tutorial

katbailey's picture
public
group: Javascript
katbailey - Fri, 2008-06-13 21:57

[Cross-posting from the Raincity blog]

I've submitted a proposal to the DrupalCon Szeged site for a tutorial session on jQuery in Drupal. I'd reallly like to get two co-presenters on board to structure it into three 30-minute tutorials, each covering two or three of the following suggested topics:


Hopefully helpful ramblings about jQuery in Drupal

katbailey's picture
public
group: Javascript
katbailey - Wed, 2008-05-28 17:35

Hi All,
I already included a link to Part One of this post in a thread below but I've just written Part Two and would love to get some feedback from other jQuery-loving Drupal developers. It gives a brief overview of the history of jQuery in Drupal, discusses jQuery Update module and the difficulty of bridging separate release cycles, looks at best practices for writing jQuery and provides a brief overview of AHAH and Drag & Drop in Drupal 6.


.form-select has no properties. jQuery problem.

ptomasiewicz's picture
public
group: Javascript
ptomasiewicz - Sat, 2008-05-10 18:56

Hi all.
I try to add some functionality to ''Multiselect'' module.

I`ve wrote simple jQuery script which fills unselected box with title of nodes from selected vocabulary.

Here is the code:

$('select.multiselect_taxonomy_vids').change(
function() {
base_path = "/inspirander";
fieldid=this.id;
vid=$('.multiselect_taxonomy_vids').filter('[@id='+fieldid+']').val();
seloptions='';
$('.multiselect_taxonomy_sel').filter('[@id
='+fieldid+']').each(
function(){
for (var i=this.options.length-1;i>=0;i--)
{


jQuery UI in Drupal 5

katbailey's picture
public
group: Javascript
katbailey - Tue, 2008-04-29 19:38

I'm trying to put together a sort of roadmap relating jQuery (and jQuery UI) at its different stages to Drupal 5 and 6 so that people can get an overview of the jQuery functionalities that are available to them. I will eventually post it to this group and if there's a suitable place in the handbook for such a thing.


Drop Down List again

public
molcom - Tue, 2008-04-22 16:05

Sorry that I post this discussion again but I've see that it is private and I want it public.

I have a module and for a menu link will be displayed a form.
1. In this form I have 2 select element. First element is populated with some authors name. The second select element must be populated with the books for the selected author from the first select element.
2. For each selection in first select element, the option array for the second element must change.
3. I must have a second submit button, or a button and have option to call a function when I press on it.

Ingredients for an Album/Track page

gusaus's picture
public
gusaus - Tue, 2008-04-22 01:48

This wiki is an attempt to explore the various options we have to build an album page with the ability to play individual tracks as well as the complete album/playlist. Ideally we'll get input/advice from some of those who have built and/or implemented this type of solution.


Packing Javascript, Dean-Edwards-style?

jjeff's picture
public
group: Javascript
jjeff - Mon, 2008-04-21 12:44

I've been looking at the results of Javascript optimization in Drupal 6 and it appears to me to be not all that optimized. It should really just be called Javascript "concatenation" as it doesn't appear that comments or white space is removed.

I'm guessing that there were problems with double-packing of jquery.js.. Can anyone point me to the thread where this was discussed?


Drop down list problem

public
group: Javascript
molcom - Mon, 2008-04-21 07:06

Hi!

I have a module and for a menu link will be displayed a form.
1. In this form I have 2 select element. First element is populated with some authors name. The second select element must be populated with the books for the selected author from the first select element.
2. For each selection in first select element, the option array for the second element must change.
3. I must have a second submit button, or a button and have option to call a function when I press on it.

If anybody could help me with any idea, suggestion, documentation.

Thank's!

jQuery plugin manager

public
group: Javascript
tjholowaychuk - Sun, 2008-04-20 01:19

Hello,

I would like some community feedback on IMO a great need for a jQuery plugin manager. I have seen many jQuery plugin 'wrapper' modules flowing through the feeds, and I think this is something that we should address. I am certainly willing to expand on my prototype which can be found at http://drupal.org/project/plugins

Any feedback or suggestions would be great.

Edit in place

public
groups: SoC 2008 · Javascript
KarenS@drupal.org - Wed, 2008-03-19 15:27

It would be great to develop edit-in-place capability where you can be viewing a page and click on the content and have it turn into an editable text area without going to a separate edit form, or be viewing a Views list and click on a field in the list and have it turn into an editable field that you can use to update the value. When using this with Views, it could almost be like having spreadsheet capabilities. This would be a killer feature.

Latest Ajax Popup News

starbow's picture
public
group: Javascript
starbow - Sat, 2008-03-15 00:37

Trying to edit the Ajax Popup wiki is just getting me the white screen of death, which is bad since it is all painfully out of date.
The big news is that all three patches have been rolled back into one. And it is prettier. More info at:
http://drupal.org/node/193311#comment-770004

I have integrated all the feedback I got at DrupalCon Boston, so I see it at the end of it's second phase of development. Now it is ready for some serious tire kicking from the rest of the world.


AJAX & Drupal: Post/Response Times

public
group: Javascript
jmmec - Thu, 2008-03-13 15:50

Hi,

I posted a message over at the Drupal Forum's asking about excessive post/reply times that I see on Drupal 5 using AJAX. With a simple change to bootstrap only the Drupal database, my AJAX post/response times decreased from 900-1000ms to 94-120ms per AJAX query. Instead of copying my post here, the link is below:

http://drupal.org/node/233608

I have a few questions at the bottom of my post and maybe some of the guru's in this group can shed some light in case there are alternative solutions for Drupal 5?

Developing AHAH Submit Functionality

joshk's picture
public
joshk - Wed, 2008-03-12 20:15

This post is intended to pull together my thinking and some of the discussions that took place in Boston around how to get a solid framework in place for real next-generation javascript into core for Drupal 7. My specific interest is in taking the promise of Nedjo Rodgers ajaxsubmit.module (part of the jstools project) and overhaul it to work in harmony with the amazing new AHAH features in Drupal 6.

My objective is to release a solid contrib module for Druapl 6.0 which provides a good framework for developers interested in this functionality, and implements some useful default behavior that will give it some purpose and life "out of the box." Assuming I can make decent progress on this in the next six weeks, this is a good way to figure out what's needed, and define functionality and code which can be engineered into Drupal core for the 7.0 release.

The full post here contains my initial spec, thinking on how to accomplish all this, and first experiments with extending the existing ajaxsubmit module.


Web Services in Drupal 7

Rob Loach's picture
public
Rob Loach - Wed, 2008-02-27 00:34

Just a quick note that nedjo posted a note about Services module going into core. This would allow use of XML-RPC, JSON, RSS, REST, SOAP and more to be loaded through a common Services API.

A Code Sprint will take place in Boston this coming Friday that will focus on the inclusion of this new Services API.


Getting Modal Dialogs in Drupal 7 - the wiki

starbow's picture
public
group: Javascript
starbow - Mon, 2008-02-25 21:53

Update: This all needs to be updated with all the BostonCon information and changes. In the mean time, the best place to catch up is: http://drupal.org/node/218830#comment-764167

Since my drupalcon session did not make the cut, I am putting my notes here. Hopefully we still can get some momentum building for the code sprint (maybe a BOF?). I would be thrilled if anyone wants to jump in a review these patches, advise on the overall direction, or jump in on the TODO items.

Popups: Adding the core modal dialog API (http://drupal.org/node/218820)


Are you interested in learning or using Flex?

ccharlton's picture
public
ccharlton - Mon, 2008-02-25 19:41
Yes
56% (73 votes)
Maybe
12% (16 votes)
No
18% (24 votes)
Not sure yet
14% (18 votes)
Total votes: 131

sun's vision for handling embedded/inline content and Wysiwyg in Drupal

sun's picture
public
sun - Wed, 2008-02-06 20:59

.

.

As some of you know, I've recently taken over maintenance of Inline and Image Assist, and initiated the Wysiwyg project. That was not only caused by personal interest, but also to take the necessary steps to realize the long awaited Inline API. You might ask yourself, what those three modules have in common or to do with each other at all: They deal with user input, allow to embed complex contents into a content, and provide an interactive GUI for that. If you already had the chance to work with them, you already know that there is a rather hidden, non-obvious hard-dependency between them.

Although I'd really like to discuss both topics (Inline and Wysiwyg support) separately, the gained experience on these topics enforces us to discuss them concurrently. The following mockup hopefully explains why: (see attachment to view in full size)


Popup Dialogs and CCK

starbow's picture
public
starbow - Thu, 2008-01-31 01:04

I have been playing with the CCK head and my modal dialogs, and you can see the result at:

http://www.citris-uc.org/blog/tao/drupal_modal_dialogs_and_cck (2 minute loop)

I am particularly happy with the new ability to detect if the drag-and-drop table has been modified, and to offer to save the current progress.

Aside: Those of you paying close attention might have noticed me cheating. The /admin/content/types page doesn't actually have "fields" links. But it should (http://drupal.org/node/215623)


jQuery / JS ninja wanted for collaboration

agentrickard@drupal.org's picture
public
groups: Javascript · MySite
agentrickard@dr... - Mon, 2008-01-28 15:11

It's that time. Time to start porting MySite to Drupal 6. It will take some effort, since I will be refactoring some code and doing an API cleanup to more closely integrate with Panels.

One of the coolest features in MySite is the ability to drag-and-drop elements around the page. Problem is, the feature is a little buggy and relies on the jQuery Interface project. Based on some recent discussion, I think a Drupal-specific solution might be best.


Ajax Modal Dialogs (Popup Module)

starbow's picture
public
starbow - Sat, 2008-01-26 01:27

I have a new Drupal 6 module that brings modal dialog to the admin interface. You can check out a screencast at:
http://www.citris-uc.org/drupal_modal_dialogs

The project itself is at:
http://drupal.org/project/popups


jQ Module

aaron's picture
public
group: Javascript
aaron - Thu, 2008-01-24 19:38

I just created the jQ module. This attempts to centralize jQuery plugins (from an administration view-point), and somewhat simplify jQuery development. As an example, I also created the hoverIntent wrapper module.


Moving JS to the Bottom of the Page

greggles's picture
public
greggles - Wed, 2008-01-23 18:13

I've been using yslow to review a few sites and always leave one last step out: move javascript to the bottom of the page

So, on a test site I just moved my

<?php
print $scripts
?>

to the bottom of the page.tpl.php right before the print $closure.


Weird Javascript syntax..

public
group: Javascript
tjholowaychuk - Sat, 2007-12-01 02:04

Other than this there isnt really much that strikes me as being overly weird about javascript but I cannot find any good documentation on this syntax that I have seen around because I dont know what it does! Any suggestions or documentation would be great thanks, its just been bugging me...

(function() {
    // ...
})();

(function() {
    // ...
})(var);

function() {
    // ...
})();

Aptana / Eclipse Drupal profile

public
group: Javascript
tjholowaychuk - Tue, 2007-11-27 18:16

has anyone documented the drupal js functionality for use with Aptana ?

I really need some help with ajax and jquery

public
group: Javascript
twooten - Sat, 2007-11-24 12:59

Hello everybody,

I'm sure this is not the right place to post this. It's just that I'm not sure where to post it and I'm about to pull whats left of my hair out messing with this ajax stuff. I have an idea for a niche website and am working to develop it. I want to throw in some ajax and jquery in order to enhance the user experience. So I'm trying to learn how to do things with ajax.

Inline search

public
group: Javascript
tjholowaychuk - Thu, 2007-11-15 01:40

I plan to make an inline search module for D6. Basically it would provide a UI for various pages such as permissions, modules, menu, and other core ( and well supported module pages ) to provide a very fast way to narrow down the page content to find what you want.

JavaScript errors with Google Gadgets

agentrickard@drupal.org's picture
public
groups: Javascript · MySite
agentrickard@dr... - Wed, 2007-10-24 01:54

Over on the MySite project we're having a recurring issue with handling the JavaScript for Google Gadgets on our pages. It looks as though there is a problem with the order in which the JS are executed -- but that's really a guess on my part.

Sometimes, Flash embeds don't fully load: http://drupal.org/files/issues/gadgets.png

Sometimes, the JS loads the same element repeatedly: http://drupal.org/files/issues/GoogleWidgetScreenshot.png

Expert 'scripters exploring the issue would be much appreciated.

http://drupal.org/node/170660


Make iframe resizable (like textarea) with JQuery

public
group: Javascript
svendecabooter@... - Mon, 2007-10-01 13:37

Hi,

I wonder how hard it would be to make an iframe resizable, much like textareas are resizable in Drupal (with the textarea.js).
The reason i ask this, is because i have created a module to integrate the "Whizzywig" WYSIWYG editor into Drupal (see http://drupal.org/project/whizzywig).
This editor replaces the textarea with an iframe to allow WYSIWYG editing.

Views Slideshow

aaron's picture
public
aaron - Sun, 2007-09-23 22:18

I just added a new slideshow mode to the Views Slideshow module. You can see a demo at Drupal Hub. It uses JQuery and views, so any type of view could be made into a slideshow. The current modes are single frame, as seen in the left sidebar of the demo page, and with 'thumbnails' as shown on the content of that page.

I also revamped the themes for it, making it easier to theme specific elements of the slideshow.


jQueryCamp '07 (Boston)

John Resig's picture
public
groups: Boston · Javascript
John Resig - Fri, 2007-09-07 12:45
Start: 
2007-10-27 10:00 Etc/GMT - 2007-10-27 18:00 Etc/GMT

We're going to be having the first all-day jQuery mini-conference October 27th, here in Boston, MA. Already, a large portion of the jQuery team will be attending and giving talks - so if you're interested in meeting some of the people who've helped to make jQuery possible and chatting with fellow developers, then this is a fantastic place to do it! (Note: jQuery is the JavaScript library that's used to power Drupal.)


Dynamic Views module (AHAH page loads)

ChrisB's picture
public
ChrisB - Sat, 2007-07-28 20:06

Hi Everyone,
I just wanted to let you know about a new views related module, Dynamic Views. (http://drupal.org/project/dynamic_views) It allows you to dynamically update the main content area (no page reload) when you click a node link in a view block. It also allows you to change dynamically update a view using a filter at the top. You can combine it with some elements of the jquery interface library for some pretty cool effects. (see http://warnerbrosrecords.com/artists)


Spry AJAX Framework

Rob Loach's picture
public
group: Javascript
Rob Loach - Mon, 2007-07-23 20:37

I just created the Spry Framework Module to facilitate the implementation of some Spry Goodness into Drupal.

The Spry framework for Ajax is a JavaScript library for web designers that provides functionality that allows designers to build pages that provide a richer experience for their users. It is designed to bring Ajax to the web design community who can benefit from Ajax, but are not well served by other frameworks.


JQuery UI

starbow's picture
public
group: Javascript
starbow - Thu, 2007-07-05 18:19

Has anyone had a chance to check out the new JQuery UI? I think it is what people have been referring to as Interface2.

Update: It looks like Dimitri has created the UI project to deal with jQuery UI in D6. I have just created the jQuery UI Backport project to allow the library to be used in D5 without breaking anything.


mootools JavaScript framework benchmark

anisotropic@drupal.org's picture
public
group: Javascript
anisotropic@dru... - Thu, 2007-06-14 19:14

Ran across this 'speedtest' page today, it has interesting results especially cross-browser:

http://mootools.net/slickspeed/

If you run it on FF ( at least on my iMac and a nearby Vista machine ) moo and prototype are much faster, but extjs wins hands down on Safari ( OS X ) and IE7 on Vista. jQuery is middling IMHO the benefits in developer satisfaction are worth the speed cost vs prototype.

Discuss.


Javascript patches need reviews!

public
group: Javascript
nedjo - Fri, 2007-06-01 04:30

With the announcement today of another four weeks before Drupal 6 freeze, we have another chance to get some critically needed Javascript patches into Drupal core.

Very few Javascript patches go through, mostly for lack of in-depth reviews. Please, everyone on this list, take your turn in reviewing Javascript patches! Better yet, wade in and help make improvements to the patches.

Here's a link to Javascript issues needing review:

http://drupal.org/project/issues/drupal?components=javascript&states=8%2...

A few highlights:

New jquery in D6?

moshe weitzman's picture
public
group: Javascript
moshe weitzman - Thu, 2007-05-24 02:18

I would really love if some enterprising member of this group would submit a patch for core where we uprgade to latest jquery. you really don't want to stick with 1.0 for another year, do you?

At minimum, the patch should swap jquery.js and fix anything that breaks. For bonus points, do whatever refactoring makes sense based on new jquery features.

I'm a js novice - just cheerleading on this one. Go Team!


jQuery Interface Sortable Module

public
marcp@drupal.org - Wed, 2007-05-16 14:12

Just a quick pointer to the jQuery Interface Sortable module that we added last week. In 5.x, it depends on the excellent jQuery Update and jQuery Interface modules. In 6.x (or HEAD -- I'm still trying to figure out how I got that 6.x release node in there), it only requires jQuery Interface.

JavaScript localization for Drupal 6.x

Gábor Hojtsy's picture
public
Gábor Hojtsy - Tue, 2007-05-01 08:37

Because there does not seem to be active development around the JavaScript localization issue, I figured I'll try to get some attention from the Javascript group. The issue at hand deals with enabling string localization in JavaScript files. Because Drupal 6 will be a big push in the multilingual direction, localizing JavaScript files should also be actively on the table. If you have time, please look into this patch or at least drop in your two cents. Thanks!


Storing javascript preferences

sime's picture
public
groups: Javascript · Services
sime - Tue, 2007-05-01 03:01

As part of SWF Tools you can embed Flash into the webpage in 2 obvious ways:
- directly embedded into the html.
- with a flash replacement technique (eg. SWFObject, jquery.flash.js, and UFO to come)

So, say my choice, as administrator, is SWFObject. But what if the user has javascript turned off? I think the result is no flash (even though the use might want to see it).


Tabs through panels

public
group: Javascript
nedjo - Wed, 2007-04-25 03:55

I posted a module today that will be of interest to anyone wanting to use tabs on their site without having to do custom coding.

It's called Panels Block, http://drupal.org/project/panelsblock. With it you can expose a set of panels as a block via a new option on the panels edit form. (Only the content added to the 'left' area is made available as a block.) There are two ways to display the content: default (sort of like a regular panel) and tabs. (The tabs.module, part of Javascript Tools, is required.)

JQuery Update / Interface / Message Effects

jjeff's picture
public
group: Javascript
jjeff - Tue, 2007-04-10 14:23

Okay, so the story goes like this:

1) The SPAjax module (4.7 only) has a feature that allowed you to apply (Scriptaculous) Javascript effects to Drupal messages - allowing the "fade yellow" technique, pulsating, or shaking of the message divs. I missed this on my Drupal 5 sites and wanted to implement it in JQuery. Easy, right?

2) JQuery's effects library is called Interface. I couldn't find a version of Interface that would work with JQuery 1.0.1 (the version in Drupal core).

3) In order to update the JQuery in core, you need John Resig's compat-1.0.js script which allows backwards compatibility with scripts written for JQuery 1.0.x (such as everything in Drupal core). So now we need a module to include the compat-1.0.js file.

4) Interface.js is a relatively large file ~80K. It's "parts" (individual effects) are available separately, but this only increases the possibility that two modules will include the same (or worse two different versions of the same) scripts. So... now we need a central module to include a single interface.js file on the page when needed.

So here's what we ended up with:


Ahah Forms v1.5 - Secure Dynamic Subforms

starbow's picture
public
group: Javascript
starbow - Sat, 2007-04-07 06:45

At the Drupal Summit, chx & eaton let me know that avoiding the FormAPI security by directly accessing $_POST was a bad idea. So I dropped the slide out of my presentation that talked about how to create dynamic subforms, and spend the last two weeks hacking like mad. I now have an approach that I believe combines convience and security. It is packaged up in Ahah Forms v1.5 as the dynamic_subform.module. It uses the same basic algorithm as drupal_get_form when #multistep is true (but is incompatible with #multistep, so don't try to use both of them).

I have a full write up at: Secure Dynamic Forms and Subforms, but here is an example of the functions in use:


How do I iterate over the jsAC objects in autocomplete?

victorkane@drupal.org's picture
public
group: Javascript
victorkane@drup... - Tue, 2007-04-03 12:50

Hi everyone.

As you can see from a cursory view of my "Practical Dojo Lesson: An autocomplete nodereference field that is dependent upon a choice made in another" (http://groups.drupal.org/node/3471), I was able to redefine autocomplete handlers (to be triggered by uri registered with menu callback), but I was not able to get rid of the "old" (created on page load, or "ready" event) handlers. I had to send the latter to the bytebucket.


Practical lesson: An autocomplete nodereference field that is dependent upon a choice made in another

victorkane@drupal.org's picture
public
victorkane@drup... - Tue, 2007-04-03 05:40

(Introducing the shiny new "Dojo Practical Lesson" format)

Problem statement

If you need to do this, feel free to use this code. If you can think of ways of improving it, please join in.

So I have three content types with additional fields added through CCK.

Content type one: Company

Content type two: Contact

Content type three: Ticket

The Company content type has a nodereference field where Contacts can be filled in (multiple autocomplete field).


Multi-Publisher Project Proposal

veggieryan's picture
public
veggieryan - Mon, 2007-03-26 03:19

Application for Summer of Code 2007: MultiPublisher Module

by Ryan Grace www.thefractal.org :: ryan@thefractal.org

Synopsis


Views and Ahah Forms 1.3 released

starbow's picture
public
starbow - Wed, 2007-03-14 21:13

I am really excited to announce the release of the work I have been doing to create an Ajax version of Views, by modifying ahah_forms and views_ui to work together . It took weeks longer than I anticipated, and required extending ahah_form.js and tweaking maybe 20% of views_ui, but I am very happy with the result. You can check it out yourself at http://demo.starbowconsulting.com/admin/build/views. The views_ui rewrite is available in the examples directory of ahah_form v1.2 (http://drupal.org/project/ahah_forms)

Update: I have removed the need to login to the site to administer views (some people were having trouble getting in).

Update: v1.3 released: Ok, I am probably just procrastinating reviewing my notes for friday's summit talk, but I have released a much simplified views_ui.module-example. The big thing I realized is that almost everything I really need to do can be done in the theming functions. Also, I have refined the ahah_forms.js visual effects and removed the yellow fade. This allows me to drop the two interface javascript files.


hook_ajax

dwees's picture
public
group: Javascript
dwees - Mon, 2007-03-12 22:21

I don't know if this is a bit of a foolish plan or not, but I was wondering about the feasibility of creating a framework for allowing modules to relatively easily create Ajax-loadable content.

Basically I envision is a module that creates a new hook (called hook_ajax) for lack of a better name. This module would also include an API for module developers to make the dynamic creation a bit easier (for instance a version of the l() function, but one that modifies the URL to point at our module's MENU_CALLBACK, perhaps with some additional information attached).


Views / Tabs / Panels - Dynamic Loading

discursives's picture
public
discursives - Wed, 2007-02-28 22:11

Hello DOJO!

I want to be a Drupal ninja!

I have seen so many cool sites lately! There's one functionality set that has really caught my eye. I can't figure out how to do it, though. Can someone here give a hint? I've been through all the searches I can think of on Drupal.org and this is the first time I'm really asking, so I hope I give enough information! Here's a recent question verging on this: http://drupal.org/node/115058

What I'd like to do is display a view in a tab in a panel, and have the view be created by a stored argument that is autogenerated from the node ID.


Syndicate content