Note that the JsWidget is currently under development but a 0.2 preview is available.
This widget generated will be similar to the chooser currently deployed at CC Labs.
The following is a simple example of how the widget would be included in a page to create a license selector. A live demonstration is available on the CC labs site.
<html> <link rel="stylesheet" href="http://labs.creativecommons.org/jswidget/trunk/example_web_app/example-widget-style.css" /> <head> <title>Example Widget Page</title> </head> <body> . . . <div id="cc_widget_container"> <script src="http://api.creativecommons.org/jswidget/tags/0.2/complete.js"></script>
. . . </body> </html>
You can play with a 0.2 pre-release right now!
- 2007-07-25: Released 0.2. The UI now doesn't ask or contain spurious questions, plus translation is halfway there.
- 2007-07-19: Released 0.1. Don't try to use this in production, but DO let us know how it fits into your systems and what you would want us to change.
- You can append ?locale=XX to your call to complete.js to choose a language. The example distributed as index.html in the distribution package sets the language to US English this way.
- If omitted, Apache Content Negotiation will select the most appropriate language based on the user's preferences, defaulting to US English.
- There are two hidden form fields called cc_js_license_uri and cc_js_license_name that respectively store the URI and name of the license selected by the user. Just do
document.getElementById("cc_js_result_uri").value(or "cc_js_result_name" instead) and you'll have the license information.
The following list of general goals to remind us what we want out of JsWidget. You can expect most of it for 1.0.
See JsWidget/Plan to see what features are planned for what versions.
- Generate HTML suitable for use in a form which presents the basic license selector
- Provide compatibility with all A-grade browsers
- Provide up to date license information by
- Support new, expanded metadata including attributionName, attributionUrl and morePermissions.