}
}
}
- }
- },
-
- /**
- * 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 = {
/**