header('Content-Type: text/javascript');
-define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/../');
+define('JIRAFEAU_ROOT', dirname(__FILE__) . '/../');
-require (JIRAFEAU_ROOT . 'lib/settings.php');
-require (JIRAFEAU_ROOT . 'lib/functions.php');
-require (JIRAFEAU_ROOT . 'lib/lang.php');
+require(JIRAFEAU_ROOT . 'lib/settings.php');
+require(JIRAFEAU_ROOT . 'lib/functions.php');
+require(JIRAFEAU_ROOT . 'lib/lang.php');
?>
function translate (expr)
{
- var lang_array = <?php echo json_lang_generator () ?>;
+ var lang_array = <?php echo json_lang_generator() ?>;
if (lang_array.hasOwnProperty(expr))
return lang_array[expr];
return expr;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
- if (res == "Error")
+
+ // if response starts with "Error" then show a failure
+ if (/^Error/.test(res))
{
- pop_failure ();
+ pop_failure (res);
return;
}
+
res = res.split ("\n");
if (time != 'none')
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
- if (res == "Error")
+
+ if (/^Error/.test(res))
{
- pop_failure ();
+ pop_failure (res);
return;
}
+
res = res.split ("\n");
async_global_ref = res[0];
var code = res[1];
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
- if (res == "Error")
+
+ if (/^Error/.test(res))
{
- pop_failure ();
+ pop_failure (res);
return;
}
+
res = res.split ("\n");
var code = res[0]
async_global_transfered = async_global_transfering;
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
- if (res == "Error")
+
+ if (/^Error/.test(res))
{
- pop_failure ();
+ pop_failure (res);
return;
}
+
res = res.split ("\n");
if (async_global_time != 'none')
{