From 7388e6b0b7944bfa71a2035e68f3791f50698632 Mon Sep 17 00:00:00 2001 From: ianb Date: Thu, 21 Jul 2005 21:46:32 +0000 Subject: Oops, it's confirm() not prompt() --- paste/url.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'paste/url.py') diff --git a/paste/url.py b/paste/url.py index 110cdcc..74ed725 100644 --- a/paste/url.py +++ b/paste/url.py @@ -197,7 +197,7 @@ class URL(URLResource): >>> u['//foo'].param(content='view').html 'view' >>> u.param(confirm='Really?', content='goto').html - 'goto' + 'goto' >>> u(title='See "it"', content='goto').html 'goto' >>> u('another', var='fuggetaboutit', content='goto').html @@ -237,7 +237,7 @@ class URL(URLResource): attrs = self.attrs.items() attrs.insert(0, ('href', self.href)) if self.params.get('confirm'): - attrs.append(('onclick', 'return prompt(%s)' + attrs.append(('onclick', 'return confirm(%s)' % js_repr(self.params['confirm']))) return attrs @@ -290,7 +290,7 @@ class Button(URLResource): >>> u = u / 'delete' >>> b = u.button['confirm=Sure?'](id=5, content='del') >>> str(b) - '' + '' """ default_params = {'tag': 'button'} @@ -321,7 +321,7 @@ class Button(URLResource): attrs = self.attrs.items() onclick = 'location.href=%s' % js_repr(self.href) if self.params.get('confirm'): - onclick = 'if (prompt(%s)) {%s}' % ( + onclick = 'if (confirm(%s)) {%s}' % ( js_repr(self.params['confirm']), onclick) onclick += '; return false' attrs.insert(0, ('onclick', onclick)) -- cgit v1.2.1