JavaScript
JavaScript is one amazing language. I recently finished reading "Javascript - The Good Parts", and am in the process of teaching myself node.js. For all of the bad press it has gotten, JavaScript is going in some really amazing directions. It is now possible to implement an entire web application in JavaScript - from the database on up. Not only that, but you can get some rediculously fast performance out of it too.
How do you get a feature to set the value of a ckeditor field so that it can run under any driver (javascript or not)?
#value = "Thing to set body to..."
begin
page.evaluate_script("CKEDITOR.instances.discussion_body_editor.setData('<p>#{value.gsub("'","\\\\'")}</p>');")
rescue Capybara::NotSupportedByDriverError
And %{I fill in "discussion_body_editor" with "#{value}"}
end
At the moment, there is no pre-packaged way to add CKEditor to Drupal 5. The following is a result of my attempt to port the Drupal 6 wysiwyg module's CKEditor plugin to the Drupal 5 version. It's ugly, but accomplishes my goal of getting CKEditor going in D5 without having to create a new module from scratch or try to port the rather large D6 module for CKEditor.
Step 1) Create ckeditor.inc (this is based off the D5 version of fckeditor.inc and the D6 version of ckeditor.inc), and place it under wysiwyg/editors
I recently needed to create a test case for selenium that required a user to have just logged in to a Drupal website. Often when running selenium tests, the browser may already have an authenticated session, so the test will need to detect this and then logout. Of course with Drupal you can always just go to the url ?q=logout to make sure you are logged out, but this way is more fun and makes a good example for using logic in Selenium tests!
Copyright © 2011, Aaron Blondeau
Drupal theme by Kiwi Themes.