fix keys for keyboard shortcuts in content type editors

This commit is contained in:
Mads Rasmussen
2018-06-04 22:44:12 +02:00
parent 4dbec70f00
commit 6697c67f38
3 changed files with 208 additions and 150 deletions

View File

@@ -31,14 +31,36 @@
"general_design",
"general_listView",
"general_rights",
"treeHeaders_templates"
"treeHeaders_templates",
"main_sections",
"shortcuts_navigateSections",
"shortcuts_addTab",
"shortcuts_addProperty",
"shortcuts_addEditor",
"shortcuts_editDataType",
"shortcuts_toggleListView",
"shortcuts_toggleAllowAsRoot",
"shortcuts_addChildNode",
"shortcuts_addTemplate"
];
localizationService.localizeMany(labelKeys).then(function (values) {
// navigation
vm.labels.design = values[0];
vm.labels.listview = values[1];
vm.labels.permissions = values[2];
vm.labels.templates = values[3];
// keyboard shortcuts
vm.labels.sections = values[4];
vm.labels.navigateSections = values[5];
vm.labels.addTab = values[6];
vm.labels.addProperty = values[7];
vm.labels.addEditor = values[8];
vm.labels.editDataType = values[9];
vm.labels.toggleListView = values[10];
vm.labels.allowAsRoot = values[11];
vm.labels.addChildNode = values[12];
vm.labels.addTemplate = values[13];
var buttons = [
{
@@ -68,75 +90,75 @@
}
];
vm.page.keyboardShortcutsOverview = [
{
"name": vm.labels.sections,
"shortcuts": [
{
"description": vm.labels.navigateSections,
"keys": [{ "key": "1" }, { "key": "4" }],
"keyRange": true
}
]
},
{
"name": vm.labels.design,
"shortcuts": [
{
"description": vm.labels.addTab,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": vm.labels.addProperty,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": vm.labels.addEditor,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": vm.labels.editDataType,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": vm.labels.listview,
"shortcuts": [
{
"description": vm.labels.toggleListView,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": vm.labels.permissions,
"shortcuts": [
{
"description": vm.labels.allowAsRoot,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": vm.labels.addChildNode,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
},
{
"name": vm.labels.templates,
"shortcuts": [
{
"description": vm.labels.addTemplate,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
}
]
}
];
loadButtons(buttons);
});
vm.page.keyboardShortcutsOverview = [
{
"name": localizationService.localize("main_sections"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_navigateSections"),
"keys": [{ "key": "1" }, { "key": "4" }],
"keyRange": true
}
]
},
{
"name": localizationService.localize("general_design"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTab"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": localizationService.localize("shortcuts_addProperty"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": localizationService.localize("shortcuts_addEditor"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": localizationService.localize("shortcuts_editDataType"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": localizationService.localize("general_listView"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleListView"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": localizationService.localize("general_rights"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleAllowAsRoot"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": localizationService.localize("shortcuts_addChildNode"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
},
{
"name": localizationService.localize("treeHeaders_templates"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTemplate"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
}
]
}
];
contentTypeHelper.checkModelsBuilderStatus().then(function (result) {
vm.page.modelsBuilder = result;
if (result) {

View File

@@ -26,14 +26,34 @@
var labelKeys = [
"general_design",
"general_listView",
"general_rights"
"general_rights",
"main_sections",
"shortcuts_navigateSections",
"shortcuts_addTab",
"shortcuts_addProperty",
"shortcuts_addEditor",
"shortcuts_editDataType",
"shortcuts_toggleListView",
"shortcuts_toggleAllowAsRoot",
"shortcuts_addChildNode"
];
localizationService.localizeMany(labelKeys).then(function (values) {
// navigation
vm.labels.design = values[0];
vm.labels.listview = values[1];
vm.labels.permissions = values[2];
// keyboard shortcuts
vm.labels.sections = values[3];
vm.labels.navigateSections = values[4];
vm.labels.addTab = values[5];
vm.labels.addProperty = values[6];
vm.labels.addEditor = values[7];
vm.labels.editDataType = values[8];
vm.labels.toggleListView = values[9];
vm.labels.allowAsRoot = values[10];
vm.labels.addChildNode = values[11];
vm.page.navigation = [
{
@@ -54,64 +74,63 @@
}
];
vm.page.keyboardShortcutsOverview = [
{
"name": vm.labels.sections,
"shortcuts": [
{
"description": vm.labels.navigateSections,
"keys": [{ "key": "1" }, { "key": "3" }],
"keyRange": true
}
]
},
{
"name": vm.labels.design,
"shortcuts": [
{
"description": vm.labels.addTab,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": vm.labels.addProperty,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": vm.labels.addEditor,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": vm.labels.editDataType,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": vm.labels.listview,
"shortcuts": [
{
"description": vm.labels.toggleListView,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": vm.labels.permissions,
"shortcuts": [
{
"description": vm.labels.allowAsRoot,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": vm.labels.addChildNode,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
}
];
});
vm.page.keyboardShortcutsOverview = [
{
"name": localizationService.localize("main_sections"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_navigateSections"),
"keys": [{ "key": "1" }, { "key": "3" }],
"keyRange": true
}
]
},
{
"name": localizationService.localize("general_design"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTab"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": localizationService.localize("shortcuts_addProperty"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": localizationService.localize("shortcuts_addEditor"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": localizationService.localize("shortcuts_editDataType"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": localizationService.localize("general_listView"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleListView"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": localizationService.localize("general_rights"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleAllowAsRoot"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": localizationService.localize("shortcuts_addChildNode"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
}
];
contentTypeHelper.checkModelsBuilderStatus().then(function (result) {
vm.page.modelsBuilder = result;
if (result) {

View File

@@ -22,8 +22,24 @@
vm.page.saveButtonState = "init";
vm.labels = {};
localizationService.localize("general_design").then(function(data){
vm.labels.design = data;
var labelKeys = [
"general_design",
"shortcuts_shortcut",
"shortcuts_addTab",
"shortcuts_addProperty",
"shortcuts_addEditor",
"shortcuts_editDataType"
];
localizationService.localizeMany(labelKeys).then(function(values){
vm.labels.design = values[0];
vm.labels.shortcut = values[1];
vm.labels.addTab = values[2];
vm.labels.addProperty = values[3];
vm.labels.addEditor = values[4];
vm.labels.editDataType = values[5];
vm.page.navigation = [
{
"name": vm.labels.design,
@@ -32,31 +48,32 @@
"active": true
}
];
});
vm.page.keyboardShortcutsOverview = [
{
"name": localizationService.localize("shortcuts_shortcut"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTab"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": localizationService.localize("shortcuts_addProperty"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": localizationService.localize("shortcuts_addEditor"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": localizationService.localize("shortcuts_editDataType"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
}
];
vm.page.keyboardShortcutsOverview = [
{
"name": vm.labels.shortcut,
"shortcuts": [
{
"description": vm.labels.addTab,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": vm.labels.addProperty,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": vm.labels.addEditor,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": vm.labels.editDataType,
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
}
];
});
contentTypeHelper.checkModelsBuilderStatus().then(function (result) {
vm.page.modelsBuilder = result;