|
|
|
@ -58,6 +58,22 @@ var getLocation = function (success, error) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var openGeoLink = function (href) {
|
|
|
|
|
if (platform_type == "cordova") {
|
|
|
|
|
if (cordova.platformId == "ios") {
|
|
|
|
|
window.open(href.replace("geo:", "http://maps.apple.com/?q="), "_system");
|
|
|
|
|
} else if (cordova.platformId == "android") {
|
|
|
|
|
window.open(href.replace("geo:", "geo:0,0?q="), "_system");
|
|
|
|
|
} else {
|
|
|
|
|
window.open(href, "_system");
|
|
|
|
|
}
|
|
|
|
|
} else if (platform_type == "nw") {
|
|
|
|
|
require('nw.gui').Shell.openExternal(href);
|
|
|
|
|
} else {
|
|
|
|
|
window.open(href, "_blank");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function initCordova() {
|
|
|
|
|
platform_type = "cordova";
|
|
|
|
@ -150,13 +166,7 @@ function initCordova() {
|
|
|
|
|
|
|
|
|
|
// Handle geo: urls
|
|
|
|
|
$("body").on("click", "a[href^='geo:']", function (evt) {
|
|
|
|
|
if (cordova.platformId == "ios") {
|
|
|
|
|
window.open($(this).attr("href").replace("geo:", "http://maps.apple.com/?q="), "_system");
|
|
|
|
|
} else if (cordova.platformId == "android") {
|
|
|
|
|
window.open($(this).attr("href").replace("geo:", "geo:0,0?q="), "_system");
|
|
|
|
|
} else {
|
|
|
|
|
window.open($(this).attr("href"), "_system");
|
|
|
|
|
}
|
|
|
|
|
openGeoLink($(this).attr("href"));
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -198,7 +208,7 @@ function initNW() {
|
|
|
|
|
|
|
|
|
|
// Handle geo: urls
|
|
|
|
|
$("body").on("click", "a[href^='geo:']", function (evt) {
|
|
|
|
|
require('nw.gui').Shell.openExternal($(this).attr("href"));
|
|
|
|
|
openGeoLink($(this).attr("href"));
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -222,8 +232,8 @@ function initBrowser() {
|
|
|
|
|
window.open(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("body").on("click", ".geolink", function (evt) {
|
|
|
|
|
window.open($(this).attr("href"), "_blank");
|
|
|
|
|
$("body").on("click", "a[href^='geo:']", function (evt) {
|
|
|
|
|
openGeoLink($(this).attr("href"));
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|