From patchwork Fri Oct 21 00:46:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 4768 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id CC6E623E03 for ; Fri, 21 Oct 2011 00:51:28 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id C3757A181B3 for ; Fri, 21 Oct 2011 00:51:28 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id 5so4432202eyg.11 for ; Thu, 20 Oct 2011 17:51:28 -0700 (PDT) Received: by 10.223.77.69 with SMTP id f5mr21422184fak.3.1319158288633; Thu, 20 Oct 2011 17:51:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs143660lak; Thu, 20 Oct 2011 17:51:28 -0700 (PDT) Received: by 10.216.80.71 with SMTP id j49mr9486887wee.23.1319157974706; Thu, 20 Oct 2011 17:46:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id h2si8345818wed.45.2011.10.20.17.46.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Oct 2011 17:46:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RH3FW-0006ne-7E for ; Fri, 21 Oct 2011 00:46:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 2D269FB7DE for ; Fri, 21 Oct 2011 00:46:14 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 269 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 269: Remove useless features from sidebar widget Message-Id: <20111021004614.12801.35911.launchpad@ackee.canonical.com> Date: Fri, 21 Oct 2011 00:46:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14165"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 22133dde7e4e38977d88ed52894314709d8e2f6b ------------------------------------------------------------ revno: 269 committer: Zygmunt Krynicki branch nick: lava-server timestamp: Fri 2011-10-21 01:32:19 +0200 message: Remove useless features from sidebar widget Useless == no longer used modified: lava_server/htdocs/js/jquery.lava.sidebar.js --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === modified file 'lava_server/htdocs/js/jquery.lava.sidebar.js' --- lava_server/htdocs/js/jquery.lava.sidebar.js 2011-09-22 11:43:08 +0000 +++ lava_server/htdocs/js/jquery.lava.sidebar.js 2011-10-20 23:32:19 +0000 @@ -10,20 +10,12 @@ $.widget("lava.sidebar", { options: { - // hidden by default (unless pinned) - hidden: true, - // not pinned by default - pinned: false, - pinnedCookieName: "lava-sidebar-pinned", - pinnedCookiePath: "/", + hidden: false, extraControls: [], onShow: null, onHide: null, onDestroy: null, - onPin: null, - onUnpin: null, }, - _pin_button: null, _close_button: null, _controls: null, controls: function() { @@ -37,8 +29,6 @@ // If the sidebar was empty then just hide it this.element.hide(); } else { - // Load cookie to check for pin status - this._load_pin_option(); // Initialize basic stuff: // 1) css class // 2) click handler @@ -56,18 +46,6 @@ "class": "lava-sidebar-controls" }) .prependTo(this.element); - // Initialize pin button - self._pin_button = $("", { - title: "Pin/unpin the sidebar" - }) - .button({ - text: false, - icons: { primary: this.options.pinned ? 'ui-icon-pin-s' : 'ui-icon-pin-w'} - }) - .click(function(event) { - self.element.sidebar("option", "pinned", !self.options.pinned); - }) - .appendTo(self._controls); // Initialize close button self._close_button = $("", { title: "Collapse the sidebar" @@ -89,7 +67,7 @@ }, _init: function() { /* Initializer */ - if (this.options.pinned == false && this.options.hidden == true) { + if (this.options.hidden == true) { this.hide(); } else { this.show(); @@ -122,40 +100,6 @@ this.options.onHide(); } }, - pin: function() { - /* Pin the sidebar so that it is shown by default */ - this._set_pinned(true); - }, - unpin: function() { - /* Unpin the sidebar */ - this._set_pinned(false); - }, - _set_pinned: function(pin_state) { - this.options.pinned = (pin_state == true); - this._pin_button.button("option", "icons", { primary: this.options.pinned ? 'ui-icon-pin-s' : 'ui-icon-pin-w'}); - this._save_pin_option(); - if (this.options.pinned == true && this.options.onPin) { - this.options.onPin(); - } - if (this.options.pinned == false && this.options.onUnpin) { - this.options.onUnpin(); - } - }, - _load_pin_option: function() { - this.options.pinned = $.cookie( - this.options.pinnedCookieName, { - path: this.optionsPinnedCookiePath, - expires: 365 - }) == "pinned"; - }, - _save_pin_option: function() { - $.cookie( - this.options.pinnedCookieName, - this.options.pinned ? "pinned" : "", { - path: this.options.pinnedCookiePath, - expires: 365 - }); - }, _setOption: function(key, value) { /* jQueryUI widget method for implementing option setter */ $.Widget.prototype._setOption.apply(this, arguments); @@ -166,9 +110,6 @@ this.show(); } } - if (key == "pinned") { - this._set_pinned(value); - } } }); })(jQuery);