View | Details | Raw Unified | Return to bug 32320
Collapse All | Expand All

(-)a/branches/ucs-4.2/ucs-4.2-1/management/univention-management-console/www/management/main.js (-2 / +62 lines)
 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
(-)a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/css/site/gallerypane.styl (+5 lines)
 Lines 133-138    Link Here 
133
			background-position: -20px -40px
133
			background-position: -20px -40px
134
			opacity: 0.67
134
			opacity: 0.67
135
135
136
	.umcGalleryItemNoTransition .umcGalleryItem,
137
	.umcGalleryItemNoTransition .umcGalleryItem .umcGalleryName,
138
	.umcGalleryItemNoTransition .umcGalleryItem .umcGalleryDescription
139
		transition: none
140
136
body:not(.umcTouchDevices) .umcGalleryPane .umcGalleryItem:hover
141
body:not(.umcTouchDevices) .umcGalleryPane .umcGalleryItem:hover
137
	cursor: pointer
142
	cursor: pointer
138
	.umcGalleryCategoryFavorite
143
	.umcGalleryCategoryFavorite
(-)a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/LiveSearch.js (-10 / +41 lines)
 Lines 63-69    Link Here 
63
			this.inherited(arguments);
63
			this.inherited(arguments);
64
64
65
			this._searchTextBox = new SearchBox({
65
			this._searchTextBox = new SearchBox({
66
				inlineLabel: this.searchLabel || _('Search term')
66
				inlineLabel: this.searchLabel || _('Search term'),
67
				intermediateChanges: true
67
			});
68
			});
68
			this.addChild(this._searchTextBox);
69
			this.addChild(this._searchTextBox);
69
		},
70
		},
 Lines 70-76    Link Here 
70
71
71
		postCreate: function() {
72
		postCreate: function() {
72
			this.inherited(arguments);
73
			this.inherited(arguments);
73
			this._searchTextBox.on('keyup', lang.hitch(this, 'search'));
74
			this._searchTextBox.on('keydown', lang.hitch(this, 'processKeydown'));
75
			this._searchTextBox.on('keyup', lang.hitch(this, 'processKeyup'));
76
			this._searchTextBox.on('change', lang.hitch(this, 'onSearch'));
74
			this._searchTextBox.on('focus', lang.hitch(this, 'onFocus'));
77
			this._searchTextBox.on('focus', lang.hitch(this, 'onFocus'));
75
			this._searchTextBox.on('blur', lang.hitch(this, 'onBlur'));
78
			this._searchTextBox.on('blur', lang.hitch(this, 'onBlur'));
76
			if (this.collapsible) {
79
			if (this.collapsible) {
 Lines 115-135    Link Here 
115
			// event stub
118
			// event stub
116
		},
119
		},
117
120
118
		_lastValue: null,
121
		processKeydown: function(keyEvent) {
119
		search: function() {
122
			keyEvent = (keyEvent) ? keyEvent : window.event;
120
			// ignore empty search expect something was searched before
123
			var keyCode = keyEvent.which || keyEvent.keyCode;
121
			// (e.g. deleting the last letter should make a new search so that everything is shown)
124
122
			var searchPattern = this.get('value');
125
			// if the searchbox has a value and tab is pressed
123
			if (searchPattern || this._lastValue) {
126
			// fire an onTab event and prevent default of tab
124
				this._lastValue = searchPattern;
127
			if (keyCode === 9 && this.get('value')) {
125
				this.onSearch();
128
				keyEvent.preventDefault();
129
				this.onTab(keyEvent.shiftKey);
126
			}
130
			}
127
		},
131
		},
128
132
133
		processKeyup: function(keyEvent) {
134
			keyEvent = (keyEvent) ? keyEvent : window.event;
135
			var keyCode = keyEvent.which || keyEvent.keyCode;
136
137
			// if the enter key is pressed send enter pressed event
138
			if (keyCode === 13) {
139
				this.onEnterKey(this.get('value'));
140
				return;
141
			}
142
143
			// if the escape key is pressed clear the search
144
			if (keyCode === 27) {
145
				this.set('value', '');
146
				return;
147
			}
148
		},
149
129
		onSearch: function() {
150
		onSearch: function() {
130
			// event stub
151
			// event stub
131
		},
152
		},
132
153
154
		onEnterKey: function(searchString) {
155
			// event stub
156
		},
157
158
		onTab: function(shiftPressed) {
159
			// event stub
160
			// fires when the tab key is pressed
161
			// does not fire on empty search strings
162
		},
163
133
		getSearchQuery: function(searchPattern) {
164
		getSearchQuery: function(searchPattern) {
134
			// sanitize the search pattern
165
			// sanitize the search pattern
135
			searchPattern = regexp.escapeString(searchPattern);
166
			searchPattern = regexp.escapeString(searchPattern);

Return to bug 32320