~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/macro/EmbedObject.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
    <<EmbedObject(attachment[,width=width][,height=height][,alt=alternate Text])>>
10
10
 
11
 
    @copyright: 2006-2009 MoinMoin:ReimarBauer,
 
11
    @copyright: 2006-2008 MoinMoin:ReimarBauer,
12
12
                2006 TomSi,
13
13
                2007 OliverSiemoneit
14
14
 
84
84
 
85
85
        if not AttachFile.exists(request, pagename, fname):
86
86
            linktext = _('Upload new attachment "%(filename)s"') % {'filename': fname}
87
 
            target = AttachFile.getAttachUrl(pagename, fname, request, do='upload_form')
 
87
            target = AttachFile.getAttachUrl(pagename, fname, request, upload=True)
88
88
            return (fmt.url(1, target) +
89
89
                    fmt.text(linktext) +
90
90
                    fmt.url(0))
195
195
}
196
196
 
197
197
    elif mt.major == 'application':
198
 
        # workaround for the acroread browser plugin not knowing the size to embed
199
 
        # we use a width of 100% for the case that there is no width given.
200
 
        # A height of 100% gives a fullscreen pdf file view without embedding it into the wikicontent.
 
198
        # workaround for the acroread not knowing the size to embed
201
199
        if mt.minor == 'pdf':
202
 
            width = width or '100%'
 
200
            width = width or '800px'
203
201
            height = height or '800px'
204
 
            embed_src = '''
205
 
<object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s>
206
 
<p>%(alt)s</p>
207
 
</object>''' % {
208
 
    "ob_data": _check_object_value("data", url),
209
 
    "ob_width": _check_object_value("width", width),
210
 
    "ob_height": _check_object_value("height", height),
211
 
    "ob_type": _check_object_value("type", mime_type),
212
 
    "ob_align": _check_object_value("align", align),
213
 
    "alt": wikiutil.escape(alt),
214
 
}
215
 
        else:
216
 
            embed_src = '''
 
202
 
 
203
        embed_src = '''
217
204
<object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s>
218
205
%(movie)s%(quality)s%(wmode)s%(autostart)s%(play)s%(loop)s%(menu)s<p>%(alt)s</p>
219
206
</object>''' % {