Dazzle is a free "check for updates" framework for dashboard widgets, allowing you to easily notify users when an update is available. Dazzle offers much flexibility, but is easy to include in your widget. It was inspired by the Sparkle framework for Cocoa applications.

Download it and give it a try! I'd also appreciate feedback...

Installation:

Un-archive "Dazzle.zip" and open the resulting folder. Inside should be a number of files, including a folder called "Dazzle". This is the framework itself; copy/move this folder into your widget bundle.

Implementation:

  1. Include Dazzle.js and Dazzle.css in your widget's main HTML file:

    <script src="Dazzle/Dazzle.js" type="text/javascript"></script>
    
    <link rel="stylesheet" href="Dazzle/Dazzle.css" type="text/css" />

    Or, if you use the CSS @import rule:

    <script src="Dazzle/Dazzle.js" type="text/javascript"></script>
    
    <style type="text/css">
    	@import "Dazzle/Dazzle.css"
    </style>
    

    Include the AppleAnimator and AppleButton classes in your widget's main HTML file (if not already there).

  2. Include the AllowNetworkAccess and AllowSystem keys in your Info.plist file and set them to true.

  3. Create a new Dazzle object when the DOM is ready and assign it to a variable. I recommend that you assign it to a global variable, so that you can access it anywhere in your code, and that you call the variable "dazzle" (just for neatness):

    var dazzle;
    
    function setup() {
    	dazzle = new Dazzle();
    }
    
    window.addEventListener('load', setup, false);
    
  4. Create a Dazzle appcast and upload it to your website (see here for more information on how to create the appcast).

    Then either specify your appcast URL as an option when you create the Dazzle object (preferred)...

    dazzle = new Dazzle({ appcastURL: "http://mywebsite.com/myappcast.xml" });

    ...or specify the URL as a key in your Info.plist file:

    <key>DUAppcastURL</key>
    <string>http://mywebsite.com/myappcast.xml</string>
    
  5. a. Add the following line of code to a widget.onshow function:

    dazzle.onShow();

    b. Add the following line of code to a widget.onhide function:

    dazzle.onHide();
  6. That's it!

    By default, Dazzle will check for updates every day. If you want to specify a different interval, use the setCheckInterval method, or pass a value to the checkInterval option when you initialise the Dazzle object.

    Also, Dazzle will not display a release notes link in the alert box automatically. To turn this on, see the "Customising the Alert Box" section here.

    Now go and browse through the Dazzle Guide and the Dazzle Reference to find out all of Dazzle's features!