docs: remove duplicate fiddles (#39419)

This commit is contained in:
Milan Burda 2023-08-10 10:52:52 +02:00 committed by GitHub
parent 0f49868234
commit c4d417b6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 0 additions and 181 deletions

View file

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<h3>Basic notification</h3>
<em>Supports: Win 7+, macOS, Linux (that supports libnotify)<span>|</span> Process: Renderer</em>
<div>
<div>
<button id="basic-noti">View demo</button>
</div>
<p>This demo demonstrates a basic notification. Text only.</p>
</div>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

View file

@ -1,26 +0,0 @@
const { BrowserWindow, app } = require('electron')
let mainWindow = null
function createWindow () {
const windowOptions = {
width: 600,
height: 300,
title: 'Basic Notification',
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
}
mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadFile('index.html')
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.whenReady().then(() => {
createWindow()
})

View file

@ -1,14 +0,0 @@
const notification = {
title: 'Basic Notification',
body: 'Short message part'
}
const notificationButton = document.getElementById('basic-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})

View file

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<h3>Notification with image</h3>
<i>Supports: Win 7+, macOS, Linux (that supports libnotify)<span>|</span> Process: Renderer</i>
<div>
<div>
<button id="advanced-noti">View demo</button>
</div>
<p>This demo demonstrates an advanced notification. Both text and image.</p>
</div>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

View file

@ -1,26 +0,0 @@
const { BrowserWindow, app } = require('electron')
let mainWindow = null
function createWindow () {
const windowOptions = {
width: 600,
height: 300,
title: 'Advanced Notification',
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
}
mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadFile('index.html')
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.whenReady().then(() => {
createWindow()
})

View file

@ -1,14 +0,0 @@
const notification = {
title: 'Notification with image',
body: 'Short message plus a custom image',
icon: 'https://raw.githubusercontent.com/electron/electron-api-demos/v2.0.2/assets/img/programming.png'
}
const notificationButton = document.getElementById('advanced-noti')
notificationButton.addEventListener('click', () => {
const myNotification = new window.Notification(notification.title, notification)
myNotification.onclick = () => {
console.log('Notification clicked')
}
})

View file

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<div>
<h1>Create a frameless window</h1>
<em>Supports: Win, macOS, Linux <span>|</span> Process: Main</em>
<div>
<p>A frameless window is a window that has no <i>"chrome"</i>,
such as toolbars, title bars, status bars, borders, etc. You can make
a browser window frameless by setting
<code>frame</code> to <code>false</code> when creating the window.</p>
<div>
<button id="frameless-window">View Demo</button>
</div>
</div>
</div>
</div>
</body>
<script>
require('./renderer.js')
</script>
</html>

View file

@ -1,23 +0,0 @@
const { app, BrowserWindow, ipcMain } = require('electron')
ipcMain.on('create-frameless-window', (event, { url }) => {
const win = new BrowserWindow({ frame: false })
win.loadURL(url)
})
function createWindow () {
const mainWindow = new BrowserWindow({
width: 600,
height: 400,
title: 'Create a frameless window',
webPreferences: {
contextIsolation: false,
nodeIntegration: true
}
})
mainWindow.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
})

View file

@ -1,8 +0,0 @@
const { ipcRenderer } = require('electron')
const newWindowBtn = document.getElementById('frameless-window')
newWindowBtn.addEventListener('click', () => {
const url = 'data:text/html,<h2>Hello World!</h2><a id="close" href="javascript:window.close()">Close this Window</a>'
ipcRenderer.send('create-frameless-window', { url })
})