Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8: Ensure all other elements can't be focused while infinite editing is active (Focus/Tab lock) #4526

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6ffd2af
Add a TODO in the relevant file - Still need to figure out the proper…
BatJan Feb 11, 2019
9818f2e
Merge branch 'temp8' into feature/temp-v8-4525
BatJan Feb 15, 2019
b174dff
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Mar 24, 2019
fd7221f
Install the wicg inert polyfill
BatJan Mar 24, 2019
b3f1b4c
Add a focustrap service
BatJan Mar 24, 2019
cf69f3b
Inject the focus trap service into the umbeditors directive
BatJan Mar 24, 2019
4e43fa4
Oops - The polyfill is of course not needed during installation :-)
BatJan Mar 24, 2019
01a3df3
Add some comments to remember the progress and what needs to be done
BatJan Mar 24, 2019
28e548a
Add a toggleInert method to ensure that when more than one infinite o…
BatJan Mar 31, 2019
63c16f6
Add method for removing the inert attribute
BatJan Mar 31, 2019
80e783d
Remove comments, change mode from "overlay" to "modal" to make a more…
BatJan Mar 31, 2019
d86d5b2
Set focus on the new refocused element - Probably needs to be refacto…
BatJan Mar 31, 2019
aaca68b
Refactor code to resemble the setup in other services where a "servic…
BatJan Mar 31, 2019
f284da7
add the addFocusTrap and removeFocusTrap functions to the overlay ser…
BatJan Mar 31, 2019
c4afcf7
Remove initial TODO comment
BatJan Apr 1, 2019
6d71711
Started refactoring the focusTrap service into an inert directive ins…
BatJan Apr 2, 2019
a7fadde
add umbInertAttribute directive - Still WIP
BatJan Apr 2, 2019
43ad1ef
Add inert directive where it's needed in order to help us achieve the…
BatJan Apr 2, 2019
08d3e1f
Remove console logs and refactor the infinite overlay into a classnam…
BatJan Apr 2, 2019
274435f
Move directive to parent
BatJan Apr 2, 2019
d0cbee4
Finishing up the directive
BatJan Apr 2, 2019
439f6a4
Remove the focusTrap service
BatJan Apr 2, 2019
4264db1
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Apr 3, 2019
326ced2
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Apr 7, 2019
f6eb29c
Merge branch 'v8/dev' into pr/4526
nul800sebastiaan Sep 30, 2019
cc7d9f9
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Oct 1, 2019
1fbd332
Add todo based on HQ feedback
BatJan Oct 1, 2019
4dbc008
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Oct 12, 2019
ebf890f
Remove directive from html files
BatJan Oct 12, 2019
29f2553
Add focusLock service
BatJan Oct 12, 2019
7f58568
Add focus lock service
BatJan Oct 12, 2019
13efdc8
Add some more POC code
BatJan Oct 12, 2019
05595a7
Add extra paramfor the addFocusLockMethod
BatJan Oct 12, 2019
79b7707
Refactor focusLock service
BatJan Oct 12, 2019
2c8a47f
Refactor add and remove methods
BatJan Oct 12, 2019
0917f21
Refactor add and remove methods
BatJan Oct 12, 2019
0c36bdb
Remove old inert attribute directive
BatJan Oct 12, 2019
32f5f70
Refactor method name and params
BatJan Oct 12, 2019
b30bc7e
Refactor methods taking our and inner overlays into account
BatJan Oct 12, 2019
160b5a1
Reorder function
BatJan Oct 12, 2019
649269f
Make add and remove focus functions for normal overlays work
BatJan Oct 12, 2019
b991197
Inject the focusLockService and call the add and remove functions
BatJan Oct 12, 2019
f8875ec
Mode the function calls to the correct locations in the umbeditor dir…
BatJan Oct 13, 2019
554540f
Refactor method after changing when the methods are called
BatJan Oct 13, 2019
5586ae0
Refactor enabling and disabling editors into a method
BatJan Oct 13, 2019
4b435f7
Add focus lock
BatJan Oct 13, 2019
4025b6c
Remove unused method and add some comments for helper methods
BatJan Oct 13, 2019
ea68493
Increase timeout to 500ms in order to fix transclusion issue
BatJan Oct 13, 2019
4975960
Add resetFocus method and increase the focusLock timeout in order to …
BatJan Oct 13, 2019
7db50b4
Activate focus lock on default overlays
BatJan Oct 13, 2019
627186b
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Oct 21, 2019
83c0e6e
Remove unused parameter
BatJan Oct 21, 2019
dd8b966
Refactor code to use a better pattern
BatJan Oct 21, 2019
b83d383
Move helpers into the focusLock method
BatJan Oct 21, 2019
50c9f93
Add focus check in order to decide whether or not the first element s…
BatJan Oct 21, 2019
3d7e880
Merge branch 'v8/dev' into pr/4526
nul800sebastiaan Oct 29, 2019
ff12ede
Try to fix whitespace
nul800sebastiaan Oct 29, 2019
fac9aed
Try to fix whitespace again
nul800sebastiaan Oct 29, 2019
edc8ace
Merge branch 'dev-v8' into feature/temp-v8-4525
BatJan Nov 7, 2019
0184599
Fix EnsureMemberProperties data type IDs
Apr 9, 2020
fdb3c55
Added support for Grid Editor in an IPublishedElement - resolves #7916
robertjf Apr 9, 2020
9f7c44c
7879: Handle for multiple picked media relations
benjaminc Apr 1, 2020
bcea0f6
Added null check on raw JSON to prevent null reference error deserial…
mattchanner Apr 1, 2020
199d908
#7658 Fix linking account if multiple IDP on common user overlay (#7845)
lillheaton Apr 9, 2020
41c51ec
Merge branch 'v8/contrib' into feature/temp-v8-4525
BatJan Apr 10, 2020
f988ff6
Merge branch 'v8/contrib' into feature/temp-v8-4525
BatJan Apr 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ private void EnsureMemberProperties(List<IPublishedPropertyType> propertyTypes,
{ "Email", Constants.DataTypes.Textbox },
{ "Username", Constants.DataTypes.Textbox },
{ "PasswordQuestion", Constants.DataTypes.Textbox },
{ "Comments", Constants.DataTypes.Textbox },
{ "Comments", Constants.DataTypes.Textarea },
{ "IsApproved", Constants.DataTypes.Boolean },
{ "IsLockedOut", Constants.DataTypes.Boolean },
{ "LastLockoutDate", Constants.DataTypes.DateTime },
{ "CreateDate", Constants.DataTypes.DateTime },
{ "LastLoginDate", Constants.DataTypes.DateTime },
{ "LastPasswordChangeDate", Constants.DataTypes.DateTime },
{ "LastLockoutDate", Constants.DataTypes.LabelDateTime },
{ "CreateDate", Constants.DataTypes.LabelDateTime },
{ "LastLoginDate", Constants.DataTypes.LabelDateTime },
{ "LastPasswordChangeDate", Constants.DataTypes.LabelDateTime }
};

#region Content type
Expand Down
8 changes: 8 additions & 0 deletions src/Umbraco.Web.UI.Client/gulp/tasks/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ function dependencies() {
"name": "underscore",
"src": ["node_modules/underscore/underscore-min.js"],
"base": "./node_modules/underscore"
},
{
"name": "wicg-inert",
"src": [
"./node_modules/wicg-inert/dist/inert.min.js",
"./node_modules/wicg-inert/dist/inert.min.js.map"
],
"base": "./node_modules/wicg-inert"
}
];

Expand Down
5 changes: 5 additions & 0 deletions src/Umbraco.Web.UI.Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 86 additions & 85 deletions src/Umbraco.Web.UI.Client/package.json
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
{
"private": true,
"scripts": {
"test": "gulp runTests",
"unit": "gulp testUnit",
"e2e": "gulp testE2e",
"build": "gulp build",
"dev": "gulp dev",
"fastdev": "gulp fastdev",
"watch": "gulp watch"
},
"dependencies": {
"ace-builds": "1.4.2",
"angular": "1.7.9",
"angular-animate": "1.7.5",
"angular-aria": "1.7.9",
"angular-chart.js": "^1.1.1",
"angular-cookies": "1.7.5",
"angular-dynamic-locale": "0.1.37",
"angular-i18n": "1.7.5",
"angular-local-storage": "0.7.1",
"angular-messages": "1.7.5",
"angular-mocks": "1.7.5",
"angular-route": "1.7.5",
"angular-sanitize": "1.7.5",
"angular-touch": "1.7.5",
"angular-ui-sortable": "0.19.0",
"animejs": "2.2.0",
"bootstrap-social": "5.1.1",
"chart.js": "^2.8.0",
"clipboard": "2.0.4",
"diff": "3.5.0",
"flatpickr": "4.5.2",
"font-awesome": "4.7.0",
"jquery": "^3.4.1",
"jquery-ui-dist": "1.12.1",
"jquery-ui-touch-punch": "0.2.3",
"lazyload-js": "1.0.0",
"moment": "2.22.2",
"ng-file-upload": "12.2.13",
"nouislider": "14.1.1",
"npm": "6.13.6",
"signalr": "2.4.0",
"spectrum-colorpicker": "1.8.0",
"tinymce": "4.9.7",
"typeahead.js": "0.11.1",
"underscore": "1.9.1"
},
"devDependencies": {
"@babel/core": "7.6.4",
"@babel/preset-env": "7.6.3",
"autoprefixer": "9.6.5",
"caniuse-lite": "^1.0.30001037",
"cssnano": "4.1.10",
"fs": "0.0.2",
"gulp": "4.0.2",
"gulp-angular-embed-templates": "^2.3.0",
"gulp-babel": "8.0.0",
"gulp-clean-css": "4.2.0",
"gulp-cli": "^2.2.0",
"gulp-concat": "2.6.1",
"gulp-eslint": "6.0.0",
"gulp-imagemin": "6.1.1",
"gulp-less": "4.0.1",
"gulp-notify": "^3.0.0",
"gulp-postcss": "8.0.0",
"gulp-rename": "1.4.0",
"gulp-sort": "2.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-watch": "5.0.1",
"gulp-wrap": "0.15.0",
"gulp-wrap-js": "0.4.1",
"jasmine-core": "3.5.0",
"karma": "4.4.1",
"karma-jasmine": "2.0.1",
"karma-junit-reporter": "2.0.1",
"karma-phantomjs-launcher": "1.0.4",
"karma-spec-reporter": "0.0.32",
"less": "3.10.3",
"lodash": "4.17.15",
"marked": "^0.7.0",
"merge-stream": "2.0.0",
"run-sequence": "2.2.1"
}
}
{
"private": true,
"scripts": {
"test": "gulp runTests",
"unit": "gulp testUnit",
"e2e": "gulp testE2e",
"build": "gulp build",
"dev": "gulp dev",
"fastdev": "gulp fastdev",
"watch": "gulp watch"
},
"dependencies": {
"ace-builds": "1.4.2",
"angular": "1.7.9",
"angular-animate": "1.7.5",
"angular-aria": "1.7.9",
"angular-chart.js": "^1.1.1",
"angular-cookies": "1.7.5",
"angular-dynamic-locale": "0.1.37",
"angular-i18n": "1.7.5",
"angular-local-storage": "0.7.1",
"angular-messages": "1.7.5",
"angular-mocks": "1.7.5",
"angular-route": "1.7.5",
"angular-sanitize": "1.7.5",
"angular-touch": "1.7.5",
"angular-ui-sortable": "0.19.0",
"animejs": "2.2.0",
"bootstrap-social": "5.1.1",
"chart.js": "^2.8.0",
"clipboard": "2.0.4",
"diff": "3.5.0",
"flatpickr": "4.5.2",
"font-awesome": "4.7.0",
"jquery": "^3.4.1",
"jquery-ui-dist": "1.12.1",
"jquery-ui-touch-punch": "0.2.3",
"lazyload-js": "1.0.0",
"moment": "2.22.2",
"ng-file-upload": "12.2.13",
"nouislider": "14.1.1",
"npm": "6.13.6",
"signalr": "2.4.0",
"spectrum-colorpicker": "1.8.0",
"tinymce": "4.9.7",
"typeahead.js": "0.11.1",
"underscore": "1.9.1",
"wicg-inert": "^2.1.0"
},
"devDependencies": {
"@babel/core": "7.6.4",
"@babel/preset-env": "7.6.3",
"autoprefixer": "9.6.5",
"caniuse-lite": "^1.0.30001037",
"cssnano": "4.1.10",
"fs": "0.0.2",
"gulp": "4.0.2",
"gulp-angular-embed-templates": "^2.3.0",
"gulp-babel": "8.0.0",
"gulp-clean-css": "4.2.0",
"gulp-cli": "^2.2.0",
"gulp-concat": "2.6.1",
"gulp-eslint": "6.0.0",
"gulp-imagemin": "6.1.1",
"gulp-less": "4.0.1",
"gulp-notify": "^3.0.0",
"gulp-postcss": "8.0.0",
"gulp-rename": "1.4.0",
"gulp-sort": "2.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-watch": "5.0.1",
"gulp-wrap": "0.15.0",
"gulp-wrap-js": "0.4.1",
"jasmine-core": "3.5.0",
"karma": "4.4.1",
"karma-jasmine": "2.0.1",
"karma-junit-reporter": "2.0.1",
"karma-phantomjs-launcher": "1.0.4",
"karma-spec-reporter": "0.0.32",
"less": "3.10.3",
"lodash": "4.17.15",
"marked": "^0.7.0",
"merge-stream": "2.0.0",
"run-sequence": "2.2.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,89 +1,87 @@
(function () {
'use strict';

function EditorsDirective($timeout, eventsService) {
function EditorsDirective($timeout, eventsService, focusLockService) {

function link(scope, el, attr, ctrl) {

var evts = [];
var allowedNumberOfVisibleEditors = 3;

scope.editors = [];

function addEditor(editor) {

editor.inFront = true;
editor.moveRight = true;
editor.level = 0;
editor.styleIndex = 0;

// push the new editor to the dom
scope.editors.push(editor);

$timeout(() => {
editor.moveRight = false;
})

editor.animating = true;
setTimeout(revealEditorContent.bind(this, editor), 400);

updateEditors();

updateEditors();
}

function removeEditor(editor) {

editor.moveRight = true;

editor.animating = true;
setTimeout(removeEditorFromDOM.bind(this, editor), 400);

updateEditors(-1);

}

function revealEditorContent(editor) {

editor.animating = false;

scope.$digest();


focusLockService.addInfiniteFocusLock(el, scope.editors.length);

}

function removeEditorFromDOM(editor) {

// push the new editor to the dom
var index = scope.editors.indexOf(editor);
if (index !== -1) {
scope.editors.splice(index, 1);
}

updateEditors();

scope.$digest();


focusLockService.removeInfiniteFocusLock(el, scope.editors.length);
}

/** update layer positions. With ability to offset positions, needed for when an item is moving out, then we dont want it to influence positions */
function updateEditors(offset) {

offset = offset || 0;// fallback value.

var len = scope.editors.length;
var calcLen = len + offset;
var ceiling = Math.min(calcLen, allowedNumberOfVisibleEditors);
var origin = Math.max(calcLen-1, 0)-ceiling;
var i = 0;

while(i<len) {
var iEditor = scope.editors[i];
iEditor.styleIndex = Math.min(i+1, allowedNumberOfVisibleEditors);
iEditor.level = Math.max(i-origin, -1);
iEditor.inFront = iEditor.level >= ceiling;
i++;
}

}

evts.push(eventsService.on("appState.editors.open", function (name, args) {
addEditor(args.editor);
}));
Expand Down
Loading