From 9463eb41a13de0cf832473982240558e78466e11 Mon Sep 17 00:00:00 2001 From: mossroy Date: Fri, 10 May 2013 17:05:44 +0200 Subject: [PATCH] Remove unused debug zone Slightly improve the case when a redirected article is not found (which seems to happen in some dumps) --- www/index.html | 8 ++------ www/js/app.js | 29 ----------------------------- www/js/lib/evopedia.js | 4 ++++ 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/www/index.html b/www/index.html index 68776166..d5021b2e 100644 --- a/www/index.html +++ b/www/index.html @@ -60,8 +60,8 @@ License: It's only a proof of concept so far : there are many many ways this could be enhanced (suggestions and patches are welcome : the source code is on github). In particular : @@ -77,11 +77,7 @@ License:
Choose a title from the filtered list :
- -
 

diff --git a/www/js/app.js b/www/js/app.js index 4601a2ef..a31843a7 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -27,9 +27,6 @@ define(function(require) { $('#searchTitles').on('click', function(e) { searchTitlesFromPrefix($('#prefix').val()); }); - $('#toggleDebug').on('click', function(e) { - switchDebugOnOff(); - }); $('#readData').on('click', function(e) { findTitleFromTitleIdAndLaunchArticleRead($('#titleList').val()); }); @@ -65,32 +62,6 @@ define(function(require) { $('#titleFile').on('change', setLocalArchiveFromFileSelect); } - var debugOn = false; - - /** - * Print the given string inside the debug zone - * - * @param string - */ - function debug(string) { - if (debugOn) { - document.getElementById("debugTextarea").value += string + "\n"; - } - } - - /** - * Switch debug mode On/Off - */ - function switchDebugOnOff() { - if (debugOn == true) { - debugOn = false; - $('#debugZone').hide(); - } else { - debugOn = true; - $('#debugZone').show(); - } - } - function setLocalArchiveFromFileSelect() { dataFiles=document.getElementById('dataFiles').files; titleFile=document.getElementById('titleFile').files[0]; diff --git a/www/js/lib/evopedia.js b/www/js/lib/evopedia.js index ec9c5bed..c52c79da 100644 --- a/www/js/lib/evopedia.js +++ b/www/js/lib/evopedia.js @@ -346,6 +346,10 @@ define(function(require) { reader.onload = function(e) { var binaryTitleFile = e.target.result; var byteArray = new Uint8Array(binaryTitleFile); + + if (byteArray.length==0) { + throw "Unable to find redirected article : offset "+title.blockStart+" not found in title file"; + } var redirectedTitle = title; redirectedTitle.fileNr = byteArray[2];