[
  {
    "path": ".gitignore",
    "content": "*.pyc\n*.egg-info\ndist\nbuild\n.DS_Store\ndocs/_build\n"
  },
  {
    "path": "AUTHORS",
    "content": "Glue is mainly developed and maintained by Jorge Bastida <me@jorgebastida.com>\n\nA big thanks to all the contributors:\nAngel Abad for the Debian and Ubuntu distribution package.\n"
  },
  {
    "path": "COPYING",
    "content": "Copyright (c) 2009-2012 Benito Jorge Bastida\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n 1. Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above\n    copyright notice, this list of conditions and the following\n    disclaimer in the documentation and/or other materials provided\n    with the distribution.\n\n 3. Neither the name of the author nor the names of other\n    contributors may be used to endorse or promote products derived\n    from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "include *.py\ninclude COPYING\ninclude AUTHORS\nrecursive-include dajax *\nrecursive-exclude dajax *.pyc\nrecursive-include docs *\nprune docs/_build\n"
  },
  {
    "path": "README.rst",
    "content": "django-dajax\n============\n\nDajax is a powerfull tool to easily and super-fastly develop asynchronous presentation logic in web applications using python and almost no lines of JS source code.\n\nIt supports up to four of the most popular JS frameworks:\n\n* jQuery\n* Prototype\n* Dojo\n* mootols\n\nUsing ``django-dajaxice`` communication core, ``django-dajax`` implements an abstraction layer between the presentation logic managed with JS and your python business logic. With dajax you can modify your ``DOM`` structure directly from python.\n\nFor more information about how django-dajax works: https://dajaxproject.com\n\nOfficial site http://dajaxproject.com\nDocumentation http://readthedocs.org/projects/django-dajax/\n\nProject status\n----------------\nFrom ``v0.9.2`` this project is not going to accept new features. In order to not break existing projects using this library, ``django-dajax`` and ``django-dajaxice`` will be maintained until ``django 1.8`` is released.\n\n\nShould I use django-dajax or django-dajaxice?\n---------------------------------------------\nIn a word, No. I created these projects 4 years ago as a cool tool in order to solve one specific problems I had at that time.\n\nThese days using these projects is a bad idea.\n\nPerhaps I'm more pragmatic now, perhaps my vision of how my django projects should be coupled to libraries like these has change, or perhaps these days I really treasure the purity and simplicity of a vanilla django development.\n\nIf you want to use this project, you are probably wrong. You should stop couplig your interface with your backend or... in the long term it will explode in your face.\n\nForget about adding more unnecessary complexity. Keep things simple.\n"
  },
  {
    "path": "dajax/__init__.py",
    "content": "__version__ = (0, 9, 2, 'beta')\n"
  },
  {
    "path": "dajax/core.py",
    "content": "from django.utils import simplejson as json\n\n\nclass Dajax(object):\n\n    def __init__(self):\n        self.calls = []\n\n    def json(self):\n        return json.dumps(self.calls)\n\n    def alert(self, message):\n        self.calls.append({'cmd': 'alert', 'val': message})\n\n    def assign(self, id, attribute, value):\n        self.calls.append({'cmd': 'as', 'id': id, 'prop': attribute, 'val': value})\n\n    def add_css_class(self, id, value):\n        if not hasattr(value, '__iter__'):\n            value = [value]\n        self.calls.append({'cmd': 'addcc', 'id': id, 'val': value})\n\n    def remove_css_class(self, id, value):\n        if not hasattr(value, '__iter__'):\n            value = [value]\n        self.calls.append({'cmd': 'remcc', 'id': id, 'val': value})\n\n    def append(self, id, attribute, value):\n        self.calls.append({'cmd': 'ap', 'id': id, 'prop': attribute, 'val': value})\n\n    def prepend(self, id, attribute, value):\n        self.calls.append({'cmd': 'pp', 'id': id, 'prop': attribute, 'val': value})\n\n    def clear(self, id, attribute):\n        self.calls.append({'cmd': 'clr', 'id': id, 'prop': attribute})\n\n    def redirect(self, url, delay=0):\n        self.calls.append({'cmd': 'red', 'url': url, 'delay': delay})\n\n    def script(self, code):  # OK\n        self.calls.append({'cmd': 'js', 'val': code})\n\n    def remove(self, id):\n        self.calls.append({'cmd': 'rm', 'id': id})\n\n    def add_data(self, data, function):\n        self.calls.append({'cmd': 'data', 'val': data, 'fun': function})\n"
  },
  {
    "path": "dajax/models.py",
    "content": "# Don't delete me\n"
  },
  {
    "path": "dajax/static/dajax/dojo.dajax.core.js",
    "content": "var Dajax = {\n    process: function(data)\n    {\n        dojo.forEach(data, function(elem,i){\n        switch(elem.cmd)\n        {\n            case 'alert':\n                alert(elem.val);\n            break;\n\n            case 'data':\n                eval( elem.fun+\"(elem.val);\" );\n            break;\n\n            case 'as':\n                if(elem.prop === 'innerHTML'){\n                    dojo.forEach(dojo.query(elem.id), function(e){\n                        require([\"dojo/html\"], function(html){\n                            html.set(e, elem.val);\n                        });\n                    });\n                }\n                else{\n                    dojo.forEach(dojo.query(elem.id),function(e){ e[elem.prop] = elem.val; });\n                }\n            break;\n\n            case 'addcc':\n                dojo.forEach(elem.val,function(e){\n                    dojo.query(elem.id).addClass(e);\n                });\n            break;\n\n            case 'remcc':\n                dojo.forEach(elem.val,function(e){\n                    dojo.query(elem.id).removeClass(e);\n                });\n            break;\n\n            case 'ap':\n                dojo.forEach(dojo.query(elem.id),function(e){ e[elem.prop] += elem.val;});\n            break;\n\n            case 'pp':\n                dojo.forEach(dojo.query(elem.id),function(e){ e[elem.prop] = elem.val + e[elem.prop] ;});\n            break;\n\n            case 'clr':\n                dojo.forEach(dojo.query(elem.id),function(e){ e[elem.prop] = \"\"; });\n            break;\n\n            case 'red':\n                window.setTimeout('window.location=\"'+elem.url+'\";',elem.delay);\n            break;\n\n            case 'js':\n                eval(elem.val);\n            break;\n\n            case 'rm':\n                dojo.forEach(dojo.query(elem.id), \"dojo.query(item).orphan();\");\n            break;\n\n            default:\n            break;\n            }\n        });\n    }\n};\n"
  },
  {
    "path": "dajax/static/dajax/jquery.dajax.core.js",
    "content": "var Dajax = {\n    process: function(data)\n    {\n        $.each(data, function(i,elem){\n        switch(elem.cmd)\n        {\n            case 'alert':\n                alert(elem.val);\n            break;\n\n            case 'data':\n                eval( elem.fun+\"(elem.val);\" );\n            break;\n\n            case 'as':\n                if(elem.prop == 'innerHTML'){\n                    $(elem.id).html(elem.val);\n                }\n                else{\n                    jQuery.each($(elem.id),function(){ this[elem.prop] = elem.val; });\n                }\n            break;\n\n            case 'addcc':\n                jQuery.each(elem.val,function(){\n                    $(elem.id).addClass(String(this));\n                });\n            break;\n\n            case 'remcc':\n                jQuery.each(elem.val,function(){\n                    $(elem.id).removeClass(String(this));\n                });\n            break;\n\n            case 'ap':\n                jQuery.each($(elem.id),function(){ this[elem.prop] += elem.val; });\n            break;\n\n            case 'pp':\n                jQuery.each($(elem.id),function(){ this[elem.prop] = elem.val + this[elem.prop]; });\n            break;\n\n            case 'clr':\n                jQuery.each($(elem.id),function(){ this[elem.prop] = \"\"; });\n            break;\n\n            case 'red':\n                window.setTimeout('window.location=\"'+elem.url+'\";',elem.delay);\n            break;\n\n            case 'js':\n                eval(elem.val);\n            break;\n\n            case 'rm':\n                $(elem.id).remove();\n            break;\n\n            default:\n            break;\n            }\n        });\n    }\n};\n"
  },
  {
    "path": "dajax/static/dajax/mootools.dajax.core.js",
    "content": "var Dajax = {\n    process: function(data)\n    {\n        data.each(function(elem){\n        switch(elem.cmd)\n        {\n            case 'alert':\n                alert(elem.val);\n            break;\n\n            case 'data':\n                eval( elem.fun+\"(elem.val);\" );\n            break;\n\n            case 'as':\n                if(elem.prop === 'innerHTML'){\n                    $$(elem.id).each(function(e){ e.set('html', elem.val); });\n                }\n                else{\n                    $$(elem.id).each(function(e){ e[elem.prop] = elem.val; });\n                }\n            break;\n\n            case 'addcc':\n                elem.val.each(function(cssclass){\n                    $$(elem.id).each(function(e){ e.addClass(cssclass);});\n                });\n            break;\n\n            case 'remcc':\n                elem.val.each(function(cssclass){\n                    $$(elem.id).each(function(e){ e.removeClass(cssclass);});\n                });\n            break;\n\n            case 'ap':\n                $$(elem.id).each(function(e){ e[elem.prop] += elem.val; });\n            break;\n\n            case 'pp':\n                $$(elem.id).each(function(e){ e[elem.prop] = elem.val + e[elem.prop]; });\n            break;\n\n            case 'clr':\n                $$(elem.id).each(function(e){ e[elem.prop]=\"\"; });\n            break;\n\n            case 'red':\n                window.setTimeout('window.location=\"'+elem.url+'\";',elem.delay);\n            break;\n\n            case 'js':\n                eval(elem.val);\n            break;\n\n            case 'rm':\n                $$(elem.id).each(function(e){ e.destroy(); });\n            break;\n\n            default:\n            break;\n            }\n        });\n    }\n};\n"
  },
  {
    "path": "dajax/static/dajax/prototype.dajax.core.js",
    "content": "var Dajax = {\n    process: function(data)\n    {\n        data.each(function(elem){\n        switch(elem.cmd)\n        {\n            case 'alert':\n                alert(elem.val);\n            break;\n\n            case 'data':\n                eval( elem.fun+\"(elem.val);\" );\n            break;\n\n            case 'as':\n                if(elem.prop === 'innerHTML'){\n                    $$(elem.id).each(function(e){Element.update(e, elem.val);});\n                }\n                else{\n                    $$(elem.id).each(function(e){e[elem.prop] = elem.val;});\n                }\n            break;\n\n            case 'addcc':\n                elem.val.each(function(cssclass){\n                    $$(elem.id).each(function(e){ e.addClassName(cssclass);});\n                });\n            break;\n\n            case 'remcc':\n                elem.val.each(function(cssclass){\n                    $$(elem.id).each(function(e){ e.removeClassName(cssclass);});\n                });\n            break;\n\n            case 'ap':\n                $$(elem.id).each(function(e){ e[elem.prop] += elem.val;});\n            break;\n\n            case 'pp':\n                $$(elem.id).each(function(e){ e[elem.prop] = elem.val + e[elem.prop];});\n            break;\n\n            case 'clr':\n                $$(elem.id).each(function(e){e[elem.prop] = \"\";});\n            break;\n\n            case 'red':\n                window.setTimeout('window.location=\"'+elem.url+'\";',elem.delay);\n            break;\n\n            case 'js':\n                eval(elem.val);\n            break;\n\n            case 'rm':\n                $$(elem.id).each(function(e){e.remove();});\n            break;\n\n            default:\n            break;\n            }\n        });\n    }\n};\n"
  },
  {
    "path": "docs/Makefile",
    "content": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD   = sphinx-build\nPAPER         =\nBUILDDIR      = _build\n\n# Internal variables.\nPAPEROPT_a4     = -D latex_paper_size=a4\nPAPEROPT_letter = -D latex_paper_size=letter\nALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .\n\n.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest\n\nhelp:\n\t@echo \"Please use \\`make <target>' where <target> is one of\"\n\t@echo \"  html       to make standalone HTML files\"\n\t@echo \"  dirhtml    to make HTML files named index.html in directories\"\n\t@echo \"  singlehtml to make a single large HTML file\"\n\t@echo \"  pickle     to make pickle files\"\n\t@echo \"  json       to make JSON files\"\n\t@echo \"  htmlhelp   to make HTML files and a HTML help project\"\n\t@echo \"  qthelp     to make HTML files and a qthelp project\"\n\t@echo \"  devhelp    to make HTML files and a Devhelp project\"\n\t@echo \"  epub       to make an epub\"\n\t@echo \"  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter\"\n\t@echo \"  latexpdf   to make LaTeX files and run them through pdflatex\"\n\t@echo \"  text       to make text files\"\n\t@echo \"  man        to make manual pages\"\n\t@echo \"  changes    to make an overview of all changed/added/deprecated items\"\n\t@echo \"  linkcheck  to check all external links for integrity\"\n\t@echo \"  doctest    to run all doctests embedded in the documentation (if enabled)\"\n\nclean:\n\t-rm -rf $(BUILDDIR)/*\n\nhtml:\n\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/html.\"\n\ndirhtml:\n\t$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/dirhtml.\"\n\nsinglehtml:\n\t$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml\n\t@echo\n\t@echo \"Build finished. The HTML page is in $(BUILDDIR)/singlehtml.\"\n\npickle:\n\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle\n\t@echo\n\t@echo \"Build finished; now you can process the pickle files.\"\n\njson:\n\t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json\n\t@echo\n\t@echo \"Build finished; now you can process the JSON files.\"\n\nhtmlhelp:\n\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp\n\t@echo\n\t@echo \"Build finished; now you can run HTML Help Workshop with the\" \\\n\t      \".hhp project file in $(BUILDDIR)/htmlhelp.\"\n\nqthelp:\n\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp\n\t@echo\n\t@echo \"Build finished; now you can run \"qcollectiongenerator\" with the\" \\\n\t      \".qhcp project file in $(BUILDDIR)/qthelp, like this:\"\n\t@echo \"# qcollectiongenerator $(BUILDDIR)/qthelp/django-dajax.qhcp\"\n\t@echo \"To view the help file:\"\n\t@echo \"# assistant -collectionFile $(BUILDDIR)/qthelp/django-dajax.qhc\"\n\ndevhelp:\n\t$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp\n\t@echo\n\t@echo \"Build finished.\"\n\t@echo \"To view the help file:\"\n\t@echo \"# mkdir -p $$HOME/.local/share/devhelp/django-dajax\"\n\t@echo \"# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/django-dajax\"\n\t@echo \"# devhelp\"\n\nepub:\n\t$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub\n\t@echo\n\t@echo \"Build finished. The epub file is in $(BUILDDIR)/epub.\"\n\nlatex:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo\n\t@echo \"Build finished; the LaTeX files are in $(BUILDDIR)/latex.\"\n\t@echo \"Run \\`make' in that directory to run these through (pdf)latex\" \\\n\t      \"(use \\`make latexpdf' here to do that automatically).\"\n\nlatexpdf:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo \"Running LaTeX files through pdflatex...\"\n\tmake -C $(BUILDDIR)/latex all-pdf\n\t@echo \"pdflatex finished; the PDF files are in $(BUILDDIR)/latex.\"\n\ntext:\n\t$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text\n\t@echo\n\t@echo \"Build finished. The text files are in $(BUILDDIR)/text.\"\n\nman:\n\t$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man\n\t@echo\n\t@echo \"Build finished. The manual pages are in $(BUILDDIR)/man.\"\n\nchanges:\n\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes\n\t@echo\n\t@echo \"The overview file is in $(BUILDDIR)/changes.\"\n\nlinkcheck:\n\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck\n\t@echo\n\t@echo \"Link check complete; look for any errors in the above output \" \\\n\t      \"or in $(BUILDDIR)/linkcheck/output.txt.\"\n\ndoctest:\n\t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest\n\t@echo \"Testing of doctests in the sources finished, look at the \" \\\n\t      \"results in $(BUILDDIR)/doctest/output.txt.\"\n"
  },
  {
    "path": "docs/api.rst",
    "content": "API\n===\n\nalert(message)\n--------------\nAlert a ``message``.\n\n* **message**: Any message you want to alert\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def alert_example(request):\n        dajax = Dajax()\n        dajax.alert('Hello from python!')\n        return dajax.json()\n\nassign(selector, attribute, value)\n----------------------------------\nAssign to all elements that matches with the ``selector`` as `attribute`` the ``value``.\n\n\n* **selector**: CSS selector.\n* **attribute**: Any valid attribute.\n* **value**: The value you want to assing.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def assign_example(request):\n        dajax = Dajax()\n        dajax.assign('#button', 'value', 'Click here!')\n        dajax.assign('div .alert', 'innerHTML', 'This email is invalid')\n        return dajax.json()\n\n\nadd_css_class(selector, value)\n------------------------------\nAssign to all elements that matches with the ``selector`` the ``CSS`` class ``value``. ``value`` could be a string or a list of them.\n\n* **selector**: CSS selector.\n* **value**: Any CSS class name or a list of them.\n\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def add_css_example(request):\n        dajax = Dajax()\n        dajax.add_css_class('div .alert', 'red')\n        dajax.add_css_class('div .warning', ['big', 'yellow'])\n        return dajax.json()\n\n\nremove_css_class(selector, value)\n---------------------------------\nRemove to all elements that matches with the ``selector`` the ``CSS`` class ``value``. ``value`` could be a string or a list of them.\n\n* **selector**: CSS selector.\n* **value**: Any CSS class name or a list of them.\n\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def remove_css_example(request):\n        dajax = Dajax()\n        dajax.remove_css_class('div .message', 'big-message')\n        dajax.remove_css_class('div .total', ['big', 'red'])\n        return dajax.json()\n\nappend(selector, attribute, value)\n----------------------------------\n\nAppend to all elements that matches with the ``selector``  ``value`` to with the desired ``attribute``.\n\n* **selector**: CSS selector.\n* **attribute**: Any valid attribute.\n* **value**: Any CSS class name or a list of them.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def append_example(request):\n        dajax = Dajax()\n        dajax.append('#message', 'innerHTML', 'Last message')\n        return dajax.json()\n\n\nprepend(selector, attribute, value)\n-----------------------------------\n\nPrepend to all elements that matches with the ``selector`` ``value`` to with the desired ``attribute``.\n\n* **selector**: CSS selector.\n* **attribute**: Any valid attribute.\n* **value**: Any CSS class name or a list of them.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def prepend_example(request):\n        dajax = Dajax()\n        dajax.prepend('#message', 'innerHTML', 'First message')\n        return dajax.json()\n\n\nclear(selector, attribute)\n--------------------------\n\nClear all elements that matches with the ``selector`` the  desired ``attribute``.\n\n* **selector**: CSS selector.\n* **attribute**: Any valid attribute.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def clear_example(request):\n        dajax = Dajax()\n        dajax.clear('#message', 'innerHTML')\n        return dajax.json()\n\n\nredirect(url, delay=0)\n----------------------\n\nRedirect current page to ``url`` with a delay of ``ms``.\n\n* **url**: Destination URL.\n* **delay**: Number of ms that the browser should wait before redirecting.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def redirect_example(request):\n        dajax = Dajax()\n        dajax.redirect('http://google.com', delay=2000)\n        return dajax.json()\n\n\nscript(code)\n------------\n\nExecutes ``code`` in the browser\n\n* **code**: Code to execute.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def code_example(request):\n        dajax = Dajax()\n        dajax.code('my_function();')\n        return dajax.json()\n\n\nremove(selector)\n----------------\n\nRemove all elements that matches ``selector``.\n\n* **selector**: CSS selector.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def code_example(request):\n        dajax = Dajax()\n        dajax.remove('.message')\n        return dajax.json()\n\n\nadd_data(data, callback_function)\n---------------------------------\n\nSend ``data`` to the browser and call ``callback_function`` using this ``data``.\n\n* **data**: Data you want to send to your function.\n* **callback_function**: Fuction you want to call in the browser.\n\nUsage Example::\n\n    from dajax.core import Dajax\n\n    def data_example(request):\n        dajax = Dajax()\n        dajax.add_data(range(10), 'my_js_function')\n        return dajax.json()\n"
  },
  {
    "path": "docs/changelog.rst",
    "content": "Changelog\n=========\n\n0.9.2\n^^^^\n* Fix unicode issues\n* Fix Internet Explorer issues modifying element's innerHTML\n\n0.9\n^^^\n* Move dajaxice core from dajaxice.core.Dajax to dajax.core\n* Django 1.3 is now a requirement\n* dajaxice 0.5 is now a requirement\n* Static files are now located inside static instead of src\n\n0.8.4\n^^^^^\n* Upgrade to dajaxice 0.1.3 (New Dajaxice.EXCEPTION)\n* Dajax PEP8 naming style for addCSSClass and removeCSSClass\n* Fixed some bugs in examples\n* Fixed unicode problems\n\n0.8.3\n^^^^^\n* General: New and cleaned setup.py\n\n0.8.2\n^^^^^\n* General: Upgrade to dajaxice 0.1.1\n\n0.8.0.1\n^^^^^^^\n* dajaxice released, now dajax use it as communication core\n* cleaned all the code\n\n0.7.5\n^^^^^\n* Added Dojo support\n* Cleaned js files\n* Ajax functions outside project folder now supported.\n* Flickr in place editor example.\n\n0.7.4.1\n^^^^^^^\n* Typo error importing ajax functions\n\n0.7.4.0\n^^^^^^^\n* Typo error importing ajax functions\n* Examples: Form validation using new utf-8 support.\n* Examples: New deserialize method\n* Examples: New DAJAX_CACHE_CONTROL usage in dajax.core.js view.\n"
  },
  {
    "path": "docs/conf.py",
    "content": "# -*- coding: utf-8 -*-\n#\n# django-dajax documentation build configuration file, created by\n# sphinx-quickstart on Sat Jul 14 08:42:53 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration -----------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'django-dajax'\ncopyright = u'2012, Jorge Bastida'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n\nversion = '0.9'\nrelease = '0.9'\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = 'nature'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'django-dajaxdoc'\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\n# The paper size ('letter' or 'a4').\n#latex_paper_size = 'letter'\n\n# The font size ('10pt', '11pt' or '12pt').\n#latex_font_size = '10pt'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n  ('index', 'django-dajax.tex', u'django-dajax Documentation',\n   u'Jorge Bastida', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Additional stuff for the LaTeX preamble.\n#latex_preamble = ''\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'django-dajax', u'django-dajax Documentation',\n     [u'Jorge Bastida'], 1)\n]\n"
  },
  {
    "path": "docs/index.rst",
    "content": "django-dajax\n============\n\n\nDajax is a powerful tool to easily and super-quickly develop asynchronous presentation logic in web applications, using Python and almost no JavaScript source code.\n\nIt supports four of the most popular JavaScript frameworks: Prototype, jQuery, Dojo and mootols.\n\nUsing ``django-dajaxice`` as communication core, Dajax implements an abstraction layer between presentation logic managed with JavaScript and your Python business logic.\n\nWith Dajax you can modify your DOM structure directly from Python.\n\n\nDocumentation\n-------------\n.. toctree::\n   :maxdepth: 2\n\n   installation\n   api\n\n   migrating-to-09\n\n   changelog\n\n\nHow does it work?\n-----------------\n\n.. image:: img/overview.png\n\n\nExample\n-------\n\nOnce you've `installed dajaxice <http://django-dajaxice.readthedocs.org/en/latest/installation.html>`_ and `dajax <http://django-dajax.readthedocs.org/en/latest/installation.html>`_ you can create ajax functions in your Python code::\n\n\n    from dajax.core import Dajax\n\n    def assign_test(request):\n        dajax = Dajax()\n        dajax.assign('#box', 'innerHTML', 'Hello World!')\n        dajax.add_css_class('div .alert', 'red')\n        return dajax.json()\n\n\nThis function will assign to ``#box`` as innerHTML the text ``Hello World!`` and ``Hola!`` to every DOM element that matches ``.btn``.\n\nYou can call this function in your html/js code using::\n\n    <div onclick=\"Dajaxice.app.assign_test(Dajax.process);\">Click Here!</div>\n\n\nSupported JS Frameworks\n-----------------------\n\nDajax currently support four of the most popular:\n\n* `jQuery 1.7.2 <http://jquery.com/>`_\n* `Prototype 1.7 <http://www.prototypejs.org>`_\n* `MooTools 1.4.5 <http://mootools.net/>`_\n* `Dojo 1.7 <http://www.dojotoolkit.org/>`_\n"
  },
  {
    "path": "docs/installation.rst",
    "content": "Installation\n============\n\nIn order to use ``dajax`` you should install ``django-dajaxice`` before. Please follow these instructions `here <http://django-dajaxice.readthedocs.org/en/latest/installation.html>`_.\n\nInstalling Dajax\n----------------\n\nInstall ``django-dajax`` using ``easy_install`` or ``pip``::\n\n    $ pip install django_dajax\n    $ easy_install django_dajax\n\n\nAdd ``dajax`` in your project settings.py inside ``INSTALLED_APPS``::\n\n    INSTALLED_APPS = (\n        'django.contrib.auth',\n        'django.contrib.contenttypes',\n        'django.contrib.sessions',\n        'django.contrib.sites',\n        'dajaxice',\n        'dajax',\n        ...\n    )\n\nCreate a new ``ajax.py`` file inside your app with your own dajax functions::\n\n    from dajax.core import Dajax\n    def multiply(request, a, b):\n        dajax = Dajax()\n        result = int(a) * int(b)\n        dajax.assign('#result','value',str(result))\n        return dajax.json()\n\n\nInclude dajax in your <head>::\n\nDajax supports up to four JS libraries. You should add to your project base template the one you need.\n\n* `jQuery 1.7.2 <http://jquery.com/>`_ - ``dajax/jquery.dajax.core.js``\n* `Prototype 1.7 <http://www.prototypejs.org>`_ - ``dajax/prototype.dajax.core.js``\n* `MooTools 1.4.5 <http://mootools.net/>`_ - ``dajax/mootools.dajax.core.js``\n* `Dojo 1.7 <http://www.dojotoolkit.org/>`_ - ``dajax/dojo.dajax.core.js``\n\nFor example for jQuery::\n\n    {% static \"/static/dajax/jquery.dajax.core.js\" %}\n\n\nUse Dajax\n---------\n\nNow you can call your ajax methods using Dajaxice.app.function('Dajax.process')::\n\n    <button onclick=\"Dajaxice.example.myexample(Dajax.process);\">Click here!</button>\n\n\nThe function _Dajax.process_ will process what the server returns and call the appropriate actions.\nIf you need your own callback, you can change the callback with a function like::\n\n    function my_callback(data){\n        Dajax.process(data);\n        /* Your js code */\n    }\n\nAnd use it as::\n\n    <button onclick=\"Dajaxice.app.function(my_callback)\">Click here!</button>\n\n\n"
  },
  {
    "path": "docs/make.bat",
    "content": "@ECHO OFF\n\nREM Command file for Sphinx documentation\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-build\n)\nset BUILDDIR=_build\nset ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .\nif NOT \"%PAPER%\" == \"\" (\n\tset ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%\n)\n\nif \"%1\" == \"\" goto help\n\nif \"%1\" == \"help\" (\n\t:help\n\techo.Please use `make ^<target^>` where ^<target^> is one of\n\techo.  html       to make standalone HTML files\n\techo.  dirhtml    to make HTML files named index.html in directories\n\techo.  singlehtml to make a single large HTML file\n\techo.  pickle     to make pickle files\n\techo.  json       to make JSON files\n\techo.  htmlhelp   to make HTML files and a HTML help project\n\techo.  qthelp     to make HTML files and a qthelp project\n\techo.  devhelp    to make HTML files and a Devhelp project\n\techo.  epub       to make an epub\n\techo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter\n\techo.  text       to make text files\n\techo.  man        to make manual pages\n\techo.  changes    to make an overview over all changed/added/deprecated items\n\techo.  linkcheck  to check all external links for integrity\n\techo.  doctest    to run all doctests embedded in the documentation if enabled\n\tgoto end\n)\n\nif \"%1\" == \"clean\" (\n\tfor /d %%i in (%BUILDDIR%\\*) do rmdir /q /s %%i\n\tdel /q /s %BUILDDIR%\\*\n\tgoto end\n)\n\nif \"%1\" == \"html\" (\n\t%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The HTML pages are in %BUILDDIR%/html.\n\tgoto end\n)\n\nif \"%1\" == \"dirhtml\" (\n\t%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.\n\tgoto end\n)\n\nif \"%1\" == \"singlehtml\" (\n\t%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.\n\tgoto end\n)\n\nif \"%1\" == \"pickle\" (\n\t%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished; now you can process the pickle files.\n\tgoto end\n)\n\nif \"%1\" == \"json\" (\n\t%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished; now you can process the JSON files.\n\tgoto end\n)\n\nif \"%1\" == \"htmlhelp\" (\n\t%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished; now you can run HTML Help Workshop with the ^\n.hhp project file in %BUILDDIR%/htmlhelp.\n\tgoto end\n)\n\nif \"%1\" == \"qthelp\" (\n\t%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished; now you can run \"qcollectiongenerator\" with the ^\n.qhcp project file in %BUILDDIR%/qthelp, like this:\n\techo.^> qcollectiongenerator %BUILDDIR%\\qthelp\\django-dajax.qhcp\n\techo.To view the help file:\n\techo.^> assistant -collectionFile %BUILDDIR%\\qthelp\\django-dajax.ghc\n\tgoto end\n)\n\nif \"%1\" == \"devhelp\" (\n\t%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished.\n\tgoto end\n)\n\nif \"%1\" == \"epub\" (\n\t%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The epub file is in %BUILDDIR%/epub.\n\tgoto end\n)\n\nif \"%1\" == \"latex\" (\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished; the LaTeX files are in %BUILDDIR%/latex.\n\tgoto end\n)\n\nif \"%1\" == \"text\" (\n\t%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The text files are in %BUILDDIR%/text.\n\tgoto end\n)\n\nif \"%1\" == \"man\" (\n\t%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Build finished. The manual pages are in %BUILDDIR%/man.\n\tgoto end\n)\n\nif \"%1\" == \"changes\" (\n\t%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.The overview file is in %BUILDDIR%/changes.\n\tgoto end\n)\n\nif \"%1\" == \"linkcheck\" (\n\t%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Link check complete; look for any errors in the above output ^\nor in %BUILDDIR%/linkcheck/output.txt.\n\tgoto end\n)\n\nif \"%1\" == \"doctest\" (\n\t%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest\n\tif errorlevel 1 exit /b 1\n\techo.\n\techo.Testing of doctests in the sources finished, look at the ^\nresults in %BUILDDIR%/doctest/output.txt.\n\tgoto end\n)\n\n:end\n"
  },
  {
    "path": "docs/migrating-to-09.rst",
    "content": "Migrating to 0.9\n================\n\nStatic files\n------------\n\nSince ``0.9`` dajax takes advantage of ``django.contrib.staticfiles`` so deploying a dajax application live is much easy than in previous versions.\nAll the ``X.dajax.core.js`` flavoured files (jQuery, Prototype, ...) are inside a new folder named static instead of src.\n\nYou need to remember to run ``python manage.py collectstatic`` before deploying your code live. This command will collect all the static files your application need into ``STATIC_ROOT``. For further information, this is the `Django static files docuemntation <https://docs.djangoproject.com/en/dev/howto/static-files/>`_\n\nYou should change all you dajax core imports using for example for jQuery::\n\n    {% static \"dajax/jquery.core.js\" %}\n\n\nImports\n-------\nIf you was importing ``dajax`` using::\n\n    from dajax.core.Dajax import Dajax\n\nyou should change it to::\n\n    from dajax.core import Dajax\n"
  },
  {
    "path": "setup.py",
    "content": "from distutils.core import setup\n\nsetup(\n    name='django-dajax',\n    version='0.9.2',\n    author='Jorge Bastida',\n    author_email='me@jorgebastida.com',\n    description=('Easy to use library to create asynchronous presentation '\n                 'logic with django and dajaxice'),\n    url='http://dajaxproject.com',\n    license='BSD',\n    packages=['dajax'],\n    package_data={'dajax': ['static/dajax/*']},\n    long_description=('dajax is a powerful tool to easily and super-quickly '\n                      'develop asynchronous presentation logic in web '\n                      'applications using python and almost no JS code. It '\n                      'supports up to four of the most popular JS frameworks: '\n                      'jQuery, Prototype, Dojo and mootols.'),\n    install_requires=[\n        'django-dajaxice>=0.5'\n    ],\n    classifiers=['Development Status :: 4 - Beta',\n                'Environment :: Web Environment',\n                'Framework :: Django',\n                'Intended Audience :: Developers',\n                'License :: OSI Approved :: BSD License',\n                'Operating System :: OS Independent',\n                'Programming Language :: Python',\n                'Topic :: Utilities']\n)\n"
  }
]