-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more Swift/JavaScript bindings to generated Xcode project.
- Loading branch information
1 parent
3a4da5c
commit b36d488
Showing
12 changed files
with
184 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//----------------------------------------------------------------------------- | ||
// Gradle Application Plugin | ||
// Copyright 2010-2024 Colorize | ||
// Apache license (http://www.apache.org/licenses/LICENSE-2.0) | ||
//----------------------------------------------------------------------------- | ||
|
||
loadImageFromScript = function() { | ||
const image = document.createElement("img"); | ||
image.addEventListener("load", () => { | ||
const description = "Loaded image size: " + image.width + "x" + image.height; | ||
document.getElementById("ajaxImage").innerText = description; | ||
}); | ||
image.src = "images/icon.png"; | ||
}; | ||
|
||
window.shareText = function() { | ||
const field = document.getElementById("shareText"); | ||
|
||
if (navigator.share) { | ||
navigator.share({ | ||
title: "Share text", | ||
text: field.innerText | ||
}); | ||
} | ||
}; | ||
|
||
window.openInNativeBrowser = function(url) { | ||
if (window.clrz) { | ||
window.clrz.openNativeBrowser(url); | ||
} else { | ||
window.location.href = url; | ||
} | ||
}; | ||
|
||
window.loadStorageText = function() { | ||
const field = document.getElementById("storageField"); | ||
|
||
if (window.clrz) { | ||
window.clrz.loadPreferences(); | ||
field.value = "Native: " + localStorage.getItem("test"); | ||
} else { | ||
field.value = "Local: " + localStorage.getItem("test"); | ||
} | ||
}; | ||
|
||
window.saveStorageText = function() { | ||
const field = document.getElementById("storageField"); | ||
localStorage.setItem("test", field.value); | ||
if (window.clrz) { | ||
window.clrz.savePreferences("test", field.value); | ||
} | ||
}; | ||
|
||
document.addEventListener("DOMContentLoaded", event => { | ||
loadImageFromScript(); | ||
if (!navigator.share) { | ||
document.getElementById("shareText").placeholder = "Not available"; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.