Transparent Message Plugin

  • Tags: /
  • Latest: 0.1
  • Last Updated: 27 February 2010
  • Grails version: 1.2.1 > *
  • Authors: null
0 vote
Dependency:
compile ":transparent-message:0.1"

 Documentation

Summary

Installation

grails install-plugin transparent-message

Description

The Transparent Message plugin for Grails integrates Humanized Messages, a JavaScript-based system for non-modal notifications developed for JQuery by Michael Heilemann, from an idea by Jef Raskin, as relayed by Aza Raskin.

Transparent messages is a technique that allows to show the user a message that is both noticeable yet unobtrusive. It's simply a large and translucent message that's displayed over the contents of your screen. They fade away when the user takes any action (like typing or moving the mouse).

Installation

To install the plugin in your application just run the 'install-plugin' Grails script, e.g.

grails install-plugin transparent-message

Usage

Once installed, the plugin modifies the standard Grails message tag by adding a new attribute "transparent", that allows to show your messages following the transparent style.

You might want to use this plugin to show the user notifications after redirections using the flash scope:

<g:message message="${flash.message}" transparent="true" />

This tag simply writes your message text inside an enclosing DIV element conveniently identified (by "#transparentMsg"), so it can be found later by the Javascript code.

In order to see the text as a transparent message, you have to add the following tag into the HEAD section of your GSP pages:

<tm:resources />

This tag inserts the Javascript libraries and code required to make it work, as well as a default CSS stylesheet.

The resources tag supports the following attributes to control its behavior:

NameTypeRequiredDescription
logbooleanno, defaults to falseIf true, it enables a message log, so the user can read the message once it fades away.
messageLogStringno, defaults to 'Message Log'The text to be shown in the message log tab.
opacityDecimal between 0 and 1no, default to 0.8The opacity level for messages.
cssbooleanno, defaults to trueIf false, it does not include a CSS by default, so you can customize the styles.
jquerybooleanno, defaults to trueIf false, it does not insert the jQuery library. It can be useful if you are already using jQuery in the application.

This plugin uses progressive enhancement to support user agents that may not support or have disabled the JavaScript functionality. In these cases the plugin degrades gracefully showing messages as usual.

Author

OSOCO Software Company

Please report any issues to the Grails User mailing list.

History

  • February 27, 2010
    • released initial version 0.1