Permalink
Browse files

Export from google code

  • Loading branch information...
1 parent d0f9080 commit 583fccbd60e90e9c24906719fba0eae648a8557a Jorge Bastida committed Dec 1, 2009
Showing with 1,550 additions and 0 deletions.
  1. +28 −0 CHANGELOG
  2. +30 −0 COPYING
  3. +4 −0 INSTALL
  4. +31 −0 LICENSE
  5. +12 −0 README
  6. +1 −0 dajax/__init__.py
  7. +85 −0 dajax/core/Dajax.py
  8. +1 −0 dajax/core/__init__.py
  9. 0 dajax/models.py
  10. 0 dajax/views.py
  11. 0 dajaxexamples/__init__.py
  12. 0 dajaxexamples/apiexamples/__init__.py
  13. +74 −0 dajaxexamples/apiexamples/ajax.py
  14. +3 −0 dajaxexamples/apiexamples/models.py
  15. +273 −0 dajaxexamples/apiexamples/templates/apiexamples/apiexamples.html
  16. +4 −0 dajaxexamples/apiexamples/templates/apiexamples/bloque.html
  17. +4 −0 dajaxexamples/apiexamples/views.py
  18. 0 dajaxexamples/examples/__init__.py
  19. +83 −0 dajaxexamples/examples/ajax.py
  20. +5 −0 dajaxexamples/examples/forms.py
  21. 0 dajaxexamples/examples/models.py
  22. +105 −0 dajaxexamples/examples/templates/examples/examples_base.html
  23. +64 −0 dajaxexamples/examples/templates/examples/flickr_example.html
  24. +12 −0 dajaxexamples/examples/templates/examples/form_example.html
  25. +22 −0 dajaxexamples/examples/templates/examples/full_form_example.html
  26. +109 −0 dajaxexamples/examples/templates/examples/google_map_example_page.html
  27. +11 −0 dajaxexamples/examples/templates/examples/index.html
  28. +7 −0 dajaxexamples/examples/templates/examples/multiply_example.html
  29. +8 −0 dajaxexamples/examples/templates/examples/pagination_example.html
  30. +20 −0 dajaxexamples/examples/templates/examples/pagination_page.html
  31. +7 −0 dajaxexamples/examples/templates/examples/random_example.html
  32. +47 −0 dajaxexamples/examples/views.py
  33. +11 −0 dajaxexamples/manage.py
  34. +113 −0 dajaxexamples/settings.py
  35. +36 −0 dajaxexamples/urls.py
  36. +6 −0 dajaxexamples/utils.py
  37. +90 −0 setup.py
  38. +60 −0 src/dojo.dajax.core.js
  39. +61 −0 src/jquery.dajax.core.js
  40. +60 −0 src/mootools.dajax.core.js
  41. +63 −0 src/prototype.dajax.core.js
View
@@ -0,0 +1,28 @@
+dajax (0.7.5) stable; urgency=medium
+
+ * Core:
+ - Dojo support
+ - Cleaned js files
+ - Ajax functions outside project folder now supported.
+ * Examples:
+ - Flickr in place editor
+
+ -- Benito Jorge Bastida <jorge@thecodefarm.com> Mon, 16 Nov 2009 13:01:00 +0100
+
+dajax (0.7.4.1) stable; urgency=high
+
+ * Core:
+ - Typo error importing ajax functions
+
+ -- Benito Jorge Bastida <jorge@thecodefarm.com> Mon, 13 Nov 2009 16:03:00 +0100
+
+dajax (0.7.4.0) stable; urgency=low
+
+ * Core:
+ - Typo error importing ajax functions
+ * Examples:
+ - Form validation using new utf-8 support
+ - New deserialize method
+ - New DAJAX_CACHE_CONTROL usage in dajax.core.js view
+
+ -- Benito Jorge Bastida <jorge@thecodefarm.com> Mon, 13 Nov 2009 10:03:00 +0100
View
30 COPYING
@@ -0,0 +1,30 @@
+Copyright (c) 2009-2010, Benito Jorge Bastida
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ 3. Neither the name of the author nor the names of other
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
@@ -0,0 +1,4 @@
+INSTALL
+###########################################
+Installation instructions are available here:
+ http://code.google.com/p/dajaxproject/wiki/Installation
View
31 LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2009 Benito Jorge Bastida
+All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ o Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the disclaimer that follows.
+
+ o Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions, and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ o Neither the name of Digital Creations nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+ IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL
+ CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
View
12 README
@@ -0,0 +1,12 @@
+Dajax is an easy to use ajax library for django inspired in xajax.
+
+Using dajaxice communication core, 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.
+
+Note: If you want to avoid mixing your Presentation logic within your Business logic, try dajaxice . Dajaxice implements an easy to use protocol to invoke your ajax functions asynchronously without any JavaScript Framework requirement.
+
+
+Dajax Home http://wiki.github.com/jorgebastida/dajax/0751-0800-upgrade-manual
+Upgrade Manual 0.7.5.1 -> 0.8.0.0 http://wiki.github.com/jorgebastida/dajax/0751-0800-upgrade-manual
+Installation http://wiki.github.com/jorgebastida/dajax/installation
+
+Dajaxice Home http://github.com/jorgebastida/dajaxice
View
@@ -0,0 +1 @@
+VERSION = (0, 8, 0, 'beta')
View
@@ -0,0 +1,85 @@
+#----------------------------------------------------------------------
+# Copyright (c) 2009 Benito Jorge Bastida
+# All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# o Redistributions of source code must retain the above copyright
+# notice, this list of conditions, and the disclaimer that follows.
+#
+# o Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions, and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#
+# o Neither the name of Digital Creations nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+# IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DIGITAL
+# CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+# DAMAGE.
+#----------------------------------------------------------------------
+
+from django.utils import simplejson as json
+
+class Dajax(object):
+
+ def __init__(self):
+ self.calls = []
+
+ def render(self):
+ return json.dumps(self.calls)
+
+ def alert(self,message):
+ self.calls.append({'cmd':'alert','val':self._clean(message)})
+
+ def assign(self,id,attribute,value):
+ self.calls.append({'cmd':'as','id':id,'prop':attribute,'val':self._clean(value)})
+
+ def addCSSClass(self,id,value):
+ if not hasattr(value,'__iter__'):
+ value = [value]
+ self.calls.append({'cmd':'addcc','id':id,'val':self._clean(value)})
+
+ def removeCSSClass(self,id,value):
+ if not hasattr(value,'__iter__'):
+ value = [value]
+ self.calls.append({'cmd':'remcc','id':id,'val':self._clean(value)})
+
+ def append(self,id,attribute,value):
+ self.calls.append({'cmd':'ap','id':id,'prop':attribute,'val':self._clean(value)})
+
+ def prepend(self,id,attribute,value):
+ self.calls.append({'cmd':'pp','id':id,'prop':attribute,'val':self._clean(value)})
+
+ def clear(self,id,attribute):
+ self.calls.append({'cmd':'clr','id':id,'prop':attribute})
+
+ def redirect(self,url,delay=0):
+ self.calls.append({'cmd':'red','url':url,'delay':delay})
+
+ def script(self,code):#OK
+ self.calls.append({'cmd':'js','val':code})
+
+ def remove(self,id):
+ self.calls.append({'cmd':'rm','id':id})
+
+ def addData(self,data,function):
+ self.calls.append({'cmd':'data','val':data,'fun':function})
+
+ def _clean(self, data):
+ if hasattr(data,'__iter__'):
+ return map(self._clean,data)
+ else:
+ return str(data).replace('\n','').replace('\r','')
View
@@ -0,0 +1 @@
+from Dajax import Dajax
View
No changes.
View
No changes.
No changes.
No changes.
@@ -0,0 +1,74 @@
+from dajax.core import Dajax
+from django.template.loader import render_to_string
+
+def assign_test(request):
+ dajax = Dajax()
+ dajax.assign('#block01 li','innerHTML','Something else...')
+ dajax.append('#console','innerHTML',"dajax.assign('#block01 li','innerHTML','Something else...')<br/>")
+ return dajax.render()
+
+def clear_test(request):
+ dajax = Dajax()
+ dajax.clear('#block02 li','innerHTML')
+ dajax.append('#console','innerHTML',"dajax.clear('#block02 li','innerHTML')<br/>")
+ return dajax.render()
+
+def alert_test(request):
+ dajax = Dajax()
+ dajax.alert('Alert Test Works!!')
+ dajax.append('#console','innerHTML',"dajax.alert('Alert Test Works!!')<br/>")
+ return dajax.render()
+
+def cssadd_test(request):
+ dajax = Dajax()
+ dajax.addCSSClass('#block04 li',('red',))
+ dajax.append('#console','innerHTML',"dajax.addCSSClass('#block04 li',('red',))<br/>")
+ return dajax.render()
+
+def cssrem_test(request):
+ dajax = Dajax()
+ dajax.removeCSSClass('#block04 li',('red',))
+ dajax.append('#console','innerHTML',"dajax.removeCSSClass('#block04 li',('red',))<br/>")
+ return dajax.render()
+
+def append_test(request):
+ dajax = Dajax()
+ dajax.append('#block06 .row','innerHTML','#')
+ dajax.append('#console','innerHTML',"dajax.append('#block06 .row','innerHTML','#')<br/>")
+ return dajax.render()
+
+def prepend_test(request):
+ dajax = Dajax()
+ dajax.prepend('#block07 .row','innerHTML','#')
+ dajax.append('#console','innerHTML',"dajax.prepend('#block07 .row','innerHTML','#')<br/>")
+ return dajax.render()
+
+def redirect_test(request):
+ dajax = Dajax()
+ dajax.redirect('http://djangoproject.com',2000)
+ dajax.append('#console','innerHTML',"dajax.redirect('http://djangoproject.com',2000)<br/>")
+ return dajax.render()
+
+def script_test(request):
+ dajax = Dajax()
+ dajax.script('alert("Alert from script!")')
+ dajax.append('#console','innerHTML',"dajax.script('alert(\'Alert from script!\')')<br/>")
+ return dajax.render()
+
+def remove_test(request):
+ dajax = Dajax()
+ dajax.remove('#block10 .row')
+ dajax.append('#console','innerHTML',"dajax.remove('#block10 .row')<br/>")
+ return dajax.render()
+
+def adddata_test(request):
+ dajax = Dajax()
+ dajax.addData(range(0,10),'my_callback')
+ dajax.append('#console','innerHTML',"dajax.addData(range(0,10),'my_callback')<br/>")
+ return dajax.render()
+
+def param_test(request):
+ dajax = Dajax()
+ dajax.alert("You search = "+request.POST['what'])
+ dajax.append('#console','innerHTML',"dajax.alert(\'You search = \'+request.POST['what'])<br/>")
+ return dajax.render()
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
Oops, something went wrong.

0 comments on commit 583fccb

Please sign in to comment.