mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-24 19:56:12 +01:00
[CLEANUP] Adopt .editorconfig settings from the TYPO3 core (#176)
Also drop redundancies and sort the entries.
This commit is contained in:
parent
dee89c5266
commit
373c7965b4
2 changed files with 62 additions and 83 deletions
|
@ -5,66 +5,45 @@ root = true
|
|||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# HTML files
|
||||
[*.html]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# CSS files
|
||||
[*.css]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
|
||||
# LESS files
|
||||
[*.less]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# SCSS files
|
||||
[*.scss]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
# JS files
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# PHP files
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# MD files
|
||||
[*.md]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# ReST files
|
||||
[*.rst]
|
||||
indent_style = space
|
||||
indent_size = 3
|
||||
|
||||
# TypoScript files
|
||||
[*.typoscript]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# YML files
|
||||
[{*.yml,*.yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# JSON files
|
||||
[{*.jsonl}]
|
||||
indent_style = space
|
||||
[*.json]
|
||||
indent_style = tab
|
||||
|
||||
# package.json
|
||||
[package.json]
|
||||
indent_size = 2
|
||||
|
||||
# XML files
|
||||
[*.xml]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
# ReST files
|
||||
[*.rst]
|
||||
indent_size = 3
|
||||
max_line_length = 80
|
||||
|
||||
# SQL files
|
||||
[*.sql]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
# TypoScript files
|
||||
[*.{typoscript,tsconfig}]
|
||||
indent_size = 2
|
||||
|
||||
# YAML files
|
||||
[{*.yml,*.yaml}]
|
||||
indent_size = 2
|
||||
|
||||
# XLF files
|
||||
[*.xlf]
|
||||
indent_style = tab
|
||||
|
||||
# .htaccess
|
||||
[.htaccess]
|
||||
indent_style = tab
|
||||
|
|
|
@ -2,40 +2,40 @@ var TYPO3 = TYPO3 || {};
|
|||
TYPO3.tea = {};
|
||||
|
||||
TYPO3.tea.makeSortable = function (table) {
|
||||
var th = table.tHead,
|
||||
i;
|
||||
th && (th = th.rows[0]) && (th = th.cells);
|
||||
if (th) i = th.length;
|
||||
else return;
|
||||
while (--i >= 0)
|
||||
(function (i) {
|
||||
var dir = 1;
|
||||
th[i].addEventListener("click", function () {
|
||||
TYPO3.tea.sortTable(table, i, (dir = 1 - dir));
|
||||
});
|
||||
})(i);
|
||||
var th = table.tHead,
|
||||
i;
|
||||
th && (th = th.rows[0]) && (th = th.cells);
|
||||
if (th) i = th.length;
|
||||
else return;
|
||||
while (--i >= 0)
|
||||
(function (i) {
|
||||
var dir = 1;
|
||||
th[i].addEventListener("click", function () {
|
||||
TYPO3.tea.sortTable(table, i, (dir = 1 - dir));
|
||||
});
|
||||
})(i);
|
||||
};
|
||||
|
||||
TYPO3.tea.sortTable = function (table, col, reverse) {
|
||||
var tb = table.tBodies[0],
|
||||
tr = Array.prototype.slice.call(tb.rows, 0),
|
||||
i;
|
||||
reverse = -(+reverse || -1);
|
||||
tr = tr.sort(function (a, b) {
|
||||
return (
|
||||
reverse *
|
||||
a.cells[col].textContent
|
||||
.trim()
|
||||
.localeCompare(b.cells[col].textContent.trim())
|
||||
);
|
||||
});
|
||||
for (i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
|
||||
var tb = table.tBodies[0],
|
||||
tr = Array.prototype.slice.call(tb.rows, 0),
|
||||
i;
|
||||
reverse = -(+reverse || -1);
|
||||
tr = tr.sort(function (a, b) {
|
||||
return (
|
||||
reverse *
|
||||
a.cells[col].textContent
|
||||
.trim()
|
||||
.localeCompare(b.cells[col].textContent.trim())
|
||||
);
|
||||
});
|
||||
for (i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var t = document.querySelectorAll(".tx-tea table"),
|
||||
i = t.length;
|
||||
while (--i >= 0) {
|
||||
TYPO3.tea.makeSortable(t[i]);
|
||||
}
|
||||
var t = document.querySelectorAll(".tx-tea table"),
|
||||
i = t.length;
|
||||
while (--i >= 0) {
|
||||
TYPO3.tea.makeSortable(t[i]);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue