electron-about-window
Advanced tools
Comparing version 1.8.0 to 1.9.1
@@ -7,2 +7,3 @@ /// <reference types="electron" /> | ||
bug_report_url?: string; | ||
bug_link_text?: string; | ||
copyright?: string; | ||
@@ -9,0 +10,0 @@ homepage?: string; |
{ | ||
"name": "electron-about-window", | ||
"version": "1.8.0", | ||
"version": "1.9.1", | ||
"description": "'About App' window for Electron application", | ||
@@ -8,5 +8,5 @@ "main": "src/index.js", | ||
"dep": "npm install", | ||
"build": "tsc -p src/", | ||
"tslint": "tslint $(git ls-files | grep -E \"\\.ts$\")", | ||
"tslint": "tslint -p ./src --type-check", | ||
"build": "tsc --pretty -p src/", | ||
"watch": "tsc --watch --pretty -p src/", | ||
"tslint": "tslint -p ./src", | ||
"stylelint": "stylelint styles/*.css", | ||
@@ -36,10 +36,10 @@ "lint": "npm run tslint && npm run stylelint", | ||
"devDependencies": { | ||
"@types/node": "^8.0.24", | ||
"electron": "^1.7.5", | ||
"stylelint": "^8.0.0", | ||
"stylelint-config-standard": "^17.0.0", | ||
"tslint": "^5.6.0", | ||
"typescript": "^2.4.2" | ||
"@types/node": "^9.4.0", | ||
"electron": "^1.7.11", | ||
"stylelint": "^8.4.0", | ||
"stylelint-config-standard": "^18.0.0", | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.6.2" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -31,2 +31,3 @@ 'About This App' Window for [Electron](https://github.com/atom/electron) Apps | ||
bug_report_url?: string; | ||
bug_link_text?: string; | ||
copyright?: string; | ||
@@ -78,4 +79,5 @@ homepage?: string; | ||
| `adjust_window_size` | Adjust the window size to its content not to show scroll bar. **Optional** | boolean | | ||
| `open_devtools` | For debug purpose, Chrome DevTools will start when the window is opened **Optional** | boolean | | ||
| `use_inner_html` | If `true`, set the value with `.innerHTML` on copyright, license and description Default is `false` **Optional** | boolean | | ||
| `open_devtools` | For debug purpose, Chrome DevTools will start when the window is opened. **Optional** | boolean | | ||
| `use_inner_html` | If `true`, set the value with `.innerHTML` on copyright, license and description Default is `false`. **Optional** | boolean | | ||
| `bug_link_text` | Text for a bug report link. **Optional** | string | | ||
@@ -82,0 +84,0 @@ **Note:** If you set `use_inner_html` to `true`, please ensure that contents don't contain any untrusted external input |
@@ -60,3 +60,3 @@ "use strict"; | ||
} | ||
if (!info.bug_report_url && typeof (pkg.bugs) === 'object') { | ||
if (!info.bug_report_url && typeof pkg.bugs === 'object') { | ||
info.bug_report_url = pkg.bugs.url; | ||
@@ -63,0 +63,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import {app, BrowserWindow, remote, shell} from 'electron'; | ||
import {statSync} from 'fs'; | ||
import { app, BrowserWindow, remote, shell } from 'electron'; | ||
import { statSync } from 'fs'; | ||
import * as path from 'path'; | ||
@@ -67,3 +67,3 @@ | ||
} | ||
if (!info.bug_report_url && typeof (pkg.bugs) === 'object') { | ||
if (!info.bug_report_url && typeof pkg.bugs === 'object') { | ||
info.bug_report_url = pkg.bugs.url; | ||
@@ -119,3 +119,3 @@ } | ||
if (process.versions.electron >= '1.4') { | ||
window.webContents.openDevTools({mode: 'detach'}); | ||
window.webContents.openDevTools({ mode: 'detach' }); | ||
} else { | ||
@@ -122,0 +122,0 @@ window.webContents.openDevTools(); |
@@ -31,2 +31,3 @@ /// <reference types="electron" /> | ||
use_inner_html?: boolean; | ||
bug_link_text?: string; | ||
} | ||
@@ -33,0 +34,0 @@ |
@@ -11,7 +11,8 @@ "use strict"; | ||
title_elem.innerText = `${app_name} ${electron_1.remote.app.getVersion()}`; | ||
title_elem.addEventListener('click', open_home); | ||
if (info.homepage) { | ||
document | ||
.querySelector('.logo') | ||
.addEventListener('click', open_home); | ||
title_elem.addEventListener('click', open_home); | ||
title_elem.classList.add('clickable'); | ||
const logo_elem = document.querySelector('.logo'); | ||
logo_elem.addEventListener('click', open_home); | ||
logo_elem.classList.add('clickable'); | ||
} | ||
@@ -33,3 +34,3 @@ const copyright_elem = document.querySelector('.copyright'); | ||
const bug_report = document.querySelector('.bug-report-link'); | ||
bug_report.innerText = 'found bug?'; | ||
bug_report.innerText = info.bug_link_text || 'Report an issue'; | ||
bug_report.addEventListener('click', e => { | ||
@@ -36,0 +37,0 @@ e.preventDefault(); |
@@ -1,2 +0,2 @@ | ||
import {ipcRenderer, remote, shell} from 'electron'; | ||
import { ipcRenderer, remote, shell } from 'electron'; | ||
@@ -11,8 +11,9 @@ ipcRenderer.on('about-window:info', (_: any, info: AboutWindowInfo) => { | ||
title_elem.innerText = `${app_name} ${remote.app.getVersion()}`; | ||
title_elem.addEventListener('click', open_home); | ||
if (info.homepage) { | ||
document | ||
.querySelector('.logo') | ||
.addEventListener('click', open_home); | ||
title_elem.addEventListener('click', open_home); | ||
title_elem.classList.add('clickable'); | ||
const logo_elem = document.querySelector('.logo'); | ||
logo_elem.addEventListener('click', open_home); | ||
logo_elem.classList.add('clickable'); | ||
} | ||
@@ -37,3 +38,3 @@ | ||
const bug_report = document.querySelector('.bug-report-link') as HTMLDivElement; | ||
bug_report.innerText = 'found bug?'; | ||
bug_report.innerText = info.bug_link_text || 'Report an issue'; | ||
bug_report.addEventListener('click', e => { | ||
@@ -40,0 +41,0 @@ e.preventDefault(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32410
611
103
16