forked from tauri-apps/tauri
-
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.
chore: add prettierignore and fmt the repo (tauri-apps#5192)
Co-authored-by: Lucas Nogueira <[email protected]>
- Loading branch information
1 parent
ecb489a
commit 1d7171a
Showing
15 changed files
with
245 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/.github | ||
/.husky | ||
/.vscode | ||
/audits | ||
node_modules | ||
target | ||
dist | ||
/core/tauri/scripts | ||
/tooling/cli/templates | ||
/tooling/cli/node | ||
/tooling/cli/schema.json |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Isolation Secure Script</title> | ||
</head> | ||
<body> | ||
<script src="index.js"></script> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Isolation Secure Script</title> | ||
</head> | ||
<body> | ||
<script src="index.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
window.__TAURI_ISOLATION_HOOK__= (payload) => { | ||
window.__TAURI_ISOLATION_HOOK__ = (payload) => { | ||
console.log('hook', payload) | ||
return payload | ||
} |
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 |
---|---|---|
@@ -1,84 +1,84 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
|
||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var appWindow = window.__TAURI__.window.appWindow | ||
var windowLabel = appWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
|
||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var appWindow = window.__TAURI__.window.appWindow | ||
var windowLabel = appWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
var container = document.getElementById('container') | ||
|
||
var container = document.getElementById('container') | ||
function createWindowMessageBtn(label) { | ||
var tauriWindow = WebviewWindow.getByLabel(label) | ||
var button = document.createElement('button') | ||
button.innerText = 'Send message to ' + label | ||
button.addEventListener('click', function () { | ||
tauriWindow.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(button) | ||
} | ||
|
||
function createWindowMessageBtn(label) { | ||
var tauriWindow = WebviewWindow.getByLabel(label) | ||
var button = document.createElement('button') | ||
button.innerText = 'Send message to ' + label | ||
button.addEventListener('click', function () { | ||
tauriWindow.emit('clicked', 'message from ' + windowLabel) | ||
// global listener | ||
window.__TAURI__.event.listen('clicked', function (event) { | ||
responseContainer.innerHTML += | ||
'Got ' + JSON.stringify(event) + ' on global listener\n\n' | ||
}) | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
createWindowMessageBtn(event.payload.label) | ||
}) | ||
container.appendChild(button) | ||
} | ||
|
||
// global listener | ||
window.__TAURI__.event.listen('clicked', function (event) { | ||
responseContainer.innerHTML += | ||
'Got ' + JSON.stringify(event) + ' on global listener\n\n' | ||
}) | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
createWindowMessageBtn(event.payload.label) | ||
}) | ||
|
||
var responseContainer = document.getElementById('response') | ||
// listener tied to this window | ||
appWindow.listen('clicked', function (event) { | ||
responseContainer.innerText += | ||
'Got ' + JSON.stringify(event) + ' on window listener\n\n' | ||
}) | ||
|
||
var createWindowButton = document.createElement('button') | ||
createWindowButton.innerHTML = 'Create window' | ||
createWindowButton.addEventListener('click', function () { | ||
var webviewWindow = new WebviewWindow(Math.random().toString().replace('.', '')) | ||
webviewWindow.once('tauri://created', function () { | ||
responseContainer.innerHTML += 'Created new webview' | ||
var responseContainer = document.getElementById('response') | ||
// listener tied to this window | ||
appWindow.listen('clicked', function (event) { | ||
responseContainer.innerText += | ||
'Got ' + JSON.stringify(event) + ' on window listener\n\n' | ||
}) | ||
webviewWindow.once('tauri://error', function (e) { | ||
responseContainer.innerHTML += 'Error creating new webview' | ||
|
||
var createWindowButton = document.createElement('button') | ||
createWindowButton.innerHTML = 'Create window' | ||
createWindowButton.addEventListener('click', function () { | ||
var webviewWindow = new WebviewWindow( | ||
Math.random().toString().replace('.', '') | ||
) | ||
webviewWindow.once('tauri://created', function () { | ||
responseContainer.innerHTML += 'Created new webview' | ||
}) | ||
webviewWindow.once('tauri://error', function (e) { | ||
responseContainer.innerHTML += 'Error creating new webview' | ||
}) | ||
}) | ||
}) | ||
container.appendChild(createWindowButton) | ||
container.appendChild(createWindowButton) | ||
|
||
var globalMessageButton = document.createElement('button') | ||
globalMessageButton.innerHTML = 'Send global message' | ||
globalMessageButton.addEventListener('click', function () { | ||
// emit to all windows | ||
window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(globalMessageButton) | ||
var globalMessageButton = document.createElement('button') | ||
globalMessageButton.innerHTML = 'Send global message' | ||
globalMessageButton.addEventListener('click', function () { | ||
// emit to all windows | ||
window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(globalMessageButton) | ||
|
||
var allWindows = window.__TAURI__.window.getAll() | ||
for (var index in allWindows) { | ||
var label = allWindows[index].label | ||
if (label === windowLabel) { | ||
continue | ||
var allWindows = window.__TAURI__.window.getAll() | ||
for (var index in allWindows) { | ||
var label = allWindows[index].label | ||
if (label === windowLabel) { | ||
continue | ||
} | ||
createWindowMessageBtn(label) | ||
} | ||
createWindowMessageBtn(label) | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tauri</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tauri</title> | ||
</head> | ||
|
||
<body> | ||
<h1></h1> | ||
<button>Back</button> | ||
<script> | ||
const button = document.querySelector('button') | ||
button.addEventListener('click', () => window.history.back()) | ||
</script> | ||
<script src="secondary.js"></script> | ||
</body> | ||
|
||
<body> | ||
<h1></h1> | ||
<button>Back</button> | ||
<script> | ||
const button = document.querySelector('button') | ||
button.addEventListener('click', () => window.history.back()) | ||
</script> | ||
<script src="secondary.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,54 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
|
||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var thisTauriWindow = window.__TAURI__.window.getCurrent() | ||
var windowLabel = thisTauriWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
|
||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var thisTauriWindow = window.__TAURI__.window.getCurrent() | ||
var windowLabel = thisTauriWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
var container = document.getElementById('container') | ||
|
||
var container = document.getElementById('container') | ||
var responseContainer = document.getElementById('response') | ||
function runCommand(commandName, args, optional) { | ||
window.__TAURI__ | ||
.invoke(commandName, args) | ||
.then((response) => { | ||
responseContainer.innerText += `Ok(${response})\n\n` | ||
}) | ||
.catch((error) => { | ||
responseContainer.innerText += `Err(${error})\n\n` | ||
}) | ||
} | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
responseContainer.innerText += 'Got window-created event\n\n' | ||
}) | ||
|
||
var responseContainer = document.getElementById('response') | ||
function runCommand(commandName, args, optional) { | ||
window.__TAURI__ | ||
.invoke(commandName, args) | ||
.then((response) => { | ||
responseContainer.innerText += `Ok(${response})\n\n` | ||
}) | ||
.catch((error) => { | ||
responseContainer.innerText += `Err(${error})\n\n` | ||
}) | ||
} | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
responseContainer.innerText += 'Got window-created event\n\n' | ||
}) | ||
|
||
var createWindowButton = document.createElement('button') | ||
var windowId = Math.random().toString().replace('.', '') | ||
var windowNumber = 1 | ||
createWindowButton.innerHTML = 'Create child window ' + windowNumber | ||
createWindowButton.addEventListener('click', function () { | ||
runCommand('create_child_window', { id: `child-${windowId}-${windowNumber}` }) | ||
windowNumber += 1 | ||
var createWindowButton = document.createElement('button') | ||
var windowId = Math.random().toString().replace('.', '') | ||
var windowNumber = 1 | ||
createWindowButton.innerHTML = 'Create child window ' + windowNumber | ||
}) | ||
container.appendChild(createWindowButton) | ||
</script> | ||
</body> | ||
|
||
</html> | ||
createWindowButton.addEventListener('click', function () { | ||
runCommand('create_child_window', { | ||
id: `child-${windowId}-${windowNumber}` | ||
}) | ||
windowNumber += 1 | ||
createWindowButton.innerHTML = 'Create child window ' + windowNumber | ||
}) | ||
container.appendChild(createWindowButton) | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
"scripts": { | ||
"tauri": "node ../../tooling/cli/node/tauri.js" | ||
} | ||
} | ||
} |
Oops, something went wrong.