diff --git a/ajax/__init__.py b/ajax/__init__.py new file mode 100644 index 0000000..38314f3 --- /dev/null +++ b/ajax/__init__.py @@ -0,0 +1,3 @@ +""" +$Id$ +""" diff --git a/ajax/dojo/__init__.py b/ajax/dojo/__init__.py new file mode 100644 index 0000000..38314f3 --- /dev/null +++ b/ajax/dojo/__init__.py @@ -0,0 +1,3 @@ +""" +$Id$ +""" diff --git a/ajax/dojo/configure.zcml b/ajax/dojo/configure.zcml new file mode 100644 index 0000000..9ccab27 --- /dev/null +++ b/ajax/dojo/configure.zcml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/ajax/dojo/dojo b/ajax/dojo/dojo new file mode 120000 index 0000000..6561cf5 --- /dev/null +++ b/ajax/dojo/dojo @@ -0,0 +1 @@ +/home/helmutm/download/build/dojo-0.3.1-ajax \ No newline at end of file diff --git a/ajax/dojo/macros.pt b/ajax/dojo/macros.pt new file mode 100644 index 0000000..a1398e3 --- /dev/null +++ b/ajax/dojo/macros.pt @@ -0,0 +1,14 @@ + + + + + + + diff --git a/ajax/innerHtml.pt b/ajax/innerHtml.pt new file mode 100644 index 0000000..1600a20 --- /dev/null +++ b/ajax/innerHtml.pt @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/container/base.py b/container/base.py new file mode 100644 index 0000000..e4547eb --- /dev/null +++ b/container/base.py @@ -0,0 +1,47 @@ +# +# Copyright (c) 2006 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Ordered container implementation. + +$Id$ +""" + +from zope.app import zapi +from zope.cachedescriptors.property import Lazy +from zope.app.container.browser.contents import JustContents +from zope.app.i18n import ZopeMessageFactory as _ +from zope.interface import Interface + + +class ContainerView(JustContents): + + def checkMoveAction(self): + pass + + orderable = False + + # informations for the ajax.inner.html view (template): + + def template(self): + basicView = zapi.getMultiAdapter((self.context, self.request), + Interface, name=u'contents.html') + return basicView.index + + macroName = 'contents' + diff --git a/container/configure.zcml b/container/configure.zcml index 76ff1bc..8375724 100644 --- a/container/configure.zcml +++ b/container/configure.zcml @@ -14,6 +14,15 @@ menu="zmi_views" title="Contents" /> + + + + diff --git a/container/contents.pt b/container/contents.pt index 89c0890..82d8600 100644 --- a/container/contents.pt +++ b/container/contents.pt @@ -1,8 +1,17 @@ + + + + + + +
-
+ +
- + - Pages: + Pages: 1 ... 2 3 3 ... 5 @@ -197,10 +210,10 @@ />
-
@@ -257,6 +270,7 @@
+
diff --git a/container/ordered.py b/container/ordered.py index 7d0e254..5fd630d 100644 --- a/container/ordered.py +++ b/container/ordered.py @@ -25,16 +25,9 @@ $Id$ from zope.app import zapi from zope.app.container.ordered import OrderedContainer as BaseOrderedContainer from zope.cachedescriptors.property import Lazy -from zope.app.container.browser.contents import JustContents from zope.app.i18n import ZopeMessageFactory as _ - - -class ContainerView(JustContents): - - def checkMoveAction(self): - pass - - orderable = False +from zope.interface import Interface +from base import ContainerView class OrderedContainerView(ContainerView): diff --git a/reporter/README.txt b/reporter/README.txt index 1875166..0dd5e71 100644 --- a/reporter/README.txt +++ b/reporter/README.txt @@ -44,7 +44,9 @@ We are now ready to use the corresponding browser view: >>> bview.items() [3, 4, 5, 6] >>> bview.last - {'url': 'http://127.0.0.1?b_size=4&b_overlap=1&b_page=5&b_orphan=0', 'title': 5} + {'url': 'http://127.0.0.1?b_size=4&b_overlap=1&b_page=5&b_orphan=0', + 'navOnClick': "dojo.io.updateNode(...); return false;", + 'title': 5} The real reporting stuff ------------------------ diff --git a/reporter/browser/batch.py b/reporter/browser/batch.py index d9a705a..b6bd631 100644 --- a/reporter/browser/batch.py +++ b/reporter/browser/batch.py @@ -84,8 +84,21 @@ class BatchView(object): def url(self, page): return str(self.request.URL) + self.urlParams(page) + def ajaxUrl(self, page): + try: + url = self.request.URL[-1] + except KeyError: # make DocTest/TestRequest happy + url = `self.request.URL` + return ''.join((url, '/@@ajax.inner.html', self.urlParams(page))) + + def navOnClick(self, page): + return ("dojo.io.updateNode('body.contents', '%s'); " + "return false;" % self.ajaxUrl(page)) + def info(self, page): - return {'title': page+1, 'url': self.url(page)} + return {'title': page+1, + 'url': self.url(page), + 'navOnClick': self.navOnClick(page)} def showNavigation(self): return self.first['title'] != self.last['title']