Notify

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.

Examples:

notify("Attention!", "This is a test message.  It will fade away in time.");

notify("Attention again!", "This is another test message.  This one is sticky.")
  with sticky = true;

See this action in action!

ruleset a60x108 {
  meta {
    name "Notify Example"
    author "Mike Grace"
    description <<
      Notify example for documentation     
    >>
    logging on    
  }
  dispatch {
    domain "docs.kynetx.com"
  }
  rule newrule is active {
    select using "http://docs.kynetx.com/krl/kynetx-rule-language-documentation/actions/notify/" setting()
    {
      notify("Notify", "This is just a plain default notify.") with sticky = true;
      notify("Notify", "I'm going to disappear!");
      notify("Notify", "I'm going to disappear in 5 seconds!") with life = 5000;
      notify("Notify", "opacity 1.0") with opacity = 1 and sticky = true;
      notify("Notify", "default opacity") with sticky = true;
      notify("Notify", "opacity .6") with opacity = 0.6 and sticky = true;
      notify("Notify", "opacity .2") with opacity = 0.2 and sticky = true;
      notify("Notify", "I'm on the top-left") with position = "top-left" and sticky = true;
      notify("Notify", "My text is Red!") with color = "#FF0000" and sticky = true;
      notify("Notify", "My background color is Red!") with background_color = "#FF0000" and sticky = true;
      notify("Notify", "My width is 100px") with width = 100 and sticky = true;
      notify("Notify", "My width is 400px") with width = 400 and sticky = true;
      notify("Notify", "I waited 1 seconds to show up") with delay = 1 and sticky = true;
      notify("Notify", "I waited 4 seconds to show up") with delay = 4 and sticky = true;
    }
  }
}