{
"info": {
"author": "Jonny Gerig Meyer",
"author_email": "jonny@oddbird.net",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3"
],
"description": "jQuery Django Messages UI\n=========================\n\n.. image:: https://travis-ci.org/jgerigmeyer/jquery-django-messages-ui.svg?branch=master\n :target: https://travis-ci.org/jgerigmeyer/jquery-django-messages-ui\n.. image:: https://cdn.gruntjs.com/builtwith.png\n :target: http://gruntjs.com/\n\nJS client-side messages plugin, with support for Django contrib.messages app\n\n\nGetting Started\n---------------\n\ndjango-messages-ui can be used as a standalone jQuery plugin for adding and\nremoving client-side messages, or as a Django add-on to additionally support\nthe Django contrib.messages app. It should be called on the message list\nelement, and accepts options for message selectors, transient messages (that\ndisappear on click or key-press), and close-links. The messages themselves\nshould be styled with CSS.\n\nMessages can be dynamically added via `Handlebars.js`_, `ICanHaz.js`_, or any\nother templating engine which creates precompiled callable template fns. If\nused as a Django plugin there's a Python middleware to automatically add\nmessages from the request into Ajax JSON responses.\n\n.. _`Handlebars.js`: http://handlebarsjs.com/\n\n\nDependencies\n------------\n\n- `jQuery`_ library\n- `jQuery doTimeout`_ plugin\n- (optionally) `handlebars.runtime.js`_ 1.0.0\n- (optionally) `ICanHaz.js`_\n- (optionally) `django-icanhaz`_ 0.2.0+\n\n.. _`jQuery`: http://jquery.com/\n.. _`jQuery doTimeout`: http://benalman.com/projects/jquery-dotimeout-plugin/\n.. _`handlebars.runtime.js`: http://handlebarsjs.com/\n.. _`ICanHaz.js`: http://icanhazjs.com/\n.. _`django-icanhaz`: https://github.com/carljm/django-icanhaz\n\n\nInstallation as a Standalone jQuery Plugin\n------------------------------------------\n\nIf using as a standalone jQuery plugin, download the `production version`_ or\nthe `development version`_, along with either the\n`Handlebars.js precompiled template`_ or the `ICanHaz.js template`_.\n\n.. _`production version`: https://raw.github.com/jgerigmeyer/jquery-django-messages-ui/master/dist/django-messages-ui.min.js\n.. _`development version`: https://raw.github.com/jgerigmeyer/jquery-django-messages-ui/master/dist/django-messages-ui.js\n.. _`Handlebars.js precompiled template`: https://raw.github.com/jgerigmeyer/jquery-django-messages-ui/master/messages_ui/static/messages_ui/message.js\n.. _`ICanHaz.js template`: https://raw.github.com/jgerigmeyer/jquery-django-messages-ui/master/messages_ui/jstemplates/message.html\n\nLinking the JS::\n\n \n\nIf desired, also include the `precompiled JS template`_::\n\n \n\n.. _`precompiled JS template`: https://raw.github.com/jgerigmeyer/jquery-django-messages-ui/master/messages_ui/static/messages_ui/message.js\n\nTo override the default JS template, pass your own precompiled template function\nas option ``template``.\n\nIf using `ICanHaz.js`_, wrap the `ICanHaz.js template`_ (or your own custom\ntemplate, if you don't want to use the default template) in a ``\n\nIf desired, also include the precompiled JS template::\n\n \n\nIf using `ICanHaz.js`_ to insert messages on the client side, use this template\ninstead, and pass in the precompiled template: ``template: ich.message``::\n\n {% include \"messages_ui/_messages_ich.html\" %}\n\nTo override the default JS template, pass your own precompiled template function\nas option ``template``.\n\n\nAjax\n~~~~\n\nTo enable automatic handling of messages from Ajax requests, add\n``\"messages_ui.middleware.AjaxMessagesMiddleware\"`` to your\n``MIDDLEWARE_CLASSES`` setting (directly after\n``django.contrib.messages.middleware.MessageMiddleware``), and pass\n``handleAjax: true`` to the plugin initialization.\n\n.. warning::\n\n ``AjaxMessagesMiddleware`` converts all HTML AJAX responses into JSON\n responses with a ``messages`` key, and the HTML embedded in an ``html``\n key. If your site uses HTML AJAX responses, this will likely require\n updates to other Ajax-handling code in your site. To avoid this for a\n particular response, set the attribute ``no_messages`` on that response to\n ``True`` before it passes through ``AjaxMessagesMiddleware``.\n\n Similarly, ``handleAjax: true`` globally sets the default expected\n dataType for AJAX requests to ``\"json\"``.\n\n\nUsage\n-----\n\nCalling the plugin::\n\n $('#messages').messages();\n\nCalling the plugin with a variety of options explicitly configured to their\ndefault values::\n\n $('#messages').messages({\n message: '.message', // Selector for individual messages\n closeLink: '.close', // Selector for link to close message\n // ...set to ``false`` to disable\n closeCallback: // Fn called when closeLink is clicked\n function (el) {\n el.stop().fadeOut('fast', function () {\n el.remove();\n });\n },\n transientMessage: '.success', // Selector for transient messages\n transientDelay: 500, // Transient message callback delay (ms)\n transientCallback: // Fn called after transientDelay\n function (el) {\n el.fadeOut(2000, function () { el.remove(); });\n },\n handleAjax: false, // Enable automatic AJAX handling\n template: Handlebars.templates.message,\n // Callable precompiled template fn.\n escapeHTML: true // Set ``false`` to display unescaped\n // ...HTML in message content\n });\n\n.. note::\n\n After the plugin is called once, subsequent calls on the same element will\n default to the options passed the first time, unless new options are\n explicitly provided.\n\nAdding a message in JS::\n\n $('#messages').messages('add', {message: \"Sample Message\", tags: \"info\"});\n\nAdding a message with unescaped HTML in JS::\n\n $('#messages').messages(\n 'add',\n { message: \"Sample Message\", tags: \"info\" },\n { escapeHTML: false }\n );\n\n\nCHANGES\n=======\n\n2.0.2 (2015.03.01)\n-------------------\n\n* Merge pull request #5 from shinglyu/http204 (handle response with no content-type header)\n* Merge pull request #4 from support-lazy-messages (coerve message bodies to text)\n\n2.0.1 (2014.03.20)\n-------------------\n\n* Delay instantiating Handlebars to prevent error if not using default.\n\n2.0.0 (2014.03.20)\n-------------------\n\n* BACKWARDS INCOMPATIBLE: Accept callable template fn instead of namespace and tplName.\n\n1.1.1 (2014.03.18)\n-------------------\n\n* Add bower.json.\n\n1.1.0 (2014.02.14)\n-------------------\n\n* Add option for template name.\n* Make agnostic regarding templating engine, as long as template is\n precompiled and callable fn.\n\n1.0.3 (2013.10.29)\n-------------------\n\n* Add option for Handlebars templates global namespace.\n\n1.0.2 (2013.10.27)\n-------------------\n\n* Add missing __init__.py.\n\n1.0.1 (2013.10.27)\n-------------------\n\n* Fix manifest.in to include package json file.\n\n1.0.0 (2013.10.27)\n-------------------\n\n* Publish as a standalone jQuery plugin. Add JS unit tests.\n* BACKWARDS INCOMPATIBLE: js filename changed from jquery.messages-ui.js to\n django-messages-ui.js\n\n0.2.7 (2013.09.25)\n-------------------\n\n* Remove transient messages on scroll (also mousedown, keydown, mouseover).\n\n0.2.6 (2013.06.05)\n-------------------\n\n* Fix AjaxMessagesMiddleware encoding issue with Python 3 and JSON response.\n* Precompile Handlebars template with 1.0.0.\n\n0.2.5 (2013.05.23)\n------------------\n\n* Precompile Handlebars template with 1.0.0-rc.4.\n* Make AjaxMessagesMiddleware Py3-compatible.\n\n0.2.4 (2013.01.28)\n------------------\n\n* Add option for function called after closeLink is clicked.\n\n0.2.3 (2013.01.24)\n------------------\n\n* Add option for function called on transient messages after transientDelay.\n\n0.2.2 (2013.01.21)\n------------------\n\n* Add response.no_messages option for disabling middleware.\n\n0.2.1 (2013.01.14)\n------------------\n\n* Rewrite using method plugin architecture; simpler 'add' method to add msg.\n* Add option to display unescaped HTML in message content.\n\n0.2.0 (2013.01.11)\n------------------\n\n* Add option to use Handlebars.js (new default) instead of ICanHaz.js.\n\n0.1.8 (2013.01.03)\n------------------\n\n* Make close-link selector specific to within a message; use preventDefault.\n\n0.1.7 (2012.11.06)\n------------------\n\n* JS stop transient-message fade on close-link click.\n\n0.1.6 (2012.10.05)\n------------------\n\n* JS don't parse non-json.\n\n0.1.5 (2012.07.23)\n------------------\n\n* Don't touch non-200 responses.\n\n0.1.4 (2011.07.14)\n------------------\n\n* JS cleanup; added JSLint options.\n\n0.1.3 (2011.06.28)\n------------------\n\n* Added ``closeLink: false`` plugin option.\n* Subsequent plugin calls on the same element default to previous options\n unless explicitly overridden.\n\n0.1.2 (2011.06.27)\n------------------\n\n* Added ``AjaxMessagesMiddleware`` and ``handleAjax`` plugin option.\n\n\n0.1.1 (2011.06.27)\n------------------\n\n* Updated HTML template (removed ``