diff --git a/bundle.js b/bundle.js index 7ddf9da..9066be0 100644 --- a/bundle.js +++ b/bundle.js @@ -11947,21 +11947,30 @@ function parse(toLoad) { console.info("Attempting parse"); parsed = parser(toLoad); display(); + if (parsed.xs) { + console.log("Magnet includes xs, attempting remote parse"); + parseRemote(parsed.xs); + } } catch(e) { console.warn(e); console.info("Attempting remote parse"); - parser.remote(toLoad, function(err, result) { - if (err) { // TODO: Display error to user - console.error(err); - return; - } - parsed = result; - display(); - }); + parseRemote(toLoad); } } +function parseRemote(toLoad) { + parser.remote(toLoad, function(err, result) { + if (err) { // TODO: Display error to user + console.error(err); + display(); + return; + } + parsed = result; + display(); + }); +} + function display() { document.getElementById('magnet').value = ""; diff --git a/index.html b/index.html index e785864..f1b789a 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@
- +
diff --git a/parse.js b/parse.js index 210485a..6a56d7c 100644 --- a/parse.js +++ b/parse.js @@ -61,21 +61,30 @@ function parse(toLoad) { console.info("Attempting parse"); parsed = parser(toLoad); display(); + if (parsed.xs) { + console.log("Magnet includes xs, attempting remote parse"); + parseRemote(parsed.xs); + } } catch(e) { console.warn(e); console.info("Attempting remote parse"); - parser.remote(toLoad, function(err, result) { - if (err) { // TODO: Display error to user - console.error(err); - return; - } - parsed = result; - display(); - }); + parseRemote(toLoad); } } +function parseRemote(toLoad) { + parser.remote(toLoad, function(err, result) { + if (err) { // TODO: Display error to user + console.error(err); + display(); + return; + } + parsed = result; + display(); + }); +} + function display() { document.getElementById('magnet').value = "";