summaryrefslogtreecommitdiff
path: root/paste/url.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-07-21 21:46:32 +0000
committerianb <devnull@localhost>2005-07-21 21:46:32 +0000
commit7388e6b0b7944bfa71a2035e68f3791f50698632 (patch)
treeb23562521fe28c275a6627df8c4cca8fd3ff3816 /paste/url.py
parentbbe2e33757997026a97d031b411327839b7c7708 (diff)
downloadpaste-7388e6b0b7944bfa71a2035e68f3791f50698632.tar.gz
Oops, it's confirm() not prompt()
Diffstat (limited to 'paste/url.py')
-rw-r--r--paste/url.py8
1 files changed, 4 insertions, 4 deletions
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
'<a href="http://localhost/view/foo">view</a>'
>>> u.param(confirm='Really?', content='goto').html
- '<a href="http://localhost/view" onclick="return prompt(\'Really?\')">goto</a>'
+ '<a href="http://localhost/view" onclick="return confirm(\'Really?\')">goto</a>'
>>> u(title='See "it"', content='goto').html
'<a href="http://localhost/view?title=See%20%22it%22">goto</a>'
>>> 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)
- '<button onclick="if (prompt(\'Sure?\')) {location.href=\'/delete?id=5\'}; return false">del</button>'
+ '<button onclick="if (confirm(\'Sure?\')) {location.href=\'/delete?id=5\'}; return false">del</button>'
"""
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))