From c4d417b6f69624828b4a109312aa718c7b54c238 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 10 Aug 2023 10:52:52 +0200 Subject: [PATCH] docs: remove duplicate fiddles (#39419) --- .../basic-notification/index.html | 22 ---------------- .../notifications/basic-notification/main.js | 26 ------------------- .../basic-notification/renderer.js | 14 ---------- .../notification-with-image/index.html | 22 ---------------- .../notification-with-image/main.js | 26 ------------------- .../notification-with-image/renderer.js | 14 ---------- .../create-frameless-window/index.html | 26 ------------------- .../create-frameless-window/main.js | 23 ---------------- .../create-frameless-window/renderer.js | 8 ------ 9 files changed, 181 deletions(-) delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/index.html delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/main.js delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/renderer.js delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/index.html delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/main.js delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/renderer.js delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/index.html delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/main.js delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js diff --git a/docs/fiddles/native-ui/notifications/basic-notification/index.html b/docs/fiddles/native-ui/notifications/basic-notification/index.html deleted file mode 100644 index e4a440c0eb99..000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
-

Basic notification

- Supports: Win 7+, macOS, Linux (that supports libnotify)| Process: Renderer -
-
- -
-

This demo demonstrates a basic notification. Text only.

-
-
- - - diff --git a/docs/fiddles/native-ui/notifications/basic-notification/main.js b/docs/fiddles/native-ui/notifications/basic-notification/main.js deleted file mode 100644 index 501299afb710..000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/main.js +++ /dev/null @@ -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() -}) diff --git a/docs/fiddles/native-ui/notifications/basic-notification/renderer.js b/docs/fiddles/native-ui/notifications/basic-notification/renderer.js deleted file mode 100644 index a46583c683de..000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/renderer.js +++ /dev/null @@ -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') - } -}) diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/index.html b/docs/fiddles/native-ui/notifications/notification-with-image/index.html deleted file mode 100644 index 5b9df4e78ecb..000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
-

Notification with image

- Supports: Win 7+, macOS, Linux (that supports libnotify)| Process: Renderer -
-
- -
-

This demo demonstrates an advanced notification. Both text and image.

-
-
- - - diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/main.js b/docs/fiddles/native-ui/notifications/notification-with-image/main.js deleted file mode 100644 index 1b2de53aeb46..000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/main.js +++ /dev/null @@ -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() -}) diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js b/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js deleted file mode 100644 index 84c43d2e111b..000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js +++ /dev/null @@ -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') - } -}) diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/index.html b/docs/fiddles/windows/manage-windows/create-frameless-window/index.html deleted file mode 100644 index f4fd84e3428e..000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -
-
-

Create a frameless window

- Supports: Win, macOS, Linux | Process: Main -
-

A frameless window is a window that has no "chrome", - such as toolbars, title bars, status bars, borders, etc. You can make - a browser window frameless by setting - frame to false when creating the window.

-
- -
-
-
-
- - - diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/main.js b/docs/fiddles/windows/manage-windows/create-frameless-window/main.js deleted file mode 100644 index c5685f97d3bf..000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/main.js +++ /dev/null @@ -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() -}) diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js b/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js deleted file mode 100644 index 21f91ad561b3..000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js +++ /dev/null @@ -1,8 +0,0 @@ -const { ipcRenderer } = require('electron') - -const newWindowBtn = document.getElementById('frameless-window') - -newWindowBtn.addEventListener('click', () => { - const url = 'data:text/html,

Hello World!

Close this Window' - ipcRenderer.send('create-frameless-window', { url }) -})