mirror of
https://github.com/Findus23/typo3-keyboard.git
synced 2024-08-27 19:52:16 +02:00
first published version
This commit is contained in:
parent
9c454ef296
commit
82956bbe90
7 changed files with 8982 additions and 24 deletions
281
.eslintrc.js
Normal file
281
.eslintrc.js
Normal file
|
@ -0,0 +1,281 @@
|
|||
module.exports = {
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"accessor-pairs": "error",
|
||||
"array-bracket-newline": "error",
|
||||
"array-bracket-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"array-callback-return": "error",
|
||||
"array-element-newline": "off",
|
||||
"arrow-body-style": "error",
|
||||
"arrow-parens": "error",
|
||||
"arrow-spacing": "error",
|
||||
"block-scoped-var": "error",
|
||||
"block-spacing": "error",
|
||||
"brace-style": "off",
|
||||
"callback-return": "error",
|
||||
"camelcase": "error",
|
||||
"capitalized-comments": "off",
|
||||
"class-methods-use-this": "error",
|
||||
"comma-dangle": "error",
|
||||
"comma-spacing": [
|
||||
"error",
|
||||
{
|
||||
"after": true,
|
||||
"before": false
|
||||
}
|
||||
],
|
||||
"comma-style": [
|
||||
"error",
|
||||
"last"
|
||||
],
|
||||
"complexity": "error",
|
||||
"computed-property-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"consistent-return": "off",
|
||||
"consistent-this": "error",
|
||||
"curly": "error",
|
||||
"default-case": "error",
|
||||
"dot-location": "error",
|
||||
"dot-notation": "error",
|
||||
"eol-last": "error",
|
||||
"eqeqeq": "error",
|
||||
"for-direction": "error",
|
||||
"func-call-spacing": "error",
|
||||
"func-name-matching": "error",
|
||||
"func-names": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"func-style": "off",
|
||||
"function-paren-newline": "off",
|
||||
"generator-star-spacing": "error",
|
||||
"getter-return": "error",
|
||||
"global-require": "error",
|
||||
"guard-for-in": "error",
|
||||
"handle-callback-err": "error",
|
||||
"id-blacklist": "error",
|
||||
"id-length": "off",
|
||||
"id-match": "error",
|
||||
"implicit-arrow-linebreak": "error",
|
||||
"indent": "off",
|
||||
"indent-legacy": "off",
|
||||
"init-declarations": "off",
|
||||
"jsx-quotes": "error",
|
||||
"key-spacing": "error",
|
||||
"keyword-spacing": [
|
||||
"error",
|
||||
{
|
||||
"after": true,
|
||||
"before": true
|
||||
}
|
||||
],
|
||||
"line-comment-position": "off",
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"lines-around-comment": "off",
|
||||
"lines-around-directive": "error",
|
||||
"lines-between-class-members": "error",
|
||||
"max-depth": "error",
|
||||
"max-len": "off",
|
||||
"max-lines": "off",
|
||||
"max-nested-callbacks": "error",
|
||||
"max-params": "error",
|
||||
"max-statements": "off",
|
||||
"max-statements-per-line": "error",
|
||||
"multiline-comment-style": [
|
||||
"error",
|
||||
"separate-lines"
|
||||
],
|
||||
"new-cap": "error",
|
||||
"new-parens": "error",
|
||||
"newline-after-var": "off",
|
||||
"newline-before-return": "off",
|
||||
"newline-per-chained-call": "error",
|
||||
"no-alert": "error",
|
||||
"no-array-constructor": "error",
|
||||
"no-await-in-loop": "error",
|
||||
"no-bitwise": "error",
|
||||
"no-buffer-constructor": "error",
|
||||
"no-caller": "error",
|
||||
"no-catch-shadow": "error",
|
||||
"no-confusing-arrow": "error",
|
||||
"no-continue": "error",
|
||||
"no-div-regex": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-else-return": "error",
|
||||
"no-empty-function": "error",
|
||||
"no-eq-null": "error",
|
||||
"no-eval": "error",
|
||||
"no-extend-native": "error",
|
||||
"no-extra-bind": "error",
|
||||
"no-extra-label": "error",
|
||||
"no-extra-parens": "off",
|
||||
"no-floating-decimal": "error",
|
||||
"no-implicit-coercion": "error",
|
||||
"no-implicit-globals": "off",
|
||||
"no-implied-eval": "error",
|
||||
"no-inline-comments": "off",
|
||||
"no-inner-declarations": [
|
||||
"error",
|
||||
"functions"
|
||||
],
|
||||
"no-invalid-this": "error",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "error",
|
||||
"no-labels": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-lonely-if": "error",
|
||||
"no-loop-func": "error",
|
||||
"no-magic-numbers": "off",
|
||||
"no-mixed-operators": "error",
|
||||
"no-mixed-requires": "error",
|
||||
"no-multi-assign": "off",
|
||||
"no-multi-spaces": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-native-reassign": "error",
|
||||
"no-negated-condition": "off",
|
||||
"no-negated-in-lhs": "error",
|
||||
"no-nested-ternary": "error",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-object": "error",
|
||||
"no-new-require": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-param-reassign": "off",
|
||||
"no-path-concat": "error",
|
||||
"no-plusplus": "error",
|
||||
"no-process-env": "error",
|
||||
"no-process-exit": "error",
|
||||
"no-proto": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-restricted-globals": "error",
|
||||
"no-restricted-imports": "error",
|
||||
"no-restricted-modules": "error",
|
||||
"no-restricted-properties": "error",
|
||||
"no-restricted-syntax": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-return-await": "error",
|
||||
"no-script-url": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-sequences": "error",
|
||||
"no-shadow": "off",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-spaced-func": "error",
|
||||
"no-sync": "error",
|
||||
"no-tabs": "error",
|
||||
"no-template-curly-in-string": "error",
|
||||
"no-ternary": "off",
|
||||
"no-throw-literal": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-undefined": "off",
|
||||
"no-underscore-dangle": "error",
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-use-before-define": "error",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-useless-return": "error",
|
||||
"no-var": "off",
|
||||
"no-void": "error",
|
||||
"no-warning-comments": "error",
|
||||
"no-whitespace-before-property": "error",
|
||||
"no-with": "error",
|
||||
"nonblock-statement-body-position": "error",
|
||||
"object-curly-newline": "off",
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"object-shorthand": "off",
|
||||
"one-var": "off",
|
||||
"one-var-declaration-per-line": "error",
|
||||
"operator-assignment": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"operator-linebreak": "error",
|
||||
"padded-blocks": "off",
|
||||
"padding-line-between-statements": "error",
|
||||
"prefer-arrow-callback": "off",
|
||||
"prefer-const": "error",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-numeric-literals": "error",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"prefer-reflect": "off",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"prefer-template": "off",
|
||||
"quote-props": "off",
|
||||
"quotes": "off",
|
||||
"radix": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"require-await": "error",
|
||||
"require-jsdoc": "off",
|
||||
"rest-spread-spacing": "error",
|
||||
"semi": "error",
|
||||
"semi-spacing": "error",
|
||||
"semi-style": [
|
||||
"error",
|
||||
"last"
|
||||
],
|
||||
"sort-imports": "error",
|
||||
"sort-keys": "off",
|
||||
"sort-vars": "error",
|
||||
"space-before-blocks": "error",
|
||||
"space-before-function-paren": "off",
|
||||
"space-in-parens": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"space-infix-ops": "error",
|
||||
"space-unary-ops": "error",
|
||||
"spaced-comment": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"strict": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"switch-colon-spacing": "error",
|
||||
"symbol-description": "error",
|
||||
"template-curly-spacing": "error",
|
||||
"template-tag-spacing": "error",
|
||||
"unicode-bom": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"valid-jsdoc": "error",
|
||||
"vars-on-top": "off",
|
||||
"wrap-regex": "error",
|
||||
"yield-star-spacing": "error",
|
||||
"no-console": "off",
|
||||
"yoda": [
|
||||
"error",
|
||||
"never"
|
||||
]
|
||||
},
|
||||
"globals": {"chrome": true}
|
||||
};
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
.idea/
|
||||
node_modules/
|
||||
web-ext-artifacts/
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* global Mousetrap */
|
||||
|
||||
function getContentDocument() {
|
||||
const iframe = document.getElementById("typo3-contentIframe");
|
||||
return iframe ? iframe.contentDocument : document;
|
||||
|
@ -23,64 +25,64 @@ const defaultkeys = {
|
|||
chrome.storage.sync.get(defaultkeys, function (keys) {
|
||||
Mousetrap.bind(keys.close, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let closeButton = contentDocument.querySelector('.t3js-editform-close');
|
||||
const closeButton = contentDocument.querySelector('.t3js-editform-close');
|
||||
closeButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.save, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let saveButton = contentDocument.querySelector('[name="_savedok"]');
|
||||
const saveButton = contentDocument.querySelector('[name="_savedok"]');
|
||||
saveButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.saveAndClose, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let saveAndCloseButton = contentDocument.querySelector('[data-name="_saveandclosedok"]');
|
||||
const saveAndCloseButton = contentDocument.querySelector('[data-name="_saveandclosedok"]');
|
||||
saveAndCloseButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.saveAndViewPage, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let saveAndViewPageButton = contentDocument.querySelector('[data-name="_savedokview"]');
|
||||
const saveAndViewPageButton = contentDocument.querySelector('[data-name="_savedokview"]');
|
||||
saveAndViewPageButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.saveAndCreateNewOne, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let saveAndCreateNewOneButton = contentDocument.querySelector('[data-name="_savedoknew"]');
|
||||
const saveAndCreateNewOneButton = contentDocument.querySelector('[data-name="_savedoknew"]');
|
||||
saveAndCreateNewOneButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.delete, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let deleteButton = contentDocument.querySelector('.t3js-editform-delete-record');
|
||||
const deleteButton = contentDocument.querySelector('.t3js-editform-delete-record');
|
||||
deleteButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.edit, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let editButton = contentDocument.querySelector('.icon-actions-page-open').parentElement;
|
||||
const editButton = contentDocument.querySelector('.icon-actions-page-open').parentElement;
|
||||
editButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.viewPage, function () {
|
||||
const contentDocument = getContentDocument();
|
||||
let viewPageButton = contentDocument.querySelector('.icon-actions-document-view').parentElement;
|
||||
const viewPageButton = contentDocument.querySelector('.icon-actions-document-view').parentElement;
|
||||
viewPageButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.flushFrontendCaches, function () {
|
||||
let flushFrontendCachesButton = parentDocument.querySelector('.icon-actions-system-cache-clear-impact-low').closest("a");
|
||||
const flushFrontendCachesButton = parentDocument.querySelector('.icon-actions-system-cache-clear-impact-low').closest("a");
|
||||
flushFrontendCachesButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.flushAllCaches, function () {
|
||||
let flushAllCachesButton = parentDocument.querySelector('.icon-actions-system-cache-clear-impact-high').closest("a");
|
||||
const flushAllCachesButton = parentDocument.querySelector('.icon-actions-system-cache-clear-impact-high').closest("a");
|
||||
flushAllCachesButton.click();
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(keys.searchField, function () {
|
||||
let searchField = parentDocument.getElementById("live-search-box");
|
||||
const searchField = parentDocument.getElementById("live-search-box");
|
||||
searchField.focus();
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Typo3 Keyboard Control",
|
||||
"short_name": "Typo3 Keyboard Control",
|
||||
"version": "1.0.0",
|
||||
"name": "TYPO3 Keyboard Control",
|
||||
"short_name": "TYPO3 Keyboard Control",
|
||||
"version": "1.0.1",
|
||||
"description": "...",
|
||||
"permissions": [
|
||||
"storage"
|
||||
|
@ -21,10 +21,5 @@
|
|||
"contentscript.js"
|
||||
]
|
||||
}
|
||||
],
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "addon@example.com"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ const keys = {
|
|||
function saveOptions(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Object.entries(keys).forEach(([key, value]) => {
|
||||
let obj = {};
|
||||
Object.entries(keys).forEach(([key]) => {
|
||||
const obj = {};
|
||||
obj[key] = document.getElementById(key).value;
|
||||
chrome.storage.sync.set(obj);
|
||||
});
|
||||
|
@ -30,10 +30,10 @@ function restoreOptions() {
|
|||
Object.entries(keys).forEach(([key, value]) => {
|
||||
chrome.storage.sync.get(key, function (result) {
|
||||
console.info(result);
|
||||
document.getElementById(key).value = result[key] || value
|
||||
document.getElementById(key).value = result[key] || value;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", restoreOptions);
|
||||
document.querySelector("form").addEventListener("submit", saveOptions);
|
||||
document.querySelector("form").addEventListener("submit", saveOptions);
|
||||
|
|
8650
package-lock.json
generated
Normal file
8650
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
28
package.json
Normal file
28
package.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "mask-detector",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"eslint": "^5.3.0",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"web-ext": "^2.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "web-ext build --ignore-files '**/*.sh' 'mousetrap/' 'yarn*'",
|
||||
"webext_lint": "web-ext lint --warnings-as-errors --ignore-files 'libs/*' 'mousetrap/' '**/*.sh' 'yarn*'",
|
||||
"eslint": "eslint *.js",
|
||||
"all": "npm-run-all --parallel webext_lint eslint --sequential build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Findus23/mask-detector.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "GPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Findus23/mask-detector/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Findus23/mask-detector#readme"
|
||||
}
|
Loading…
Reference in a new issue