forked from enviPath/enviPy
Current Dev State
This commit is contained in:
47
static/js/ketcher2/node_modules/opener/LICENSE.txt
generated
vendored
Normal file
47
static/js/ketcher2/node_modules/opener/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
Dual licensed under WTFPL and MIT:
|
||||
|
||||
---
|
||||
|
||||
Copyright © 2012–2016 Domenic Denicola <d@domenic.me>
|
||||
|
||||
This work is free. You can redistribute it and/or modify it under the
|
||||
terms of the Do What The Fuck You Want To Public License, Version 2,
|
||||
as published by Sam Hocevar. See below for more details.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
---
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2012–2016 Domenic Denicola <d@domenic.me>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
57
static/js/ketcher2/node_modules/opener/README.md
generated
vendored
Normal file
57
static/js/ketcher2/node_modules/opener/README.md
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
# It Opens Stuff
|
||||
|
||||
That is, in your desktop environment. This will make *actual windows pop up*, with stuff in them:
|
||||
|
||||
```bash
|
||||
npm install opener -g
|
||||
|
||||
opener http://google.com
|
||||
opener ./my-file.txt
|
||||
opener firefox
|
||||
opener npm run lint
|
||||
```
|
||||
|
||||
Also if you want to use it programmatically you can do that too:
|
||||
|
||||
```js
|
||||
var opener = require("opener");
|
||||
|
||||
opener("http://google.com");
|
||||
opener("./my-file.txt");
|
||||
opener("firefox");
|
||||
opener("npm run lint");
|
||||
```
|
||||
|
||||
Plus, it returns the child process created, so you can do things like let your script exit while the window stays open:
|
||||
|
||||
```js
|
||||
var editor = opener("documentation.odt");
|
||||
editor.unref();
|
||||
// These other unrefs may be necessary if your OS's opener process
|
||||
// exits before the process it started is complete.
|
||||
editor.stdin.unref();
|
||||
editor.stdout.unref();
|
||||
editor.stderr.unref();
|
||||
```
|
||||
|
||||
|
||||
## Use It for Good
|
||||
|
||||
Like opening the user's browser with a test harness in your package's test script:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"test": "opener ./test/runner.html"
|
||||
},
|
||||
"devDependencies": {
|
||||
"opener": "*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Why
|
||||
|
||||
Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least
|
||||
[according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all
|
||||
three. Like Node.js. And Opener.
|
||||
60
static/js/ketcher2/node_modules/opener/opener.js
generated
vendored
Executable file
60
static/js/ketcher2/node_modules/opener/opener.js
generated
vendored
Executable file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
var childProcess = require("child_process");
|
||||
|
||||
function opener(args, options, callback) {
|
||||
// http://stackoverflow.com/q/1480971/3191, but see below for Windows.
|
||||
var command = process.platform === "win32" ? "cmd" :
|
||||
process.platform === "darwin" ? "open" :
|
||||
"xdg-open";
|
||||
|
||||
if (typeof args === "string") {
|
||||
args = [args];
|
||||
}
|
||||
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (options && typeof options === "object" && options.command) {
|
||||
if (process.platform === "win32") {
|
||||
// *always* use cmd on windows
|
||||
args = [options.command].concat(args);
|
||||
} else {
|
||||
command = options.command;
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and
|
||||
// escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the
|
||||
// responsibility to "cmd /c", which has that logic built in.
|
||||
//
|
||||
// Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title,
|
||||
// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191
|
||||
//
|
||||
// Additionally, on Windows ampersand needs to be escaped when passed to "start"
|
||||
args = args.map(function(value) {
|
||||
return value.replace(/&/g, '^&');
|
||||
});
|
||||
args = ["/c", "start", '""'].concat(args);
|
||||
}
|
||||
|
||||
return childProcess.execFile(command, args, options, callback);
|
||||
}
|
||||
|
||||
// Export `opener` for programmatic access.
|
||||
// You might use this to e.g. open a website: `opener("http://google.com")`
|
||||
module.exports = opener;
|
||||
|
||||
// If we're being called from the command line, just execute, using the command-line arguments.
|
||||
if (require.main && require.main.id === module.id) {
|
||||
opener(process.argv.slice(2), function (error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
}
|
||||
57
static/js/ketcher2/node_modules/opener/package.json
generated
vendored
Normal file
57
static/js/ketcher2/node_modules/opener/package.json
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"_from": "opener@^1.4.1",
|
||||
"_id": "opener@1.4.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=",
|
||||
"_location": "/opener",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "opener@^1.4.1",
|
||||
"name": "opener",
|
||||
"escapedName": "opener",
|
||||
"rawSpec": "^1.4.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.4.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/tap"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz",
|
||||
"_shasum": "5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8",
|
||||
"_spec": "opener@^1.4.1",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/tap",
|
||||
"author": {
|
||||
"name": "Domenic Denicola",
|
||||
"email": "d@domenic.me",
|
||||
"url": "https://domenic.me/"
|
||||
},
|
||||
"bin": {
|
||||
"opener": "opener.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/domenic/opener/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Opens stuff, like webpages and files and executables, cross-platform",
|
||||
"devDependencies": {
|
||||
"jshint": "^2.6.3"
|
||||
},
|
||||
"files": [
|
||||
"opener.js"
|
||||
],
|
||||
"homepage": "https://github.com/domenic/opener#readme",
|
||||
"license": "(WTFPL OR MIT)",
|
||||
"main": "opener.js",
|
||||
"name": "opener",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/domenic/opener.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "jshint opener.js"
|
||||
},
|
||||
"version": "1.4.3"
|
||||
}
|
||||
Reference in New Issue
Block a user