From: Neko7sora <75793267+Neko7sora@users.noreply.github.com> Date: Thu, 6 May 2021 12:54:57 +0000 (+0900) Subject: README訂正 X-Git-Url: http://git.osdn.net/view?p=commentgenerator-electron%2FCommentGenerator-Electron.git;a=commitdiff_plain;h=8cb8edc84614f41892117374937d35d0e6f4ad7a README訂正 --- diff --git a/README.md b/README.md index 1b66f8f..ba2f33d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ HTML5コメントジェネレーター(Re) ## プログラム作成条件 1. HTML5コメントジェネレーター、HTML5コメントジェネレーター改に、 - **「なるべく、相互性のあるものにする」** + **「なるべく、互換性のあるものにする」** なるべくだから100%ではなくてもいいよ!! diff --git a/src/main.js b/src/main.js index c7bfdbb..0b15778 100644 --- a/src/main.js +++ b/src/main.js @@ -1,20 +1,20 @@ /* #Node.js */ //アプリケーションを制御し、ネイティブなブラウザウィンドウを作成するモジュール -const { app, BrowserWindow, Notification } = require('electron') +const { app, BrowserWindow, Notification, globalShortcut } = require('electron') const path = require('path') +let window function createWindow() { //ブラウザウィンドウを作成します。 - const win = new BrowserWindow({ + window = new BrowserWindow({ width: 800, height: 600, webPreferences: { preload: path.join(__dirname, 'preload.js') } }) - //アプリのindex.htmlを読み込みます。 - win.loadFile('index.html') + window.loadFile('index.html') } function showNotification() { @@ -29,19 +29,54 @@ function showNotification() { // このメソッドは、Electronが初期化を終え、ブラウザウィンドウを作成する準備ができたときに呼び出されます。 // 初期化が完了し、ブラウザウィンドウを作成する準備ができたときに呼び出されます。 // いくつかのAPIは、このイベントが発生した後にのみ使用できます。 -app.whenReady().then(() => { +app.whenReady().then(() => {/* + globalShortcut.register('CommandOrControl+Shift+I', () => { + console.log('Devtool Block') + })//*/ +}).then(() => { createWindow()// <-- function createWindow のやつを動かす。 + window.setProgressBar(0.555555555555,{mode:"paused"}) + setTimeout(() => { + window.setProgressBar(0) + setTimeout(() => { + window.setProgressBar(0.2) + setTimeout(() => { + window.setProgressBar(0.25) + setTimeout(() => { + window.setProgressBar(0.3,{mode:"error"}) + setTimeout(() => { + window.setProgressBar(0.9) + setTimeout(() => { + window.setProgressBar(0.99) + setTimeout(() => { + window.setProgressBar(1) + setTimeout(() => { + window.setProgressBar(-1) + setTimeout(() => { + window.setProgressBar(2) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + }, 2000) + // このリスナーは、アプリケーションが起動した後に動きます。 app.on('activate', () => { - // 表示されているウィンドウがないときにのみ動きます。 + // 表示されているウィンドウがないときにのみ動きます。(バックグラウンド処理など) + /* if (BrowserWindow.getAllWindows().length === 0) { // 新しいブラウザウィンドウを作成します。 createWindow() } - + //*/ }) + }).then(() => { showNotification() }) diff --git a/src/plugin/OnlineStatus/renderer.js b/src/plugin/OnlineStatus/renderer.js new file mode 100644 index 0000000..6a30184 --- /dev/null +++ b/src/plugin/OnlineStatus/renderer.js @@ -0,0 +1,7 @@ +/* #electron */ +const alertOnlineStatus = navigator.onLine ? 'online' : 'offline' + +new Notification('[ステータス] オンライン = インターネットに接続されています。', alertOnlineStatus) +new Notification('[ステータス] オフライン = インターネットに接続されていません。', alertOnlineStatus) + +alertOnlineStatus() \ No newline at end of file diff --git a/src/renderer.js b/src/renderer.js index fa7853f..92795d2 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -1,9 +1,11 @@ /* #electron */ // 通知のやつ +/* const myNotification = new Notification('Title', { body: 'Notification from the Renderer process' }) myNotification.onclick = () => { console.log('Notification clicked') - } \ No newline at end of file + } +*/ \ No newline at end of file