Merge branch '3.0'
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Aug 2017 19:11:33 +0000 (21:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Aug 2017 19:11:33 +0000 (21:11 +0200)
# Conflicts:
# wcfsetup/install/files/js/3rdParty/redactor2/redactor.min.js
# wcfsetup/install/files/js/WCF.js

1  2 
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/DragAndDrop.js

index 2fc7c29a454a6be44ca3179c244c51fd837b510c,a726112146a643cd787ccbb4636a9b060b350b3a..90b6c7796975bf2f9022c9ceb4b9518c530dced0
@@@ -3722,77 -3648,73 +3722,86 @@@ if (COMPILER_TARGET_DEFAULT) 
                                        }
                                }
                        }
 -              }
 -      },
 -      
 -      /**
 -       * Enables/Disables an option.
 -       * 
 -       * @param       string          target
 -       * @param       boolean         enable
 -       */
 -      _enableOption: function(target, enable) {
 -              this._enableOptionElement($('#' + $.wcfEscapeID(target)), enable);
 -      },
 -      
 -      /**
 -       * Enables/Disables an option element.
 -       * 
 -       * @param       string          target
 -       * @param       boolean         enable
 -       */
 -      _enableOptionElement: function(element, enable) {
 -              element = $(element);
 -              var $tagName = element.getTagName();
 +              },
 +              
 +              /**
 +               * Enables/Disables an option.
 +               *
 +               * @param        string                target
 +               * @param        boolean                enable
 +               */
 +              _enableOption: function (target, enable) {
 +                      this._enableOptionElement($('#' + $.wcfEscapeID(target)), enable);
 +              },
                
 -              if ($tagName == 'select' || ($tagName == 'input' && (element.attr('type') == 'checkbox' || element.attr('type') == 'file' || element.attr('type') == 'radio'))) {
 -                      if (enable) element.enable();
 -                      else element.disable();
 +              /**
 +               * Enables/Disables an option element.
 +               *
 +               * @param        string                target
 +               * @param        boolean                enable
 +               */
 +              _enableOptionElement: function (element, enable) {
 +                      element = $(element);
 +                      var $tagName = element.getTagName();
                        
 -                      if (element.parents('.optionTypeBoolean:eq(0)')) {
 -                              // escape dots so that they are not recognized as class selectors
 -                              var elementId = element.wcfIdentify().replace(/\./g, "\\.");
 -                              
 -                              var noElement = $('#' + elementId + '_no');
 -                              if (enable) noElement.enable();
 -                              else noElement.disable();
 +                      if ($tagName == 'select' || ($tagName == 'input' && (element.attr('type') == 'checkbox' || element.attr('type') == 'file' || element.attr('type') == 'radio'))) {
 +                              if (enable) element.enable();
 +                              else element.disable();
                                
 -                              var neverElement = $('#' + elementId + '_never');
 -                              if (neverElement.length) {
 -                                      if (enable) neverElement.enable();
 -                                      else neverElement.disable();
 +                              if (element.parents('.optionTypeBoolean:eq(0)')) {
-                                       var noElement = $('#' + element.wcfIdentify() + '_no');
++                                      // escape dots so that they are not recognized as class selectors
++                                      var elementId = element.wcfIdentify().replace(/\./g, "\\.");
++                                      
++                                      var noElement = $('#' + elementId + '_no');
 +                                      if (enable) noElement.enable();
 +                                      else noElement.disable();
++                                      
++                                      var neverElement = $('#' + elementId + '_never');
++                                      if (neverElement.length) {
++                                              if (enable) neverElement.enable();
++                                              else neverElement.disable();
++                                      }
                                }
                        }
 -              }
 -              else {
 -                      if (enable) element.removeAttr('readonly');
 -                      else element.attr('readonly', true);
 -              }
 +                      else {
 +                              if (enable) element.removeAttr('readonly');
 +                              else element.attr('readonly', true);
 +                      }
 +                      
 +                      if (enable) {
 +                              element.closest('dl').removeClass('disabled');
 +                      }
 +                      else {
 +                              element.closest('dl').addClass('disabled');
 +                      }
 +              },
                
 -              if (enable) {
 -                      element.closest('dl').removeClass('disabled');
 -              }
 -              else {
 -                      element.closest('dl').addClass('disabled');
 -              }
 -      },
 -      
 -      /**
 -       * Enables/Disables an option consisting of multiple form elements.
 -       * 
 -       * @param       string          target
 -       * @param       boolean         enable
 -       */
 -      _enableOptions: function(targets, enable) {
 -              for (var $i = 0, $length = targets.length; $i < $length; $i++) {
 -                      this._enableOptionElement(targets[$i], enable);
 +              /**
 +               * Enables/Disables an option consisting of multiple form elements.
 +               *
 +               * @param        string                target
 +               * @param        boolean                enable
 +               */
 +              _enableOptions: function (targets, enable) {
 +                      for (var $i = 0, $length = targets.length; $i < $length; $i++) {
 +                              this._enableOptionElement(targets[$i], enable);
 +                      }
                }
 -      }
 -});
 +      });
 +}
 +else {
 +      WCF.Option.Handler = Class.extend({
 +              init: function() {},
 +              _initOptions: function() {},
 +              _initOption: function() {},
 +              _handleChange: function() {},
 +              _change: function() {},
 +              _execute: function() {},
 +              _enableOption: function() {},
 +              _enableOptionElement: function() {},
 +              _enableOptions: function() {}
 +      });
 +}
  
  WCF.PageVisibilityHandler = {
        /**