|
Lines 46-51
Link Here
|
| 46 |
"dojo/promise/all", |
46 |
"dojo/promise/all", |
| 47 |
"dojo/cookie", |
47 |
"dojo/cookie", |
| 48 |
"dojo/topic", |
48 |
"dojo/topic", |
|
|
49 |
"dojo/query", |
| 49 |
"dojo/io-query", |
50 |
"dojo/io-query", |
| 50 |
"dojo/store/Memory", |
51 |
"dojo/store/Memory", |
| 51 |
"dojo/store/Observable", |
52 |
"dojo/store/Observable", |
|
Lines 85-91
Link Here
|
| 85 |
"umc/i18n!management", |
86 |
"umc/i18n!management", |
| 86 |
"dojo/sniff" // has("ie"), has("ff") |
87 |
"dojo/sniff" // has("ie"), has("ff") |
| 87 |
], function(declare, lang, kernel, array, baseWin, win, on, mouse, touch, tap, aspect, has, |
88 |
], function(declare, lang, kernel, array, baseWin, win, on, mouse, touch, tap, aspect, has, |
| 88 |
Evented, Deferred, all, cookie, topic, ioQuery, Memory, Observable, |
89 |
Evented, Deferred, all, cookie, topic, domQuery, ioQuery, Memory, Observable, |
| 89 |
dom, domAttr, domClass, domGeometry, domConstruct, put, hash, styles, entities, gfx, registry, tools, login, dialog, store, |
90 |
dom, domAttr, domClass, domGeometry, domConstruct, put, hash, styles, entities, gfx, registry, tools, login, dialog, store, |
| 90 |
_WidgetBase, Menu, MenuItem, PopupMenuItem, MenuSeparator, Tooltip, DropDownButton, StackContainer, menu, MenuButton, |
91 |
_WidgetBase, Menu, MenuItem, PopupMenuItem, MenuSeparator, Tooltip, DropDownButton, StackContainer, menu, MenuButton, |
| 91 |
TabController, LiveSearch, GalleryPane, ContainerWidget, Page, Form, Button, Text, _ |
92 |
TabController, LiveSearch, GalleryPane, ContainerWidget, Page, Form, Button, Text, _ |
|
Lines 1327-1336
Link Here
|
| 1327 |
if (!this._header._search) { |
1328 |
if (!this._header._search) { |
| 1328 |
return; |
1329 |
return; |
| 1329 |
} |
1330 |
} |
|
|
1331 |
|
| 1332 |
on(baseWin.doc, 'keyup', lang.hitch(this, function(keyEvent) { |
| 1333 |
// focus search if Ctr+Enter was pressed |
| 1334 |
|
| 1335 |
keyEvent = (keyEvent) ? keyEvent : window.event; |
| 1336 |
var keyCode = keyEvent.which || keyEvent.keyCode; |
| 1337 |
// keyCode 13 is return key |
| 1338 |
if (keyCode === 13 && keyEvent.ctrlKey) { |
| 1339 |
this._header._search.focus(); |
| 1340 |
} |
| 1341 |
})); |
| 1342 |
|
| 1330 |
this._header._search.on('search', lang.hitch(this, function() { |
1343 |
this._header._search.on('search', lang.hitch(this, function() { |
| 1331 |
this.switchToOverview(); |
1344 |
this.switchToOverview(); |
| 1332 |
this._updateQuery(null); |
1345 |
this._updateQuery(null); |
| 1333 |
})); |
1346 |
})); |
|
|
1347 |
|
| 1348 |
this._header._search.on('tab', lang.hitch(this, function(shiftPressed) { |
| 1349 |
// move the focus to the next or previous search entry |
| 1350 |
|
| 1351 |
var focusedModule = domQuery('.umcGalleryItemKeyboardFocus', this._grid.contentNode)[0]; |
| 1352 |
if (!focusedModule) { |
| 1353 |
// the search did not yield searchresults |
| 1354 |
return; |
| 1355 |
} |
| 1356 |
|
| 1357 |
var newFocusedModule; |
| 1358 |
if (shiftPressed) { |
| 1359 |
// focus the previous search entry or the last entry if at the beginning |
| 1360 |
newFocusedModule = focusedModule.previousSibling ? focusedModule.previousSibling : domQuery('.umcGalleryWrapperItem', this._grid.contentNode).pop(); |
| 1361 |
} else { |
| 1362 |
// focus the next search entry or the first entry if at the end |
| 1363 |
newFocusedModule = focusedModule.nextSibling ? focusedModule.nextSibling : domQuery('.umcGalleryWrapperItem', this._grid.contentNode).shift(); |
| 1364 |
} |
| 1365 |
|
| 1366 |
// remove focus from old module and focus new module |
| 1367 |
domClass.add(newFocusedModule, 'umcGalleryItemKeyboardFocus umcGalleryItemNoTransition umcGalleryItemActive'); |
| 1368 |
domClass.remove(focusedModule, 'umcGalleryItemKeyboardFocus umcGalleryItemNoTransition umcGalleryItemActive'); |
| 1369 |
})); |
| 1370 |
|
| 1371 |
this._header._search.on('enterKey', lang.hitch(this, function(searchString) { |
| 1372 |
// open the focused module |
| 1373 |
|
| 1374 |
// return if we have not searched anything or we are not in the overview |
| 1375 |
if (!searchString || !domClass.contains(baseWin.body(), 'umcOverviewShown')) { |
| 1376 |
return; |
| 1377 |
} |
| 1378 |
|
| 1379 |
var modules = this._grid.store.query(this._grid.query, this._grid.queryOptions); |
| 1380 |
// Only open if there are modules for the search |
| 1381 |
if (modules.length) { |
| 1382 |
var index = domQuery('.umcGalleryItemKeyboardFocus', this._grid.contentNode)[0].rowIndex; |
| 1383 |
this.openModule(modules[index]); |
| 1384 |
} |
| 1385 |
})); |
| 1334 |
}, |
1386 |
}, |
| 1335 |
|
1387 |
|
| 1336 |
_lastSearchPattern: null, |
1388 |
_lastSearchPattern: null, |
|
Lines 1370-1375
Link Here
|
| 1370 |
|
1422 |
|
| 1371 |
this._grid.updateQuery(searchPattern, searchQuery, category); |
1423 |
this._grid.updateQuery(searchPattern, searchQuery, category); |
| 1372 |
|
1424 |
|
|
|
1425 |
// focus the first search entry that can be opened with the keyboard |
| 1426 |
if (!category) { |
| 1427 |
var modules = domQuery('.umcGalleryWrapperItem', this._grid.contentNode); |
| 1428 |
if (modules.length) { |
| 1429 |
domClass.add(modules[0], 'umcGalleryItemKeyboardFocus umcGalleryItemNoTransition umcGalleryItemActive'); |
| 1430 |
} |
| 1431 |
} |
| 1432 |
|
| 1373 |
// update the search label |
1433 |
// update the search label |
| 1374 |
domClass.toggle(this._searchText.domNode, 'dijitDisplayNone', !!category); |
1434 |
domClass.toggle(this._searchText.domNode, 'dijitDisplayNone', !!category); |
| 1375 |
this._searchText.set('content', _('Search query ›%s‹', entities.encode(searchPattern))); |
1435 |
this._searchText.set('content', _('Search query ›%s‹', entities.encode(searchPattern))); |
|
Lines 1489-1495
Link Here
|
| 1489 |
styles.insertCssRule(lang.replace('{0}.umcModuleTab-{1}.dijitTabChecked', [defaultClasses, module_flavor_css]), cssProperties); |
1549 |
styles.insertCssRule(lang.replace('{0}.umcModuleTab-{1}.dijitTabChecked', [defaultClasses, module_flavor_css]), cssProperties); |
| 1490 |
// color action buttons in an dgrid |
1550 |
// color action buttons in an dgrid |
| 1491 |
styles.insertCssRule(lang.replace('.umcModule.color-{0} .umcGridHeader .dijitButtonText', [tab.categoryColor]), lang.replace('color: {0}', [color])); |
1551 |
styles.insertCssRule(lang.replace('.umcModule.color-{0} .umcGridHeader .dijitButtonText', [tab.categoryColor]), lang.replace('color: {0}', [color])); |
| 1492 |
// color scroll to top floating button |
1552 |
// color scroll to top floating button |
| 1493 |
styles.insertCssRule(lang.replace('.umcModule.color-{0} .scrollToTopFloatingButton', [tab.categoryColor]), lang.replace('background-color: {0}', [color])); |
1553 |
styles.insertCssRule(lang.replace('.umcModule.color-{0} .scrollToTopFloatingButton', [tab.categoryColor]), lang.replace('background-color: {0}', [color])); |
| 1494 |
}, |
1554 |
}, |
| 1495 |
|
1555 |
|