Commit ba81af1e authored by 神楽坂玲奈's avatar 神楽坂玲奈

target es6

parent 0a5ddc82
import {Component, Renderer} from "@angular/core";
import {TranslateService} from "ng2-translate";
import {remote} from "electron";
import {LoginService} from "./login.service";
@Component({
selector: 'mycard',
......@@ -14,7 +15,7 @@ export class MyCardComponent {
platform = process.platform;
constructor(private renderer: Renderer, private translate: TranslateService) {
constructor(private renderer: Renderer, private translate: TranslateService, private loginService: LoginService) {
renderer.listenGlobal('window', 'message', (event) => {
console.log(event);
// Do something with 'event'
......
......@@ -149,10 +149,10 @@ export class YGOProComponent implements OnInit {
fix_fonts = (data) => {
return this.get_font([data.numfont])
.catch(() => this.get_font(this.numfont[process.platform]).then(font => data['numfont'] = font))
.catch()
.catch(null)
.then(() => this.get_font([data.textfont.split(' ', 2)[0]]))
.catch(() => this.get_font(this.textfont[process.platform]).then(font => data['textfont'] = `${font} 14`))
.catch()
.catch(null)
.then(() => data)
};
......
......@@ -2,28 +2,27 @@
/**
* Created by weijian on 2016/10/27.
*/
var Rx = require("rxjs/Rx");
var ipcMain = require('electron').ipcMain;
var child_process_1 = require("child_process");
const Rx = require("rxjs/Rx");
const {ipcMain} = require('electron');
const child_process_1 = require("child_process");
// import * as Aria2 from "aria2";
var Aria2 = require("aria2");
var a = (createProcess("D:/Github/mycard/bin/aria2c.exe", ['--enable-rpc', '--rpc-allow-origin-all', "--continue", "--split=10", "--min-split-size=1M", "--max-connection-per-server=10"]));
a.on('error', function (error) {
const Aria2 = require("aria2");
let a = (createProcess("D:/Github/mycard/bin/aria2c.exe", ['--enable-rpc', '--rpc-allow-origin-all', "--continue", "--split=10", "--min-split-size=1M", "--max-connection-per-server=10"]));
a.on('error', (error) => {
console.log(error);
});
// console.log(Aria2,2);
function createProcess(aria2c_path, args) {
if (args === void 0) { args = []; }
function createProcess(aria2c_path, args = []) {
return child_process_1.spawn(aria2c_path, args);
}
var options = { 'host': 'localhost', 'port': 6800, 'secure': false };
var aria2 = new Aria2(options);
aria2.onDownloadComplete = function (response) {
let options = {'host': 'localhost', 'port': 6800, 'secure': false};
let aria2 = new Aria2(options);
aria2.onDownloadComplete = (response) => {
console.log(response);
};
var open = aria2.open();
let open = aria2.open();
function addUri(uri, path) {
return open.then(function () {
return open.then(() => {
return aria2.addUri(uri, { 'dir': path });
});
}
......
{"version":3,"file":"aria2.js","sourceRoot":"","sources":["aria2.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,IAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACvB,yCAAO,CAAuB;AACrC,8BAAkC,eAAe,CAAC,CAAA;AAClD,kCAAkC;AAClC,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,iCAAiC,EAAE,CAAC,cAAc,EAAE,wBAAwB,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAA;AAC3L,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AACH,wBAAwB;AACxB,uBAAuB,WAAmB,EAAE,IAAmB;IAAnB,oBAAmB,GAAnB,SAAmB;IAC3D,MAAM,CAAC,qBAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,IAAI,OAAO,GAAG,EAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAA;AAClE,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAE/B,KAAK,CAAC,kBAAkB,GAAG,UAAC,QAAQ;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;AACxB,gBAAgB,GA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AAC,OAAO,CAAC,CAAC;AAE/B,KAAK,CAAC,kBAAkB,GAAG,CAAC,QAAQ;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;AACxB,gBAAgB,GAAa,EAAE,IAAY;IACvC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACP,CAAC;AACD,eAAe,GAAW;IACtB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAED;IACI,KAAK,CAAC,UAAU,EAAE,CAAA;AACtB,CAAC;AAED,cAAc"
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* Adjust as necessary for your application needs.
*/
// map tells the System loader where to look for things
var map = {
var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
......@@ -11,47 +11,50 @@
'ng2-translate': 'node_modules/ng2-translate/bundles/index.js',
"electron": "@node/electron",
"ini": "@node/ini",
"mkdirp": "@node/mkdirp",
"aria2": "@node/aria2",
"electron-sudo": "@node/electron-sudo"
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': {main: 'main.js', defaultExtension: 'js'},
'rxjs': {defaultExtension: 'js'},
'angular2-in-memory-web-api': {main: 'index.js', defaultExtension: 'js'}
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': {main: 'main.js', defaultExtension: 'js'},
'rxjs': {defaultExtension: 'js'},
'angular2-in-memory-web-api': {main: 'index.js', defaultExtension: 'js'}
};
let builtin_modules = ["buffer", "querystring", "events", "http", "cluster", "zlib", "os", "https", "punycode", "repl", "readline", "vm", "child_process", "url", "dns", "net", "dgram", "fs", "path", "string_decoder", "tls", "crypto", "stream", "util", "assert", "tty", "domain", "constants", "process", "v8", "timers", "console"];
for (let mod of builtin_modules) {
map[mod] = `@node/${mod}`;
}
var ngPackageNames = [
'common',
'compiler',
'core',
'forms',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade',
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/' + pkgName] = {main: 'index.js', defaultExtension: 'js'};
}
var ngPackageNames = [
'common',
'compiler',
'core',
'forms',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade',
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/' + pkgName] = {main: 'index.js', defaultExtension: 'js'};
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/' + pkgName] = {main: 'bundles/' + pkgName + '.umd.js', defaultExtension: 'js'};
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/' + pkgName] = {main: 'bundles/' + pkgName + '.umd.js', defaultExtension: 'js'};
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
map: map,
packages: packages
};
System.config(config);
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
map: map,
packages: packages
};
System.config(config);
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"lib": [
"dom",
"es2016"
],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
......
{
"globalDependencies": {
"core-js": "registry:dt/core-js",
"electron/github-electron": "registry:dt/electron/github-electron",
"ini": "registry:dt/ini",
"jasmine": "registry:dt/jasmine",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment