diff --git a/www/assets/js/platform.js b/www/assets/js/platform.js index f73e872..a063b55 100644 --- a/www/assets/js/platform.js +++ b/www/assets/js/platform.js @@ -102,8 +102,8 @@ function setupCordovaBarcodeScanner() { showFlipCameraButton: true, prompt: "Scan barcode", resultDisplayDuration: 0, - disableSuccessBeep: true, - formats: "QR_CODE,DATA_MATRIX,CODE_39,CODE_93,CODE_128,CODABAR,PDF_417,AZTEC,MAXICODE" + disableSuccessBeep: false, + formats: "QR_CODE,DATA_MATRIX,CODE_39,CODE_93,CODE_128" } ); }; @@ -191,8 +191,16 @@ function initCordova() { } }, 3000); - // Handle geo: urls - $("#app").on("click", ".geolink", function (evt) { + + $("#app").on("click", "a[href^='geo:']", function (evt) { + window.open($(this).attr("href"), "_system"); + evt.preventDefault(); + }); + $("#app").on("click", "a[href^='tel:']", function (evt) { + window.open($(this).attr("href"), "_system"); + evt.preventDefault(); + }); + $("#app").on("click", "a[href^='mailto:']", function (evt) { window.open($(this).attr("href"), "_system"); evt.preventDefault(); }); @@ -254,8 +262,15 @@ function initNW() { setupHTML5BarcodeScanner(); - // Handle geo: urls - $("#app").on("click", ".geolink", function (evt) { + $("#app").on("click", "a[href^='geo:']", function (evt) { + require('nw.gui').Shell.openExternal($(this).attr("href")); + evt.preventDefault(); + }); + $("#app").on("click", "a[href^='tel:']", function (evt) { + require('nw.gui').Shell.openExternal($(this).attr("href")); + evt.preventDefault(); + }); + $("#app").on("click", "a[href^='mailto:']", function (evt) { require('nw.gui').Shell.openExternal($(this).attr("href")); evt.preventDefault(); });