Removed ui.wcfSidebar and descendants
authorAlexander Ebert <ebert@woltlab.com>
Tue, 23 Oct 2012 16:26:17 +0000 (18:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 23 Oct 2012 16:26:17 +0000 (18:26 +0200)
Closes #734

wcfsetup/install/files/js/WCF.js

index 7000f885e362ec150348ce1ae51ef9a2b7cbde9d..e31a8484d774a09d08e27066297ba38617ea5952 100755 (executable)
@@ -6284,79 +6284,6 @@ WCF.EditableItemList = Class.extend({
        }
 });
 
-/**
- * Provides a toggleable sidebar.
- */
-$.widget('ui.wcfSidebar', {
-       /**
-        * toggle button
-        * @var jQuery
-        */
-       _button: null,
-       
-       /**
-        * sidebar containder
-        * @var jQuery
-        */
-       _container: null,
-       
-       /**
-        * sidebar visibility
-        * @var boolean
-        */
-       _visible: true,
-       
-       /**
-        * Creates a new toggleable sidebar.
-        */
-       _create: function() {
-               this.element.wrap('<div class="collapsibleSidebar"></div>');
-               this._container = this.element.parents('aside:eq(0)');
-               
-               // create toggle button
-               this._button = $('<span class="collapsibleSidebarButton" title="' + WCF.Language.get('wcf.global.button.collapsible') + '"><span></span></span>').appendTo(this._container);
-               
-               // bind event
-               this._button.click($.proxy(this._toggle, this));
-       },
-       
-       /**
-        * Toggles visibility on button click.
-        */
-       _toggle: function() {
-               if (this._visible) {
-                       this.hide();
-               }
-               else {
-                       this.show();
-               }
-       },
-       
-       /**
-        * Shows sidebar content.
-        */
-       show: function() {
-               if (this._visible) {
-                       return;
-               }
-               
-               this._visible = true;
-               this._container.removeClass('collapsed');
-       },
-       
-       /**
-        * Hides the sidebar content.
-        */
-       hide: function() {
-               if (!this._visible) {
-                       return;
-               }
-               
-               this._visible = false;
-               this._container.addClass('collapsed');
-       }
-});
-
 /**
  * Provides a generic sitemap.
  */
@@ -6578,97 +6505,6 @@ WCF.Language.Chooser = Class.extend({
        }
 });
 
-/**
- * Provides a toggleable sidebar with persistent visibility.
- */
-$.widget('ui.wcfPersistentSidebar', $.ui.wcfSidebar, {
-       /**
-        * widget options
-        * @var object
-        */
-       options: {
-               className: '',
-               collapsed: false,
-               objectTypeID: 0
-       },
-       
-       /**
-        * action proxy
-        * @var WCF.Action.Proxy
-        */
-       _proxy: null,
-       
-       /**
-        * Creates a new toggleable sidebar.
-        */
-       _create: function() {
-               if (this.options.className === '' || this.options.objectTypeID === 0) {
-                       console.debug('[ui.wcfPersistentSidebar] Class name or object type id missing, aborting.');
-                       return;
-               }
-               
-               $.ui.wcfSidebar.prototype._init.apply(this, arguments);
-               
-               // collapse on init
-               if (this.options.collapsed) {
-                       this.element.hide();
-                       this._visible = false;
-               }
-               
-               // init proxy
-               this._proxy = new WCF.Action.Proxy();
-       },
-       
-       /**
-        * Shows sidebar content.
-        */
-       show: function() {
-               if (this._visible) {
-                       return;
-               }
-               
-               $.ui.wcfSidebar.prototype._init.apply(this, arguments);
-               
-               // save state
-               this._save();
-       },
-       
-       /**
-        * Hides the sidebar content.
-        */
-       hide: function() {
-               if (!this._visible) {
-                       return;
-               }
-               
-               $.ui.wcfSidebar.prototype._init.apply(this, arguments);
-               
-               // save state
-               this._save();
-       },
-       
-       /**
-        * Save collapsible state
-        */
-       _save: function() {
-               var $currentState = (!this._visible) ? 'close' : 'open';
-               var $newState = (this._visible) ? 'open' : 'close';
-               
-               this._proxy.setOption('data', {
-                       actionName: 'toggleSidebar',
-                       className: this.options.className,
-                       parameters: {
-                               data: {
-                                       currentState: $currentState,
-                                       newState: $newState,
-                                       objectTypeID: this.options.objectTypeID
-                               }
-                       }
-               });
-               this._proxy.sendRequest();
-       }
-});
-
 /**
  * WCF implementation for nested sortables.
  */