-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // ==UserScript== | ||
| // @name M365 Admin - PIM Activate Hotkey | ||
| // @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic | ||
| // @version 1.0.0 | ||
| // @description `Ctrl` + `Enter` to Activate PIM role instead of having to manually click the `Activate` button. | ||
| // @author Øyvind Nilsen (on@ntnu.no) | ||
| // @match https://portal.azure.com/?feature.msaljs=true#view/Microsoft_Azure_PIMCommon/ActivationMenuBlade/* | ||
| // @icon https://www.google.com/s2/favicons?sz=64&domain=microsoft.com | ||
| // @grant none | ||
| // @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js | ||
| // @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/m365-admin.user.js | ||
| // ==/UserScript== | ||
|
|
||
| (function() { | ||
| 'use strict'; | ||
|
|
||
| document.addEventListener('keydown', function(e) { | ||
| if (e.ctrlKey && e.key === 'Enter') { | ||
| var button_container = document.querySelector('div[data-formelement="pcControl: saveButton"]'); | ||
| if (button_container) { | ||
| button_container.childNodes[0].click(); | ||
| } | ||
| } | ||
| }); | ||
| })(); |