» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with ON + script.aculo.us

script.aculo.us 1.6.2

After four long months of waiting (due to my being busy with sekrit work), script.aculo.us 1.6.2 is now out!

It’s a mostly-bug-fix-only release, so don’t expect any major oohs! and aahs! here, but sure get it. It’s recommended for all users, and addresses various more-or-less cosmetically issues, besides a memory leak bug with Draggables and an endless loop in the Slider code.

Anyway, big, big thanks to all contributors who continue to do patches and bug reports! Hopefully the trac will be up to speed soon (new server is coming!). If you should have any issues, please report it to the rails-spinoffs mailing list.

Updates and fixes:

  • Fix a problem in the drag and drop logic if an reverting/drag ending draggable was initialized for a new drag (for example by clicking repeatedly) for all cases where the default start/revert/end-effects are used, fixes #4706 [thx tecM0]
  • Fix possible memory leaks with Draggables, fixes #3436 [thx aal]
  • Throw nicer errors when requires script.aculo.us libraries are not loaded, fixes #5339
  • Make slider handles work when not displayed initially by using CSS width/height, fixes #4011 [thx foysavas]
  • Update sortable functional test with onUpdate counter
  • Make more Element extensions unit tests work on Safari
  • Add the assertMatch unit test assertion for asserts with RegExps [thx Ian Tyndall]
  • Fix a problem with Effect.Move causing “jumping” elements because of very low float numbers in some situations
  • Fix a missing semicolon in dragdrop.js, fixes #5569 [thx mackalicious]
  • Fix a slight inaccuracy with Effect.Scale that could lead the scaling to be one pixel off
  • Be more prototypish with Effect.Transitions.linear
  • Make Effect.Scale recognize font sizes that use the pt unit, fixes #4136 [thx aljoscha]
  • Fix IE hack in Effect.Opacity, fixes #5444 [thx nicholas]
  • Fix IFRAME layout fix for IE and Autocompleter, fixes #5192 [thx tommy skaue]
  • Fix only option in onEmptyHover, fiex #5348 [thx glenn nilsson]
  • Fix Effect.BlindDown and SwitchOff handling of supplied callbacks, fixes #5089 [thx martinstrom]
  • Fix a problem with field focus on Ajax.InPlaceEditor and loading external text, fixes #4988, #5244 [thx rob]
  • Do not attempt to scroll if scrollspeed is 0/0, fixes #5035 [thx tomg]
  • Fix a problem with Sortable Tree serialization, fixes #4939, #4688, #4767 [thx Sammi Williams]
  • Fix an endless loop with sliders, fixes #3226, #4051, #4765 [thx jeff]
  • Make autocompleter work with update DIVs that have scrollbars, fixes #4782 [thx Tommy Skaue]
  • Corrected options parsing on switchoff effect, fixes #4710 [thx haldini]

There are also some updated functional and unit tests (use these links to get to live online versions of these).

Also, this version of script.aculo.us is now included with Edge Rails (as of changeset 4765), and should be part of the upcoming (as in “when it’s ready”) Rails 1.2 release.

Next up: Planning the script.aculo.us 2 release… ;)

script.aculo.us: Thomas Fuch's Weblog

Mac OS X 10.5 Leopard on Ruby on Rails

The next release of Apple’s operating system Mac OS X 10.5 will ship with Ruby on Rails installed (read more on this at Riding Rails).

Cool stuff indeed.

script.aculo.us: Thomas Fuch's Weblog

Judgment (Rails) Day

Along with fellow core team members and other railsers, I’m going to be one of the Judges for Rails Day 2006.

With lots of cool prizes around, we’re probably going to have a tough time on deciding what’s best (and I do hope some serious freakin’ hot stuff will be developed!).

I’m going to hang out at the campfire tomorrow, and maybe I can even answer a question or two if you’re using script.aculo.us (or just hit #prototype on freenode.net).

script.aculo.us: Thomas Fuch's Weblog

Rails Day 2006 - June 17

Rails Day 2006 is coming soon and we here at wollzelle will add some cool stuff to the already very nice prize list.

I’ll give a quick update here, as soon as it’s official on the Rails Day site. Update: We’re giving away 5 fluxiom Pro accounts to Rails Day winners, read more on that at the offical Rails Day blog.

And for you Rails developers: I want to see some cool uses of script.aculo.us, so please don’t let me down! :)

script.aculo.us: Thomas Fuch's Weblog

Ajax training in Austria: "Ajax richtig verwenden"

I’m doing a one-day training on everything Ajax mainly focusing on script.aculo.us, but naturally including Prototype and a look on Ruby on Rails Ajax capabilities as well, on March 17, here in Vienna, Austria (for german speaking audiences).

Here are the (in-german) details:

In diesem eintägigen Seminar zeigt Ihnen Thomas Fuchs wie Sie die Benutzerfreundlichkeit und Interaktivität ihrer Websites verbessern. Das Seminar bietet einen Überblick über verbreitete Ajax-Entwicklungswerkzeuge und fokusiert auf die Verwendung der Prototype-Bibliothek und script.aculo.us. Weiters werden die Möglichkeiten der integrierten Ajax-Funktionalität von Ruby on Rails demonstriert.

Also, nichts wie anmelden, nur 20 Plätze verfügbar!

script.aculo.us: Thomas Fuch's Weblog

script.aculo.us V1.5.2 featuring auto-scrolling draggables

Here are the new features:

  • Added auto-scroll option to Draggables and Sortables, activate with scroll: ‘id_of_scroll_container_element’. See test/functional/dragdrop3_test.html for usage/demo
  • Add limit option to effect queues to limit the maximum number of effects in a queue, new unit tests for scoped effect queues, fixes #3498 [thx Abdur-Rahman Advany]
  • Add Sortable.sequence method to extract the current sequence of a Sortable as an array, fixes #3675 [thx sphivo]
  • Added activate method to Autocompleter that allows you to trigger the suggestions through other means than user input [DHH]
  • Add assertEnumEqual for unit testing (from Prototype SVN trunk) [Sam Stephenson]

Additionally, various bugs where fixed (see the CHANGELOG for details).

Get it at the script.aculo.us downloads page.

(So I’m back from exploring London now, hope to get some more updates to script.aculo.us done over the next few weeks!)

script.aculo.us: Thomas Fuch's Weblog

New inline RJS for rails

Sam doesn’t stop the goodness coming, now with the new inline RJS updates (from the CHANGELOG):

Add render :update for inline RJS. [Sam Stephenson] Example:

class UserController < ApplicationController 
  def refresh 
    render :update do |page| 
      page.replace_html('user_list', 
        :partial => 'user', :collection => @users) 
      page.visual_effect :highlight, 'user_list' 
    end 
  end 
end

Now, that’s very cool for those “quickie” 2 to 3 lines .rjs templates.

See the changeset for more info.

script.aculo.us: Thomas Fuch's Weblog

Stikipad hosts script.aculo.us wiki

StikipadThe script.aculo.us documentation wiki is now hosted by the nice guys over at Stikipad, a hosted wiki solution currently in beta (and yes, it’s a Rails app, naturally).

That being said, we’re going to be launching soon and you’ll be able to try out us out free of charge – who knows, we might even throw in a perk for being a script.aculo.us fan!

Thanks for giving the script.aculo.us wiki a new home, guys!

script.aculo.us: Thomas Fuch's Weblog

Speaking at Canada on Rails

It’s official now—I’m going to have a talk on Ajax in Rails at the first-ever conference dedicated on Ruby on Rails: Canada on Rails.

The conference will be held in Vancouver, B.C. (in Canada obviously) on April 13 and 14, 2006.

There’s not much time left to get one of those early bird tickets, so you’d better hurry!

script.aculo.us: Thomas Fuch's Weblog

Audible Ajax Interview

The lastest episode of the Audbile Ajax Podcast is all about script.aculo.us, web usability and other subjects:

Some of the first “wow” moments were due to the effects created by Thomas Fuchs in his Script.aculo.us library that builds on top of Prototype. Many people didn’t realise that with one line of JavaScript code they could get such a nice effect to happen, and now ugly developer-created sites have a chance ;)

We had the pleasure of interviewing Thomas, an we got to discuss his frameworks, and gain knowledge from his experience.

What you will learn in this podcast
  • How script.acuo.us was born out of a real project
  • Why Rails was chosen for Fluxiom
  • Where Rails shines with Ajax
  • The new RJS templates feature that makes Ajax even easier
  • The difference between Prototype and Script.aculo.us
  • How Script.aculo.us is available in Rails 1.0
  • Future plans for Script.aculo.us
  • When you should use the cool effects, and when you should not
  • About drag and drop and web usability
  • Challenges that Thomas has faced with his Ajax projects
  • Why you would choose an Ajax application versus using other technologies such as Flash
  • How hard it is to build a very rich Ajax application
  • How to handle browser differences
  • Experiences with DOM manipulation and innerHTML
  • How naming collisions are not as much of an issue in recent builds of Prototype

So, tune right in!

script.aculo.us: Thomas Fuch's Weblog

Photos from my Ajax Workshop in London

Over at the Carson Workshops site, you’ll find a bunch of photos from my December 2005 workshop on Ajax in London.

Also, hoping to see some of you at my Get Started Using Ajax Workshop in New York!

script.aculo.us: Thomas Fuch's Weblog

Ruby on Rails Workshop in Austria

Sebastian Gräßl is doing a Workshop on Ruby on Rails in Graz, Styria on January 21 and 22.

It’s cheap too, so if you want to start with Ruby on Rails, there’s no excuse now…

script.aculo.us: Thomas Fuch's Weblog

script.aculo.us V1.5.1 out now

script.aculo.us V1.5.1 is available now. Besides fixing bugs, some new features have made it in.

Also, Edge Rails now features support for the new toggling effects, so you can do:


visual_effect :toggle_slide, 'element'
visual_effect :toggle_blind, 'element'
visual_effect :toggle_appear, 'element'

Have fun!

Btw, the new year will bring even more nice new features…

script.aculo.us: Thomas Fuch's Weblog

Unicode-escaping h() variant

Put this in application_helper.rb:


def u(html)
  h(html).gsub(/([^\x00-\x9f])/u) { |s| 
    "&#x%x;" % $1.unpack('U')[0] }
end

This will automatically output &#x9999;-style HTML entities where needed.

I’m using it for escaping HTML inside of Edge Rails .rjs templates, to ensure compatibility across browsers (especially Safari seems to be a bit buggy here with support for UTF-8 in Ajax calls).

script.aculo.us: Thomas Fuch's Weblog

Keep your Rails app on the script.aculo.us edge

Want an easy way to stay on the latest script.aculo.us SVN trunk for your Ruby on Rails app?

Read the tip over at Rails Weenie.

script.aculo.us: Thomas Fuch's Weblog

Ajax Workshop in New York

I’m doing another Ajax Workshop on January 26, 2006, and this time it’s in New York City. So, all who couldn’t attend to the Workshop in London two days from now, here’s your chance.

More info over at the Carson Workshops site.

script.aculo.us: Thomas Fuch's Weblog

OCG Rails Presentation

The presentation on Ruby on Rails that I did last Tuesday, is now available for download at the site of the Austrian Computer Society

It’s just a few overview slides on Rails, nothing special. But I got a few oohs and aahs from the folks there, which were mainly Java developers.

Update: Some nice guy Ichigo (who is a nice guy), who attended the whole thing recorded audio (while the presentation itself is in English, the audio is in German). :)

script.aculo.us: Thomas Fuch's Weblog

Fluxiom

We’ve finally unveiled what we’ve been working on the last months. It’s a Ajax/Web 2.0 Application (of course) that does asset management, and it’s called fluxiom.

Here’s a short overview of what it does, with some of the marketing speak clarified:

  • Upload/Manage/Preview/Download digital media files and documents from any browser and platform (IE, Firefox/Mozilla, Safari and others)
  • User-definable tags for categorizing, plus realtime tag filtering and RSS feeds for tag filters (like “inform me of any changes for assets tagged as ‘Marketing’ and ‘Logos’”)
  • Freely zoomable “thumbnail” view and full-screen previews
  • Realtime searching in metadata and inside files and documents (indexed fulltext search for things like PDF, DOC, and so on)
  • Share assets with others using automatically generated .ZIP download packages (so you don’t have to send those 50MB emails)
  • Uploads are presented with a progress bar plus you can continue to work in the application while doing an upload
  • Supports more than 100 file formats, color profiles, EPS crop marks, plus some more “professional” features

Most important though is that is does all that without getting in your way, and it even looks good.

But enough of this, just head over to www.fluxiom.com and watch the teaser video! :)

Update: For those who asked, yes it’s running on Ruby on Rails, and no, no Flash involved in the user interface, just plain XHTML/CSS plus JavaScript.

script.aculo.us: Thomas Fuch's Weblog

Vienna OSS web development frameworks action day

The Austrian Computer Society holds a one-afternoon presentation on Open source web development frameworks on November 29 here in Vienna, Austria.

All presentations will be in German (but the presentation slides will probably be available in English).

Participation is free (registration is required!). I’ll do a talk on Ruby on Rails which will “compete” with some Java-based frameworks (Cocoon/JSF/Struts). Hopefully I can lure some Java developers to Rails :)

More information and registration info (German)

script.aculo.us: Thomas Fuch's Weblog

AJAX Activity indicators with Rails 0.14.3

Step 1:

Create an element on the page that should be displayed while AJAX Requests are active. I mostly use an IMG element displaying an animated GIF file. Give this element an id="busy" attribute.

Step 2:

Create a file application.js in your public/javascripts folder (if you don’t already have one!), and be sure to use <%= javascript_include_tag :defaults %> in the HEAD section of your layout or view template to include the Rails-provided JavaScripts.

Insert the following code into the application.js file:


Ajax.Responders.register({
  onCreate: function() {
    if($('busy') && Ajax.activeRequestCount>0)
      Effect.Appear('busy',{duration:0.5,queue:'end'});
  },
  onComplete: function() {
    if($('busy') && Ajax.activeRequestCount==0)
      Effect.Fade('busy',{duration:0.5,queue:'end'});
  }
});

Step 3:

Enjoy!

script.aculo.us: Thomas Fuch's Weblog

Localization plugin

I’ve updated my pragmatic i18n/l10n library for Ruby on Rails and released it as a plugin.

With the latest edge rails, a simple script/plugin install localization should get you going.

For more information, see the included README flie!

script.aculo.us: Thomas Fuch's Weblog

Slider plugin for Ruby on Rails!

So, have a quick look at it!

Still rough warning, so expect more tomorrow or so.

script.aculo.us: Thomas Fuch's Weblog

AJAX Workshop (with me!)

On December 8, I’m doing a one-day workshop in London, UK on AJAX and how to use it properly with Ruby on Rails (and PHP, too). Participants will get a chance to have look at some of the inner workings of the still unannounced application we’ve in the works at wollzelle.

Read more on the Carson Workshops site!

script.aculo.us: Thomas Fuch's Weblog

Ruby on Rails i18n revisited

Having a requirement for both internationalization and per-instance customizability of translations in our soon to be revealed application, I wanted to go with an as-simple-as-possible pure Ruby solution for translating strings.

While gettext based approaches might have some advantages over this (some tools available, possibly faster speed with C-based variants) I didn’t want to go with a sledgehammerized solution (I’ve very few strings in the app, and I really only need to support a handful of languages), so I’ve come up with this:


# .rb files to define l10ns in (lang/ and lang/custom/)
Localization.define('de_DE') do |l|
  l.store "blah", "blub" 
  l.store "testing %d", ["Singular: %d", "Plural: %d"]
end

# Call from anywhere (extension to Object class):
_('blah')
_('testing %d', 5)

# in .rhtml
<%=_ 'testing %d', 1 %>

# current language is a class var in class
# Localization, so set e.g. in application.rb
Localization.lang = 'de_DE'

# in environment.rb (rails 0.13.1)
Localization.load

All you need to include for this is the following localization.rb file, which you stick in your lib directory:


module Localization
  mattr_accessor :lang

  @@l10s = { :default => {} }
  @@lang = :default

  def self._(string_to_localize, *args)
    translated = 
      @@l10s[@@lang][string_to_localize] || string_to_localize
    return translated.call(*args).to_s if translated.is_a? Proc
    translated = 
      translated[args[0]>1 ? 1 : 0] if translated.is_a?(Array)
    sprintf translated, *args
  end

  def self.define(lang = :default)
    @@l10s[lang] ||= {}
    yield @@l10s[lang]
  end

  def self.load
    Dir.glob("#{RAILS_ROOT}/lang/*.rb"){ |t| require t }
    Dir.glob("#{RAILS_ROOT}/lang/custom/*.rb"){ |t| require t }
  end

end

class Object
  def _(*args); Localization._(*args); end
end

It should be easy to alter or extend that for your own purposes, or just use it as-is.

Update: Changed to module; and here’s a very quick hack to extract a nice pre-generated guesstimation of a l10n file:


# Generates a best-estimate l10n file from all views by
# collecting calls to _() -- note: use the generated file only
# as a start (this method is only guesstimating)
def self.generate_l10n_file
  "Localization.define('en_US') do |l|\n" <<
  Dir.glob("#{RAILS_ROOT}/app/views/**/*.rhtml").collect do |f| 
    ["# #{f}"] << File.read(f).scan(/<%.*[^\w]_\s*[\"\'](.*?)[\"\']/)
  end.uniq.flatten.collect do |g|
    g.starts_with?('#') ? "\n  #{g}" : "  l.store '#{g}', '#{g}'" 
  end.uniq.join("\n") << "\nend" 
end

To use that, call up script/console and do a puts Localization.generate_l10n_file.

Update 2: I’ve added support for using nice lambda blocks of code for those “speciality” translations. The block gets passed the *args given to the _ method, so you can basically do anything:


Localization.define do |l|
   l.store '(time)', lambda { |t| t.strftime('%I:%M%p') }
end

Localization.define('de_DE') do |l|
   l.store '(time)', lambda { |t| t.strftime('%H:%M') }
end

_ '(time)', Time.now =>"10:13PM" 
Localization.lang = 'de_DE'
_ '(time)', Time.now => "22:13" 

script.aculo.us: Thomas Fuch's Weblog

An unveiling

Our company is moving to brand-new offices in the heart of Vienna really soon, so you might want to take a peek.

wollzelle

This will not be the last of our unveilings, so stay tuned. :)

P.S. And yes, among other things, we’re working on the next big thing in web apps (written in Ruby on Rails, of course!). ;)

script.aculo.us: Thomas Fuch's Weblog

FUD revisited (1): Can you upload files with AJAX?

The short answer is: No.

The long answer is: You can’t, because AJAX get/post data is gathered via JavaScript, and JavaScript has no way at getting at local file contents (for security reasons).

But you can use AJAX to get information on the running upload, as long as your framework has functions that give information on current uploads; and your webserver doesn’t buffer upload data.

In Ruby on Rails that works like this: If you enable the UploadProgress module, Rails stores information about the progress in the session, so while the upload is doing its thing, you can poll the server via an AJAX call and get nice status information. The Upload itself is made via a “traditional” HTML upload form to a hidden IFRAME (the helpers will do all this hard work for you transparently!).

See Sean Treadway’s demo and articles about this.

script.aculo.us: Thomas Fuch's Weblog