(Classic) notify()

Engine Compatibility

notify is not supported by the Node engine.

notify(<header_text>, <message>)

Place a notification over the page. Similar to Growl notification on OS X.

notify("Header","This is the message");

Place a notification over the page. Similar to Growl notification on OS X. The parameters are

  • <header_text> - The header. Empty string results in empty header.
  • <message> - A string representing the message.

The following options are available:

  • <sticky> - (defaults to false) If true, the message will stay until the user dismisses it. If false the message will fade after 3 seconds.
  • <opacity> - (defaults to 0.8) Real number between 0 and 1 that sets opacity of the notification box and anything in it.
  • <position> - (defaults to top-right) A string specifying where to place the notification. Valid values are "top-left", "top-right", "bottom-left", and "bottom-right".
  • <color> - (defaults to #FFF) A string giving the CSS RGB value of the foreground color. Must contain a preceding '#'.
  • <background_color> - (defaults to #222) A string giving the CSS RGB value of the background color. Must contain a preceding '#'.
  • <width> - (defaults to 235px) A string giving the CSS width. Must be a valid width value such as "400px" or "30%".
  • <life> - (defaults to 3000) Length of time to display the notification (in ms). If the <sticky> option is true, this is ignored.
If you wish to use multiple options, separate them with the "and" keyword.
notify("Header","This is the message") with sticky = true and background_color = "#346" and color = "#CC9";

The following ruleset shows notify() being used

ruleset a1299x176 {
	meta {
		name "notify example"
		author "nathan cerny"
		logging off
	}
	dispatch {
		// domain "exampley.com"
	}
	rule first_rule {
		select when pageview ".*" setting ()
        // Display notification that will not fade.
		notify("Hello World", "This is a sample rule.") with sticky = true;
	}
}

The following demonstrates the preceding rule:

Copyright Picolabs | Licensed under Creative Commons.