Coffee Script

Coming very soon.

CoffeeScript is a simple and elegant version of JavaScript.

This module provides CoffeeScript integration with Drupal, allowing you to write CoffeeScript code, which is automatically converted into JavaScript for use by the browser. CoffeeScript can also be used in combination with jQuery and some examples are below.

Usage

Add CoffeeScripts to your Drupal site by using one of the following:

# in your themes html.tpl.php
<?php print coffeescript_add('myscript.js.coffee') ?>
# or in your themes .info file:
scripts[] = myscript.js.coffee

Installation

Requires the Libraries API

  1. Download the CoffeeScript PHP library from GitHub.
  2. Place the extracted folder in your sites/all/libraries folder
  3. Download and install this module

Why CoffeeScript?

In CoffeeScript, the function keyword is replaced by the -> symbol, and indentation is used instead of curly braces. Parentheses "{}" can be omitted.

A jQuery before and after:

$(document).ready(function() {
  // Do something
});

$ ->
  # Do something

Downloads

Project Information


Maintainers for CoffeeScript

Issues for CoffeeScript

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
nobody click here