Skip to content
This repository
Browse code

Remove examples in favor of external implementations.

  • Loading branch information...
commit 0afcda2d1e62996b3b07447f6f5b1344c0f52986 1 parent 827c1ca
jimsafley jimsafley authored

Showing 38 changed files with 0 additions and 4,792 deletions. Show diff stats Hide diff stats

  1. +0 45 examples/README.markdown
  2. +0 208 examples/SideBySide/index.php
  3. +0 97 examples/SideBySide/screen.css
  4. +0 127 examples/Simple/index.php
  5. +0 188 examples/TopAndBottom/index.php
  6. +0 78 examples/TopAndBottom/screen.css
  7. +0 347 examples/shared/MediaWikiToolbar.js
  8. +0 2,561 examples/shared/OpenLayers.ScriptoFork.js
  9. +0 33 examples/shared/ajax.php
  10. +0 16 examples/shared/config.php.changeme
  11. +0 4 examples/shared/imageViewer.css.php
  12. +0 85 examples/shared/imageViewer.js.php
  13. BIN  examples/shared/images/Button_blockquote.png
  14. BIN  examples/shared/images/Button_enter.png
  15. BIN  examples/shared/images/Button_gallery.png
  16. BIN  examples/shared/images/Button_hide_comment.png
  17. BIN  examples/shared/images/Button_insert_table.png
  18. BIN  examples/shared/images/Button_lower_letter.png
  19. BIN  examples/shared/images/Button_redirect.png
  20. BIN  examples/shared/images/Button_reflink.png
  21. BIN  examples/shared/images/Button_small.png
  22. BIN  examples/shared/images/Button_strike.png
  23. BIN  examples/shared/images/Button_upper_letter.png
  24. BIN  examples/shared/images/button_bold.png
  25. BIN  examples/shared/images/button_extlink.png
  26. BIN  examples/shared/images/button_headline.png
  27. BIN  examples/shared/images/button_hr.png
  28. BIN  examples/shared/images/button_image.png
  29. BIN  examples/shared/images/button_italic.png
  30. BIN  examples/shared/images/button_link.png
  31. BIN  examples/shared/images/button_math.png
  32. BIN  examples/shared/images/button_media.png
  33. BIN  examples/shared/images/button_nowiki.png
  34. BIN  examples/shared/images/button_sig.png
  35. BIN  examples/shared/images/button_template.png
  36. +0 154 examples/shared/jquery-1.4.2.min.js
  37. +0 68 examples/shared/jquery-ui-1.8.5.js
  38. +0 781 examples/shared/jquery.form.js
45 examples/README.markdown
Source Rendered
... ... @@ -1,45 +0,0 @@
1   -Scripto User Interface Examples
2   -=============
3   -
4   -The examples/ directory contains three example layouts. The Simple/ layout is
5   -the most straightforward; while the SideBySide/ and TopAndBottom/ layouts are
6   -more intricate, using [OpenLayers](http://openlayers.org/) for the document
7   -image viewer and [jQuery](http://jquery.com/) for a dynamic, AJAX-powered user
8   -interface.
9   -
10   -Running the Examples
11   --------------
12   -
13   -To run the examples, follow these steps:
14   -
15   -* Make sure the Scripto directory is accessible to your web server;
16   -* Copy config.php.changeme to config.php:
17   -
18   -On the command line:
19   -
20   - $ cd /path/to/mydomain.org/Scripto/examples/shared/
21   - $ cp config.php.changeme config.php
22   -
23   -* Set the configuration in config.php:
24   -
25   -Something like this:
26   -
27   - <?php
28   -
29   - // Path to directory containing Zend Framework, from root.
30   - define('ZEND_PATH', '/path/to/zend/library');
31   -
32   - // Path to directory containing the Scripto library, from root.
33   - define('SCRIPTO_PATH', '/path/to/mydomain.org/Scripto/lib');
34   -
35   - // URL to the MediaWiki installation API.
36   - define('MEDIAWIKI_API_URL', 'http://mydomain.org/wiki/api.php');
37   -
38   - // Name of the MediaWiki database.
39   - define('MEDIAWIKI_DB_NAME', 'mediawiki_db');
40   -
41   -* Load the following layouts in your web browser:
42   - * http://mydomain.org/Scripto/examples/Simple/
43   - * http://mydomain.org/Scripto/examples/TopAndBottom/
44   - * http://mydomain.org/Scripto/examples/SideBySide/
45   -
208 examples/SideBySide/index.php
... ... @@ -1,208 +0,0 @@
1   -<?php
2   -require('../shared/config.php');
3   -
4   -// Must set the Content-Type header to correctly display UTF-8.
5   -header('Content-Type: text/html; charset=utf-8');
6   -
7   -// Get the document ID and page ID.
8   -$documentId = isset($_GET['documentId']) ? $_GET['documentId'] : 16344;
9   -$pageId = isset($_GET['pageId']) ? $_GET['pageId'] : null;
10   -
11   -// Set the Adapter object.
12   -require_once 'Scripto/Adapter/Example.php';
13   -$adapter = new Scripto_Adapter_Example;
14   -
15   -// Set the Document object.
16   -require_once 'Scripto.php';
17   -$scripto = new Scripto($adapter, array('api_url' => MEDIAWIKI_API_URL));
18   -$doc = $scripto->getDocument($documentId);
19   -
20   -// Must set the current page first.
21   -$doc->setPage($pageId);
22   -
23   -//var_dump($doc->getBaseTitle());
24   -//var_dump($doc->decodeBaseTitle($doc->getBaseTitle()));
25   -
26   -if (isset($_POST['submit_login'])) {
27   - $scripto->login($_POST['username'], $_POST['password']);
28   -}
29   -
30   -if (isset($_POST['submit_logout'])) {
31   - $scripto->logout();
32   -}
33   -
34   -// Determine if the current user can edit MediaWiki.
35   -$canEditTranscription = $doc->canEditTranscriptionPage();
36   -$canEditTalk = $doc->canEditTalkPage();
37   -
38   -if ($canEditTranscription) {
39   - // Edit the transcription if submitted.
40   - if (isset($_POST['submit_transcription'])) {
41   - $doc->editTranscriptionPage($_POST['transcription']);
42   - }
43   -}
44   -
45   -if ($canEditTalk){
46   - // Edit the talk page if submitted
47   - if (isset($_POST['submit_talk'])) {
48   - $doc->editTalkPage($_POST['talk']);
49   - }
50   -}
51   -
52   -
53   -// Set up the OpenLayers image viewer.
54   -$olExternalGraphicUrl = $doc->getPageFileUrl();
55   -$size = getimagesize($olExternalGraphicUrl);
56   -$olGraphicWidth = 400;
57   -$olGraphicHeight = (400 * $size[1]) / $size[0];
58   -$olMapHeight = 400;
59   -$olMapWidth = 460;
60   -
61   -// Set up the MediaWiki edit toolbar.
62   -$mwUrl = dirname(MEDIAWIKI_API_URL);
63   -
64   -?>
65   -<!DOCTYPE html>
66   -<html>
67   -<head>
68   - <title>Scripto Example</title>
69   - <link rel="stylesheet" href="screen.css" />
70   - <?php if ($canEditTranscription): // Include the necessary scripts if the user can edit. ?>
71   - <script src="../shared/jquery-1.4.2.min.js" type="text/javascript"></script>
72   - <script src="../shared/jquery-ui-1.8.5.js" type="text/javascript"></script>
73   - <script src="../shared/jquery.form.js" type="text/javascript"></script>
74   - <script type="text/javascript">
75   - jQuery.noConflict();
76   - </script>
77   - <style type="text/css"><?php include '../shared/imageViewer.css.php'; ?></style>
78   - <script src="../shared/OpenLayers.ScriptoFork.js" type="text/javascript"></script>
79   - <script type="text/javascript"><?php include '../shared/imageViewer.js.php'; ?></script>
80   - <script src="../shared/MediaWikiToolbar.js" type="text/javascript"></script>
81   - <script type="text/javascript">
82   - jQuery(document).ready(function() {
83   - jQuery("#formWrap").tabs();
84   - jQuery("#transcriptionWrap").tabs();
85   - jQuery("#discussionWrap").tabs();
86   -
87   - // bind 'myForm' and provide a simple callback function
88   - jQuery('#transcriptionEditForm').ajaxForm(function() {
89   - jQuery.get('../shared/ajax.php', {documentId:<?php echo $doc->getId(); ?>, pageId:<?php echo $doc->getPageId(); ?>, type:'transcription'}, function(data){
90   - jQuery('#transcriptionCurrent').html(data);
91   - });
92   - return false;
93   - });
94   - jQuery('#talkEditForm').ajaxForm(function() {
95   - jQuery.get('../shared/ajax.php', {documentId:<?php echo $doc->getId(); ?>, pageId:<?php echo $doc->getPageId(); ?>, type:'talk'}, function(data){
96   - jQuery('#discussionCurrent').html(data);
97   - });
98   - return false;
99   - });
100   - jQuery('.toolbar').each(function() {
101   - setupToolbar(this);
102   - });
103   -
104   - });
105   - </script>
106   -
107   -<?php endif; ?>
108   -</head>
109   -<body <?php echo $canEditTranscription ? 'onload="init()"' : ''; ?>>
110   -<div id="wrap">
111   -
112   - <h1>Scripto Example</h1>
113   - <?php if (!$canEditTranscription): // Display the login form if the current user does not have permission to edit. ?>
114   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
115   - <p>Username: <input type="input" name="username" /></p>
116   - <p>Password: <input type="password" name="password" /></p>
117   - <p><input type="submit" name="submit_login" value="Login" /></p>
118   - </form>
119   - <?php else: // Display the edit and logout forms and/or process the edit form if the current user has permission to edit. ?>
120   -
121   - <div id="documentContainer">
122   -
123   - <div id="mapContainer">
124   - <button onmousedown="rotate(-1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate ←</button>
125   - <button onmousedown="rotate(1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate →</button>
126   - <button onclick="rotateGraphic(90)">Rotate 90°</button>
127   - <button onclick="rotateGraphic(0)">Reset</button>
128   - <div id="olMap"></div>
129   - </div>
130   -
131   - <div id="formWrap">
132   -
133   - <ul id="formWrapList">
134   - <li><a href="#transcriptionWrap"><span>Transcription</span></a></li>
135   - <li><a href="#discussionWrap"><span>Discussion</span></a></li>
136   - </ul>
137   -
138   - <div id="transcriptionWrap">
139   -
140   - <div id="transcriptionCurrent">
141   - <?php echo $doc->getTranscriptionPageHtml(); ?>
142   - </div>
143   -
144   -
145   - <div id="transcriptionEdit">
146   - <div class="toolbar"><!-- MediaWiki edit toolbar --></div>
147   - <form id="transcriptionEditForm" action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
148   - <textarea name="transcription" id="wpTextbox1" rows="22" cols="62"><?php echo $doc->getTranscriptionPageWikitext(); ?></textarea><br />
149   - <input type="submit" name="submit_transcription" value="Submit" />
150   - </form>
151   - </div>
152   -
153   - <ul id="transcriptionWrapList">
154   - <li><a class="transcriptionCurrent" href="#transcriptionCurrent"><span>Transcription Current</span></a></li>
155   - <li><a class="transcriptionEdit" href="#transcriptionEdit"><span>Transcription Edit</span></a></li>
156   - </ul>
157   -
158   - </div><!-- end transcriptionWrap -->
159   -
160   - <div id="discussionWrap">
161   -
162   - <div id="discussionCurrent">
163   - <?php echo $doc->getTalkPageHtml(); ?>
164   - </div>
165   -
166   - <div id="discussionEdit">
167   -
168   - <?php if ($canEditTalk): ?>
169   - <div class="toolbar"><!-- MediaWiki edit toolbar --></div>
170   - <form id="talkEditForm" action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
171   - <textarea name="talk" id="wpTextbox2" rows="22" cols="62"><?php echo $doc->getTalkPageWikitext(); ?></textarea><br />
172   - <input type="submit" name="submit_talk" value="Submit" />
173   - </form>
174   -
175   - <?php else: ?>
176   - <p>You do not have permission to edit the talk page.</p>
177   - <?php endif; ?>
178   - </div>
179   -
180   - <ul id="discussionWrapList">
181   - <li><a class="discussionCurrent" href="#discussionCurrent"><span>Discussion Current</span></a></li>
182   - <li><a class="discussionEdit" href="#discussionEdit"><span>Discussion Edit</span></a></li>
183   - </ul>
184   -
185   - </div>
186   -
187   -
188   - </div>
189   -
190   -
191   - <div id="logOut">
192   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
193   - <input type="submit" name="submit_logout" value="Logout" />
194   - </form>
195   - </div>
196   -
197   - </div>
198   -
199   - <div id="documentPages">
200   - <?php endif; ?>
201   - <?php foreach ($doc->getPages() as $pageId => $pageName): ?>
202   - <a href="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($pageId); ?>"><?php echo $pageName; ?></a><br />
203   - <?php endforeach; ?>
204   - </div>
205   -
206   -</div><!--end wrap-->
207   -</body>
208   -</html>
97 examples/SideBySide/screen.css
... ... @@ -1,97 +0,0 @@
1   -p, ul {
2   - margin:0;
3   - padding:0;
4   -}
5   -
6   -#wrap {
7   - width:995px;
8   - margin:auto;
9   - padding:0 20px;
10   - overflow:hidden;
11   -}
12   -
13   -#mapContainer {
14   - width:460px;
15   - float:left;
16   - border:solid 1px black;
17   -}
18   -
19   -#formWrap {
20   - height:422px;
21   - width:510px;
22   - float:left;
23   - margin-left:20px;
24   - overflow:hidden;
25   - border:solid 1px black;
26   - position:relative;
27   -
28   -}
29   -
30   -#formWrapList {
31   - border-bottom:1px solid black;
32   -}
33   -
34   -#transcriptionWrapList {
35   - border-top:1px solid black;
36   - }
37   -
38   -#formWrap ul {
39   - height:30px;
40   -}
41   -#transcriptionCurrent {
42   - overflow:auto;
43   - padding:4px;
44   -}
45   -#transcriptionEdit {
46   - padding:4px 0;
47   -}
48   -#formWrap textarea {
49   - width:98%;
50   - height:290px;
51   -}
52   -
53   -#discussionWrapList {
54   - border-top:1px solid black;
55   -}
56   -#discussionCurrent {
57   - overflow:auto;
58   - padding:4px;
59   -}
60   -#discussionEdit{
61   - padding:4px 0;
62   -}
63   -#formWrap ul li {
64   - padding-right:.5em;
65   -}
66   -
67   -li.ui-tabs-selected a {
68   - color:black;
69   -}
70   -
71   -#documentPages {
72   - clear:both;
73   - width:220px;
74   -}
75   -
76   -#logOut {
77   - float:right;
78   - margin:1em 20px 0 0;
79   -}
80   -
81   -
82   - /* jQuery UI Tabs @VERSION
83   - *
84   - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
85   - * Dual licensed under the MIT or GPL Version 2 licenses.
86   - * http://jquery.org/license
87   - *
88   - * http://docs.jquery.com/UI/Tabs#theming
89   - */
90   -.ui-tabs { position: relative; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
91   -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
92   -.ui-tabs .ui-tabs-nav li a { float: left; padding: .25em .5em; text-decoration: none; }
93   -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
94   -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
95   -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
96   -.ui-tabs-panel {height:350px;}
97   -.ui-tabs .ui-tabs-hide { display: none !important; }
127 examples/Simple/index.php
... ... @@ -1,127 +0,0 @@
1   -<?php
2   -require('../shared/config.php');
3   -
4   -// Must set the Content-Type header to correctly display UTF-8.
5   -header('Content-Type: text/html; charset=utf-8');
6   -
7   -// Get the document ID and page ID.
8   -$documentId = isset($_GET['documentId']) ? $_GET['documentId'] : 16344;
9   -$pageId = isset($_GET['pageId']) ? $_GET['pageId'] : null;
10   -
11   -// Set the Adapter object.
12   -require_once 'Scripto/Adapter/Example.php';
13   -$adapter = new Scripto_Adapter_Example;
14   -
15   -// Set the Document object.
16   -require_once 'Scripto.php';
17   -$scripto = new Scripto($adapter, array('api_url' => MEDIAWIKI_API_URL));
18   -$doc = $scripto->getDocument($documentId);
19   -
20   -// Must set the current page first.
21   -$doc->setPage($pageId);
22   -
23   -//var_dump($doc->getBaseTitle());
24   -//var_dump($doc->decodeBaseTitle($doc->getBaseTitle()));
25   -
26   -if (isset($_POST['submit_login'])) {
27   - $scripto->login($_POST['username'], $_POST['password']);
28   -}
29   -
30   -if (isset($_POST['submit_logout'])) {
31   - $scripto->logout();
32   -}
33   -
34   -// Determine if the current user can edit MediaWiki.
35   -$canEditTranscription = $doc->canEditTranscriptionPage();
36   -$canEditTalk = $doc->canEditTalkPage();
37   -
38   -if ($canEditTranscription) {
39   - // Edit the transcription if submitted.
40   - if (isset($_POST['submit_transcription'])) {
41   - $doc->editTranscriptionPage($_POST['transcription']);
42   - }
43   -}
44   -
45   -if ($canEditTalk){
46   - // Edit the talk page if submitted
47   - if (isset($_POST['submit_talk'])) {
48   - $doc->editTalkPage($_POST['talk']);
49   - }
50   -}
51   -
52   -
53   -// Set up the OpenLayers image viewer.
54   -$olExternalGraphicUrl = $doc->getPageFileUrl();
55   -$size = getimagesize($olExternalGraphicUrl);
56   -$olGraphicWidth = 400;
57   -$olGraphicHeight = (400 * $size[1]) / $size[0];
58   -$olMapHeight = 400;
59   -$olMapWidth = 460;
60   -
61   -// Set up the MediaWiki edit toolbar.
62   -$mwUrl = dirname(MEDIAWIKI_API_URL);
63   -
64   -?>
65   -<!DOCTYPE html>
66   -<html>
67   -<head>
68   - <title>Scripto Example</title>
69   - <?php if ($canEditTranscription): // Include the necessary scripts if the user can edit. ?>
70   - <script src="../shared/jquery-1.4.2.min.js" type="text/javascript"></script>
71   - <script type="text/javascript">
72   - jQuery.noConflict();
73   - </script>
74   - <style type="text/css"><?php include '../shared/imageViewer.css.php'; ?></style>
75   - <script src="../shared/OpenLayers.ScriptoFork.js" type="text/javascript"></script>
76   - <script type="text/javascript"><?php include '../shared/imageViewer.js.php'; ?></script>
77   - <script src="../shared/MediaWikiToolbar.js" type="text/javascript"></script>
78   - <script type="text/javascript">
79   - jQuery(document).ready(function() {
80   - jQuery('.toolbar').each(function() {
81   - setupToolbar(this);
82   - });
83   - });
84   - </script>
85   - <?php endif; ?>
86   -</head>
87   -<body <?php echo $canEditTranscription ? 'onload="init()"' : ''; ?>>
88   -<div id="wrap">
89   -
90   - <h1>Scripto Example</h1>
91   - <?php if (!$canEditTranscription): // Display the login form if the current user does not have permission to edit. ?>
92   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
93   - <p>Username: <input type="input" name="username" /></p>
94   - <p>Password: <input type="password" name="password" /></p>
95   - <p><input type="submit" name="submit_login" value="Login" /></p>
96   - </form>
97   - <?php else: // Display the edit and logout forms and/or process the edit form if the current user has permission to edit. ?>
98   - <div id="mapContainer">
99   - <button onmousedown="rotate(-1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate ←</button>
100   - <button onmousedown="rotate(1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate →</button>
101   - <button onclick="rotateGraphic(90)">Rotate 90°</button>
102   - <button onclick="rotateGraphic(0)">Reset</button>
103   - <div id="olMap"></div>
104   - </div>
105   - <div id="transcriptionContainer">
106   - <div class="toolbar"><!-- MediaWiki edit toolbar --></div>
107   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
108   - <textarea name="transcription" id="wpTextbox1" rows="24" cols="80"><?php echo $doc->getTranscriptionPageWikitext(); ?></textarea><br />
109   - <input type="submit" name="submit_transcription" value="Submit" />
110   - </form>
111   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
112   - <input type="submit" name="submit_logout" value="Logout" />
113   - </form>
114   - <?php echo $doc->getTranscriptionPageHtml(); ?>
115   -
116   - </div>
117   -
118   - <div id="documentPages">
119   - <?php endif; ?>
120   - <?php foreach ($doc->getPages() as $pageId => $pageName): ?>
121   - <a href="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($pageId); ?>"><?php echo $pageName; ?></a><br />
122   - <?php endforeach; ?>
123   - </div>
124   -
125   -</div><!--end wrap-->
126   -</body>
127   -</html>
188 examples/TopAndBottom/index.php
... ... @@ -1,188 +0,0 @@
1   -<?php
2   -require('../shared/config.php');
3   -
4   -// Must set the Content-Type header to correctly display UTF-8.
5   -header('Content-Type: text/html; charset=utf-8');
6   -
7   -// Get the document ID and page ID.
8   -$documentId = isset($_GET['documentId']) ? $_GET['documentId'] : 16344;
9   -$pageId = isset($_GET['pageId']) ? $_GET['pageId'] : null;
10   -
11   -// Set the Adapter object.
12   -require_once 'Scripto/Adapter/Example.php';
13   -$adapter = new Scripto_Adapter_Example;
14   -
15   -// Set the Document object.
16   -require_once 'Scripto.php';
17   -$scripto = new Scripto($adapter, array('api_url' => MEDIAWIKI_API_URL));
18   -$doc = $scripto->getDocument($documentId);
19   -
20   -// Must set the current page first.
21   -$doc->setPage($pageId);
22   -
23   -//var_dump($doc->getBaseTitle());
24   -//var_dump($doc->decodeBaseTitle($doc->getBaseTitle()));
25   -
26   -if (isset($_POST['submit_login'])) {
27   - $scripto->login($_POST['username'], $_POST['password']);
28   -}
29   -
30   -if (isset($_POST['submit_logout'])) {
31   - $scripto->logout();
32   -}
33   -
34   -// Determine if the current user can edit MediaWiki.
35   -$canEditTranscription = $doc->canEditTranscriptionPage();
36   -$canEditTalk = $doc->canEditTalkPage();
37   -
38   -if ($canEditTranscription) {
39   - // Edit the transcription if submitted.
40   - if (isset($_POST['submit_transcription'])) {
41   - $doc->editTranscriptionPage($_POST['transcription']);
42   - }
43   -}
44   -
45   -if ($canEditTalk){
46   - // Edit the talk page if submitted
47   - if (isset($_POST['submit_talk'])) {
48   - $doc->editTalkPage($_POST['talk']);
49   - }
50   -}
51   -
52   -
53   -// Set up the OpenLayers image viewer.
54   -$olExternalGraphicUrl = $doc->getPageFileUrl();
55   -$size = getimagesize($olExternalGraphicUrl);
56   -$olGraphicWidth = 400;
57   -$olGraphicHeight = (400 * $size[1]) / $size[0];
58   -$olMapHeight = 400;
59   -$olMapWidth = 460;
60   -
61   -// Set up the MediaWiki edit toolbar.
62   -$mwUrl = dirname(MEDIAWIKI_API_URL);
63   -
64   -?>
65   -<!DOCTYPE html>
66   -<html>
67   -<head>
68   - <title>Scripto Example</title>
69   - <!--link rel="stylesheet" href="screen.css" /-->
70   - <link rel="stylesheet" href="screen.css" />
71   - <?php if ($canEditTranscription): // Include the necessary scripts if the user can edit. ?>
72   - <script src="../shared/jquery-1.4.2.min.js" type="text/javascript"></script>
73   - <script src="../shared/jquery-ui-1.8.5.js" type="text/javascript"></script>
74   - <script src="../shared/jquery.form.js" type="text/javascript"></script>
75   - <script type="text/javascript">
76   - jQuery.noConflict();
77   - </script>
78   - <style type="text/css"><?php include '../shared/imageViewer.css.php'; ?></style>
79   - <script src="../shared/OpenLayers.ScriptoFork.js" type="text/javascript"></script>
80   - <script type="text/javascript"><?php include '../shared/imageViewer.js.php'; ?></script>
81   - <script src="../shared/MediaWikiToolbar.js" type="text/javascript"></script>
82   - <script>
83   - jQuery(document).ready(function() {
84   - jQuery("#transcriptionWrap").tabs();
85   -
86   - // bind 'myForm' and provide a simple callback function
87   - jQuery('#transcriptionEditForm').ajaxForm(function() {
88   - jQuery.get('../shared/ajax.php', {documentId:<?php echo $doc->getId(); ?>, pageId:<?php echo $doc->getPageId(); ?>, type:'transcription'}, function(data){
89   - jQuery('#transcriptionCurrent').html(data);
90   - });
91   - return false;
92   - });
93   - jQuery('#talkEditForm').ajaxForm(function() {
94   - jQuery.get('../shared/ajax.php', {documentId:<?php echo $doc->getId(); ?>, pageId:<?php echo $doc->getPageId(); ?>, type:'talk'}, function(data){
95   - jQuery('#discussionCurrent').html(data);
96   - });
97   - return false;
98   - });
99   - jQuery('.toolbar').each(function() {
100   - setupToolbar(this);
101   - });
102   -
103   - });
104   - </script>
105   -
106   -<?php endif; ?>
107   -</head>
108   -<body <?php echo $canEditTranscription ? 'onload="init()"' : ''; ?>>
109   -<div id="wrap">
110   -
111   - <h1>Scripto Example</h1>
112   - <?php if (!$canEditTranscription): // Display the login form if the current user does not have permission to edit. ?>
113   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
114   - <p>Username: <input type="input" name="username" /></p>
115   - <p>Password: <input type="password" name="password" /></p>
116   - <p><input type="submit" name="submit_login" value="Login" /></p>
117   - </form>
118   - <?php else: // Display the edit and logout forms and/or process the edit form if the current user has permission to edit. ?>
119   -
120   - <div id="documentContainer">
121   -
122   - <div id="mapContainer">
123   - <button onmousedown="rotate(-1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate ←</button>
124   - <button onmousedown="rotate(1, 50)" onmouseup="stopRotate()" onmouseout="stopRotate()">Rotate →</button>
125   - <button onclick="rotateGraphic(90)">Rotate 90°</button>
126   - <button onclick="rotateGraphic(0)">Reset</button>
127   - <div id="olMap"></div>
128   - </div>
129   -
130   - <div id="transcriptionWrap">
131   -
132   - <div id="transcriptionCurrent">
133   - <?php echo $doc->getTranscriptionPageHtml(); ?>
134   - </div>
135   -
136   - <div id="transcriptionEdit">
137   - <div class="toolbar"><!-- MediaWiki edit toolbar --></div>
138   - <form id="transcriptionEditForm" action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
139   - <textarea name="transcription" id="wpTextbox1" rows="4" cols="80"><?php echo $doc->getTranscriptionPageWikitext(); ?></textarea><br />
140   - <input type="submit" name="submit_transcription" value="Submit" />
141   - </form>
142   - </div>
143   -
144   - <div id="discussionCurrent">
145   - <?php echo $doc->getTalkPageHtml(); ?>
146   - </div>
147   -
148   - <div id="discussionEdit">
149   -
150   - <?php if ($canEditTalk): ?>
151   - <div class="toolbar"><!-- MediaWiki edit toolbar --></div>
152   - <form id="talkEditForm" action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
153   - <textarea name="talk" id="wpTextbox2" rows="4" cols="80"><?php echo $doc->getTalkPageWikitext(); ?></textarea><br />
154   - <input type="submit" name="submit_talk" value="Submit" />
155   - </form>
156   -
157   - <?php else: ?>
158   - <p>You do not have permission to edit the talk page.</p>
159   - <?php endif; ?>
160   - </div>
161   -
162   - <ul>
163   - <li><a href="#transcriptionCurrent"><span>Transcription Current</span></a></li>
164   - <li><a href="#transcriptionEdit"><span>Transcription Edit</span></a></li>
165   - <li><a href="#discussionCurrent"><span>Discussion Current</span></a></li>
166   - <li><a href="#discussionEdit"><span>Discussion Edit</span></a></li>
167   - </ul>
168   -
169   - </div><!-- end transcriptionWrap -->
170   -
171   - <div id="logOut">
172   - <form action="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($doc->getPageId()); ?>" method="post">
173   - <input type="submit" name="submit_logout" value="Logout" />
174   - </form>
175   - </div>
176   -
177   - </div>
178   -
179   - <div id="documentPages">
180   - <?php endif; ?>
181   - <?php foreach ($doc->getPages() as $pageId => $pageName): ?>
182   - <a href="?documentId=<?php echo urlencode($doc->getId()); ?>&amp;pageId=<?php echo urlencode($pageId); ?>"><?php echo $pageName; ?></a><br />
183   - <?php endforeach; ?>
184   - </div>
185   -
186   -</div><!--end wrap-->
187   -</body>
188   -</html>
78 examples/TopAndBottom/screen.css
... ... @@ -1,78 +0,0 @@
1   -p {
2   - margin:1em 1.5em 0;
3   -}
4   -
5   -#wrap {width:960px;
6   - margin:auto;
7   - padding:0 20px;
8   - overflow:hidden;
9   -}
10   -
11   -#documentContainer {
12   - float:right;
13   -}
14   -
15   -#mapContainer {
16   - float:right;
17   - width:700px;
18   - border:solid 1px black;
19   -}
20   -
21   -#documentPages {
22   - width:220px;
23   - float:left;
24   -}
25   -
26   -#transcriptionWrap {
27   - float:right;
28   - clear:right;
29   - width:700px;
30   - margin-top:1em;
31   - border:solid 1px black;
32   -}
33   -
34   -#transcriptionWrap ul {
35   - overflow:hidden;
36   - border-top:1px solid black;
37   - margin-top:1em;
38   - }
39   -
40   -li.ui-tabs-selected a {
41   - color:black;
42   -}
43   -
44   -#transcriptionWrap form {
45   - padding:1em 1em 0;
46   - height:300px;
47   -}
48   -
49   -#transcriptionWrap form textarea {
50   - height:270px;
51   -}
52   -#transcriptionWrap textarea {
53   - width:98%;
54   -}
55   -
56   -#logOut {
57   - clear:right;
58   - float:right;
59   - margin:1em 0;
60   -}
61   -
62   - * jQuery UI Tabs @VERSION
63   - *
64   - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
65   - * Dual licensed under the MIT or GPL Version 2 licenses.
66   - * http://jquery.org/license
67   - *
68   - * http://docs.jquery.com/UI/Tabs#theming
69   - */
70   -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
71   -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
72   -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
73   -.ui-tabs .ui-tabs-nav li a { float: left; padding: .25em .5em; text-decoration: none; }
74   -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
75   -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
76   -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
77   -.ui-tabs .ui-tabs-panel { }
78   -.ui-tabs .ui-tabs-hide { display: none !important; }
347 examples/shared/MediaWikiToolbar.js
... ... @@ -1,347 +0,0 @@
1   -// From: /mediawiki/skins/common/wikibits.js
2   -var mwEditButtons = [];
3   -var mwCustomEditButtons = [];
4   -
5   -function hookEvent(hookName, hookFunct) {
6   - addHandler(window, hookName, hookFunct);
7   -}
8   -
9   -function addHandler( element, attach, handler ) {
10   - if( window.addEventListener ) {
11   - element.addEventListener( attach, handler, false );
12   - } else if( window.attachEvent ) {
13   - element.attachEvent( 'on' + attach, handler );
14   - }
15   -}
16   -
17   -function setupToolbar(toolbar) {
18   - // Don't generate buttons for browsers which don't fully
19   - // support it.
20   - // but don't assume wpTextbox1 is always here
21   - var textboxes = document.getElementsByTagName( 'textarea' );
22   - if ( !textboxes.length ) {
23   - // No toolbar if we can't find any textarea
24   - return false;
25   - }
26   -
27   - // Only check for selection capability if the textarea is visible - errors will occur otherwise - just because
28   - // the textarea is not visible, doesn't mean we shouldn't build out the toolbar though - it might have been replaced
29   - // with some other kind of control
30   - for ( var i = 0; i < mwEditButtons.length; i++ ) {
31   - mwInsertEditButton( toolbar, mwEditButtons[i] );
32   - }
33   - for ( var i = 0; i < mwCustomEditButtons.length; i++ ) {
34   - mwInsertEditButton( toolbar, mwCustomEditButtons[i] );
35   - }
36   - return true;
37   -}
38   -
39   -function mwInsertEditButton( parent, item ) {
40   - var image = document.createElement( 'img' );
41   - image.width = 23;
42   - image.height = 22;
43   - image.className = 'mw-toolbar-editbutton';
44   - if ( item.imageId ) {
45   - image.id = item.imageId;
46   - }
47   - image.src = item.imageFile;
48   - image.border = 0;
49   - image.alt = item.speedTip;
50   - image.title = item.speedTip;
51   - image.style.cursor = 'pointer';
52   - image.onclick = function() {
53   - insertTags( item.tagOpen, item.tagClose, item.sampleText );
54   - // click tracking
55   - if ( ( typeof $j != 'undefined' ) && ( typeof $j.trackAction != 'undefined' ) ) {
56   - $j.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") );
57   - }
58   - return false;
59   - };
60   -
61   - parent.appendChild( image );
62   - return true;
63   -}
64   -
65   -// apply tagOpen/tagClose to selection in textarea,
66   -// use sampleText instead of selection if there is none
67   -function insertTags( tagOpen, tagClose, sampleText ) {
68   - if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' &&
69   - ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) {
70   - $j( '#wpTextbox1' ).textSelection(
71   - 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose }
72   - );
73   - return;
74   - }
75   - var txtarea;
76   - txtarea = currentFocused;
77   - var selText, isSample = false;
78   -
79   - if ( document.selection && document.selection.createRange ) { // IE/Opera
80   - // save window scroll position
81   - if ( document.documentElement && document.documentElement.scrollTop ) {
82   - var winScroll = document.documentElement.scrollTop
83   - } else if ( document.body ) {
84   - var winScroll = document.body.scrollTop;
85   - }
86   - // get current selection
87   - txtarea.focus();
88   - var range = document.selection.createRange();
89   - selText = range.text;
90   - // insert tags
91   - checkSelectedText();
92   - range.text = tagOpen + selText + tagClose;
93   - // mark sample text as selected
94   - if ( isSample && range.moveStart ) {
95   - if ( window.opera ) {
96   - tagClose = tagClose.replace(/\n/g,'');
97   - }
98   - range.moveStart('character', - tagClose.length - selText.length);
99   - range.moveEnd('character', - tagClose.length);
100   - }
101   - range.select();
102   - // restore window scroll position
103   - if ( document.documentElement && document.documentElement.scrollTop ) {
104   - document.documentElement.scrollTop = winScroll;
105   - } else if ( document.body ) {
106   - document.body.scrollTop = winScroll;
107   - }
108   -
109   - } else if ( txtarea.selectionStart || txtarea.selectionStart == '0' ) { // Mozilla
110   - // save textarea scroll position
111   - var textScroll = txtarea.scrollTop;
112   - // get current selection
113   - txtarea.focus();
114   - var startPos = txtarea.selectionStart;
115   - var endPos = txtarea.selectionEnd;
116   - selText = txtarea.value.substring( startPos, endPos );
117   - // insert tags
118   - checkSelectedText();
119   - txtarea.value = txtarea.value.substring(0, startPos)
120   - + tagOpen + selText + tagClose
121   - + txtarea.value.substring(endPos, txtarea.value.length);
122   - // set new selection
123   - if ( isSample ) {
124   - txtarea.selectionStart = startPos + tagOpen.length;
125   - txtarea.selectionEnd = startPos + tagOpen.length + selText.length;
126   - } else {
127   - txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length;
128   - txtarea.selectionEnd = txtarea.selectionStart;
129   - }
130   - // restore textarea scroll position
131   - txtarea.scrollTop = textScroll;
132   - }
133   -
134   - function checkSelectedText() {
135   - if ( !selText ) {
136   - selText = sampleText;
137   - isSample = true;
138   - } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char
139   - selText = selText.substring(0, selText.length - 1);
140   - tagClose += ' ';
141   - }
142   - }
143   -
144   -}
145   -
146   -/**
147   - * Restore the edit box scroll state following a preview operation,
148   - * and set up a form submission handler to remember this state
149   - */
150   -function scrollEditBox() {
151   - var editBox = document.getElementById( 'wpTextbox1' );
152   - var scrollTop = document.getElementById( 'wpScrolltop' );
153   - var editForm = document.getElementById( 'editform' );
154   - if( editForm && editBox && scrollTop ) {
155   - if( scrollTop.value ) {
156   - editBox.scrollTop = scrollTop.value;
157   - }
158   - addHandler( editForm, 'submit', function() {
159   - scrollTop.value = editBox.scrollTop;
160   - } );
161   - }
162   -}
163   -hookEvent( 'load', scrollEditBox );
164   -// hookEvent( 'load', mwSetupToolbar );
165   -hookEvent( 'load', function() {
166   - currentFocused = document.getElementById( 'wpTextbox1' );
167   - function onfocus( e ) {
168   - var elm = e.target || e.srcElement;
169   - if ( !elm ) {
170   - return;
171   - }
172   - var tagName = elm.tagName.toLowerCase();
173   - var type = elm.type || '';
174   - if ( tagName !== 'textarea' && tagName !== 'input' ) {
175   - return;
176   - }
177   - if ( tagName === 'input' && type.toLowerCase() !== 'text' ) {
178   - return;
179   - }
180   -
181   - currentFocused = elm;
182   - }
183   - jQuery('textarea').focus(onfocus);
184   -
185   - // HACK: make currentFocused work with the usability iframe
186   - // With proper focus detection support (HTML 5!) this'll be much cleaner
187   - if ( typeof $j != 'undefined' ) {
188   - var iframe = $j( '.wikiEditor-ui-text iframe' );
189   - if ( iframe.length > 0 ) {
190   - $j( iframe.get( 0 ).contentWindow.document )
191   - .add( iframe.get( 0 ).contentWindow.document.body ) // for IE
192   - .focus( function() { currentFocused = iframe.get( 0 ); } );
193   - }
194   - }
195   -
196   -} );
197   -
198   -// See: http://en.wikipedia.org/wiki/MediaWiki:Common.js/edit.js
199   -// See: getEditToolbar() in /mediawiki/includes/EditPage.php
200   -mwEditButtons.push({
201   - "imageFile": "../shared/images/button_bold.png",
202   - "speedTip": "Bold text",
203   - "tagOpen": "'''",
204   - "tagClose": "'''",
205   - "sampleText": "Bold text"
206   -});
207   -mwEditButtons.push({
208   - "imageFile": "../shared/images/button_italic.png",
209   - "speedTip": "Italic text",
210   - "tagOpen": "''",
211   - "tagClose": "''",
212   - "sampleText": "Italic text"
213   -});
214   -mwEditButtons.push({
215   - "imageFile": "../shared/images/button_link.png",
216   - "speedTip": "Internal link",
217   - "tagOpen": "[[",
218   - "tagClose": "]]",
219   - "sampleText": "Link title"
220   -});
221   -mwEditButtons.push({
222   - "imageFile": "../shared/images/button_extlink.png",
223   - "speedTip": "External link (remember http:// prefix)",
224   - "tagOpen": "[",
225   - "tagClose": "]",
226   - "sampleText": "http://www.example.com link title"
227   -});
228   -mwEditButtons.push({
229   - "imageFile": "../shared/images/button_headline.png",
230   - "speedTip": "Level 2 headline",
231   - "tagOpen": "\n== ",
232   - "tagClose": " ==\n",
233   - "sampleText": "Headline text"
234   -});
235   -mwEditButtons.push({
236   - "imageFile": "../shared/images/button_image.png",
237   - "speedTip": "Embedded file",
238   - "tagOpen": "[[File:",
239   - "tagClose": "]]",
240   - "sampleText": "Example.jpg"
241   -});
242   -mwEditButtons.push({
243   - "imageFile": "../shared/images/button_media.png",
244   - "speedTip": "File link",
245   - "tagOpen": "[[Media:",
246   - "tagClose": "]]",
247   - "sampleText": "Example.ogg"
248   -});
249   -mwEditButtons.push({
250   - "imageFile": "../shared/images/button_math.png",
251   - "speedTip": "Mathematical formula (LaTeX)",
252   - "tagOpen": "<math>",
253   - "tagClose": "</math>",
254   - "sampleText": "Insert formula here"
255   -});
256   - mwEditButtons.push({
257   - "imageFile": "../shared/images/button_nowiki.png",
258   - "speedTip": "Ignore wiki formatting",
259   - "tagOpen": "<nowiki>",
260   - "tagClose": "</nowiki>",
261   - "sampleText": "Insert non-formatted text here"
262   -});
263   -mwEditButtons.push({
264   - "imageFile": "../shared/images/button_sig.png",
265   - "speedTip": "Your signature with timestamp",
266   - "tagOpen": "--~~~~",
267   - "tagClose": "",
268   - "sampleText": ""
269   -});
270   -mwEditButtons.push({
271   - "imageFile": "../shared/images/button_hr.png",
272   - "speedTip": "Horizontal line (use sparingly)",
273   - "tagOpen": "\n----\n",
274   - "tagClose": "",
275   - "sampleText": ""
276   -});
277   -mwCustomEditButtons.push({
278   - "imageFile": "../shared/images/Button_strike.png",
279   - "speedTip": "Strike",
280   - "tagOpen": "<s>",
281   - "tagClose": "</s>",
282   - "sampleText": "Strike-through text"
283   -});
284   -mwCustomEditButtons.push({
285   - "imageFile": "../shared/images/Button_enter.png",
286   - "speedTip": "Line break",
287   - "tagOpen": "<br />",
288   - "tagClose": "",
289   - "sampleText": ""
290   -});
291   -mwCustomEditButtons.push({
292   - "imageFile": "../shared/images/Button_upper_letter.png",
293   - "speedTip": "Superscript",
294   - "tagOpen": "<sup>",
295   - "tagClose": "</sup>",
296   - "sampleText": "Superscript text"
297   -});
298   -mwCustomEditButtons.push({
299   - "imageFile": "../shared/images/Button_lower_letter.png",
300   - "speedTip": "Subscript",
301   - "tagOpen": "<sub>",
302   - "tagClose": "</sub>",
303   - "sampleText": "Subscript text"
304   -});
305   -
306   -mwCustomEditButtons.push({
307   - "imageFile": "../shared/images/Button_small.png",
308   - "speedTip": "Small",
309   - "tagOpen": "<small>",
310   - "tagClose": "</small>",
311   - "sampleText": "Small Text"
312   -});
313   -mwCustomEditButtons.push({
314   - "imageFile": "../shared/images/Button_hide_comment.png",
315   - "speedTip": "Insert hidden Comment",
316   - "tagOpen": "<!-- ",
317   - "tagClose": " -->",
318   - "sampleText": "Comment"
319   -});
320   -mwCustomEditButtons.push({
321   - "imageFile": "../shared/images/Button_gallery.png",
322   - "speedTip": "Insert a picture gallery",
323   - "tagOpen": "\n<gallery>\n",
324   - "tagClose": "\n</gallery>",
325   - "sampleText": "Image:Example.jpg|Caption1\nImage:Example.jpg|Caption2"
326   -});
327   -mwCustomEditButtons.push({
328   - "imageFile": "../shared/images/Button_blockquote.png",
329   - "speedTip": "Insert block of quoted text",
330   - "tagOpen": "<blockquote>\n",
331   - "tagClose": "\n</blockquote>",
332   - "sampleText": "Block quote"
333   -});
334   -mwCustomEditButtons.push({
335   - "imageFile": "../shared/images/Button_insert_table.png",
336   - "speedTip": "Insert a table",
337   - "tagOpen": '{| class="wikitable"\n|',
338   - "tagClose": "\n|}",
339   - "sampleText": "-\n! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"
340   -});
341   -mwCustomEditButtons.push({
342   - "imageFile": "../shared/images/Button_reflink.png",
343   - "speedTip": "Insert a reference",
344   - "tagOpen": "<ref>",
345   - "tagClose": "</ref>",
346   - "sampleText": "Insert footnote text here"
347   -});
2,561 examples/shared/OpenLayers.ScriptoFork.js
0 additions, 2,561 deletions not shown
33 examples/shared/ajax.php
... ... @@ -1,33 +0,0 @@
1   -<?php
2   -require('config.php');
3   -
4   -// Get the document ID and page ID.
5   -$documentId = isset($_GET['documentId']) ? $_GET['documentId'] : null;
6   -$pageId = isset($_GET['pageId']) ? $_GET['pageId'] : null;
7   -$type = $_GET['type'] == 'talk' ? 'talk' : 'transcription';
8   -
9   -// Set the Adapter object.
10   -require_once 'Scripto/Adapter/Example.php';
11   -$adapter = new Scripto_Adapter_Example;
12   -
13   -// Set the Document object.
14   -require_once 'Scripto.php';
15   -$scripto = new Scripto($adapter, array('api_url' => MEDIAWIKI_API_URL,
16   - 'db_name' => MEDIAWIKI_DB_NAME));
17   -$doc = $scripto->getDocument($documentId);
18   -
19   -// Must set the current page first.
20   -$doc->setPage($pageId);
21   -
22   -// Get updated transcription
23   -switch ($type) {
24   - case 'transcription':
25   - echo $doc->getTranscriptionPageHtml();
26   - break;
27   - case 'talk':
28   - echo $doc->getTalkPageHtml();
29   - break;
30   - default:
31   - echo '';
32   - break;
33   -}
16 examples/shared/config.php.changeme
... ... @@ -1,16 +0,0 @@
1   -<?php
2   -ini_set('display_errors', 1);
3   -
4   -// Path to directory containing Zend Framework, from root.
5   -define('ZEND_PATH', '');
6   -
7   -// Path to directory containing the Scripto library, from root.
8   -define('SCRIPTO_PATH', '');
9   -
10   -// URL to the MediaWiki installation API.
11   -define('MEDIAWIKI_API_URL', '');
12   -
13   -// Set the include path to Zend and Scripto libraries.
14   -set_include_path(get_include_path()
15   - . PATH_SEPARATOR . ZEND_PATH
16   <