Andrew Berry Development - web development http://www.abdevelopment.ca/taxonomy/term/8/0 en Fixing the Enter Key on AHAH Forms http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms <p><strong>Update:</strong> I've modified the suggested JavaScript code to not break #autocomplete enter presses.</p> <p>The <code>#ahah</code> element introduced in Drupal 6 makes setting up dynamic JavaScript-driven forms much simpler than with Drupal 5. To see this in action, take a look at the Poll module. When adding more choices to a form, clicking the "Add another choice" button doesn't reload the page if JavaScript is enabled. However, there is one problem with such a form: by adding a submit button above other submit elements, it becomes the default action when pressing the enter key. Unfortunately, browsers don't have a method to specify the default submit action, and usually just use the first submit element on the form. To see this issue, try pressing the enter key inside the Title field on a Poll node. The page reloads, and the JS-disabled fallback is executed, instead of the Preview action as may be expected.</p> <p>This might be behaving as intended with the <a href="https://api.drupal.org/api/file/modules/poll/poll.module/6/source">Poll module</a>, but I wanted to ensure that the enter key action was consistent with a similar feature I was adding to the <a href="https://www.drupal.org/project/skeleton">Skeleton Outline</a> module. Most JavaScript code online will recommend doing something similar to the following:</p> <div class="field field-type-link field-field-links"> <div class="field-items"> <div class="field-item"> <div class="field-label-inline-first"> Related Links:&nbsp;</div> <a href="https://www.drupal.org/node/348475">Introduction to AHAH in Drupal</a> </div> </div> </div> <p><a href="http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms" target="_blank">read more</a></p> http://www.abdevelopment.ca/blog/fixing-enter-key-ahah-forms#comments drupal javascript web development Tue, 20 Jan 2009 00:29:39 +0000 andrew 78 at http://www.abdevelopment.ca Deploy Drupal Modules and Themes with Eclipse External Tools http://www.abdevelopment.ca/blog/deploy-drupal-modules-and-themes-eclipse-external-tools <p>Eclipse, with the newly released <a href="http://www.eclipse.org/pdt/release-notes/pdt2_0.php">PDT 2.0</a>, is a very capable Drupal IDE. With code completion, automatic documentation lookups, and integrated debugging, Eclipse is very good for anyone who spends time doing Drupal code.</p> <p>One issue I've run into with Eclipse when working on contributed modules is that the modules themselves aren't located within a Drupal installation. I found myself resorting to external programs or the command line to copy my changes to my development site or to my local development copy. Using Eclipse's External Tools, it's possible to deploy changes with a single click, greatly reducing the time to test modified code.</p> <div class="field field-type-link field-field-links"> <div class="field-items"> <div class="field-item"> <div class="field-label-inline-first"> Related Links:&nbsp;</div> <a href="http://www.eclipse.org/pdt/release-notes/pdt2_0.php">PDT 2.0 Release Notes</a> </div> </div> </div> <p><a href="http://www.abdevelopment.ca/blog/deploy-drupal-modules-and-themes-eclipse-external-tools" target="_blank">read more</a></p> http://www.abdevelopment.ca/blog/deploy-drupal-modules-and-themes-eclipse-external-tools#comments drupal eclipse web development Mon, 05 Jan 2009 21:27:49 +0000 andrew 70 at http://www.abdevelopment.ca Open Firefox Page in Safari http://www.abdevelopment.ca/blog/open-firefox-page-safari <p>I do most of my website development work in Firefox, due to the availability of extensions such as Firebug, YSlow, and Tamper. Sometimes, I want to check a page in another browser so I can log in as a different user. This simple Applescript, combined with Quicksilver, allow me to easily open the current Firefox page in Safari:</p> <div class="codeblock"><code>tell application &quot;Minefield&quot; to set theURL to «class curl» of window 1<br />tell application &quot;Safari&quot;<br /> activate<br /> open location theURL<br />end tell</code></div> <p><a href="http://www.abdevelopment.ca/blog/open-firefox-page-safari" target="_blank">read more</a></p> http://www.abdevelopment.ca/blog/open-firefox-page-safari#comments applescript web development Thu, 25 Sep 2008 05:46:53 +0000 andrew 48 at http://www.abdevelopment.ca Running Microsoft's IE Application Compatibility Images in VirtualBox http://www.abdevelopment.ca/blog/running-microsofts-ie-application-compatibility-images-virtualbox <p><strong>Update:</strong> Unfortunately, as of the September 2009 release, the VPC images from Microsoft have been changed and are now a bit more picky about activation. <strong>When you follow this procedure, the images will now fail activation</strong>. I've left this page up so that the procedure can be tried on future releases of the images.</p> <p>Virtualbox is a virtualization product produced by Sun. Available for Windows, Linux, OS X, and Solaris, it not only is fast and full of features, but free! Most of the product is available under the GPL. Some additional features, such as USB and Remote Desktop support, are available free of charge for personal and small-scale commercial use.</p> <p>Unfortunately, Virtualbox doesn't come with a robust set of tools to convert disk images. While you can convert images between Virtualbox (VDI) and VMWare (VMDK), as well as from straight raw disk images, you can't easily convert images from Microsoft's VirtualPC format. This is an issue when you want to use Microsoft's free VPC images for testing various versions of Internet Explorer. Luckily, with a little bit of help from QEMU, it's possible to convert these images into something usable, all without needing a copy of Windows installed to bootstrap everything.</p> <div class="field field-type-link field-field-links"> <div class="field-items"> <div class="field-item"> <div class="field-label-inline-first"> Related Links:&nbsp;</div> <a href="http://www.microsoft.com/en-us/download/details.aspx?id=11575">Internet Explorer Application Compatibility VPC Image</a> </div> <div class="field-item"> <div class="field-label-inline"> Related Links:&nbsp;</div> <a href="https://www.virtualbox.org/">VirtualBox</a> </div> <div class="field-item"> <div class="field-label-inline"> Related Links:&nbsp;</div> <a href="http://www.kju-app.org/">Q (Qemu for OS X)</a> </div> <div class="field-item"> <div class="field-label-inline"> Related Links:&nbsp;</div> <a href="http://bellard.org/qemu/">QEMU</a> </div> </div> </div> <p><a href="http://www.abdevelopment.ca/blog/running-microsofts-ie-application-compatibility-images-virtualbox" target="_blank">read more</a></p> http://www.abdevelopment.ca/blog/running-microsofts-ie-application-compatibility-images-virtualbox#comments virtualbox web development Fri, 22 Aug 2008 18:46:10 +0000 andrew 45 at http://www.abdevelopment.ca The Future of Internet Explorer is Firefox http://www.abdevelopment.ca/blog/future-internet-explorer-firefox <p>If you do any website development, and have <strong>ever</strong> experienced a compatibility issue with Internet Explorer, then this article will be interesting to you. Mozilla is working on getting both <a href="http://blog.vlad1.com/2008/07/30/no-browser-left-behind/">the canvas element</a> and <a href="https://wiki.mozilla.org/Tamarin:ScreamingMonkey">Tamarin</a> supported natively in Internet Explorer through ActiveX controls. While the <a href="http://arstechnica.com/information-technology/2008/08/mozilla-drags-ie-into-the-future-with-canvas-element-plugin/">Ars Technica</a> article doubts that many will install such plugins, a few big backers, such as Adobe or Google could make a major change in the web browser landscape. Imagine if the Google Toolbar came bundled with additional controls to fix IE's broken CSS, add support for tags and selectors Microsoft decided not to implement, and speed up Google Maps to boot (by avoiding the ExCanvas library). Exciting work!</p> <div class="field field-type-link field-field-links"> <div class="field-items"> <div class="field-item"> <div class="field-label-inline-first"> Related Links:&nbsp;</div> <a href="http://arstechnica.com/information-technology/2008/08/mozilla-drags-ie-into-the-future-with-canvas-element-plugin/">Mozilla drags IE into the future with Canvas element plugin</a> </div> <div class="field-item"> <div class="field-label-inline"> Related Links:&nbsp;</div> <a href="http://blog.vlad1.com/2008/07/30/no-browser-left-behind/">No Browser Left Behind</a> </div> <div class="field-item"> <div class="field-label-inline"> Related Links:&nbsp;</div> <a href="https://wiki.mozilla.org/Tamarin:ScreamingMonkey">Screaming Monkey Project Page</a> </div> </div> </div> <p><a href="http://www.abdevelopment.ca/blog/future-internet-explorer-firefox" target="_blank">read more</a></p> http://www.abdevelopment.ca/blog/future-internet-explorer-firefox#comments web browsers web development web standards Wed, 20 Aug 2008 01:25:22 +0000 andrew 35 at http://www.abdevelopment.ca