This repository has been archived by the owner on May 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
scribd.xml
41 lines (39 loc) · 2.05 KB
/
scribd.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<extension>
<title>Scribd Extension</title>
<label>Scribd</label>
<copyright>Copyright (c) 2006-2009 MindTouch Inc.</copyright>
<description>This extension allows to view Adobe PDF, Microsoft Office, RTF, and Postscript documents in your wiki.</description>
<uri.help>http://developer.mindtouch.com/App_Catalog/Scribd</uri.help>
<uri.logo>http://scripts.mindtouch.com/logos/scribd-logo.png</uri.logo>
<config>
<param name="pubid" type="str">Publisher ID. Sign up for free at http://www.scribd.com/platform/start.</param>
</config>
<function>
<name>scribd</name>
<description>Embed a Adobe PDF, Microsoft Office, RTF, or Postscript document.</description>
<param name="document" type="uri">URI of Document to view.</param>
<param name="page" type="num" optional="true">Start page for document to open on. (default: 1)</param>
<param name="width" type="num" optional="true">Viewer width. (default: 100%)</param>
<param name="height" type="num" optional="true">Viewer height. (default: 100%)</param>
<return>
<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
<head>
<script type="text/javascript" src='http://www.scribd.com/javascripts/view.js' />
</head>
<body>
<eval:if test="!config.pubid"><span style="color:red; font:bold;">Scribd is misconfigured ('pubid' configuration key is missing)</span></eval:if>
<eval:else>
<div eval:id="@id" />
<script type="text/javascript">
var scribd_doc = scribd.Document.getDocFromUrl(<eval:js>args.document</eval:js>, <eval:js>config['pubid']</eval:js>);
<eval:if test="args.width">scribd_doc.addParam('width', <eval:js>web.size(args.width)</eval:js>);</eval:if>
<eval:if test="args.height">scribd_doc.addParam('height', <eval:js>web.size(args.height)</eval:js>);</eval:if>
<eval:if test="args.page">scribd_doc.addParam('page', <eval:js>args.page</eval:js>);</eval:if>
scribd_doc.write(<eval:js value="@id" />);
</script>
</eval:else>
</body>
</html>
</return>
</function>
</extension>