eslint quality changes
This commit is contained in:
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "airbnb-base"
|
||||
}
|
||||
654
package-lock.json
generated
654
package-lock.json
generated
@@ -1951,11 +1951,26 @@
|
||||
"resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz",
|
||||
"integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc="
|
||||
},
|
||||
"caller-path": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
|
||||
"integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"callsites": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"callsite": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
|
||||
"integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA="
|
||||
},
|
||||
"callsites": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
|
||||
"integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
|
||||
"dev": true
|
||||
},
|
||||
"camel-case": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
|
||||
@@ -2472,6 +2487,12 @@
|
||||
"resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
|
||||
"integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U="
|
||||
},
|
||||
"contains-path": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
|
||||
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
|
||||
"dev": true
|
||||
},
|
||||
"content-disposition": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
|
||||
@@ -3087,6 +3108,15 @@
|
||||
"buffer-indexof": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"doctrine": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esutils": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"dom-converter": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.1.4.tgz",
|
||||
@@ -3526,6 +3556,356 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint": {
|
||||
"version": "4.19.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
|
||||
"integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^5.3.0",
|
||||
"babel-code-frame": "^6.22.0",
|
||||
"chalk": "^2.1.0",
|
||||
"concat-stream": "^1.6.0",
|
||||
"cross-spawn": "^5.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"doctrine": "^2.1.0",
|
||||
"eslint-scope": "^3.7.1",
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"espree": "^3.5.4",
|
||||
"esquery": "^1.0.0",
|
||||
"esutils": "^2.0.2",
|
||||
"file-entry-cache": "^2.0.0",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"glob": "^7.1.2",
|
||||
"globals": "^11.0.1",
|
||||
"ignore": "^3.3.3",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^3.0.6",
|
||||
"is-resolvable": "^1.0.0",
|
||||
"js-yaml": "^3.9.1",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.3.0",
|
||||
"lodash": "^4.17.4",
|
||||
"minimatch": "^3.0.2",
|
||||
"mkdirp": "^0.5.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.8.2",
|
||||
"path-is-inside": "^1.0.2",
|
||||
"pluralize": "^7.0.0",
|
||||
"progress": "^2.0.0",
|
||||
"regexpp": "^1.0.1",
|
||||
"require-uncached": "^1.0.3",
|
||||
"semver": "^5.3.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"strip-json-comments": "~2.0.1",
|
||||
"table": "4.0.2",
|
||||
"text-table": "~0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "5.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
|
||||
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"co": "^4.6.0",
|
||||
"fast-deep-equal": "^1.0.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.3.0"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
|
||||
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"chardet": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
|
||||
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
|
||||
"dev": true
|
||||
},
|
||||
"concat-stream": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
|
||||
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^2.2.2",
|
||||
"typedarray": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
||||
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^4.0.1",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"external-editor": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
|
||||
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chardet": "^0.4.0",
|
||||
"iconv-lite": "^0.4.17",
|
||||
"tmp": "^0.0.33"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
"version": "11.7.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
|
||||
"integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==",
|
||||
"dev": true
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
|
||||
"integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-escapes": "^3.0.0",
|
||||
"chalk": "^2.0.0",
|
||||
"cli-cursor": "^2.1.0",
|
||||
"cli-width": "^2.0.0",
|
||||
"external-editor": "^2.0.4",
|
||||
"figures": "^2.0.0",
|
||||
"lodash": "^4.3.0",
|
||||
"mute-stream": "0.0.7",
|
||||
"run-async": "^2.2.0",
|
||||
"rx-lite": "^4.0.8",
|
||||
"rx-lite-aggregates": "^4.0.8",
|
||||
"string-width": "^2.1.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"through": "^2.3.6"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
|
||||
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-config-airbnb-base": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.0.0.tgz",
|
||||
"integrity": "sha512-hUFXRlE6AY84z0qYh4wKdtSF4EqDnyT8sxrvTpcXCV4ENSLF8li5yNA1yDM26iinH8Ierbpc4lv8Rp62uX6VSQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"eslint-restricted-globals": "^0.1.1",
|
||||
"object.assign": "^4.1.0",
|
||||
"object.entries": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"eslint-import-resolver-node": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
|
||||
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^2.6.9",
|
||||
"resolve": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"eslint-module-utils": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz",
|
||||
"integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^2.6.8",
|
||||
"pkg-dir": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"pkg-dir": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
|
||||
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-plugin-import": {
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.13.0.tgz",
|
||||
"integrity": "sha512-t6hGKQDMIt9N8R7vLepsYXgDfeuhp6ZJSgtrLEDxonpSubyxUZHjhm6LsAaZX8q6GYVxkbT3kTsV9G5mBCFR6A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"contains-path": "^0.1.0",
|
||||
"debug": "^2.6.8",
|
||||
"doctrine": "1.5.0",
|
||||
"eslint-import-resolver-node": "^0.3.1",
|
||||
"eslint-module-utils": "^2.2.0",
|
||||
"has": "^1.0.1",
|
||||
"lodash": "^4.17.4",
|
||||
"minimatch": "^3.0.3",
|
||||
"read-pkg-up": "^2.0.0",
|
||||
"resolve": "^1.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"doctrine": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
|
||||
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esutils": "^2.0.2",
|
||||
"isarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"find-up": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
|
||||
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||
"dev": true
|
||||
},
|
||||
"load-json-file": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
|
||||
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"parse-json": "^2.2.0",
|
||||
"pify": "^2.0.0",
|
||||
"strip-bom": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
|
||||
"dev": true
|
||||
},
|
||||
"path-type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
|
||||
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"pify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"read-pkg": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
|
||||
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"load-json-file": "^2.0.0",
|
||||
"normalize-package-data": "^2.3.2",
|
||||
"path-type": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"read-pkg-up": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
|
||||
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^2.0.0",
|
||||
"read-pkg": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"strip-bom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-restricted-globals": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz",
|
||||
"integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
|
||||
@@ -3535,11 +3915,36 @@
|
||||
"estraverse": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"eslint-visitor-keys": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
|
||||
"integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
|
||||
"dev": true
|
||||
},
|
||||
"espree": {
|
||||
"version": "3.5.4",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
|
||||
"integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "^5.5.0",
|
||||
"acorn-jsx": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"esprima": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
|
||||
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw=="
|
||||
},
|
||||
"esquery": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
|
||||
"integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estraverse": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"esrecurse": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
|
||||
@@ -3955,6 +4360,16 @@
|
||||
"escape-string-regexp": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"file-entry-cache": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz",
|
||||
"integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flat-cache": "^1.2.1",
|
||||
"object-assign": "^4.0.1"
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
@@ -4306,6 +4721,26 @@
|
||||
"resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz",
|
||||
"integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c="
|
||||
},
|
||||
"flat-cache": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
|
||||
"integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"circular-json": "^0.3.1",
|
||||
"del": "^2.0.2",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"write": "^0.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"circular-json": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
|
||||
"integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"flush-write-stream": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz",
|
||||
@@ -5014,6 +5449,12 @@
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"functional-red-black-tree": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
|
||||
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
|
||||
"dev": true
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
@@ -6647,6 +7088,12 @@
|
||||
"resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
|
||||
"integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE="
|
||||
},
|
||||
"ignore": {
|
||||
"version": "3.3.10",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
|
||||
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
|
||||
"dev": true
|
||||
},
|
||||
"immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
@@ -7157,6 +7604,12 @@
|
||||
"is-unc-path": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"is-resolvable": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
|
||||
"integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
|
||||
"dev": true
|
||||
},
|
||||
"is-retry-allowed": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz",
|
||||
@@ -7522,6 +7975,12 @@
|
||||
"jsonify": "~0.0.0"
|
||||
}
|
||||
},
|
||||
"json-stable-stringify-without-jsonify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
|
||||
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
|
||||
"dev": true
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
||||
@@ -9503,6 +9962,12 @@
|
||||
"resolved": "https://registry.npmjs.org/nanosocket/-/nanosocket-1.1.0.tgz",
|
||||
"integrity": "sha512-v2LsjYMRu3/JT/z8Qpkj1X5dgwCptC3D0NzeYlb7tb2qGJhlx0PSXZJraf1tRPKipj2iwB15GRzqUaOlN+LieQ=="
|
||||
},
|
||||
"natural-compare": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
|
||||
"integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
|
||||
"dev": true
|
||||
},
|
||||
"negotiator": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
|
||||
@@ -10035,6 +10500,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"object.entries": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz",
|
||||
"integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"define-properties": "^1.1.2",
|
||||
"es-abstract": "^1.6.1",
|
||||
"function-bind": "^1.1.0",
|
||||
"has": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"object.getownpropertydescriptors": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
|
||||
@@ -10829,6 +11306,12 @@
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
|
||||
},
|
||||
"progress": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
|
||||
"integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
|
||||
"dev": true
|
||||
},
|
||||
"promise-inflight": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
|
||||
@@ -11336,6 +11819,12 @@
|
||||
"safe-regex": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"regexpp": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz",
|
||||
"integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==",
|
||||
"dev": true
|
||||
},
|
||||
"regexpu-core": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz",
|
||||
@@ -11618,6 +12107,24 @@
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||
},
|
||||
"require-uncached": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
|
||||
"integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caller-path": "^0.1.0",
|
||||
"resolve-from": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"resolve-from": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
|
||||
"integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
@@ -12091,6 +12598,21 @@
|
||||
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
||||
"integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I="
|
||||
},
|
||||
"rx-lite": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
|
||||
"integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
|
||||
"dev": true
|
||||
},
|
||||
"rx-lite-aggregates": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
|
||||
"integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"rx-lite": "*"
|
||||
}
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz",
|
||||
@@ -12833,6 +13355,23 @@
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
|
||||
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU="
|
||||
},
|
||||
"slice-ansi": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
|
||||
"integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"smart-buffer": {
|
||||
"version": "1.1.15",
|
||||
"resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
|
||||
@@ -13606,6 +14145,106 @@
|
||||
"acorn-node": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
|
||||
"integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "^5.2.3",
|
||||
"ajv-keywords": "^2.1.0",
|
||||
"chalk": "^2.1.0",
|
||||
"lodash": "^4.17.4",
|
||||
"slice-ansi": "1.0.0",
|
||||
"string-width": "^2.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "5.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
|
||||
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"co": "^4.6.0",
|
||||
"fast-deep-equal": "^1.0.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.3.0"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
|
||||
"integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
|
||||
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
|
||||
"dev": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-fullwidth-code-point": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
|
||||
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tapable": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz",
|
||||
@@ -13661,6 +14300,12 @@
|
||||
"execa": "^0.7.0"
|
||||
}
|
||||
},
|
||||
"text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
|
||||
"dev": true
|
||||
},
|
||||
"tfunk": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tfunk/-/tfunk-3.1.0.tgz",
|
||||
@@ -16300,6 +16945,15 @@
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"write": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
|
||||
"integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1"
|
||||
}
|
||||
},
|
||||
"write-file-atomic": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz",
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
"license": "The Unlicense",
|
||||
"devDependencies": {
|
||||
"bower": "^1.3.1",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb-base": "^13.0.0",
|
||||
"eslint-plugin-import": "^2.13.0",
|
||||
"http-server": "^0.11.1",
|
||||
"karma": "^2.0.4",
|
||||
"karma-junit-reporter": "^0.2.2",
|
||||
@@ -22,7 +25,8 @@
|
||||
"test": "karma start karma.conf.js",
|
||||
"test-single-run": "karma start karma.conf.js --single-run",
|
||||
"preupdate-webdriver": "npm install",
|
||||
"update-webdriver": "webdriver-manager update"
|
||||
"update-webdriver": "webdriver-manager update",
|
||||
"lint": "node ./node_modules/eslint/bin/eslint src/js/*.js --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import './../styles/scss/base.scss';
|
||||
import './../styles/css/base.css';
|
||||
import '../styles/scss/base.scss';
|
||||
import '../styles/css/base.css';
|
||||
|
||||
require('./event-toggles.js');
|
||||
|
||||
|
||||
|
||||
180
src/js/config.js
180
src/js/config.js
@@ -1,92 +1,92 @@
|
||||
module.exports = {
|
||||
gitToken: "96ead73c54cbbf023a73ee57af145b205d460851",
|
||||
intentSlugToOperations: {
|
||||
'createrepo' : {
|
||||
"requestMethod": 'post',
|
||||
"intentMessage": "Create a Repository in Github",
|
||||
"getDataOperation": "getCreateRepoJson",
|
||||
"githubOperation": "createRepository",
|
||||
"showWidgetOperation": "showCreateRepoWidget",
|
||||
"populateDataOperation": "populateCreateRepoData",
|
||||
"successMessage": "Repository Added!",
|
||||
"cardMsg": "Requested Repository has been added and is available at ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "name"
|
||||
},
|
||||
'createissue' : {
|
||||
"requestMethod": 'post',
|
||||
"intentMessage": "Raise an issue in Github",
|
||||
"getDataOperation": "getCreateIssueJson",
|
||||
"githubOperation": "createIssue",
|
||||
"showWidgetOperation": "showCreateIssueWidget",
|
||||
"populateDataOperation": "populateCreateIssueData",
|
||||
"successMessage": "Issue Created!",
|
||||
"cardMsg": "Issue Created as requested, issue details available at ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "title"
|
||||
},
|
||||
'closeissue' : {
|
||||
"requestMethod": 'post',
|
||||
"intentMessage": "Close an issue in Github",
|
||||
"getDataOperation": "getCloseIssueJson",
|
||||
"githubOperation": "closeIssue",
|
||||
"showWidgetOperation": "showCloseIssueWidget",
|
||||
"populateDataOperation": "populateCloseIssueData",
|
||||
"successMessage": "Issue Closed!",
|
||||
"cardMsg": "Issue Closed as requested, closed issue available at: ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "title"
|
||||
},
|
||||
'addissuecomment' : {
|
||||
"requestMethod": 'post',
|
||||
"intentMessage": "Add a comment on an issue in Github",
|
||||
"getDataOperation": "getAddCommentJson",
|
||||
"githubOperation": "addIssueComment",
|
||||
"showWidgetOperation": "showAddCommentWidget",
|
||||
"populateDataOperation": "populateAddCommentData",
|
||||
"successMessage": "Comment Added!",
|
||||
"cardMsg": "Comment Added as Requested, view here: ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "title"
|
||||
},
|
||||
'displaylastcomment' : {
|
||||
"requestMethod": 'get',
|
||||
"intentMessage": "Display last comment of an issue in Github",
|
||||
"getDataOperation": "getDisplayCommentJson",
|
||||
"githubOperation": "displayLastComment",
|
||||
"showWidgetOperation": "showDisplayCommentWidget",
|
||||
"populateDataOperation": "populateDisplayCommentData",
|
||||
"successMessage": "Comment Retrieved!",
|
||||
"cardMsg": "Please find requested comment below: ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "title"
|
||||
},
|
||||
'addcollab' : {
|
||||
"requestMethod": 'post',
|
||||
"intentMessage": "Add a collaborator",
|
||||
"getDataOperation": "getAddCollaboratorJson",
|
||||
"githubOperation": "addCollaborator",
|
||||
"showWidgetOperation": "showAddCollaboratorWidget",
|
||||
"populateDataOperation": "populateAddCollaboratorData",
|
||||
"successMessage": "Collaborator Added!",
|
||||
"cardMsg": "Collaborator added, details available at ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "invitee,login"
|
||||
},
|
||||
'viewrepos': {
|
||||
"requestMethod": 'get',
|
||||
"intentMessage": "View Repositories for current user",
|
||||
"getDataOperation": "getViewRepositoryJson",
|
||||
"githubOperation": "viewRepositories",
|
||||
"showWidgetOperation": "showViewRepoWidget",
|
||||
"populateDataOperation": "populateViewRepoData",
|
||||
"successMessage": "Showing repositories",
|
||||
"cardMsg": "Repository Details available below: ",
|
||||
"cardDataUrl": "html_url",
|
||||
"cardDataName": "invitee,login"
|
||||
}
|
||||
gitToken: '96ead73c54cbbf023a73ee57af145b205d460851',
|
||||
intentSlugToOperations: {
|
||||
createrepo: {
|
||||
requestMethod: 'post',
|
||||
intentMessage: 'Create a Repository in Github',
|
||||
getDataOperation: 'getCreateRepoJson',
|
||||
githubOperation: 'createRepository',
|
||||
showWidgetOperation: 'showCreateRepoWidget',
|
||||
populateDataOperation: 'populateCreateRepoData',
|
||||
successMessage: 'Repository Added!',
|
||||
cardMsg: 'Requested Repository has been added and is available at ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'name',
|
||||
},
|
||||
costants: {
|
||||
"hiddenIntentFieldId": "intentHidden",
|
||||
}
|
||||
}
|
||||
createissue: {
|
||||
requestMethod: 'post',
|
||||
intentMessage: 'Raise an issue in Github',
|
||||
getDataOperation: 'getCreateIssueJson',
|
||||
githubOperation: 'createIssue',
|
||||
showWidgetOperation: 'showCreateIssueWidget',
|
||||
populateDataOperation: 'populateCreateIssueData',
|
||||
successMessage: 'Issue Created!',
|
||||
cardMsg: 'Issue Created as requested, issue details available at ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'title',
|
||||
},
|
||||
closeissue: {
|
||||
requestMethod: 'post',
|
||||
intentMessage: 'Close an issue in Github',
|
||||
getDataOperation: 'getCloseIssueJson',
|
||||
githubOperation: 'closeIssue',
|
||||
showWidgetOperation: 'showCloseIssueWidget',
|
||||
populateDataOperation: 'populateCloseIssueData',
|
||||
successMessage: 'Issue Closed!',
|
||||
cardMsg: 'Issue Closed as requested, closed issue available at: ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'title',
|
||||
},
|
||||
addissuecomment: {
|
||||
requestMethod: 'post',
|
||||
intentMessage: 'Add a comment on an issue in Github',
|
||||
getDataOperation: 'getAddCommentJson',
|
||||
githubOperation: 'addIssueComment',
|
||||
showWidgetOperation: 'showAddCommentWidget',
|
||||
populateDataOperation: 'populateAddCommentData',
|
||||
successMessage: 'Comment Added!',
|
||||
cardMsg: 'Comment Added as Requested, view here: ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'title',
|
||||
},
|
||||
displaylastcomment: {
|
||||
requestMethod: 'get',
|
||||
intentMessage: 'Display last comment of an issue in Github',
|
||||
getDataOperation: 'getDisplayCommentJson',
|
||||
githubOperation: 'displayLastComment',
|
||||
showWidgetOperation: 'showDisplayCommentWidget',
|
||||
populateDataOperation: 'populateDisplayCommentData',
|
||||
successMessage: 'Comment Retrieved!',
|
||||
cardMsg: 'Please find requested comment below: ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'title',
|
||||
},
|
||||
addcollab: {
|
||||
requestMethod: 'post',
|
||||
intentMessage: 'Add a collaborator',
|
||||
getDataOperation: 'getAddCollaboratorJson',
|
||||
githubOperation: 'addCollaborator',
|
||||
showWidgetOperation: 'showAddCollaboratorWidget',
|
||||
populateDataOperation: 'populateAddCollaboratorData',
|
||||
successMessage: 'Collaborator Added!',
|
||||
cardMsg: 'Collaborator added, details available at ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'invitee,login',
|
||||
},
|
||||
viewrepos: {
|
||||
requestMethod: 'get',
|
||||
intentMessage: 'View Repositories for current user',
|
||||
getDataOperation: 'getViewRepositoryJson',
|
||||
githubOperation: 'viewRepositories',
|
||||
showWidgetOperation: 'showViewRepoWidget',
|
||||
populateDataOperation: 'populateViewRepoData',
|
||||
successMessage: 'Showing repositories',
|
||||
cardMsg: 'Repository Details available below: ',
|
||||
cardDataUrl: 'html_url',
|
||||
cardDataName: 'invitee,login',
|
||||
},
|
||||
},
|
||||
costants: {
|
||||
hiddenIntentFieldId: 'intentHidden',
|
||||
},
|
||||
};
|
||||
|
||||
1202
src/js/dom-ops.js
1202
src/js/dom-ops.js
File diff suppressed because it is too large
Load Diff
@@ -1,81 +1,84 @@
|
||||
const Recast = require('./bot/recast-ops.js');
|
||||
|
||||
const recastclient = new Recast();
|
||||
const DomManipulator = require('./dom-ops.js');
|
||||
|
||||
const dom = new DomManipulator();
|
||||
const Microbot = require('./microbot-ops.js');
|
||||
|
||||
const app = new Microbot();
|
||||
const $config = require('./config.js');
|
||||
|
||||
|
||||
module.exports = $(document).ready(function () {
|
||||
// console.log('test');
|
||||
app.setToken();
|
||||
$('#sidebarCollapse').on('click', function () {
|
||||
$('#sidebar').toggleClass('active');
|
||||
$('.hideable').toggleClass('hide');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-star').hover(function () {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-star').toggleClass('fas');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').hover(function () {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').toggleClass('fas');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').hover(function () {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').toggleClass('fas');
|
||||
});
|
||||
$('#command').keyup(function (e) {
|
||||
var code = (e.keyCode ? e.keyCode : e.which);
|
||||
if (code == 13) {
|
||||
$('#widgets').children().addClass('hide');
|
||||
$('#successAlert').addClass('hide');
|
||||
$('#dangetAlert').addClass('hide');
|
||||
$('#intentBox').addClass('hide');
|
||||
var command = document.getElementById('command').value;
|
||||
if (command) {
|
||||
var text = { "text": command };
|
||||
recastclient.getAndCallProcessIntent(command, text);
|
||||
} else {
|
||||
dom.showEmptyCommandMessage();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#btnSubmitConfirm').on('click', function () {
|
||||
$('#submitConfirm').removeClass('hide');
|
||||
});
|
||||
$('#submitGitData').on('click', function () {
|
||||
var data = dom.getDataFromFormAsJSON();
|
||||
var intent = $('#' + $config.costants.hiddenIntentFieldId).val();
|
||||
if (intent) {
|
||||
var operation = $config.intentSlugToOperations[intent]['githubOperation'];
|
||||
app[operation](data);
|
||||
}
|
||||
});
|
||||
$("#hideInfoAlert").on('click', function () {
|
||||
$('#intentBox').addClass('hide');
|
||||
})
|
||||
$("#hideSuccessAlert").on('click', function () {
|
||||
$('#successAlert').addClass('hide');
|
||||
});
|
||||
$('#conversations').on('click', '.close', function () {
|
||||
var $target = $(this).closest('.card');
|
||||
var line = $target.next();
|
||||
$target.hide('slow', function () { $target.remove(); });
|
||||
line.hide('slow', function () { line.remove(); });
|
||||
});
|
||||
$("#hideDangerAlert").on('click', function () {
|
||||
$('#dangerAlert').addClass('hide');
|
||||
});
|
||||
$('#git_bridge').on('click', function() {
|
||||
window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';
|
||||
// var user = app.getCurrentUser();
|
||||
// if(user) {
|
||||
// window.location.href = './../continue.html'
|
||||
// } else {
|
||||
// window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';
|
||||
// }
|
||||
})
|
||||
if(window.location.href.match(/\?code=(.*)/) ) {
|
||||
var code = window.location.href.match(/\?code=(.*)/)[1];
|
||||
app.getToken(code);
|
||||
module.exports = $(document).ready(() => {
|
||||
// console.log('test');
|
||||
app.setToken();
|
||||
$('#sidebarCollapse').on('click', () => {
|
||||
$('#sidebar').toggleClass('active');
|
||||
$('.hideable').toggleClass('hide');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-star').hover(() => {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-star').toggleClass('fas');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').hover(() => {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-trash-alt').toggleClass('fas');
|
||||
});
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').hover(() => {
|
||||
$('#content nav div.collapse li a.nav-link i.far.fa-paper-plane').toggleClass('fas');
|
||||
});
|
||||
$('#command').keyup((e) => {
|
||||
const code = (e.keyCode ? e.keyCode : e.which);
|
||||
if (code == 13) {
|
||||
$('#widgets').children().addClass('hide');
|
||||
$('#successAlert').addClass('hide');
|
||||
$('#dangetAlert').addClass('hide');
|
||||
$('#intentBox').addClass('hide');
|
||||
const command = document.getElementById('command').value;
|
||||
if (command) {
|
||||
const text = { text: command };
|
||||
recastclient.getAndCallProcessIntent(command, text);
|
||||
} else {
|
||||
dom.showEmptyCommandMessage();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#btnSubmitConfirm').on('click', () => {
|
||||
$('#submitConfirm').removeClass('hide');
|
||||
});
|
||||
$('#submitGitData').on('click', () => {
|
||||
const data = dom.getDataFromFormAsJSON();
|
||||
const intent = $(`#${$config.costants.hiddenIntentFieldId}`).val();
|
||||
if (intent) {
|
||||
const operation = $config.intentSlugToOperations[intent].githubOperation;
|
||||
app[operation](data);
|
||||
}
|
||||
});
|
||||
$('#hideInfoAlert').on('click', () => {
|
||||
$('#intentBox').addClass('hide');
|
||||
});
|
||||
$('#hideSuccessAlert').on('click', () => {
|
||||
$('#successAlert').addClass('hide');
|
||||
});
|
||||
$('#conversations').on('click', '.close', function () {
|
||||
const $target = $(this).closest('.card');
|
||||
const line = $target.next();
|
||||
$target.hide('slow', () => { $target.remove(); });
|
||||
line.hide('slow', () => { line.remove(); });
|
||||
});
|
||||
$('#hideDangerAlert').on('click', () => {
|
||||
$('#dangerAlert').addClass('hide');
|
||||
});
|
||||
$('#git_bridge').on('click', () => {
|
||||
window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';
|
||||
// var user = app.getCurrentUser();
|
||||
// if(user) {
|
||||
// window.location.href = './../continue.html'
|
||||
// } else {
|
||||
// window.location.href = 'https://github.com/login/oauth/authorize?scope=user:email:repo&client_id=f6f649a1fe2dfea082ba';
|
||||
// }
|
||||
});
|
||||
if (window.location.href.match(/\?code=(.*)/)) {
|
||||
const code = window.location.href.match(/\?code=(.*)/)[1];
|
||||
app.getToken(code);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,336 +1,323 @@
|
||||
const config = require('./config.js');
|
||||
const GithubHelper = require('./helper.js');
|
||||
|
||||
const githubHelper = new GithubHelper();
|
||||
const DomManipulator = require('./dom-ops.js');
|
||||
|
||||
const dom = new DomManipulator();
|
||||
const PersistentOps = require('./persistent-ops.js');
|
||||
|
||||
const persistentOps = new PersistentOps();
|
||||
|
||||
|
||||
module.exports = class Github {
|
||||
constructor() {
|
||||
this.authorizationToken = `token ${config.gitToken}`;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.authorizationToken = "token " + config.gitToken;
|
||||
}
|
||||
getToken(code) {
|
||||
let token = '';
|
||||
self = this;
|
||||
$.getJSON(`http://localhost:9999/authenticate/${code}`, (data) => {
|
||||
console.log(data.token);
|
||||
token = data.token;
|
||||
// set cookie here
|
||||
persistentOps.setCookie('gitToken', token, 30);
|
||||
// self.authorizationToken = "token " + persistentOps.getCookie('gitToken');
|
||||
dom.concealCodeInUrl();
|
||||
});
|
||||
return token;
|
||||
}
|
||||
|
||||
getToken(code) {
|
||||
var token = '';
|
||||
self = this;
|
||||
$.getJSON('http://localhost:9999/authenticate/' + code, function(data) {
|
||||
console.log(data.token);
|
||||
token = data.token;
|
||||
// set cookie here
|
||||
persistentOps.setCookie('gitToken', token, 30);
|
||||
// self.authorizationToken = "token " + persistentOps.getCookie('gitToken');
|
||||
dom.concealCodeInUrl();
|
||||
getCurrentUser() {
|
||||
let repositories = '';
|
||||
const url = 'https://api.github.com/user/';
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
response.json().then((body) => {
|
||||
repositories = body;
|
||||
console.log(repositories);
|
||||
return repositories;
|
||||
});
|
||||
return token;
|
||||
}
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return repositories;
|
||||
}
|
||||
|
||||
getCurrentUser() {
|
||||
var repositories = '';
|
||||
let url = 'https://api.github.com/user/';
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8"
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
response.json().then(function(body){
|
||||
repositories = body;
|
||||
console.log(repositories);
|
||||
return repositories;
|
||||
});
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return repositories;
|
||||
}
|
||||
authenticate() {
|
||||
authenticate() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
viewRepositories() {
|
||||
var repositories = '';
|
||||
let url = 'https://api.github.com/user/repos';
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
// response.json().then(function(body){
|
||||
// repositories = body;
|
||||
// console.log(repositories);
|
||||
// return repositories;
|
||||
// });
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return repositories;
|
||||
}
|
||||
viewRepositories() {
|
||||
const repositories = '';
|
||||
const url = 'https://api.github.com/user/repos';
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
// response.json().then(function(body){
|
||||
// repositories = body;
|
||||
// console.log(repositories);
|
||||
// return repositories;
|
||||
// });
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return repositories;
|
||||
}
|
||||
|
||||
createRepository(newRepoJson) {
|
||||
let url = 'https://api.github.com/user/repos';
|
||||
var responsePromise = '';
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(newRepoJson)
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
createRepository(newRepoJson) {
|
||||
const url = 'https://api.github.com/user/repos';
|
||||
const responsePromise = '';
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(newRepoJson),
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
updateRepository(updateRepoJson, repoName) {
|
||||
repoName = "Hello-World3";
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName;
|
||||
fetch(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(updateRepoJson)
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
updateRepository(updateRepoJson, repoName) {
|
||||
repoName = 'Hello-World3';
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}`;
|
||||
fetch(url, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(updateRepoJson),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
deleteRepository(repoName) {
|
||||
repoName = "Hello-World2";
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName;
|
||||
fetch(url, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
deleteRepository(repoName) {
|
||||
repoName = 'Hello-World2';
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}`;
|
||||
fetch(url, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
createIssue(newIssueJson, repoName) {
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues';
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(newIssueJson)
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
createIssue(newIssueJson, repoName) {
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues`;
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(newIssueJson),
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
updateIssue(updateIssueJson, repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;
|
||||
fetch(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(updateIssueJson)
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
updateIssue(updateIssueJson, repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;
|
||||
fetch(url, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(updateIssueJson),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
closeIssue(closeIssueJson, repoName, issueNumber) {
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;
|
||||
fetch(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(closeIssueJson)
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
closeIssue(closeIssueJson, repoName, issueNumber) {
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;
|
||||
fetch(url, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(closeIssueJson),
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
reopenIssue(reopenIssueJson, repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;
|
||||
fetch(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(reopenIssueJson)
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
reopenIssue(reopenIssueJson, repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;
|
||||
fetch(url, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(reopenIssueJson),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
displayIssue(repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber;
|
||||
var issues = '';
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
response.json().then(function(body){
|
||||
issues = body;
|
||||
console.log(issues);
|
||||
return issues;
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return issues;
|
||||
}
|
||||
displayIssue(repoName, issueNumber) {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}`;
|
||||
let issues = '';
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
response.json().then((body) => {
|
||||
issues = body;
|
||||
console.log(issues);
|
||||
return issues;
|
||||
});
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
return issues;
|
||||
}
|
||||
|
||||
addIssueComment(commentBodyJson, repoName, issueId) {
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueId + "/comments";
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(commentBodyJson)
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
addIssueComment(commentBodyJson, repoName, issueId) {
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueId}/comments`;
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(commentBodyJson),
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
displayLastComment(repoName, issueNumber) {
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/' + issueNumber + "/comments";
|
||||
var comments = [];
|
||||
var latestComment = "";
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
// response.json().then(function(body){
|
||||
// comments = body;
|
||||
// latestComment = githubHelper.getLatestComment(comments);
|
||||
// console.log(comments);
|
||||
// console.log(latestComment);
|
||||
// });
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
displayLastComment(repoName, issueNumber) {
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/${issueNumber}/comments`;
|
||||
const comments = [];
|
||||
const latestComment = '';
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
// response.json().then(function(body){
|
||||
// comments = body;
|
||||
// latestComment = githubHelper.getLatestComment(comments);
|
||||
// console.log(comments);
|
||||
// console.log(latestComment);
|
||||
// });
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
displayIssuesForUser() {
|
||||
let url = 'https://api.github.com/user/issues';
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
displayIssuesForUser() {
|
||||
const url = 'https://api.github.com/user/issues';
|
||||
fetch(url, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
displayIssuesOnRepo() {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/issues/';
|
||||
fetch(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Authorization": this.authorizationToken
|
||||
},
|
||||
body: JSON.stringify(updateIssueJson)
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
displayIssuesOnRepo() {
|
||||
repoName = 'stack_route_prj7';
|
||||
issueNumber = 2;
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/issues/`;
|
||||
fetch(url, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
body: JSON.stringify(updateIssueJson),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
addCollaborator(repoName, collaborator) {
|
||||
repoName = 'stack_route_prj7';
|
||||
collaborator = 'swat1508';
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;
|
||||
fetch(url, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(function(response) {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
addCollaborator(repoName, collaborator) {
|
||||
repoName = 'stack_route_prj7';
|
||||
collaborator = 'swat1508';
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;
|
||||
fetch(url, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
dom.toggleModals(response);
|
||||
})
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
removeCollaborator(repoName, collaborator) {
|
||||
repoName = 'stack_route_prj7';
|
||||
collaborator = 'swat1508';
|
||||
let url = 'https://api.github.com/repos/mohiit1502/' + repoName + '/collaborators/' + collaborator;
|
||||
fetch(url, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": this.authorizationToken
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
removeCollaborator(repoName, collaborator) {
|
||||
repoName = 'stack_route_prj7';
|
||||
collaborator = 'swat1508';
|
||||
const url = `https://api.github.com/repos/mohiit1502/${repoName}/collaborators/${collaborator}`;
|
||||
fetch(url, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: this.authorizationToken,
|
||||
},
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Fetch Error =\n', error));
|
||||
}
|
||||
|
||||
createUser(newuserJson) {
|
||||
createUser(newuserJson) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
updateUser(updateUserJson) {
|
||||
updateUser(updateUserJson) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
deleteUser(userId) {
|
||||
deleteUser(userId) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module.exports = class GithubHelper {
|
||||
getLatestComment(comments) {
|
||||
if(comments && comments.length > 0)
|
||||
return comments[comments.length - 1]['body'];
|
||||
}
|
||||
}
|
||||
getLatestComment(comments) {
|
||||
if (comments && comments.length > 0) { return comments[comments.length - 1].body; }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,126 +1,127 @@
|
||||
const Github = require('./github-ops.js');
|
||||
const $github = new Github()
|
||||
|
||||
const $github = new Github();
|
||||
const PersistentOps = require('./persistent-ops.js');
|
||||
|
||||
const persistentOps = new PersistentOps();
|
||||
|
||||
module.exports = class Microbot {
|
||||
constructor(clientId, clientSecret) {
|
||||
// TODO move to config or env variables
|
||||
this.clientId = 'f6f649a1fe2dfea082ba';
|
||||
this.clientSecret = '7e9a33d05ffdb36b4a498140bb9bb06d62de4f0e';
|
||||
}
|
||||
|
||||
constructor(clientId, clientSecret) {
|
||||
// TODO move to config or env variables
|
||||
this.clientId = 'f6f649a1fe2dfea082ba';
|
||||
this.clientSecret = '7e9a33d05ffdb36b4a498140bb9bb06d62de4f0e';
|
||||
}
|
||||
getToken(code) {
|
||||
$github.getToken(code);
|
||||
}
|
||||
|
||||
getToken(code) {
|
||||
$github.getToken(code);
|
||||
}
|
||||
setToken() {
|
||||
$github.authorizationToken = `token ${persistentOps.getCookie('gitToken')}`;
|
||||
}
|
||||
|
||||
setToken() {
|
||||
$github.authorizationToken = "token " + persistentOps.getCookie('gitToken');
|
||||
}
|
||||
getCurrentUser() {
|
||||
$github.getCurrentUser();
|
||||
}
|
||||
|
||||
getCurrentUser() {
|
||||
$github.getCurrentUser();
|
||||
}
|
||||
viewRepositories() {
|
||||
return $github.viewRepositories();
|
||||
}
|
||||
|
||||
viewRepositories() {
|
||||
return $github.viewRepositories();
|
||||
}
|
||||
createRepository(requestData) {
|
||||
const requestJson = requestData.request;
|
||||
$github.createRepository(requestJson);
|
||||
// $github.createRepository({
|
||||
// "name": "new-test-js-git-api-repo",
|
||||
// "description": "This is your first repository",
|
||||
// "homepage": "https://github.com",
|
||||
// "private": false,
|
||||
// "has_issues": true,
|
||||
// "has_wiki": true
|
||||
// })
|
||||
}
|
||||
|
||||
createRepository(requestData) {
|
||||
var requestJson = requestData.request;
|
||||
$github.createRepository(requestJson);
|
||||
// $github.createRepository({
|
||||
// "name": "new-test-js-git-api-repo",
|
||||
// "description": "This is your first repository",
|
||||
// "homepage": "https://github.com",
|
||||
// "private": false,
|
||||
// "has_issues": true,
|
||||
// "has_wiki": true
|
||||
// })
|
||||
}
|
||||
updateRepository(repoName, repoType) {
|
||||
$github.authenticate();
|
||||
$github.updateRepository({
|
||||
name: 'Hello-World4',
|
||||
description: 'This is your test description',
|
||||
homepage: 'https://github.com',
|
||||
private: false,
|
||||
has_issues: true,
|
||||
has_projects: true,
|
||||
has_wiki: true,
|
||||
});
|
||||
}
|
||||
|
||||
updateRepository(repoName, repoType) {
|
||||
$github.authenticate();
|
||||
$github.updateRepository({
|
||||
"name": "Hello-World4",
|
||||
"description": "This is your test description",
|
||||
"homepage": "https://github.com",
|
||||
"private": false,
|
||||
"has_issues": true,
|
||||
"has_projects": true,
|
||||
"has_wiki": true
|
||||
})
|
||||
}
|
||||
deleteRepository() {
|
||||
$github.deleteRepository();
|
||||
}
|
||||
|
||||
deleteRepository() {
|
||||
$github.deleteRepository();
|
||||
}
|
||||
createIssue(requestData) {
|
||||
const requestJson = requestData.request;
|
||||
const repoName = requestData.urlParams.repoName;
|
||||
$github.createIssue(requestJson, repoName);
|
||||
}
|
||||
|
||||
createIssue(requestData) {
|
||||
var requestJson = requestData.request;
|
||||
var repoName = requestData.urlParams.repoName;
|
||||
$github.createIssue(requestJson, repoName);
|
||||
}
|
||||
updateIssue() {
|
||||
$github.updateIssue({
|
||||
title: 'Found a bug - title updated',
|
||||
body: 'This is the updated problem description.',
|
||||
assignees: [
|
||||
'mohiit1502',
|
||||
],
|
||||
milestone: 1,
|
||||
state: 'open',
|
||||
labels: [
|
||||
'bug', 'issue',
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
updateIssue() {
|
||||
$github.updateIssue({
|
||||
"title": "Found a bug - title updated",
|
||||
"body": "This is the updated problem description.",
|
||||
"assignees": [
|
||||
"mohiit1502"
|
||||
],
|
||||
"milestone": 1,
|
||||
"state": "open",
|
||||
"labels": [
|
||||
"bug", "issue"
|
||||
]
|
||||
});
|
||||
}
|
||||
closeIssue(requestData) {
|
||||
const repoName = requestData.urlParams.repoName;
|
||||
const issueId = requestData.urlParams.issueId;
|
||||
$github.closeIssue({
|
||||
state: 'close',
|
||||
}, repoName, issueId);
|
||||
}
|
||||
|
||||
closeIssue(requestData) {
|
||||
var repoName = requestData.urlParams.repoName;
|
||||
var issueId = requestData.urlParams.issueId;
|
||||
$github.closeIssue({
|
||||
"state": "close",
|
||||
}, repoName, issueId);
|
||||
}
|
||||
displayIssue() {
|
||||
return $github.displayIssue();
|
||||
}
|
||||
|
||||
displayIssue() {
|
||||
return $github.displayIssue();
|
||||
}
|
||||
reopenIssue() {
|
||||
$github.reopenIssue({
|
||||
milestone: 1,
|
||||
state: 'open',
|
||||
});
|
||||
}
|
||||
|
||||
reopenIssue() {
|
||||
$github.reopenIssue({
|
||||
"milestone": 1,
|
||||
"state": "open",
|
||||
})
|
||||
}
|
||||
addIssueComment(requestData) {
|
||||
const requestJson = requestData.request;
|
||||
const repoName = requestData.urlParams.repoName;
|
||||
const issueId = requestData.urlParams.issueId;
|
||||
$github.addIssueComment(requestJson, repoName, issueId);
|
||||
}
|
||||
|
||||
addIssueComment(requestData) {
|
||||
var requestJson = requestData.request;
|
||||
var repoName = requestData.urlParams.repoName;
|
||||
var issueId = requestData.urlParams.issueId;
|
||||
$github.addIssueComment(requestJson, repoName, issueId);
|
||||
}
|
||||
displayLastComment(requestData) {
|
||||
const repoName = requestData.urlParams.repoName;
|
||||
const issueId = requestData.urlParams.issueId;
|
||||
return $github.displayLastComment(repoName, issueId);
|
||||
}
|
||||
|
||||
displayLastComment(requestData) {
|
||||
var repoName = requestData.urlParams.repoName;
|
||||
var issueId = requestData.urlParams.issueId;
|
||||
return $github.displayLastComment(repoName, issueId);
|
||||
}
|
||||
addCollaborator(requestData) {
|
||||
const repoName = requestData.urlParams.repoName;
|
||||
const collaborator = requestData.urlParams.collaborator;
|
||||
$github.addCollaborator(repoName, collaborator);
|
||||
}
|
||||
|
||||
addCollaborator(requestData) {
|
||||
var repoName = requestData.urlParams.repoName;
|
||||
var collaborator = requestData.urlParams.collaborator;
|
||||
$github.addCollaborator(repoName, collaborator);
|
||||
}
|
||||
removeCollaborator() {
|
||||
$github.removeCollaborator();
|
||||
}
|
||||
|
||||
removeCollaborator() {
|
||||
$github.removeCollaborator();
|
||||
}
|
||||
callAppropriate(intent) {
|
||||
|
||||
callAppropriate(intent) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
module.exports = class PersistentOps {
|
||||
getLatestComment(comments) {
|
||||
if(comments && comments.length > 0)
|
||||
return comments[comments.length - 1]['body'];
|
||||
}
|
||||
getLatestComment(comments) {
|
||||
if (comments && comments.length > 0) { return comments[comments.length - 1].body; }
|
||||
}
|
||||
|
||||
setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
setCookie(cname, cvalue, exdays) {
|
||||
const d = new Date();
|
||||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
||||
const expires = `expires=${d.toUTCString()}`;
|
||||
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
||||
}
|
||||
|
||||
getCookie(cname) {
|
||||
var name = cname + "=";
|
||||
var decodedCookie = decodeURIComponent(document.cookie);
|
||||
var ca = decodedCookie.split(';');
|
||||
for(var i = 0; i <ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
getCookie(cname) {
|
||||
const name = `${cname}=`;
|
||||
const decodedCookie = decodeURIComponent(document.cookie);
|
||||
const ca = decodedCookie.split(';');
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user