soundManager.stopAll();
soundManager.destroySound('chunk'+this.ttsIndex+'-'+this.ttsPosition);
this.ttsRemoveHilites();
+ this.ttsRemovePopup();
this.ttsPlaying = false;
this.ttsIndex = null; //leaf index
from lxml import etree
import sys
import json
+import re
minWordsInBlock = 25
maxWordsInBlock = 50
pageNum = int(sys.argv[2])
callback = sys.argv[3]
+if not re.match('^/\d{1,2}/items/.+_djvu.xml$', path):
+ sys.exit(-1);
+
+if ('ttsNextPageCB' != callback):
+ callback = 'ttsStartCB'
+
tree = etree.parse(path)
objects = tree.findall('//OBJECT')
#print 'got %s objects' % len(objects)
+if pageNum > (len(objects)-1):
+ sys.exit(-1)
+
page = objects[pageNum]
lines = page.findall('.//LINE')
*/
//$env = 'LD_LIBRARY_PATH=/petabox/sw/lib/lxml/lib PYTHONPATH=/petabox/sw/lib/lxml/lib/python2.5/site-packages:$PYTHONPATH';
-$path=$_GET['path'];
-$page=$_GET['page'];
-$callback=$_GET['callback'];
+$path = escapeshellarg($_GET['path']);
+$page = escapeshellarg($_GET['page']);
+$callback = escapeshellarg($_GET['callback']);
header('Content-Type: application/javascript');
passthru("python BookReaderGetText.py $path $page $callback");
?>
along with BookReader. If not, see <http://www.gnu.org/licenses/>.
*/
+header('Content-Type: application/javascript');
+
$id = $_REQUEST['id'];
$itemPath = $_REQUEST['itemPath'];
$subPrefix = $_REQUEST['subPrefix'];