<commit_before><?xml version="1.0" encoding="UTF-8"?>
<xwikidoc>
<web>XWiki</web>
<name>XWikiGroupSheet</name>
<language></language>
<defaultLanguage>en</defaultLanguage>
<translation>0</translation>
<parent>XWiki.XWikiGroups</parent>
<creator>XWiki.Admin</creator>
<author>XWiki.Admin</author>
<customClass></customClass>
<contentAuthor>XWiki.Admin</contentAuthor>
<creationDate>1242173909000</creationDate>
<date>1242173909000</date>
<contentUpdateDate>1242173909000</contentUpdateDate>
<version>1.1</version>
<title></title>
<template></template>
<defaultTemplate></defaultTemplate>
<validationScript></validationScript>
<comment></comment>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.0</syntaxId>
<hidden>false</hidden>
<object>
<class>
<name>XWiki.SheetClass</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
<defaultEditMode>
<disabled>0</disabled>
<name>defaultEditMode</name>
<number>1</number>
<prettyName>Default Edit Mode</prettyName>
<size>15</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</defaultEditMode>
</class>
<name>XWiki.XWikiGroupSheet</name>
<number>0</number>
<className>XWiki.SheetClass</className>
<guid>6e184b54-5bb0-4d81-acaf-87493bc1b1e8</guid>
</object>
<content>{{velocity output="false"}}
#set($mainwk = $xcontext.isMainWiki())
$xwiki.jsfx.use('js/xwiki/usersandgroups/usersandgroups.js', true)
$xwiki.ssfx.use('js/xwiki/usersandgroups/usersandgroups.css')
$xwiki.jsfx.use('js/xwiki/table/livetable.js', true)
$xwiki.ssfx.use('js/xwiki/table/livetable.css', true)
#set($groupDoc = $doc)
#if($doc.fullName == 'Main.UserDirectory')
  #set($groupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup'))
#end
#macro(hasEditGroupRight)
  #set($hasEditGroupRight = false)
  #if($hasAdmin &amp;&amp; $doc.getObject('XWiki.XWikiGroups', false))
    #set($hasEditGroupRight = true)
  #end
#end
#hasEditGroupRight()
##
##
{{/velocity}}

{{velocity}}
#if($xcontext.action == 'inline' &amp;&amp; $hasEditGroupRight)
{{html}}
  &lt;div id="addNewMember"&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;td class="addlabel"&gt;$msg.get('xe.admin.groups.addUser')
          #if(!$mainwk)
            &lt;/td&gt;
            &lt;td&gt;&lt;select name="wiki" onchange="changeWiki(this);"&gt;
                &lt;option value="local" selected="selected"&gt;$msg.get('xe.admin.local')&lt;/option&gt;
                &lt;option value="global"&gt;$msg.get('xe.admin.global')&lt;/option&gt;
              &lt;/select&gt;
            &lt;/td&gt;
          #else
            &lt;input type="hidden" name="wiki" value="local" /&gt;&lt;/td&gt;
          #end
        &lt;td&gt;
          &lt;input id="userSuggest" type="text" size="30" name="newMember" autocomplete="off" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="button" id="addNewUser" class="button" value="$msg.get('xe.admin.groups.addUser.submit')" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="addlabel"&gt;$msg.get('xe.admin.groups.addGroup')
          #if(!$mainwk)
            &lt;/td&gt;
            &lt;td&gt;&lt;select name="wiki" onchange="changeWiki(this);"&gt;
                &lt;option value="local" selected="selected"&gt;$msg.get('xe.admin.local')&lt;/option&gt;
                &lt;option value="global"&gt;$msg.get('xe.admin.global')&lt;/option&gt;
              &lt;/select&gt;
            &lt;/td&gt;
          #else
            &lt;input type="hidden" name="wiki" value="local" /&gt;&lt;/td&gt;
          #end
        &lt;td&gt;
          &lt;input id="groupSuggest" type="text" size="30" name="newMember" autocomplete="off" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="button" id="addNewGroup" class="button" value="$msg.get('xe.admin.groups.addGroup.submit')" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td colspan="3" id="errMsg"&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  ##
  ##
  &lt;script type="text/javascript"&gt;
    // &lt;![CDATA[
      if (typeof XWiki == "undefined") {
        var XWiki = {}; 
      }
      Object.extend(XWiki, {
        groupmanager : {
          /*
          ** Initialize Group Manager javascript widgets (called on document load).
          */
          userSuggest: null,

          groupSuggest: null,

          init: function() {
            if (XWiki.contextaction != 'view') {
              this.initSuggestWidget();
              this.initAddNewMemberWidget();
            }
          },
          initSuggestWidget: function() {
            if ($('userSuggest')) {
              $('userSuggest').observe('focus', this.createSuggest.bind(this, $('userSuggest'), 'user', true));
            }
            if ($('groupSuggest')) {
              $('groupSuggest').observe('focus', this.createSuggest.bind(this, $('groupSuggest'), 'group', false));
            }
          },
          initAddNewMemberWidget: function() {
            if ($('addNewUser')) {
              $('addNewUser').observe('click', this.addNewMember.bind(this, 'user', $('userSuggest')));
            }
            if ($('addNewGroup')) {
              $('addNewGroup').observe('click', this.addNewMember.bind(this, 'group', $('groupSuggest')));
            }
          },
          createSuggest: function(input, uorg, suggestObj) {
            // Clear the errors
            $('errMsg').innerHTML = "";
            suggesturl = "${doc.getURL('view', 'xpage=uorgsuggest&amp;classname=XWiki.XWikiUsers&amp;wiki=local')}";

            if (uorg == "user") {
              suggesturl += "&amp;uorg=user&amp;";
            } else {
              suggesturl += "&amp;uorg=group&amp;";
            }
            return new XWiki.widgets.Suggest(input, { script: suggesturl, varname:'input' });
          },
          addNewMember: function(uorg, input) {
            if (input) {
              var url = "${doc.getURL()}?xpage=adduorg&amp;uorg=" + uorg + "&amp;name=" + input.value;
              new Ajax.Request(url, {<commit_msg>XWIKI-5648 New visual design for the AJAX suggest module XWIKI-5649 CSS classes to support automatic users and groups suggestions on field input XWIKI-3655 Clean the JS code of the ajax suggest - Continued work XWIKI-5105 When several suggest are used on the same page, suggests results interfer from one field to another - Fixed<commit_after><?xml version="1.0" encoding="UTF-8"?>
<xwikidoc>
<web>XWiki</web>
<name>XWikiGroupSheet</name>
<language></language>
<defaultLanguage>en</defaultLanguage>
<translation>0</translation>
<parent>XWiki.XWikiGroups</parent>
<creator>XWiki.Admin</creator>
<author>XWiki.Admin</author>
<customClass></customClass>
<contentAuthor>XWiki.Admin</contentAuthor>
<creationDate>1242173909000</creationDate>
<date>1288812724000</date>
<contentUpdateDate>1288812724000</contentUpdateDate>
<version>1.1</version>
<title></title>
<template></template>
<defaultTemplate></defaultTemplate>
<validationScript></validationScript>
<comment></comment>
<minorEdit>true</minorEdit>
<syntaxId>xwiki/2.0</syntaxId>
<hidden>false</hidden>
<object>
<class>
<name>XWiki.SheetClass</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
<defaultEditMode>
<disabled>0</disabled>
<name>defaultEditMode</name>
<number>1</number>
<prettyName>Default Edit Mode</prettyName>
<size>15</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</defaultEditMode>
</class>
<name>XWiki.XWikiGroupSheet</name>
<number>0</number>
<className>XWiki.SheetClass</className>
<guid>6e184b54-5bb0-4d81-acaf-87493bc1b1e8</guid>
</object>
<content>{{velocity output="false"}}
#set($mainwk = $xcontext.isMainWiki())
$xwiki.jsfx.use('js/xwiki/usersandgroups/usersandgroups.js', true)
$xwiki.ssfx.use('js/xwiki/usersandgroups/usersandgroups.css')
$xwiki.jsfx.use('js/xwiki/table/livetable.js', true)
$xwiki.ssfx.use('js/xwiki/table/livetable.css', true)
#set($groupDoc = $doc)
#if($doc.fullName == 'Main.UserDirectory')
  #set($groupDoc = $xwiki.getDocument('XWiki.XWikiAllGroup'))
#end
#macro(hasEditGroupRight)
  #set($hasEditGroupRight = false)
  #if($hasAdmin &amp;&amp; $doc.getObject('XWiki.XWikiGroups', false))
    #set($hasEditGroupRight = true)
  #end
#end
#hasEditGroupRight()
##
##
{{/velocity}}

{{velocity}}
#if($xcontext.action == 'inline' &amp;&amp; $hasEditGroupRight)
{{html}}
  &lt;div id="addNewMember"&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;td class="addlabel"&gt;$msg.get('xe.admin.groups.addUser')
          #if(!$mainwk)
            &lt;/td&gt;
            &lt;td&gt;&lt;select name="wiki" onchange="changeWiki(this);"&gt;
                &lt;option value="local" selected="selected"&gt;$msg.get('xe.admin.local')&lt;/option&gt;
                &lt;option value="global"&gt;$msg.get('xe.admin.global')&lt;/option&gt;
              &lt;/select&gt;
            &lt;/td&gt;
          #else
            &lt;input type="hidden" name="wiki" value="local" /&gt;&lt;/td&gt;
          #end
        &lt;td&gt;
          &lt;input id="userSuggest" type="text" size="30" name="newMember" autocomplete="off" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="button" id="addNewUser" class="button" value="$msg.get('xe.admin.groups.addUser.submit')" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="addlabel"&gt;$msg.get('xe.admin.groups.addGroup')
          #if(!$mainwk)
            &lt;/td&gt;
            &lt;td&gt;&lt;select name="wiki" onchange="changeWiki(this);"&gt;
                &lt;option value="local" selected="selected"&gt;$msg.get('xe.admin.local')&lt;/option&gt;
                &lt;option value="global"&gt;$msg.get('xe.admin.global')&lt;/option&gt;
              &lt;/select&gt;
            &lt;/td&gt;
          #else
            &lt;input type="hidden" name="wiki" value="local" /&gt;&lt;/td&gt;
          #end
        &lt;td&gt;
          &lt;input id="groupSuggest" type="text" size="30" name="newMember" autocomplete="off" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;input type="button" id="addNewGroup" class="button" value="$msg.get('xe.admin.groups.addGroup.submit')" /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td colspan="3" id="errMsg"&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  ##
  ##
  &lt;script type="text/javascript"&gt;
    // &lt;![CDATA[
      if (typeof XWiki == "undefined") {
        var XWiki = {}; 
      }
      Object.extend(XWiki, {
        groupmanager : {
          /*
          ** Initialize Group Manager javascript widgets (called on document load).
          */
          userSuggest: null,

          groupSuggest: null,

          init: function() {
            if (XWiki.contextaction != 'view') {
              this.initSuggestWidget();
              this.initAddNewMemberWidget();
            }
          },
          initSuggestWidget: function() {
            if ($('userSuggest')) {
              $('userSuggest').observe('focus', this.createSuggest.bind(this, $('userSuggest'), 'user', true));
            }
            if ($('groupSuggest')) {
              $('groupSuggest').observe('focus', this.createSuggest.bind(this, $('groupSuggest'), 'group', false));
            }
          },
          initAddNewMemberWidget: function() {
            if ($('addNewUser')) {
              $('addNewUser').observe('click', this.addNewMember.bind(this, 'user', $('userSuggest')));
            }
            if ($('addNewGroup')) {
              $('addNewGroup').observe('click', this.addNewMember.bind(this, 'group', $('groupSuggest')));
            }
          },
          createSuggest: function(input, uorg, suggestObj) {
            // Clear the errors
            $('errMsg').innerHTML = "";
            suggesturl = "${doc.getURL('view', 'xpage=uorgsuggest&amp;classname=XWiki.XWikiUsers&amp;wiki=local')}";

            if (uorg == "user") {
              suggesturl += "&amp;uorg=user&amp;";
              icon = "$xwiki.getSkinFile('icons/silk/user.gif')";
            } else {
              suggesturl += "&amp;uorg=group&amp;";
              icon = "$xwiki.getSkinFile('icons/silk/group.gif')";
            }
            return new XWiki.widgets.Suggest(input, { script: suggesturl, varname:'input', icon:icon });
          },
          addNewMember: function(uorg, input) {
            if (input) {
              var url = "${doc.getURL()}?xpage=adduorg&amp;uorg=" + uorg + "&amp;name=" + input.value;
              new Ajax.Request(url, {
{'fraction_non_alphanumeric': 0.18768991040124658, 'fraction_numerical': 0.013245033112582781, 'mean_word_length': 3.155390093881515, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 2, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '141587', 'n_tokens_mistral': 4538, 'n_tokens_neox': 4347, 'n_words': 610}