A fork of Gitea (see branch `mj`) adding Majority Judgment Polls 𐄷 over Issues and Merge Requests. https://git.mieuxvoter.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
12 KiB

Use AJAX for notifications table (#10961) * Use AJAX for notifications table Signed-off-by: Andrew Thornton <art27@cantab.net> * move to separate js Signed-off-by: Andrew Thornton <art27@cantab.net> * placate golangci-lint Signed-off-by: Andrew Thornton <art27@cantab.net> * Add autoupdating notification count Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix wipeall Signed-off-by: Andrew Thornton <art27@cantab.net> * placate tests Signed-off-by: Andrew Thornton <art27@cantab.net> * Try hidden Signed-off-by: Andrew Thornton <art27@cantab.net> * Try hide and hidden Signed-off-by: Andrew Thornton <art27@cantab.net> * More auto-update improvements Only run checker on pages that have a count Change starting checker to 10s with a back-off to 60s if there is no change Signed-off-by: Andrew Thornton <art27@cantab.net> * string comparison! Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * add configurability as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add documentation as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Use CSRF header not query Signed-off-by: Andrew Thornton <art27@cantab.net> * Further JS improvements Fix @etzelia update notification table request Fix @silverwind comments Co-Authored-By: silverwind <me@silverwind.io> Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify the notification count fns Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
2 years ago
  1. root: true
  2. reportUnusedDisableDirectives: true
  3. ignorePatterns:
  4. - /web_src/js/vendor
  5. - /templates/base/head.tmpl
  6. - /templates/repo/activity.tmpl
  7. - /templates/repo/view_file.tmpl
  8. parserOptions:
  9. sourceType: module
  10. ecmaVersion: 2021
  11. plugins:
  12. - eslint-plugin-unicorn
  13. - eslint-plugin-import
  14. - eslint-plugin-vue
  15. - eslint-plugin-html
  16. extends:
  17. - plugin:vue/recommended
  18. env:
  19. es2021: true
  20. node: true
  21. globals:
  22. __webpack_public_path__: true
  23. CodeMirror: false
  24. Dropzone: false
  25. SimpleMDE: false
  26. u2fApi: false
  27. settings:
  28. html/html-extensions: [".tmpl"]
  29. overrides:
  30. - files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
  31. env:
  32. browser: true
  33. jquery: true
  34. node: false
  35. - files: ["templates/**/*.tmpl"]
  36. rules:
  37. no-tabs: [0]
  38. indent: [2, tab, {SwitchCase: 1}]
  39. - files: ["web_src/**/*worker.js"]
  40. env:
  41. worker: true
  42. rules:
  43. no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
  44. - files: ["build/generate-images.js"]
  45. rules:
  46. import/no-unresolved: [0]
  47. import/no-extraneous-dependencies: [0]
  48. rules:
  49. accessor-pairs: [2]
  50. array-bracket-newline: [0]
  51. array-bracket-spacing: [2, never]
  52. array-callback-return: [0]
  53. array-element-newline: [0]
  54. arrow-body-style: [0]
  55. arrow-parens: [2, always]
  56. arrow-spacing: [2, {before: true, after: true}]
  57. block-scoped-var: [2]
  58. brace-style: [2, 1tbs, {allowSingleLine: true}]
  59. camelcase: [0]
  60. capitalized-comments: [0]
  61. class-methods-use-this: [0]
  62. comma-dangle: [2, only-multiline]
  63. comma-spacing: [2, {before: false, after: true}]
  64. comma-style: [2, last]
  65. complexity: [0]
  66. computed-property-spacing: [2, never]
  67. consistent-return: [0]
  68. consistent-this: [0]
  69. constructor-super: [2]
  70. curly: [0]
  71. default-case-last: [2]
  72. default-case: [0]
  73. default-param-last: [0]
  74. dot-location: [2, property]
  75. dot-notation: [0]
  76. eol-last: [2]
  77. eqeqeq: [2]
  78. for-direction: [2]
  79. func-call-spacing: [2, never]
  80. func-name-matching: [2]
  81. func-names: [0]
  82. func-style: [0]
  83. function-call-argument-newline: [0]
  84. function-paren-newline: [0]
  85. generator-star-spacing: [0]
  86. getter-return: [2]
  87. grouped-accessor-pairs: [2]
  88. guard-for-in: [0]
  89. id-blacklist: [0]
  90. id-length: [0]
  91. id-match: [0]
  92. implicit-arrow-linebreak: [0]
  93. import/default: [0]
  94. import/dynamic-import-chunkname: [0]
  95. import/export: [2]
  96. import/exports-last: [0]
  97. import/extensions: [2, always, {ignorePackages: true}]
  98. import/first: [2]
  99. import/group-exports: [0]
  100. import/max-dependencies: [0]
  101. import/named: [2]
  102. import/namespace: [0]
  103. import/newline-after-import: [0]
  104. import/no-absolute-path: [0]
  105. import/no-amd: [0]
  106. import/no-anonymous-default-export: [0]
  107. import/no-commonjs: [0]
  108. import/no-cycle: [2, {ignoreExternal: true}]
  109. import/no-default-export: [0]
  110. import/no-deprecated: [0]
  111. import/no-dynamic-require: [0]
  112. import/no-extraneous-dependencies: [2]
  113. import/no-internal-modules: [0]
  114. import/no-mutable-exports: [2]
  115. import/no-named-as-default-member: [0]
  116. import/no-named-as-default: [2]
  117. import/no-named-default: [0]
  118. import/no-named-export: [0]
  119. import/no-namespace: [0]
  120. import/no-nodejs-modules: [0]
  121. import/no-relative-parent-imports: [0]
  122. import/no-restricted-paths: [0]
  123. import/no-self-import: [2]
  124. import/no-unassigned-import: [0]
  125. import/no-unresolved: [2, {commonjs: true}]
  126. import/no-unused-modules: [2, {unusedExports: true}]
  127. import/no-useless-path-segments: [2, {commonjs: true}]
  128. import/no-webpack-loader-syntax: [2]
  129. import/order: [0]
  130. import/prefer-default-export: [0]
  131. import/unambiguous: [0]
  132. indent: [2, 2, {SwitchCase: 1}]
  133. init-declarations: [0]
  134. key-spacing: [2]
  135. keyword-spacing: [2]
  136. line-comment-position: [0]
  137. linebreak-style: [2, unix]
  138. lines-around-comment: [0]
  139. lines-between-class-members: [0]
  140. max-classes-per-file: [0]
  141. max-depth: [0]
  142. max-len: [0]
  143. max-lines-per-function: [0]
  144. max-lines: [0]
  145. max-nested-callbacks: [0]
  146. max-params: [0]
  147. max-statements-per-line: [0]
  148. max-statements: [0]
  149. multiline-comment-style: [2, separate-lines]
  150. multiline-ternary: [0]
  151. new-cap: [0]
  152. new-parens: [2]
  153. newline-per-chained-call: [0]
  154. no-alert: [0]
  155. no-array-constructor: [2]
  156. no-async-promise-executor: [2]
  157. no-await-in-loop: [0]
  158. no-bitwise: [0]
  159. no-buffer-constructor: [0]
  160. no-caller: [2]
  161. no-case-declarations: [2]
  162. no-class-assign: [2]
  163. no-compare-neg-zero: [2]
  164. no-cond-assign: [2, except-parens]
  165. no-confusing-arrow: [0]
  166. no-console: [1, {allow: [info, warn, error]}]
  167. no-const-assign: [2]
  168. no-constant-condition: [0]
  169. no-constructor-return: [2]
  170. no-continue: [0]
  171. no-control-regex: [0]
  172. no-debugger: [1]
  173. no-delete-var: [2]
  174. no-div-regex: [0]
  175. no-dupe-args: [2]
  176. no-dupe-class-members: [2]
  177. no-dupe-else-if: [2]
  178. no-dupe-keys: [2]
  179. no-duplicate-case: [2]
  180. no-duplicate-imports: [2]
  181. no-else-return: [2]
  182. no-empty-character-class: [2]
  183. no-empty-function: [0]
  184. no-empty-pattern: [2]
  185. no-empty: [2, {allowEmptyCatch: true}]
  186. no-eq-null: [2]
  187. no-eval: [2]
  188. no-ex-assign: [2]
  189. no-extend-native: [2]
  190. no-extra-bind: [2]
  191. no-extra-boolean-cast: [2]
  192. no-extra-label: [0]
  193. no-extra-parens: [0]
  194. no-extra-semi: [2]
  195. no-fallthrough: [2]
  196. no-floating-decimal: [0]
  197. no-func-assign: [2]
  198. no-global-assign: [2]
  199. no-implicit-coercion: [0]
  200. no-implicit-globals: [0]
  201. no-implied-eval: [2]
  202. no-import-assign: [2]
  203. no-inline-comments: [0]
  204. no-inner-declarations: [2]
  205. no-invalid-regexp: [2]
  206. no-invalid-this: [0]
  207. no-irregular-whitespace: [2]
  208. no-iterator: [2]
  209. no-label-var: [2]
  210. no-labels: [2]
  211. no-lone-blocks: [2]
  212. no-lonely-if: [0]
  213. no-loop-func: [0]
  214. no-loss-of-precision: [2]
  215. no-magic-numbers: [0]
  216. no-misleading-character-class: [2]
  217. no-mixed-operators: [0]
  218. no-mixed-spaces-and-tabs: [2]
  219. no-multi-assign: [0]
  220. no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true}}]
  221. no-multi-str: [2]
  222. no-negated-condition: [0]
  223. no-nested-ternary: [0]
  224. no-new-func: [2]
  225. no-new-object: [2]
  226. no-new-symbol: [2]
  227. no-new-wrappers: [2]
  228. no-new: [0]
  229. no-nonoctal-decimal-escape: [2]
  230. no-obj-calls: [2]
  231. no-octal-escape: [2]
  232. no-octal: [2]
  233. no-param-reassign: [0]
  234. no-plusplus: [0]
  235. no-promise-executor-return: [0]
  236. no-proto: [2]
  237. no-prototype-builtins: [2]
  238. no-redeclare: [2]
  239. no-regex-spaces: [2]
  240. no-restricted-exports: [0]
  241. no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top]
  242. no-restricted-imports: [0]
  243. no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement]
  244. no-return-assign: [0]
  245. no-return-await: [0]
  246. no-script-url: [2]
  247. no-self-assign: [2, {props: true}]
  248. no-self-compare: [2]
  249. no-sequences: [2]
  250. no-setter-return: [2]
  251. no-shadow-restricted-names: [2]
  252. no-shadow: [0]
  253. no-sparse-arrays: [2]
  254. no-tabs: [2]
  255. no-template-curly-in-string: [2]
  256. no-ternary: [0]
  257. no-this-before-super: [2]
  258. no-throw-literal: [2]
  259. no-trailing-spaces: [2]
  260. no-undef-init: [2]
  261. no-undef: [2, {typeof: true}]
  262. no-undefined: [0]
  263. no-underscore-dangle: [0]
  264. no-unexpected-multiline: [2]
  265. no-unmodified-loop-condition: [2]
  266. no-unneeded-ternary: [0]
  267. no-unreachable-loop: [2]
  268. no-unreachable: [2]
  269. no-unsafe-finally: [2]
  270. no-unsafe-negation: [2]
  271. no-unused-expressions: [2]
  272. no-unused-labels: [2]
  273. no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrorsIgnorePattern: ^_, ignoreRestSiblings: false}]
  274. no-use-before-define: [2, nofunc]
  275. no-useless-backreference: [0]
  276. no-useless-call: [2]
  277. no-useless-catch: [2]
  278. no-useless-computed-key: [2]
  279. no-useless-concat: [2]
  280. no-useless-constructor: [2]
  281. no-useless-escape: [2]
  282. no-useless-rename: [2]
  283. no-useless-return: [2]
  284. no-var: [2]
  285. no-void: [2]
  286. no-warning-comments: [0]
  287. no-whitespace-before-property: [2]
  288. no-with: [2]
  289. nonblock-statement-body-position: [2]
  290. object-curly-newline: [0]
  291. object-curly-spacing: [2, never]
  292. object-shorthand: [2, always]
  293. one-var-declaration-per-line: [0]
  294. one-var: [0]
  295. operator-assignment: [2, always]
  296. operator-linebreak: [2, after]
  297. padded-blocks: [2, never]
  298. padding-line-between-statements: [0]
  299. prefer-arrow-callback: [2, {allowNamedFunctions: true, allowUnboundThis: true}]
  300. prefer-const: [2, {destructuring: all}]
  301. prefer-destructuring: [0]
  302. prefer-exponentiation-operator: [2]
  303. prefer-named-capture-group: [0]
  304. prefer-numeric-literals: [2]
  305. prefer-object-spread: [0]
  306. prefer-promise-reject-errors: [2, {allowEmptyReject: false}]
  307. prefer-regex-literals: [2]
  308. prefer-rest-params: [2]
  309. prefer-spread: [2]
  310. prefer-template: [2]
  311. quote-props: [0]
  312. quotes: [2, single, {avoidEscape: true, allowTemplateLiterals: true}]
  313. radix: [2, as-needed]
  314. require-atomic-updates: [0]
  315. require-await: [0]
  316. require-unicode-regexp: [0]
  317. require-yield: [2]
  318. rest-spread-spacing: [2, never]
  319. semi-spacing: [2, {before: false, after: true}]
  320. semi-style: [2, last]
  321. semi: [2, always, {omitLastInOneLineBlock: true}]
  322. sort-imports: [0]
  323. sort-keys: [0]
  324. sort-vars: [0]
  325. space-before-blocks: [2, always]
  326. space-in-parens: [2, never]
  327. space-infix-ops: [2]
  328. space-unary-ops: [2]
  329. spaced-comment: [2, always]
  330. strict: [0]
  331. switch-colon-spacing: [2]
  332. symbol-description: [2]
  333. template-curly-spacing: [2, never]
  334. template-tag-spacing: [2, never]
  335. unicode-bom: [2, never]
  336. unicorn/better-regex: [0]
  337. unicorn/catch-error-name: [0]
  338. unicorn/consistent-function-scoping: [2]
  339. unicorn/custom-error-definition: [0]
  340. unicorn/error-message: [0]
  341. unicorn/escape-case: [0]
  342. unicorn/expiring-todo-comments: [0]
  343. unicorn/explicit-length-check: [0]
  344. unicorn/filename-case: [0]
  345. unicorn/import-index: [0]
  346. unicorn/import-style: [0]
  347. unicorn/new-for-builtins: [2]
  348. unicorn/no-abusive-eslint-disable: [0]
  349. unicorn/no-array-instanceof: [0]
  350. unicorn/no-console-spaces: [0]
  351. unicorn/no-fn-reference-in-iterator: [0]
  352. unicorn/no-for-loop: [0]
  353. unicorn/no-hex-escape: [0]
  354. unicorn/no-keyword-prefix: [0]
  355. unicorn/no-nested-ternary: [0]
  356. unicorn/no-new-buffer: [0]
  357. unicorn/no-null: [0]
  358. unicorn/no-object-as-default-parameter: [2]
  359. unicorn/no-process-exit: [0]
  360. unicorn/no-reduce: [2]
  361. unicorn/no-unreadable-array-destructuring: [0]
  362. unicorn/no-unsafe-regex: [0]
  363. unicorn/no-unused-properties: [2]
  364. unicorn/no-useless-undefined: [0]
  365. unicorn/no-zero-fractions: [2]
  366. unicorn/number-literal-case: [0]
  367. unicorn/numeric-separators-style: [0]
  368. unicorn/prefer-add-event-listener: [2]
  369. unicorn/prefer-array-find: [2]
  370. unicorn/prefer-dataset: [2]
  371. unicorn/prefer-event-key: [2]
  372. unicorn/prefer-includes: [2]
  373. unicorn/prefer-math-trunc: [2]
  374. unicorn/prefer-modern-dom-apis: [0]
  375. unicorn/prefer-negative-index: [2]
  376. unicorn/prefer-node-append: [0]
  377. unicorn/prefer-node-remove: [0]
  378. unicorn/prefer-number-properties: [0]
  379. unicorn/prefer-optional-catch-binding: [2]
  380. unicorn/prefer-query-selector: [0]
  381. unicorn/prefer-reflect-apply: [0]
  382. unicorn/prefer-replace-all: [0]
  383. unicorn/prefer-set-has: [0]
  384. unicorn/prefer-spread: [0]
  385. unicorn/prefer-starts-ends-with: [2]
  386. unicorn/prefer-string-slice: [0]
  387. unicorn/prefer-ternary: [0]
  388. unicorn/prefer-text-content: [2]
  389. unicorn/prefer-trim-start-end: [2]
  390. unicorn/prefer-type-error: [0]
  391. unicorn/prevent-abbreviations: [0]
  392. unicorn/string-content: [0]
  393. unicorn/throw-new-error: [2]
  394. use-isnan: [2]
  395. valid-typeof: [2, {requireStringLiterals: true}]
  396. vars-on-top: [0]
  397. vue/attributes-order: [0]
  398. vue/component-definition-name-casing: [0]
  399. vue/html-closing-bracket-spacing: [0]
  400. vue/max-attributes-per-line: [0]
  401. vue/one-component-per-file: [0]
  402. wrap-iife: [2, inside]
  403. wrap-regex: [0]
  404. yield-star-spacing: [2, after]
  405. yoda: [2, never]