[TASK] Migrate TYPO3/CMS/Beuser/* to TypeScript 14/59814/2
authorFrank Naegler <frank.naegler@typo3.org>
Wed, 27 Feb 2019 21:35:48 +0000 (22:35 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 1 Mar 2019 14:22:00 +0000 (15:22 +0100)
Resolves: #87810
Releases: master
Change-Id: Idd4525c1d97006ace05128eaa9093841d782797a
Reviewed-on: https://review.typo3.org/c/59814
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Build/tslint.json
Build/types/TYPO3/index.d.ts
typo3/sysext/beuser/Resources/Private/TypeScript/BackendUserListing.ts [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/TypeScript/ContextMenuActions.ts [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/TypeScript/Permissions.ts [new file with mode: 0644]
typo3/sysext/beuser/Resources/Public/JavaScript/BackendUserListing.js
typo3/sysext/beuser/Resources/Public/JavaScript/ContextMenuActions.js
typo3/sysext/beuser/Resources/Public/JavaScript/Permissions.js

index be5cd88..924bbc1 100644 (file)
@@ -46,7 +46,7 @@
                ],
                "no-any": false,
                "no-arg": true,
-               "no-bitwise": true,
+               "no-bitwise": false,
                "no-console": [
                        true,
                        "debug",
index 5d7bc50..b2c6207 100644 (file)
@@ -14,6 +14,7 @@ declare namespace TYPO3 {
   export let Notification: any;
   export let Modal: any;
   export let OpendocsMenu: any;
+  export let Permissions: any;
   export let Popover: any;
   export let Severity: any;
   export let ShortcutMenu: any;
diff --git a/typo3/sysext/beuser/Resources/Private/TypeScript/BackendUserListing.ts b/typo3/sysext/beuser/Resources/Private/TypeScript/BackendUserListing.ts
new file mode 100644 (file)
index 0000000..728e6f6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+import * as $ from 'jquery';
+import 'TYPO3/CMS/Backend/jquery.clearable';
+
+/**
+ * Module: TYPO3/CMS/Beuser/BackendUserListing
+ * JavaScript for backend user listing
+ * @exports TYPO3/CMS/Beuser/BackendUserListing
+ */
+class BackendUserListing {
+  constructor() {
+    let $searchFields = $('#tx_Beuser_username');
+    let searchResultShown = ('' !== $searchFields.first().val());
+
+    // make search field clearable
+    $searchFields.clearable({
+      onClear: (e: JQueryEventObject): void => {
+        if (searchResultShown) {
+          $(e.currentTarget).closest('form').submit();
+        }
+      },
+    });
+  }
+}
+
+export = new BackendUserListing();
diff --git a/typo3/sysext/beuser/Resources/Private/TypeScript/ContextMenuActions.ts b/typo3/sysext/beuser/Resources/Private/TypeScript/ContextMenuActions.ts
new file mode 100644 (file)
index 0000000..5d06068
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Module: TYPO3/CMS/Beuser/ContextMenuActions
+ *
+ * JavaScript to handle permissions module from context menu
+ * @exports TYPO3/CMS/Beuser/ContextMenuActions
+ */
+class ContextMenuActions {
+  /**
+   * Open permission module for given uid
+   *
+   * @param {string} table
+   * @param {int} uid of the page
+   */
+  public openPermissionsModule = (table: string, uid: number): void => {
+    if (table === 'pages') {
+      top.TYPO3.Backend.ContentContainer.setUrl(
+        top.TYPO3.settings.AccessPermissions.moduleUrl +
+          '&id=' + uid +
+          '&tx_beuser_system_beusertxpermission[action]=edit' +
+          '&tx_beuser_system_beusertxpermission[controller]=Permission' +
+          '&returnUrl=' + this.getReturnUrl(),
+      );
+    }
+  }
+
+  private getReturnUrl = (): string => {
+    return top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search);
+  }
+}
+
+export = new ContextMenuActions();
diff --git a/typo3/sysext/beuser/Resources/Private/TypeScript/Permissions.ts b/typo3/sysext/beuser/Resources/Private/TypeScript/Permissions.ts
new file mode 100644 (file)
index 0000000..28a8305
--- /dev/null
@@ -0,0 +1,318 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+import * as $ from 'jquery';
+
+declare global {
+  interface Document { editform: any; }
+}
+
+/**
+ * Module: TYPO3/CMS/Beuser/Permissons
+ * Javascript functions regarding the permissions module
+ */
+class Permissions {
+  private options: any = {
+    containerSelector: '#typo3-permissionList',
+  };
+
+  private ajaxUrl: string = TYPO3.settings.ajaxUrls.user_access_permissions;
+
+  constructor() {
+    this.initializeEvents();
+  }
+
+  /**
+   * Changes the value of the permissions in the form
+   */
+  public setCheck = (checknames: string, varname: string): void => {
+    if (document.editform[varname]) {
+      let res = document.editform[varname].value;
+      for (let a = 1; a <= 5; a++) {
+        document.editform[checknames + '[' + a + ']'].checked = (res & Math.pow(2, a - 1));
+      }
+    }
+  }
+
+  /**
+   * checks for a change of the permissions in the form
+   */
+  public checkChange = (checknames: string, varname: string): void => {
+    let res = 0;
+    for (let a = 1; a <= 5; a++) {
+      if (document.editform[checknames + '[' + a + ']'].checked) {
+        res |= Math.pow(2, a - 1);
+      }
+    }
+    document.editform[varname].value = res | (checknames === 'tx_beuser_system_beusertxpermission[check][perms_user]' ? 1 : 0);
+    this.setCheck(checknames, varname);
+  }
+
+  /**
+   * wrapper function to call a URL in the current frame
+   */
+  public jumpToUrl = (url: string): void => {
+    window.location.href = url;
+  }
+
+  /**
+   * Changes permissions by sending an AJAX request to the server
+   */
+  public setPermissions = ($element: JQuery): void => {
+    let page = $element.data('page');
+    let who = $element.data('who');
+    let elementSelector = '#' + page + '_' + who;
+
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'page': page,
+        'who': who,
+        'permissions': $element.data('permissions'),
+        'mode': $element.data('mode'),
+        'bits': $element.data('bits'),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $(elementSelector).replaceWith(data);
+      // Reinitialize tooltip
+      $(elementSelector).find('span').tooltip();
+    });
+  }
+
+  /**
+   * changes the flag to lock the editing on a page by sending an AJAX request
+   */
+  public toggleEditLock = ($element: JQuery): void => {
+    let page = $element.data('page');
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'action': 'toggle_edit_lock',
+        'page': page,
+        'editLockState': $element.data('lockstate'),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $('#el_' + page).replaceWith(data);
+    });
+  }
+
+  /**
+   * Owner-related: Set the new owner of a page by executing an ajax call
+   */
+  public changeOwner = ($element: JQuery): void => {
+    let page = $element.data('page');
+
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'action': 'change_owner',
+        'page': page,
+        'ownerUid': $element.data('owner'),
+        'newOwnerUid': $('#new_page_owner').val(),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $('#o_' + page).replaceWith(data);
+    });
+  }
+
+  /**
+   * Owner-related: load the selector for selecting
+   * the owner of a page by executing an ajax call
+   */
+  public showChangeOwnerSelector = ($element: JQuery): void => {
+    let page = $element.data('page');
+
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'action': 'show_change_owner_selector',
+        'page': page,
+        'ownerUid': $element.data('owner'),
+        'username': $element.data('username'),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $('#o_' + page).replaceWith(data);
+    });
+  }
+
+  /**
+   * Owner-related: Update the HTML view and show the original owner
+   */
+  public restoreOwner = ($element: JQuery): void => {
+    let page = $element.data('page');
+    let username = $element.data('username');
+    let usernameHtml = username;
+    if (typeof username === 'undefined') {
+      username = $('<span>', {
+        'class': 'not_set',
+        'text': '[not set]',
+      });
+      usernameHtml = username.html();
+      username = username.text();
+    }
+
+    let html = $('<span/>', {
+      'id': 'o_' + page,
+    });
+    let aSelector = $('<a/>', {
+      'class': 'ug_selector changeowner',
+      'data-page': page,
+      'data-owner': $element.data('owner'),
+      'data-username': usernameHtml,
+      'text': username,
+    });
+    html.append(aSelector);
+
+    // Replace content
+    $('#o_' + page).replaceWith(html);
+  }
+
+  /**
+   * Group-related: Set the new group by executing an ajax call
+   */
+  public changeGroup = ($element: JQuery): void => {
+    let page = $element.data('page');
+
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'action': 'change_group',
+        'page': page,
+        'groupUid': $element.data('groupId'),
+        'newGroupUid': $('#new_page_group').val(),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $('#g_' + page).replaceWith(data);
+    });
+  }
+
+  /**
+   * Group-related: Load the selector by executing an ajax call
+   */
+  public showChangeGroupSelector = ($element: JQuery): void => {
+    let page = $element.data('page');
+
+    $.ajax({
+      url: this.ajaxUrl,
+      type: 'post',
+      dataType: 'html',
+      cache: false,
+      data: {
+        'action': 'show_change_group_selector',
+        'page': page,
+        'groupUid': $element.data('groupId'),
+        'groupname': $element.data('groupname'),
+      },
+    }).done((data: any): void => {
+      // Replace content
+      $('#g_' + page).replaceWith(data);
+    });
+  }
+
+  /**
+   * Group-related: Update the HTML view and show the original group
+   */
+public restoreGroup = ($element: JQuery): void => {
+    let page = $element.data('page');
+    let groupname = $element.data('groupname');
+    let groupnameHtml = groupname;
+    if (typeof groupname === 'undefined') {
+      groupname = $('<span>', {
+        'class': 'not_set',
+        'text': '[not set]',
+      });
+      groupnameHtml = groupname.html();
+      groupname = groupname.text();
+    }
+    let html = $('<span/>', {
+      'id': 'g_' + page,
+    });
+    let aSelector = $('<a/>', {
+      'class': 'ug_selector changegroup',
+      'data-page': page,
+      'data-group': $element.data('groupId'),
+      'data-groupname': groupnameHtml,
+      'text': groupname,
+    });
+    html.append(aSelector);
+
+    // Replace content
+    $('#g_' + page).replaceWith(html);
+  }
+
+  /**
+   * initializes events using deferred bound to document
+   * so AJAX reloads are no problem
+   */
+  public initializeEvents = (): void => {
+    // Click event to change permissions
+    $(this.options.containerSelector).on('click', '.change-permission', (evt: JQueryEventObject): void => {
+      evt.preventDefault();
+      this.setPermissions($(evt.currentTarget));
+    }).on('click', '.editlock', (evt: JQueryEventObject): void => {
+      // Click event for lock state
+      evt.preventDefault();
+      this.toggleEditLock($(evt.currentTarget));
+    }).on('click', '.changeowner', (evt: JQueryEventObject): void => {
+      // Click event to change owner
+      evt.preventDefault();
+      this.showChangeOwnerSelector($(evt.currentTarget));
+    }).on('click', '.changegroup', (evt: JQueryEventObject): void => {
+      // click event to change group
+      evt.preventDefault();
+      this.showChangeGroupSelector($(evt.currentTarget));
+    }).on('click', '.restoreowner', (evt: JQueryEventObject): void => {
+      // Add click handler for restoring previous owner
+      evt.preventDefault();
+      this.restoreOwner($(evt.currentTarget));
+    }).on('click', '.saveowner', (evt: JQueryEventObject): void => {
+      // Add click handler for saving owner
+      evt.preventDefault();
+      this.changeOwner($(evt.currentTarget));
+    }).on('click', '.restoregroup', (evt: JQueryEventObject): void => {
+      // Add click handler for restoring previous group
+      evt.preventDefault();
+      this.restoreGroup($(evt.currentTarget));
+    }).on('click', '.savegroup', (evt: JQueryEventObject): void => {
+      // Add click handler for saving group
+      evt.preventDefault();
+      this.changeGroup($(evt.currentTarget));
+    });
+  }
+}
+
+let permissionObject: Permissions = new Permissions();
+// expose to global
+TYPO3.Permissions = permissionObject;
+
+export = permissionObject;
index e0e59a6..fbb53b2 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-
-/**
- * Module: TYPO3/CMS/Beuser/BackendUserListing
- * JavaScript for backend user listing
- * @exports TYPO3/CMS/Beuser/BackendUserListing
- */
-define(['jquery', 'TYPO3/CMS/Backend/jquery.clearable'], function($) {
-
-  var $searchFields = $('#tx_Beuser_username');
-  var searchResultShown = ('' !== $searchFields.first().val());
-
-  // make search field clearable
-  $searchFields.clearable({
-    onClear: function() {
-      if (searchResultShown) {
-        $(this).closest('form').submit();
-      }
-    }
-  });
-
-});
+define(["require","exports","jquery","TYPO3/CMS/Backend/jquery.clearable"],function(e,r,n){"use strict";return new function(){var e=n("#tx_Beuser_username"),r=""!==e.first().val();e.clearable({onClear:function(e){r&&n(e.currentTarget).closest("form").submit()}})}});
\ No newline at end of file
index e031c9c..6a5db16 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-
-/**
- * Module: TYPO3/CMS/Beuser/ContextMenuActions
- *
- * JavaScript to handle permissions module from context menu
- * @exports TYPO3/CMS/Beuser/ContextMenuActions
- */
-define(function() {
-  'use strict';
-
-  /**
-   * @exports TYPO3/CMS/Beuser/ContextMenuActions
-   */
-  var ContextMenuActions = {};
-
-  /**
-   * Open permission module for given uid
-   *
-   * @param {string} table
-   * @param {int} uid of the page
-   */
-  ContextMenuActions.openPermissionsModule = function(table, uid) {
-    if (table === 'pages') {
-      top.TYPO3.Backend.ContentContainer.setUrl(
-        top.TYPO3.settings.AccessPermissions.moduleUrl +
-        '&id=' + uid +
-        '&tx_beuser_system_beusertxpermission[action]=edit' +
-        '&tx_beuser_system_beusertxpermission[controller]=Permission' +
-        '&returnUrl=' + ContextMenuActions.getReturnUrl()
-      );
-    }
-  };
-
-  ContextMenuActions.getReturnUrl = function() {
-    return top.rawurlencode(top.list_frame.document.location.pathname + top.list_frame.document.location.search);
-  };
-
-  return ContextMenuActions;
-});
+define(["require","exports"],function(e,t){"use strict";return new function(){var e=this;this.openPermissionsModule=function(t,n){"pages"===t&&top.TYPO3.Backend.ContentContainer.setUrl(top.TYPO3.settings.AccessPermissions.moduleUrl+"&id="+n+"&tx_beuser_system_beusertxpermission[action]=edit&tx_beuser_system_beusertxpermission[controller]=Permission&returnUrl="+e.getReturnUrl())},this.getReturnUrl=function(){return top.rawurlencode(top.list_frame.document.location.pathname+top.list_frame.document.location.search)}}});
\ No newline at end of file
index 78bdddb..251b081 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-
-/**
- * Module: TYPO3/CMS/Beuser/Permissons
- * Javascript functions regarding the permissions module
- */
-define(['jquery'], function($) {
-
-  /**
-   *
-   * @type {{options: {containerSelector: string}}}
-   * @exports TYPO3/CMS/Beuser/Permissons
-   */
-  var Permissions = {
-    options: {
-      containerSelector: '#typo3-permissionList'
-    }
-  };
-  var ajaxUrl = TYPO3.settings.ajaxUrls['user_access_permissions'];
-
-  /**
-   * Changes the value of the permissions in the form
-   *
-   * @param {String} checknames
-   * @param {String} varname
-   */
-  Permissions.setCheck = function(checknames, varname) {
-    if (document.editform[varname]) {
-      var res = document.editform[varname].value;
-      for (var a = 1; a <= 5; a++) {
-        document.editform[checknames + '[' + a + ']'].checked = (res & Math.pow(2, a - 1));
-      }
-    }
-  };
-
-  /**
-   * checks for a change of the permissions in the form
-   *
-   * @param {String} checknames
-   * @param {String} varname
-   */
-  Permissions.checkChange = function(checknames, varname) {
-    var res = 0;
-    for (var a = 1; a <= 5; a++) {
-      if (document.editform[checknames + '[' + a + ']'].checked) {
-        res |= Math.pow(2, a - 1);
-      }
-    }
-    document.editform[varname].value = res | (checknames === 'tx_beuser_system_beusertxpermission[check][perms_user]' ? 1 : 0);
-    Permissions.setCheck(checknames, varname);
-  };
-
-  /**
-   * wrapper function to call a URL in the current frame
-   */
-  Permissions.jumpToUrl = function(url) {
-    window.location.href = url;
-  };
-
-  /**
-   * changes permissions by sending an AJAX request to the server
-   *
-   * @param {Object} $element
-   */
-  Permissions.setPermissions = function($element) {
-    var page = $element.data('page');
-    var who = $element.data('who');
-    var elementSelector = '#' + page + '_' + who;
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'page': page,
-        'who': who,
-        'permissions': $element.data('permissions'),
-        'mode': $element.data('mode'),
-        'bits': $element.data('bits')
-      }
-    }).done(function(data) {
-      // Replace content
-      $(elementSelector).replaceWith(data);
-      // Reinitialize tooltip
-      $(elementSelector).find('span').tooltip();
-    });
-  };
-
-  /**
-   * changes the flag to lock the editing on a page by sending an AJAX request
-   *
-   * @param {Object} $element
-   */
-  Permissions.toggleEditLock = function($element) {
-    var page = $element.data('page');
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'action': 'toggle_edit_lock',
-        'page': page,
-        'editLockState': $element.data('lockstate')
-      }
-    }).done(function(data) {
-      // Replace content
-      $('#el_' + page).replaceWith(data);
-    });
-  };
-
-  /**
-   * Owner-related: Set the new owner of a page by executing an ajax call
-   *
-   * @param {Object} $element
-   */
-  Permissions.changeOwner = function($element) {
-    var page = $element.data('page');
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'action': 'change_owner',
-        'page': page,
-        'ownerUid': $element.data('owner'),
-        'newOwnerUid': $('#new_page_owner').val()
-      }
-    }).done(function(data) {
-      // Replace content
-      $('#o_' + page).replaceWith(data);
-    });
-  };
-
-  /**
-   * Owner-related: load the selector for selecting
-   * the owner of a page by executing an ajax call
-   *
-   * @param {Object} $element
-   */
-  Permissions.showChangeOwnerSelector = function($element) {
-    var page = $element.data('page');
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'action': 'show_change_owner_selector',
-        'page': page,
-        'ownerUid': $element.data('owner'),
-        'username': $element.data('username')
-      }
-    }).done(function(data) {
-      // Replace content
-      $('#o_' + page).replaceWith(data);
-    });
-  };
-
-  /**
-   * Owner-related: Update the HTML view and show the original owner
-   *
-   * @param {Object} $element
-   */
-  Permissions.restoreOwner = function($element) {
-    var page = $element.data('page');
-    var username = $element.data('username');
-    var usernameHtml = username;
-    if (typeof username === 'undefined') {
-      username = $('<span>', {
-        'class': 'not_set',
-        'text': '[not set]'
-      });
-      usernameHtml = username.html();
-      username = username.text();
-    }
-
-    var html = $('<span/>', {
-      'id': 'o_' + page
-    });
-    var aSelector = $('<a/>', {
-      'class': 'ug_selector changeowner',
-      'data-page': page,
-      'data-owner': $element.data('owner'),
-      'data-username': usernameHtml,
-      'text': username
-    });
-    html.append(aSelector);
-
-    // Replace content
-    $('#o_' + page).replaceWith(html);
-  };
-
-  /**
-   * Group-related: Set the new group by executing an ajax call
-   *
-   * @param {Object} $element
-   */
-  Permissions.changeGroup = function($element) {
-    var page = $element.data('page');
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'action': 'change_group',
-        'page': page,
-        'groupUid': $element.data('groupId'),
-        'newGroupUid': $('#new_page_group').val()
-      }
-    }).done(function(data) {
-      // Replace content
-      $('#g_' + page).replaceWith(data);
-    });
-  };
-
-  /**
-   * Group-related: Load the selector by executing an ajax call
-   *
-   * @param {Object} $element
-   */
-  Permissions.showChangeGroupSelector = function($element) {
-    var page = $element.data('page');
-
-    $.ajax({
-      url: ajaxUrl,
-      type: 'post',
-      dataType: 'html',
-      cache: false,
-      data: {
-        'action': 'show_change_group_selector',
-        'page': page,
-        'groupUid': $element.data('groupId'),
-        'groupname': $element.data('groupname')
-      }
-    }).done(function(data) {
-      // Replace content
-      $('#g_' + page).replaceWith(data);
-    });
-  };
-
-  /**
-   * Group-related: Update the HTML view and show the original group
-   *
-   * @param {Object} $element
-   */
-  Permissions.restoreGroup = function($element) {
-    var page = $element.data('page');
-    var groupname = $element.data('groupname');
-    var groupnameHtml = groupname;
-    if (typeof groupname === 'undefined') {
-      groupname = $('<span>', {
-        'class': 'not_set',
-        'text': '[not set]'
-      });
-      groupnameHtml = groupname.html();
-      groupname = groupname.text();
-    }
-    var html = $('<span/>', {
-      'id': 'g_' + page
-    });
-    var aSelector = $('<a/>', {
-      'class': 'ug_selector changegroup',
-      'data-page': page,
-      'data-group': $element.data('groupId'),
-      'data-groupname': groupnameHtml,
-      'text': groupname
-    });
-    html.append(aSelector);
-
-    // Replace content
-    $('#g_' + page).replaceWith(html);
-  };
-
-  /**
-   * initializes events using deferred bound to document
-   * so AJAX reloads are no problem
-   */
-  Permissions.initializeEvents = function() {
-
-    // Click event to change permissions
-    $(Permissions.options.containerSelector).on('click', '.change-permission', function(evt) {
-      evt.preventDefault();
-      Permissions.setPermissions($(this));
-    }).on('click', '.editlock', function(evt) {
-      // Click event for lock state
-      evt.preventDefault();
-      Permissions.toggleEditLock($(this));
-    }).on('click', '.changeowner', function(evt) {
-      // Click event to change owner
-      evt.preventDefault();
-      Permissions.showChangeOwnerSelector($(this));
-    }).on('click', '.changegroup', function(evt) {
-      // click event to change group
-      evt.preventDefault();
-      Permissions.showChangeGroupSelector($(this));
-    }).on('click', '.restoreowner', function(evt) {
-      // Add click handler for restoring previous owner
-      evt.preventDefault();
-      Permissions.restoreOwner($(this));
-    }).on('click', '.saveowner', function(evt) {
-      // Add click handler for saving owner
-      evt.preventDefault();
-      Permissions.changeOwner($(this));
-    }).on('click', '.restoregroup', function(evt) {
-      // Add click handler for restoring previous group
-      evt.preventDefault();
-      Permissions.restoreGroup($(this));
-    }).on('click', '.savegroup', function(evt) {
-      // Add click handler for saving group
-      evt.preventDefault();
-      Permissions.changeGroup($(this));
-    });
-  };
-
-  $(Permissions.initializeEvents);
-
-  // expose to global
-  TYPO3.Permissions = Permissions;
-
-  return Permissions;
-});
+define(["require","exports","jquery"],function(e,t,a){"use strict";var n=new function(){var e=this;this.options={containerSelector:"#typo3-permissionList"},this.ajaxUrl=TYPO3.settings.ajaxUrls.user_access_permissions,this.setCheck=function(e,t){if(document.editform[t])for(var a=document.editform[t].value,n=1;n<=5;n++)document.editform[e+"["+n+"]"].checked=a&Math.pow(2,n-1)},this.checkChange=function(t,a){for(var n=0,o=1;o<=5;o++)document.editform[t+"["+o+"]"].checked&&(n|=Math.pow(2,o-1));document.editform[a].value=n|("tx_beuser_system_beusertxpermission[check][perms_user]"===t?1:0),e.setCheck(t,a)},this.jumpToUrl=function(e){window.location.href=e},this.setPermissions=function(t){var n=t.data("page"),o=t.data("who"),r="#"+n+"_"+o;a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{page:n,who:o,permissions:t.data("permissions"),mode:t.data("mode"),bits:t.data("bits")}}).done(function(e){a(r).replaceWith(e),a(r).find("span").tooltip()})},this.toggleEditLock=function(t){var n=t.data("page");a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{action:"toggle_edit_lock",page:n,editLockState:t.data("lockstate")}}).done(function(e){a("#el_"+n).replaceWith(e)})},this.changeOwner=function(t){var n=t.data("page");a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{action:"change_owner",page:n,ownerUid:t.data("owner"),newOwnerUid:a("#new_page_owner").val()}}).done(function(e){a("#o_"+n).replaceWith(e)})},this.showChangeOwnerSelector=function(t){var n=t.data("page");a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{action:"show_change_owner_selector",page:n,ownerUid:t.data("owner"),username:t.data("username")}}).done(function(e){a("#o_"+n).replaceWith(e)})},this.restoreOwner=function(e){var t=e.data("page"),n=e.data("username"),o=n;void 0===n&&(o=(n=a("<span>",{class:"not_set",text:"[not set]"})).html(),n=n.text());var r=a("<span/>",{id:"o_"+t}),c=a("<a/>",{class:"ug_selector changeowner","data-page":t,"data-owner":e.data("owner"),"data-username":o,text:n});r.append(c),a("#o_"+t).replaceWith(r)},this.changeGroup=function(t){var n=t.data("page");a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{action:"change_group",page:n,groupUid:t.data("groupId"),newGroupUid:a("#new_page_group").val()}}).done(function(e){a("#g_"+n).replaceWith(e)})},this.showChangeGroupSelector=function(t){var n=t.data("page");a.ajax({url:e.ajaxUrl,type:"post",dataType:"html",cache:!1,data:{action:"show_change_group_selector",page:n,groupUid:t.data("groupId"),groupname:t.data("groupname")}}).done(function(e){a("#g_"+n).replaceWith(e)})},this.restoreGroup=function(e){var t=e.data("page"),n=e.data("groupname"),o=n;void 0===n&&(o=(n=a("<span>",{class:"not_set",text:"[not set]"})).html(),n=n.text());var r=a("<span/>",{id:"g_"+t}),c=a("<a/>",{class:"ug_selector changegroup","data-page":t,"data-group":e.data("groupId"),"data-groupname":o,text:n});r.append(c),a("#g_"+t).replaceWith(r)},this.initializeEvents=function(){a(e.options.containerSelector).on("click",".change-permission",function(t){t.preventDefault(),e.setPermissions(a(t.currentTarget))}).on("click",".editlock",function(t){t.preventDefault(),e.toggleEditLock(a(t.currentTarget))}).on("click",".changeowner",function(t){t.preventDefault(),e.showChangeOwnerSelector(a(t.currentTarget))}).on("click",".changegroup",function(t){t.preventDefault(),e.showChangeGroupSelector(a(t.currentTarget))}).on("click",".restoreowner",function(t){t.preventDefault(),e.restoreOwner(a(t.currentTarget))}).on("click",".saveowner",function(t){t.preventDefault(),e.changeOwner(a(t.currentTarget))}).on("click",".restoregroup",function(t){t.preventDefault(),e.restoreGroup(a(t.currentTarget))}).on("click",".savegroup",function(t){t.preventDefault(),e.changeGroup(a(t.currentTarget))})},this.initializeEvents()};return TYPO3.Permissions=n,n});
\ No newline at end of file