) {
+ draggable.addEventListener('dragstart', function (e: DragEvent) {
+ if (!e.dataTransfer) return;
+ e.dataTransfer.setData('text/plain', draggable.getAttribute("fy-index") as string);
+ e.dataTransfer.dropEffect = 'move';
+ });
+
+ draggable.addEventListener('dragover', function (e: DragEvent) {
+ e.preventDefault();
+ });
+
+ draggable.addEventListener('drop', function (e: DragEvent) {
+ if (!e.dataTransfer) return;
+ e.preventDefault();
+ const before: number = parseInt(e.dataTransfer.getData('text/plain'));
+ const after: number = parseInt(draggable.getAttribute("fy-index") as string);
+ (!(before === after || [before, after].includes(-2))) &&
+ swap(storage.tools, before, after);
+ });
+ }
+})
@@ -106,16 +143,44 @@ function remove() {
-
-
+
+{
+ "zh": {
+ "add": "添加工具",
+ },
+ "en": {
+ "add": "Add Tool",
+ },
+ "tw": {
+ "add": "添加工具",
+ },
+ "ru": {
+ "add": "Добавить инструмент",
+ },
+ "de": {
+ "add": "Werkzeug hinzufügen",
+ },
+ "fr": {
+ "add": "Ajouter un outil",
+ },
+ "ja": {
+ "add": "ツールを追加",
+ }
+}
+