[Moin-devel] CVS: MoinMoin Page.py,1.119,1.120 PageEditor.py,1.11,1.12 wikiutil.py,1.100,1.101
J?rgen Hermann
jhermann at users.sourceforge.net
Fri May 10 16:00:03 EDT 2002
Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv18229
Modified Files:
Page.py PageEditor.py wikiutil.py
Log Message:
Added InterWiki link to page editor that opens in a new window;
added "target" keyword parameter to link calls for that purpose
Index: Page.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/Page.py,v
retrieving revision 1.119
retrieving revision 1.120
diff -C2 -r1.119 -r1.120
*** Page.py 25 Apr 2002 19:32:30 -0000 1.119
--- Page.py 10 May 2002 22:59:21 -0000 1.120
***************
*** 112,117 ****
! def link_to(self, text=None, querystr=None, anchor=None):
! """Return HTML markup that links to this page"""
text = text or self.split_title()
fmt = getattr(self, 'formatter', None)
--- 112,120 ----
! def link_to(self, text=None, querystr=None, anchor=None, **kw):
! """ Return HTML markup that links to this page.
!
! See wikiutil.link_tag() for possible keyword parameters.
! """
text = text or self.split_title()
fmt = getattr(self, 'formatter', None)
***************
*** 120,129 ****
if anchor: url = "%s#%s" % (url, urllib.quote_plus(anchor))
if self.exists():
! return wikiutil.link_tag(url, text, formatter=fmt)
elif user.current.show_nonexist_qm:
return wikiutil.link_tag(url,
! '?', 'nonexistent', formatter=fmt) + text
else:
! return wikiutil.link_tag(url, text, 'nonexistent', formatter=fmt)
--- 123,132 ----
if anchor: url = "%s#%s" % (url, urllib.quote_plus(anchor))
if self.exists():
! return wikiutil.link_tag(url, text, formatter=fmt, **kw)
elif user.current.show_nonexist_qm:
return wikiutil.link_tag(url,
! '?', 'nonexistent', formatter=fmt, **kw) + text
else:
! return wikiutil.link_tag(url, text, 'nonexistent', formatter=fmt, **kw)
Index: PageEditor.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/PageEditor.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** PageEditor.py 9 May 2002 11:33:07 -0000 1.11
--- PageEditor.py 10 May 2002 22:59:21 -0000 1.12
***************
*** 83,86 ****
--- 83,87 ----
_('Reduce editor size'))
print "|", wikiutil.getSysPage('HelpOnFormatting').link_to()
+ print "|", wikiutil.getSysPage('InterWiki').link_to(target='_blank')
if preview:
print '| <a href="#preview">%s</a>' % _('Skip to preview')
Index: wikiutil.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -r1.100 -r1.101
*** wikiutil.py 10 May 2002 12:16:27 -0000 1.100
--- wikiutil.py 10 May 2002 22:59:21 -0000 1.101
***************
*** 433,447 ****
def link_tag(params, text=None, css_class=None, formatter=None, **kw):
if text is None:
text = params # default
if formatter:
! return apply(formatter.url,
! ("%s/%s" % (webapi.getScriptname(), params), text, css_class), kw)
if css_class:
! classattr = ' class="%s"' % css_class
! else:
! classattr = ''
return ('<a%s href="%s/%s">%s</a>'
! % (classattr, webapi.getScriptname(), params, text))
--- 433,453 ----
def link_tag(params, text=None, css_class=None, formatter=None, **kw):
+ """ Create a link.
+
+ Keyword params:
+ target - link target
+ """
if text is None:
text = params # default
if formatter:
! return formatter.url("%s/%s" % (webapi.getScriptname(), params), text, css_class, **kw)
! attrs = ''
if css_class:
! attrs += ' class="%s"' % css_class
! target = kw.get('target', None)
! if target:
! attrs += ' target="%s"' % target
return ('<a%s href="%s/%s">%s</a>'
! % (attrs, webapi.getScriptname(), params, text))
More information about the Moin-devel
mailing list