From a768c9c1c270e7da74aab2723e5f2e506837e2f1 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Sun, 14 Jul 2013 16:23:26 -0700 Subject: [PATCH] remove stringquery panel, replaced with query --- panels/stringquery/editor.html | 17 ------- panels/stringquery/module.html | 49 -------------------- panels/stringquery/module.js | 81 ---------------------------------- 3 files changed, 147 deletions(-) delete mode 100644 panels/stringquery/editor.html delete mode 100644 panels/stringquery/module.html delete mode 100644 panels/stringquery/module.js diff --git a/panels/stringquery/editor.html b/panels/stringquery/editor.html deleted file mode 100644 index 4b95d42f397..00000000000 --- a/panels/stringquery/editor.html +++ /dev/null @@ -1,17 +0,0 @@ -
-
-
- -
-
- - -
-
-
-
-
A note on multi query panels
-

You turned on multi panel support: cool. Be aware that not all panels support display of multiple queries. Panels that don't support receiving several queries at one time will (should) display the results of the first query in the list. Further, some panels might not support receiving multiple queries in all modes. For example, the pie panel supports multiple queries only in query mode. In its other modes it will display the results of the first query in the list

-
-
-
\ No newline at end of file diff --git a/panels/stringquery/module.html b/panels/stringquery/module.html deleted file mode 100644 index 60286854015..00000000000 --- a/panels/stringquery/module.html +++ /dev/null @@ -1,49 +0,0 @@ - -
-
- - - - - - -
- - - - - - -
-
-
-
- - - - -
-
-
-
- - -
-
-
- - - - - - -
Queries
- - - - -
- - -
- \ No newline at end of file diff --git a/panels/stringquery/module.js b/panels/stringquery/module.js deleted file mode 100644 index ea58f7ed34d..00000000000 --- a/panels/stringquery/module.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - - ## Stringquery - - Broadcasts a query object to other panels - - ### Parameters - * label :: The label to stick over the field - * query :: A string or an array of querys. String if multi is off, array if it is on - This should be fixed, it should always be an array even if its only - one element - * multi :: Allow input of multiple queries? true/false - * multi_arrange :: How to arrange multu query string panels, 'vertical' or 'horizontal' - ### Group Events - #### Sends - * query :: Always broadcast as an array, even in multi: false - #### Receives - * query :: An array of queries. This is probably needs to be fixed. - -*/ - -angular.module('kibana.stringquery', []) -.controller('stringquery', function($scope, eventBus) { - - // Set and populate defaults - var _d = { - status : "Stable", - label : "Search", - query : "*", - group : "default", - multi : false, - multi_arrange: 'horizontal', - history : [], - remember: 10 // max: 100, angular strap can't take a variable for items param - } - _.defaults($scope.panel,_d); - - $scope.init = function() { - // If we're in multi query mode, they all get wiped out if we receive a - // query. Query events must be exchanged as arrays. - eventBus.register($scope,'query',function(event,query) { - $scope.panel.query = query; - update_history(query); - }); - } - - $scope.send_query = function(query) { - var _query = _.isArray(query) ? query : [query]; - update_history(_query); - eventBus.broadcast($scope.$id,$scope.panel.group,'query',_query); - } - - $scope.add_query = function() { - if (_.isArray($scope.panel.query)) - $scope.panel.query.push("") - else { - $scope.panel.query = new Array($scope.panel.query) - $scope.panel.query.push("") - } - } - - $scope.set_multi = function(multi) { - $scope.panel.query = multi ? - new Array($scope.panel.query) : $scope.panel.query[0]; - } - - $scope.remove_query = function(index) { - $scope.panel.query.splice(index,1); - } - - var update_history = function(query) { - if($scope.panel.remember > 0) { - $scope.panel.history = _.union(query.reverse(),$scope.panel.history) - var _length = $scope.panel.history.length - if(_length > $scope.panel.remember) { - $scope.panel.history = $scope.panel.history.slice(0,$scope.panel.remember) - } - } - } - -}); \ No newline at end of file