Fat Cow Icons Plugin

  • Tags: ajax, ui, link, icons
  • Latest: 0.1.0
  • Last Updated: 19 November 2013
  • Grails version: 2.0 > *
2 votes
Dependency:
compile ":fatcow-icons:0.1.0"

 Documentation  Source  Issues

Summary

Bundles free icons from http://www.fatcow.com and provides a handful of convenient taglibs that create asynchronous buttons out of the icons.This plugin started as a clone of the grails-glyph-icons plugin with some adaptations.

Installation

grails install-plugin fatcow-icons

Description

3800 free web icons from http://www.fatcow.com/free-icons in 16x16 and 32x32 pixel format (.png).

See the preview of icons with labels at http://www.fatcow.com/fatcow-icons/fatcow.png (Full Set, 3820px Wide - 7.4MB)

Usage

fatcow:icon

Generates an <img/> tag that will load the icon on the page.

For example, the following will produce an tag on the page, loading the 16x16 'accept.png' icon:

<fatcow:icon iconName="accept"/>

iconName

The file name of the plugin without the .png extension. For example, iconName="accept" would load the resource from '/images/FatCowIcons16x16/accept.png' .

size

Currently either 16x16 or 32x32 . Size is optional and will default to 16x16 .

alt

Creates the HTML alt attribute in the <img/> tag. The taglib doesn't require this attribute, although HTML standard does. If you leave this blank, the plugin will place the iconName in there instead.

width

Generates an HTML width attribute in the <img/> tag.

height

Generates an HTML height attribute in the <img/> tag.

fatcow:action

Uses an icon as a link to a remote uri that can be invoked via ajax. This tag is a thin wrapper above the remoteLink tag built into grails. The attributes for the action tag are exactly the same as icon, adding all the attributes from remoteLink .

For example, the following will produce an async link using the the accept.png icon, calling the mycontroller/list and updating the content element with the results:

<fatcow:action controller="mycontroller" action="list" update="content" iconName="accept" alt="Accept Icon" />

Given the action tag leverages the remoteLink tag, here are some examples taken from http://grails.org/doc/latest/ref/Tags/remoteLink.html redone for fatcow:

<fatcow:action iconName="accept" alt="Accept Icon" action="show" id="1">Test 1</fatcow:action>
<fatcow:action 
    iconName="accept" alt="Accept Icon" action="show" id="1" 
    update="[success:'success',failure:'error']" 
    on404="alert('not found');">Test 2</fatcow:action>
<fatcow:action 
    iconName="accept" alt="Accept Icon" action="show" id="1" update="success" 
    onLoading="showSpinner();">Test 3</fatcow:action>
<fatcow:action 
    iconName="accept" alt="Accept Icon" action="show" id="1" update="success" 
    params="[sortBy:'name',offset:offset]">Test 4</fatcow:action>
<fatcow:action 
    iconName="accept" alt="Accept Icon" action="show" id="1" update="success" 
    before="if(!confirm('Are you sure?')) return false">Test 5</fatcow:action>

More info at https://github.com/davidecavestro/grails-fatcow-icons