Skip to content

Commit

Permalink
KaiOS 3
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Dec 24, 2023
1 parent 0c661ef commit ef6e110
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 129 deletions.
Binary file removed application/assets/icons/icon-112-112-png
Binary file not shown.
Binary file added application/assets/icons/icon-112-112.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 71 additions & 37 deletions application/assets/icons/icon-112-112.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed application/assets/icons/icon-56-56-png
Binary file not shown.
Binary file added application/assets/icons/icon-56-56.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 40 additions & 23 deletions application/assets/icons/icon-56-56.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 5 additions & 53 deletions application/assets/js/mozactivity.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
const mozactivity = (() => {
let share_position = function () {
let a =
"https://www.openstreetmap.org/?mlat=" +
mainmarker.current_lat +
"&mlon=" +
mainmarker.current_lng +
"#map=13/" +
mainmarker.current_lat +
"/" +
mainmarker.current_lng +
"&layers=T";
try {
let activity = new MozActivity({
name: "share",
data: {
type: "url",
url: a,
},
});

activity.onsuccess = function () {
console.log("successfully shared");
};

activity.onerror = function () {
console.log("The activity encounter en error: " + this.error);
};
} catch (e) {}

try {
let activity = new WebActivity("share", { type: "url", url: a });
activity.start().then(
(rv) => {
console.log("Results passed back from activity handler:");
console.log(rv);
},
(err) => {
console.log(err);
}
);
} catch (e) {}
};

const photo = function () {
try {
let activity = new MozActivity({
Expand Down Expand Up @@ -126,7 +83,7 @@ const mozactivity = (() => {
});

pick.onsuccess = function (e) {
callback(pick);
callback(pick, "k2");
};

pick.onerror = function () {
Expand All @@ -137,9 +94,8 @@ const mozactivity = (() => {
console.log(e);
}

try {
let pick = new WebActivity({
name: "pick",
if ("b2g" in navigator) {
let pick = new WebActivity("pick", {
data: {
type: ["image/png", "image/jpg", "image/jpeg"],
},
Expand All @@ -148,23 +104,19 @@ const mozactivity = (() => {
pick.start().then(
(rv) => {
general.blocker = false;
callback(pick);

console.log("Results passed back from activity handler:");
console.log(rv);
callback(rv, "k3");
},
(err) => {
general.blocker = false;

console.log(err);
}
);
} catch (e) {}
}
};

return {
photo,
share_position,
openSettings,
pickGallery,
};
Expand Down
Loading

0 comments on commit ef6e110

Please sign in to comment.