TheDesk modify

This commit is contained in:
cutls
2018-01-28 21:27:11 +09:00
parent 30132ca31d
commit 50e99f6a68
138 changed files with 0 additions and 0 deletions

115
app/node_modules/about-window/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const electron_1 = require("electron");
const fs_1 = require("fs");
const path = require("path");
let window = null;
function loadPackageJson(pkg_path) {
try {
return require(pkg_path);
}
catch (e) {
return null;
}
}
function detectPackageJson(specified_dir) {
if (specified_dir) {
const pkg = loadPackageJson(path.join(specified_dir, 'package.json'));
if (pkg !== null) {
return pkg;
}
else {
console.warn('about-window: package.json is not found in specified directory path: ' + specified_dir);
}
}
const app_name = electron_1.app.getName();
for (const mod_path of module.paths) {
if (!path.isAbsolute(mod_path)) {
continue;
}
const p = path.join(mod_path, '..', 'package.json');
try {
const stats = fs_1.statSync(p);
if (stats.isFile()) {
const pkg = loadPackageJson(p);
if (pkg !== null && pkg.productName === app_name) {
return pkg;
}
}
}
catch (e) {
}
}
return null;
}
function injectInfoFromPackageJson(info) {
const pkg = detectPackageJson(info.package_json_dir);
if (pkg === null) {
return info;
}
if (!info.description) {
info.description = pkg.description;
}
if (!info.license && pkg.license) {
const l = pkg.license;
info.license = typeof l === 'string' ? l : l.type;
}
if (!info.homepage) {
info.homepage = pkg.homepage;
}
if (!info.bug_report_url && typeof (pkg.bugs) === 'object') {
info.bug_report_url = pkg.bugs.url;
}
if (info.use_inner_html === undefined) {
info.use_inner_html = false;
}
return info;
}
function openAboutWindow(info) {
if (window !== null) {
window.focus();
return window;
}
const index_html = 'file://' + path.join(__dirname, '..', 'about.html');
const options = Object.assign({
width: 400,
height: 400,
useContentSize: true,
titleBarStyle: 'hidden-inset',
show: !info.adjust_window_size,
icon: info.icon_path,
}, info.win_options || {});
window = new (electron_1.BrowserWindow || electron_1.remote.BrowserWindow)(options);
window.once('closed', () => {
window = null;
});
window.loadURL(index_html);
window.webContents.on('will-navigate', (e, url) => {
e.preventDefault();
electron_1.shell.openExternal(url);
});
window.webContents.on('new-window', (e, url) => {
e.preventDefault();
electron_1.shell.openExternal(url);
});
window.webContents.once('dom-ready', () => {
delete info.win_options;
window.webContents.send('about-window:info', info);
if (info.open_devtools) {
if (process.versions.electron >= '1.4') {
window.webContents.openDevTools({ mode: 'detach' });
}
else {
window.webContents.openDevTools();
}
}
});
window.once('ready-to-show', () => {
window.show();
});
window.setMenu(null);
info = injectInfoFromPackageJson(info);
return window;
}
exports.default = openAboutWindow;
//# sourceMappingURL=index.js.map

1
app/node_modules/about-window/src/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAAA,uCAA2D;AAC3D,2BAA4B;AAC5B,6BAA6B;AAE7B,IAAI,MAAM,GAA2B,IAAI,CAAC;AAE1C,yBAAyB,QAAgB;IACrC,IAAI,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;AACL,CAAC;AAED,2BAA2B,aAAqB;IAC5C,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;QAChB,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;QACtE,EAAE,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,GAAG,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,uEAAuE,GAAG,aAAa,CAAC,CAAC;QAC1G,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,cAAG,CAAC,OAAO,EAAE,CAAC;IAE/B,GAAG,CAAC,CAAC,MAAM,QAAQ,IAAK,MAAc,CAAC,KAAK,CAAC,C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GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEvC,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAzDD,kCAyDC"}

134
app/node_modules/about-window/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,134 @@
import {app, BrowserWindow, remote, shell} from 'electron';
import {statSync} from 'fs';
import * as path from 'path';
let window: Electron.BrowserWindow = null;
function loadPackageJson(pkg_path: string): PackageJson {
try {
return require(pkg_path);
} catch (e) {
return null;
}
}
function detectPackageJson(specified_dir: string) {
if (specified_dir) {
const pkg = loadPackageJson(path.join(specified_dir, 'package.json'));
if (pkg !== null) {
return pkg;
} else {
console.warn('about-window: package.json is not found in specified directory path: ' + specified_dir);
}
}
const app_name = app.getName();
for (const mod_path of (module as any).paths) {
if (!path.isAbsolute(mod_path)) {
continue;
}
const p = path.join(mod_path, '..', 'package.json');
try {
const stats = statSync(p);
if (stats.isFile()) {
const pkg = loadPackageJson(p);
if (pkg !== null && pkg.productName === app_name) {
return pkg;
}
}
} catch (e) {
// File not found. Ignored.
}
}
// Note: Not found.
return null;
}
function injectInfoFromPackageJson(info: AboutWindowInfo) {
const pkg = detectPackageJson(info.package_json_dir);
if (pkg === null) {
// Note: Give up.
return info;
}
if (!info.description) {
info.description = pkg.description;
}
if (!info.license && pkg.license) {
const l = pkg.license;
info.license = typeof l === 'string' ? l : l.type;
}
if (!info.homepage) {
info.homepage = pkg.homepage;
}
if (!info.bug_report_url && typeof (pkg.bugs) === 'object') {
info.bug_report_url = pkg.bugs.url;
}
if (info.use_inner_html === undefined) {
info.use_inner_html = false;
}
return info;
}
export default function openAboutWindow(info: AboutWindowInfo) {
if (window !== null) {
window.focus();
return window;
}
const index_html = 'file://' + path.join(__dirname, '..', 'about.html');
const options = Object.assign(
{
width: 400,
height: 400,
useContentSize: true,
titleBarStyle: 'hidden-inset',
show: !info.adjust_window_size,
icon: info.icon_path,
},
info.win_options || {},
);
window = new (BrowserWindow || remote.BrowserWindow)(options);
window.once('closed', () => {
window = null;
});
window.loadURL(index_html);
window.webContents.on('will-navigate', (e, url) => {
e.preventDefault();
shell.openExternal(url);
});
window.webContents.on('new-window', (e, url) => {
e.preventDefault();
shell.openExternal(url);
});
window.webContents.once('dom-ready', () => {
delete info.win_options;
window.webContents.send('about-window:info', info);
if (info.open_devtools) {
if (process.versions.electron >= '1.4') {
window.webContents.openDevTools({mode: 'detach'});
} else {
window.webContents.openDevTools();
}
}
});
window.once('ready-to-show', () => {
window.show();
});
window.setMenu(null);
info = injectInfoFromPackageJson(info);
return window;
}

37
app/node_modules/about-window/src/lib.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
/// <reference types="electron" />
interface LicenseEntry {
type: string;
url: string;
}
interface PackageJson {
productName?: string;
description?: string;
homepage?: string;
license?: string | LicenseEntry;
bugs?: {
url: string;
};
}
interface AboutWindowInfo {
icon_path: string;
copyright?: string;
homepage?: string;
description?: string;
package_json_dir?: string;
license?: string;
bug_report_url?: string;
css_path?: string;
adjust_window_size?: boolean;
win_options?: Electron.BrowserWindowConstructorOptions;
open_devtools?: boolean;
use_inner_html?: boolean;
}
declare namespace NodeJS {
interface ProcessVersions {
[name: string]: string;
}
}

65
app/node_modules/about-window/src/renderer.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const electron_1 = require("electron");
electron_1.ipcRenderer.on('about-window:info', (_, info) => {
const app_name = electron_1.remote.app.getName();
const open_home = () => electron_1.shell.openExternal(info.homepage);
const content = info.use_inner_html ? 'innerHTML' : 'innerText';
document.title = `About ${app_name}`;
const title_elem = document.querySelector('.title');
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);
}
const copyright_elem = document.querySelector('.copyright');
if (info.copyright) {
copyright_elem[content] = info.copyright;
}
else if (info.license) {
copyright_elem[content] = `Distributed under ${info.license} license.`;
}
const icon_elem = document.getElementById('app-icon');
icon_elem.src = info.icon_path;
if (info.description) {
const desc_elem = document.querySelector('.description');
desc_elem[content] = info.description;
}
if (info.bug_report_url) {
const bug_report = document.querySelector('.bug-report-link');
bug_report.innerText = 'found bug?';
bug_report.addEventListener('click', e => {
e.preventDefault();
electron_1.shell.openExternal(info.bug_report_url);
});
}
if (info.css_path) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = info.css_path;
document.head.appendChild(link);
}
if (info.adjust_window_size) {
const height = document.body.scrollHeight;
const width = document.body.scrollWidth;
const win = electron_1.remote.getCurrentWindow();
if (height > 0 && width > 0) {
win.setContentSize(width, height + 40);
}
}
});
const versions = document.querySelector('.versions');
const vs = process.versions;
for (const name of ['electron', 'chrome', 'node', 'v8']) {
const tr = document.createElement('tr');
const name_td = document.createElement('td');
name_td.innerText = name;
tr.appendChild(name_td);
const version_td = document.createElement('td');
version_td.innerText = ' : ' + vs[name];
tr.appendChild(version_td);
versions.appendChild(tr);
}
//# sourceMappingURL=renderer.js.map

1
app/node_modules/about-window/src/renderer.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["renderer.ts"],"names":[],"mappings":";;AAAA,uCAAoD;AAEpD,sBAAW,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,CAAM,EAAE,IAAqB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,iBAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,gBAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAChE,QAAQ,CAAC,KAAK,GAAG,SAAS,QAAQ,EAAE,CAAC;IAErC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAuB,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AG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IACzB,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACxB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChD,UAAU,CAAC,SAAS,GAAG,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC"}

73
app/node_modules/about-window/src/renderer.ts generated vendored Normal file
View File

@@ -0,0 +1,73 @@
import {ipcRenderer, remote, shell} from 'electron';
ipcRenderer.on('about-window:info', (_: any, info: AboutWindowInfo) => {
const app_name = remote.app.getName();
const open_home = () => shell.openExternal(info.homepage);
const content = info.use_inner_html ? 'innerHTML' : 'innerText';
document.title = `About ${app_name}`;
const title_elem = document.querySelector('.title') as HTMLHeadingElement;
title_elem.innerText = `${app_name} ${remote.app.getVersion()}`;
title_elem.addEventListener('click', open_home);
if (info.homepage) {
document
.querySelector('.logo')
.addEventListener('click', open_home);
}
const copyright_elem = document.querySelector('.copyright') as any;
if (info.copyright) {
copyright_elem[content] = info.copyright;
} else if (info.license) {
copyright_elem[content] = `Distributed under ${info.license} license.`;
}
const icon_elem = document.getElementById('app-icon') as HTMLImageElement;
icon_elem.src = info.icon_path;
if (info.description) {
const desc_elem = document.querySelector('.description') as any;
desc_elem[content] = info.description;
}
if (info.bug_report_url) {
const bug_report = document.querySelector('.bug-report-link') as HTMLDivElement;
bug_report.innerText = 'found bug?';
bug_report.addEventListener('click', e => {
e.preventDefault();
shell.openExternal(info.bug_report_url);
});
}
if (info.css_path) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = info.css_path;
document.head.appendChild(link);
}
if (info.adjust_window_size) {
const height = document.body.scrollHeight;
const width = document.body.scrollWidth;
const win = remote.getCurrentWindow();
if (height > 0 && width > 0) {
// Note:
// Add 30px(= about 2em) to add padding in window
win.setContentSize(width, height + 40);
}
}
});
const versions = document.querySelector('.versions');
const vs = process.versions;
for (const name of ['electron', 'chrome', 'node', 'v8']) {
const tr = document.createElement('tr');
const name_td = document.createElement('td');
name_td.innerText = name;
tr.appendChild(name_td);
const version_td = document.createElement('td');
version_td.innerText = ' : ' + vs[name];
tr.appendChild(version_td);
versions.appendChild(tr);
}

20
app/node_modules/about-window/src/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"preserveConstEnums": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmitOnError": true,
"strictNullChecks": false,
"target": "es2015",
"sourceMap": true
},
"include": [
"**/*.ts"
]
}