incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [02/19] Moving blur console to the root of the project.
Date Tue, 17 Jun 2014 20:24:10 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.model.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.model.js b/contrib/blur-console/src/main/webapp/js/blurconsole.model.js
deleted file mode 100644
index 61a15c2..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.model.js
+++ /dev/null
@@ -1,573 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-/*global blurconsole:false */
-blurconsole.model = (function() {
-	'use strict';
-
-	//----------------------- Configuration and State ------------------
-	var
-		configMap = {
-			poller : null
-		},
-		stateMap = {
-			currentTables: null,
-			currentClusters: [],
-			nodeMap : null,
-			queryPerformance : [],
-			queries : {},
-			errors: [],
-			schema: {}
-		};
-
-	//----------------------- Models ----------------------------------
-	var tables = (function() {
-		//-------------- Public API -----------------
-		function getClusters() {
-			if (stateMap.currentClusters === null) {
-				return [];
-			}
-
-			return blurconsole.utils.unique(stateMap.currentClusters, true);
-		}
-
-		function getEnabledTables(cluster) {
-			var data = [];
-
-			$.each(stateMap.currentTables, function(idx, table) {
-				if (table.cluster === cluster && table.enabled) {
-					data.push({name:table.name, rowCount:table.rows, recordCount:table.records});
-				}
-			});
-
-			return data;
-		}
-
-		function getDisabledTables(cluster) {
-			var data = [];
-
-			$.each(stateMap.currentTables, function(idx, table) {
-				if (table.cluster === cluster && !table.enabled) {
-					data.push({name:table.name, rowCount:table.rows, recordCount:table.records});
-				}
-			});
-
-			return data;
-		}
-
-		function getAllEnabledTables() {
-			var tableMap = {};
-
-			$.each(getClusters(), function(c, cluster){
-				tableMap[cluster] = getEnabledTables(cluster);
-			});
-
-			return tableMap;
-		}
-
-		function isDataLoaded() {
-			return stateMap.currentTables !== null;
-		}
-
-		function disableTable(tableName) {
-			configMap.poller.disableTable(tableName);
-		}
-
-		function enableTable(tableName) {
-			configMap.poller.enableTable(tableName);
-		}
-
-		function deleteTable(tableName, includeFiles) {
-			configMap.poller.deleteTable(tableName, includeFiles);
-		}
-
-		function getSchema(tableName, callback) {
-			if(stateMap.schema && stateMap.schema.tableName === tableName && new Date() - stateMap.schema.date < 60000) {
-				setTimeout(function(){
-					callback(stateMap.schema.data);
-				}, 0);
-			} else {
-				configMap.poller.getSchema(tableName, function(schema) {
-					stateMap.schema.tableName = tableName;
-					stateMap.schema.data = schema;
-					stateMap.schema.date = new Date();
-					callback(schema);
-				});
-			}
-		}
-
-		function getFamilies(tableName) {
-			var table;
-
-			$.each(stateMap.currentTables, function(idx, t) {
-				if (t.name === tableName) {
-					table = t;
-					return false;
-				}
-			});
-			if(table) {
-				return table.families;
-			} else {
-				return [];
-			}
-		}
-
-		function findTerms(table, family, column, startsWith, callback) {
-			configMap.poller.findTerms(table, family, column, startsWith, callback);
-		}
-
-		return {
-			getClusters : getClusters,
-			getEnabledTables : getEnabledTables,
-			getDisabledTables : getDisabledTables,
-			isDataLoaded : isDataLoaded,
-			disableTable : disableTable,
-			enableTable : enableTable,
-			deleteTable : deleteTable,
-			getSchema : getSchema,
-			findTerms : findTerms,
-			getAllEnabledTables : getAllEnabledTables,
-			getFamilies : getFamilies
-		};
-	}());
-
-	var nodes = (function() {
-		//------------- Private Methods -----------------
-		function _getClusterData(clusterName) {
-			var clusterData = $.grep(stateMap.nodeMap.clusters, function(cluster) {
-				return cluster.name === clusterName;
-			});
-			return clusterData.length > 0 ? clusterData[0] : null;
-		}
-
-		//------------- Public API ----------------------
-		function getOnlineZookeeperNodes() {
-			return stateMap.nodeMap.zookeepers.online;
-		}
-
-		function getOfflineZookeeperNodes() {
-			return stateMap.nodeMap.zookeepers.offline;
-		}
-
-		function getOnlineControllerNodes() {
-			return stateMap.nodeMap.controllers.online;
-		}
-
-		function getOfflineControllerNodes() {
-			return stateMap.nodeMap.controllers.offline;
-		}
-
-		function getOfflineShardNodes(clusterName) {
-			var clusterData = _getClusterData(clusterName);
-			return clusterData ? clusterData.offline : [];
-		}
-
-		function getOnlineShardNodes(clusterName) {
-			var clusterData = _getClusterData(clusterName);
-			return clusterData ? clusterData.online : [];
-		}
-
-		function isDataLoaded() {
-			return stateMap.nodeMap !== null;
-		}
-
-		return {
-			getOnlineZookeeperNodes : getOnlineZookeeperNodes,
-			getOfflineZookeeperNodes : getOfflineZookeeperNodes,
-			getOfflineControllerNodes : getOfflineControllerNodes,
-			getOnlineControllerNodes : getOnlineControllerNodes,
-			getOfflineShardNodes : getOfflineShardNodes,
-			getOnlineShardNodes : getOnlineShardNodes,
-			isDataLoaded : isDataLoaded
-		};
-	}());
-
-	var metrics = (function() {
-		//------------- Private Methods ------------------
-		function _buildPieChartData(onlineCount, offlineCount) {
-			var onlineChart = {
-				'label':'Online',
-				'color':'#66CDCC',
-				'data':[[0,onlineCount]]
-			};
-
-			var offlineChart = {
-				'label':'Offline',
-				'color':'#FF1919',
-				'data':[[0,offlineCount]]
-			};
-
-			return [onlineChart, offlineChart];
-		}
-
-		//------------- Public API -----------------------
-		function getZookeeperChartData() {
-			return _buildPieChartData(stateMap.nodeMap.zookeepers.online.length, stateMap.nodeMap.zookeepers.offline.length);
-		}
-
-		function getControllerChartData() {
-			return _buildPieChartData(stateMap.nodeMap.controllers.online.length, stateMap.nodeMap.controllers.offline.length);
-		}
-
-		function getClusters() {
-			return $.map(stateMap.nodeMap.clusters, function(cluster) {
-				return cluster.name;
-			});
-		}
-
-		function getShardChartData(clusterName) {
-			var clusterData = $.grep(stateMap.nodeMap.clusters, function(cluster) {
-				return cluster.name === clusterName;
-			});
-
-			if (clusterData.length > 0) {
-				return _buildPieChartData(clusterData[0].online.length, clusterData[0].offline.length);
-			}
-			return null;
-		}
-
-		function getTableChartData() {
-			var enabledData = blurconsole.utils.reduce(stateMap.currentTables, [], function(accumulator, table){
-				var currentCluster = $.grep(accumulator, function(item){
-					return item[0] === table.cluster;
-				});
-
-				if (currentCluster.length === 0) {
-					currentCluster = [table.cluster, 0];
-					accumulator.push(currentCluster);
-				} else {
-					currentCluster = currentCluster[0];
-				}
-
-				if (table.enabled) {
-					currentCluster[1] = currentCluster[1]+1;
-				}
-				return accumulator;
-			});
-
-			var disabledData = blurconsole.utils.reduce(stateMap.currentTables, [], function(accumulator, table){
-				var currentCluster = $.grep(accumulator, function(item){
-					return item[0] === table.cluster;
-				});
-
-				if (currentCluster.length === 0) {
-					currentCluster = [table.cluster, 0];
-					accumulator.push(currentCluster);
-				} else {
-					currentCluster = currentCluster[0];
-				}
-
-				if (!table.enabled) {
-					currentCluster[1] = currentCluster[1]+1;
-				}
-				return accumulator;
-			});
-
-			return [
-				{
-					'data' : enabledData,
-					'label' : 'Enabled',
-					'color' : '#66CDCC',
-					'stack' : true
-				},
-				{
-					'data' : disabledData,
-					'label' : 'Disabled',
-					'color' : '#333333',
-					'stack' : true
-				}
-			];
-		}
-
-		function getQueryLoadChartData() {
-			var total = 0,
-				queryArray = [],
-				meanArray = [],
-				queryData, mean;
-
-			queryData = stateMap.queryPerformance;
-
-			$.each(queryData, function(idx, increment) {
-				total += increment;
-			});
-
-			mean = queryData.length === 0 ? 0 : total/queryData.length;
-
-			$.each(queryData, function(idx, increment) {
-				queryArray.push([idx, increment]);
-				meanArray.push([idx, mean]);
-			});
-
-			return [{label: 'Queries', data: queryArray}, {label:'Average', data:meanArray}];
-		}
-
-		function getSlowQueryWarnings() {
-			return stateMap.queries.slowQueries;
-		}
-
-		return {
-			getZookeeperChartData : getZookeeperChartData,
-			getControllerChartData : getControllerChartData,
-			getClusters : getClusters,
-			getShardChartData : getShardChartData,
-			getTableChartData : getTableChartData,
-			getQueryLoadChartData : getQueryLoadChartData,
-			getSlowQueryWarnings : getSlowQueryWarnings
-		};
-	}());
-
-	var queries = (function() {
-		var states = ['running', 'interrupted', 'complete', 'backpressureinterrupted'];
-
-		//-------------- Private Methods -------------------
-		function _matchesFilter(queryData, filterText) {
-			var queryStr = queryData.user + '~~~' + queryData.query + '~~~' + states[queryData.state];
-
-			if (filterText === null || filterText === '') {
-				return true;
-			}
-
-			return queryStr.toLowerCase().indexOf(filterText.toLowerCase()) !== -1;
-		}
-
-		//-------------- Public API -----------------------
-		function queriesForTable(table, sort, filter) {
-			var queries = [], qSort, sortField, sortDir;
-
-			qSort = (sort || 'startTime~desc').split('~');
-			sortField = qSort[0];
-			sortDir = qSort.length > 1 ? qSort[1] : 'asc';
-
-			$.each(stateMap.queries.queries, function(i, query){
-				if (query.table === table && _matchesFilter(query, filter)) {
-					queries.push(query);
-				}
-			});
-
-			queries.sort(function(a, b){
-				if (sortDir === 'asc') {
-					return a[sortField] > b[sortField];
-				} else {
-					return b[sortField] > b[sortField];
-				}
-			});
-
-			return queries;
-		}
-
-		function cancelQuery(table, uuid) {
-			configMap.poller.cancelQuery(uuid);
-		}
-
-		function tableHasActivity(table) {
-			var hasActivity = false;
-			$.each(stateMap.queries.queries, function(i, query){
-				if (query.table === table) {
-					hasActivity = true;
-					return false;
-				}
-			});
-			return hasActivity;
-		}
-
-		return {
-			queriesForTable : queriesForTable,
-			cancelQuery : cancelQuery,
-			tableHasActivity : tableHasActivity
-		};
-	}());
-
-	var search = (function() {
-		var results = {}, totalRecords = 0, currentQuery, currentTable, currentArgs = {start: 0, fetch: 10, rowRecordOption: 'rowrow', families: null};
-
-		//-------------- Private Methods -------------------------
-		function _sendSearch() {
-			configMap.poller.sendSearch(currentQuery, currentTable, currentArgs, _processResults);
-		}
-
-		function _processResults(data) {
-			var dataFamilies = data.families;
-			var dataResults = data.results;
-			totalRecords = data.total;
-
-			if (typeof dataResults !== 'undefined' && dataResults !== null) {
-				$.each(dataResults, function(family, resultList){
-					var dataList = results[family] || [];
-					results[family] = dataList.concat(resultList);
-				});
-			}
-			$.gevent.publish('results-updated', [dataFamilies]);
-		}
-
-		//-------------- Public API ------------------------------
-		function runSearch( query, table, searchArgs ) {
-			var parsedFamilies = blurconsole.utils.findFamilies(query);
-
-			currentQuery = query;
-			currentTable = table;
-			currentArgs = $.extend(currentArgs, searchArgs);
-			currentArgs.families = parsedFamilies;
-			results = {};
-
-			if (query.indexOf('rowid:') === -1 && query.indexOf('recordid:') === -1) {
-				_sendSearch();
-			}
-		}
-
-		function getResults() {
-			return results;
-		}
-
-		function getTotal() {
-			return totalRecords;
-		}
-
-		function loadMoreResults(family) {
-			var alreadyLoadedResults = results[family];
-
-			if (typeof alreadyLoadedResults === 'undefined' || alreadyLoadedResults === null) {
-				currentArgs.start = 0;
-			} else if ($.isArray(alreadyLoadedResults)) {
-				currentArgs.start = alreadyLoadedResults.length;
-			} else {
-				currentArgs.start = blurconsole.utils.keys(alreadyLoadedResults).length;
-			}
-
-			// currentArgs.start = alreadyLoadedResults ? alreadyLoadedResults.length : 0;
-			currentArgs.fetch = 10;
-			currentArgs.families = [family];
-			_sendSearch();
-		}
-
-		return {
-			runSearch: runSearch,
-			getResults: getResults,
-			loadMoreResults: loadMoreResults,
-			getTotal: getTotal
-		};
-	}());
-
-	var logs = (function() {
-		//------------- Public API -------------------
-		function logError(error, module) {
-			stateMap.errors.push({error: error, module: module, timestamp: new Date()});
-			$.gevent.publish('logging-updated');
-		}
-
-		function clearErrors() {
-			delete stateMap.errors;
-			stateMap.errors = [];
-			$.gevent.publish('logging-updated');
-		}
-
-		function getLogs() {
-			return stateMap.errors;
-		}
-
-		return {
-			logError: logError,
-			clearErrors: clearErrors,
-			getLogs: getLogs
-		};
-	}());
-
-	//----------------------- Private Methods -------------------------
-	function _nodePoller() {
-		configMap.poller.getNodeList(_updateNodes);
-	}
-
-	function _tablePoller() {
-		configMap.poller.getTableList(_updateTables);
-	}
-
-	function _queryPerformancePoller() {
-		configMap.poller.getQueryPerformance(_updateQueryPerformance);
-	}
-
-	function _queryPoller() {
-		configMap.poller.getQueries(_updateQueries);
-	}
-
-	//----------------------- Event Handlers --------------------------
-	function _updateNodes(nodes) {
-		if (nodes !== 'error' && !blurconsole.utils.equals(nodes, stateMap.nodeMap)) {
-			stateMap.nodeMap = nodes;
-			$.gevent.publish('node-status-updated');
-		}
-		setTimeout(_nodePoller, 5000);
-	}
-
-	function _updateTables(data) {
-		if (data !== 'error') {
-			var tables = data.tables, clusters = data.clusters;
-			if (!blurconsole.utils.equals(tables, stateMap.currentTables) || !blurconsole.utils.equals(clusters, stateMap.currentClusters)) {
-				stateMap.currentTables = tables;
-				stateMap.currentClusters = clusters;
-				$.gevent.publish('tables-updated');
-			}
-		}
-		setTimeout(_tablePoller, 5000);
-	}
-
-	function _updateQueryPerformance(performanceMetric) {
-		if (performanceMetric !== 'error') {
-			if (stateMap.queryPerformance.length === 100) {
-				stateMap.queryPerformance.shift();
-			}
-
-			stateMap.queryPerformance.push(performanceMetric);
-			$.gevent.publish('query-perf-updated');
-		}
-		setTimeout(_queryPerformancePoller, 5000);
-	}
-
-	function _updateQueries(queries) {
-		if (queries !== 'error' && !blurconsole.utils.equals(queries, stateMap.queries)) {
-			stateMap.queries = queries;
-			$.gevent.publish('queries-updated');
-		}
-		setTimeout(_queryPoller, 5000);
-	}
-
-	//----------------------- Public API ------------------------------
-	function initModule() {
-		if(window.location.href.indexOf('fakeIt=') > -1) {
-			blurconsole.fake.initModule();
-			configMap.poller = blurconsole.fake;
-		} else {
-			configMap.poller = blurconsole.data;
-		}
-		setTimeout(function() {
-			_nodePoller();
-			_tablePoller();
-			_queryPerformancePoller();
-			_queryPoller();
-		}, 1000);
-	}
-
-	return {
-		initModule : initModule,
-		tables : tables,
-		metrics: metrics,
-		nodes : nodes,
-		queries : queries,
-		search : search,
-		logs: logs
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.queries.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.queries.js b/contrib/blur-console/src/main/webapp/js/blurconsole.queries.js
deleted file mode 100644
index 9b3d6b0..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.queries.js
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-/*jshint laxbreak: true */
-/*global blurconsole:false */
-blurconsole.queries = (function() {
-    'use strict';
-  
-    //------------------------ Configuration and State --------------------
-    var configMap = {
-        view: 'views/queries.tpl.html',
-        states: ['Running', 'Interrupted', 'Complete', 'Back Pressure Interrupted'],
-        queryDef: [
-            { label: 'User', key: 'user' },
-            { label: 'Query', key: 'query' },
-            { label: 'Time Started', key: function(row) {
-                var start = new Date(row.startTime);
-                return start.toTimeString(); //start.getHours() + ':' + start.getMinutes() + ':' + start.getSeconds();
-            } },
-            { label: 'State', key: function(row) {
-                var stateInfo = configMap.states[row.state];
-                if(row.state === 0) {
-                    stateInfo += ' <div class="badge badge-info">' + row.percent + '%</div>';
-                }
-                return stateInfo;
-            } },
-            { label: 'Actions', key: function(row) {
-                var actions = '';
-                if(row.state === 0) {
-                    actions += '<a href="#" class="cancelTrigger btn btn-danger" data-uuid="' + row.uuid + '" data-query="' + row.query + '" data-table="' + row.table + '"><i class="glyphicon glyphicon-ban-circle"></i> Cancel</a> ';
-                }
-                return actions;
-            } }
-        ],
-    },
-    stateMap = {
-        $container: null,
-        currentTable: null,
-        currentFilter: null,
-        currentSort: null
-    },
-    jqueryMap = {};
-  
-    //----------------------------------- Private methods ----------------------------
-
-    function _setJqueryMap() {
-        var $container = stateMap.$container;
-        jqueryMap = {
-            $container: $container,
-            $tableHolder: $('#tableHolder'),
-            $queryHolder: $('#queryHolder'),
-            $filterHolder: $('#filterOptions'),
-            $filterText: $('#filterOptions .filterText')
-        };
-    }
-
-    function _registerPageEvents() {
-        jqueryMap.$tableHolder.on('click', '.list-group-item', _showQueriesForTable);
-        jqueryMap.$queryHolder.on('click', 'a.cancelTrigger', _cancelSelectedQuery);
-        jqueryMap.$filterHolder.on('click', '.filterTrigger', _filterQueries);
-    }
-
-    function _unregisterPageEvents() {
-        if(jqueryMap.$tableHolder) {
-            jqueryMap.$tableHolder.off();
-        }
-    }
-
-    function _waitForData() {
-        var clusters = blurconsole.model.tables.getClusters();
-        if(clusters && clusters.length > 0) {
-            _drawTableList();
-            _drawQueries();
-        } else {
-            setTimeout(_waitForData, 100);
-        }
-    }
-    //----------------------------- Event Handlers and DOM Methods -----------------------------
-
-    function _showQueriesForTable(evt) {
-        stateMap.currentTable = $(evt.currentTarget).attr('href');
-        $('.list-group-item', jqueryMap.$tableHolder).removeClass('active');
-        $('.list-group-item[href="' + stateMap.currentTable + '"]', jqueryMap.$tableHolder).addClass('active');
-        _drawQueries();
-        return false;
-    }
-
-    function _cancelSelectedQuery(evt) {
-        var uuid = $(evt.currentTarget).data('uuid'),
-          query = $(evt.currentTarget).data('query'),
-          table = $(evt.currentTarget).data('table');
-        var modalContent = blurconsole.browserUtils.modal('confirmDelete', 'Confirm Query Cancel', 'You are about to cancel the query [' + query + '].  Are you sure you want to do this?', [{
-            classes: 'btn-primary killQuery',
-            label: 'Stop Query'
-        }, {
-            classes: 'btn-default cancel',
-            label: 'Cancel',
-            data: {
-                dismiss: 'modal'
-            }
-        }], 'medium');
-        var modal = $(modalContent).modal().on('shown.bs.modal', function(e) {
-            $(e.currentTarget).on('click', '.killQuery', function() {
-                blurconsole.model.queries.cancelQuery(table, uuid);
-                modal.modal('hide');
-            });
-        }).on('hidden.bs.modal', function(e) {
-            $(e.currentTarget).remove();
-        });
-        return false;
-    }
-
-    function _filterQueries() {
-        var filterVal = jqueryMap.$filterText.val();
-        stateMap.currentFilter = filterVal;
-        _drawQueries();
-    }
-
-    function _drawTableList() {
-        var clusters = blurconsole.model.tables.getClusters();
-        if(clusters) {
-            jqueryMap.$tableHolder.html('');
-            clusters.sort();
-            $.each(clusters, function(i, cluster) {
-                var panelContent, tables = blurconsole.model.tables.getEnabledTables(cluster);
-                panelContent = '<div class="panel panel-default">' + '<div class="panel-heading">' + '<h3 class="panel-title">' + cluster + '</h3>' + '</div>' + '<div class="panel-body">';
-                if(tables.length > 0) {
-                    tables.sort(function(a, b) {
-                        return a.name > b.name;
-                    });
-                    panelContent += '<div class="list-group">';
-                    $.each(tables, function(i, table) {
-                        panelContent += '<a href="' + table.name + '" class="list-group-item';
-                        if(table.name === stateMap.currentTable) {
-                            panelContent += ' active';
-                            _drawQueries();
-                        }
-                        panelContent += '">' + table.name + '</a>';
-                    });
-                    panelContent += '</div>';
-                } else {
-                    panelContent += '<div class="alert alert-warning">There are not any enabled tables!</div>';
-                }
-                panelContent += '</div></div>';
-                jqueryMap.$tableHolder.append(panelContent);
-            });
-        } else {
-            jqueryMap.$tableHolder.html('<div class="alert alert-warning">There are no clusters of tables!</div>');
-        }
-    }
-
-    function _drawQueries() {
-        if(stateMap.currentTable) {
-            jqueryMap.$queryHolder.html(blurconsole.browserUtils.table(configMap.queryDef, blurconsole.model.queries.queriesForTable(stateMap.currentTable, stateMap.currentSort, stateMap.currentFilter)));
-        } else {
-            jqueryMap.$queryHolder.html('<div class="alert alert-info">Select a table on the left to see the current queries</div>');
-        }
-    }
-  
-    //-------------------------- Public API ---------------------------------
-
-    function initModule($container) {
-        $container.load(configMap.view, function() {
-            stateMap.$container = $container;
-            _setJqueryMap();
-            $.gevent.subscribe(jqueryMap.$container, 'queries-updated', _drawQueries);
-            $.gevent.subscribe(jqueryMap.$container, 'tables-updated', _drawTableList);
-            _registerPageEvents();
-            _waitForData();
-        });
-        return true;
-    }
-
-    function unloadModule() {
-        $.gevent.unsubscribe(jqueryMap.$container, 'queries-updated');
-        $.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
-        _unregisterPageEvents();
-    }
-    return {
-        initModule: initModule,
-        unloadModule: unloadModule
-    };
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.schema.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.schema.js b/contrib/blur-console/src/main/webapp/js/blurconsole.schema.js
deleted file mode 100644
index ebb36dd..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.schema.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-/*jshint laxbreak: true */
-/*global blurconsole:false */
-blurconsole.schema = (function () {
-	'use strict';
-    
-    //----------------------------- Configuration and State -------------------------
-	var
-		configMap = {
-			mainHtml: String()
-				+ '<div class="container-fluid">'
-					+ '<div class="row">'
-						+ '<div class="col-md-6">'
-							+ '<div class="panel-group schemaList">'
-							+ '</div>'
-						+ '</div>'
-						+ '<div class="col-md-6">'
-							+ '<div class="row">'
-								+ '<div class="col-md-12 schemaColumnInfo">'
-									+ '<div class="schemaColumnDef in">'
-										+ '<strong>Choose a column on the left to see def</strong>'
-									+ '</div>'
-								+ '</div>'
-							+ '</div>'
-							+ '<div class="row">'
-								+ '<div class="col-md-12 schemaColumnTerms">'
-									+ '<div class="input-group">'
-										+ '<input class="form-control termSearch" placeholder="Starts With" type="text">'
-										+ '<span class="input-group-btn">'
-											+ '<button class="btn btn-default" type="button">Go!</button>'
-										+ '</span>'
-									+ '</div>'
-									+ '<ul class="list-group termList"></ul>'
-								+ '</div>'
-							+ '</div>'
-						+ '</div>'
-					+ '</div>'
-				+ '</div>'
-		},
-		stateMap = {},
-		jqueryMap = {};
-
-	//------------------------------ Private Methods -----------------------------------------------------
-	function _findTerms() {
-		blurconsole.model.tables.findTerms(stateMap.table, stateMap.termFamily, stateMap.termColumn, jqueryMap.termSearch.val(), _loadTerms);
-	}
-
-	//------------------------------ Event Handling and DOM Methods --------------------------------------
-	function _showSchema(event, table) {
-		stateMap.table = table;
-		stateMap.modalId = stateMap.table + '_modal';
-		blurconsole.model.tables.getSchema(stateMap.table, _popupSchemaView);
-	}
-
-	function _popupSchemaView(schema) {
-		stateMap.schema = schema;
-		jqueryMap.contentHolder = $(configMap.mainHtml);
-		jqueryMap.contentHolder.find('.schemaList').html(_buildTreeSection());
-		jqueryMap.contentHolder.find('.schemaColumnInfo').append(_buildInfoSection());
-
-		jqueryMap.modal = $(blurconsole.browserUtils.modal(stateMap.modalId, 'Schema Definition for ' + stateMap.table, jqueryMap.contentHolder, null, 'large'));
-		jqueryMap.modal.modal()
-		.on('shown.bs.modal', function(e){
-			jqueryMap.columnTermsSection = $('.schemaColumnTerms', jqueryMap.modal);
-			jqueryMap.termSearch = $('.termSearch', jqueryMap.modal);
-			jqueryMap.termList = $('.termList', jqueryMap.modal);
-			jqueryMap.termSearchButton = $('.schemaColumnTerms button', jqueryMap.modal);
-			$('.collapse', e.currentTarget).collapse({ toggle: false });
-		})
-		.on('hidden.bs.modal', function(e) {
-			$(e.currentTarget).remove();
-			jqueryMap.contentHolder.remove();
-			jqueryMap = {};
-			stateMap = {};
-		})
-		.on('click', 'li.schemaColumn', function() {
-			var defId = $(this).find('a').attr('href');
-			$('div.schemaColumnDef').removeClass('in');
-			$(defId).addClass('in');
-			jqueryMap.columnTermsSection.hide();
-			return false;
-		})
-		.on('click', 'a.termsTrigger', _viewTerms)
-		.on('click', '.schemaColumnTerms button', _findTerms)
-		.on('click', '.searchTrigger', _switchToSearch);
-	}
-
-	function _buildTreeSection() {
-		var tree = '';
-		$.each(stateMap.schema, function(family, cols){
-			var famId = blurconsole.browserUtils.cleanId(family);
-			tree += '<div class="panel panel-default"><div class="panel-heading">';
-			tree += '<h4 class="panel-title" data-toggle="collapse" data-parent=".schemaList" data-target="#' + famId + '">' + family + '</h4></div>';
-			tree += '<div id="' + famId + '" class="panel-collapse collapse"><div class="panel-body"><ul class="list-group">';
-			$.each(cols, function(col, def) {
-				var colId = blurconsole.browserUtils.cleanId(col);
-				tree += '<li class="list-group-item schemaColumn"><a href="#' + famId + '_' + colId + '">' + col + '';
-				tree += '</a><div class="pull-right">';
-				if (def.type !== 'stored') {
-					tree += ' <span class="badge">searchable</span>';
-				}
-				tree += '<i class="glyphicon glyphicon-chevron-right"></i></div></li>';
-			});
-			tree += '</ul></div></div></div>';
-		});
-		return tree;
-	}
-
-	function _buildInfoSection() {
-		var info = '';
-		$.each(stateMap.schema, function(family, cols){
-			var famId = blurconsole.browserUtils.cleanId(family);
-			$.each(cols, function(col, def){
-				var colId = blurconsole.browserUtils.cleanId(col);
-				info += '<div class="schemaColumnDef" id="' + famId + '_' + colId + '"><ul class="list-group">';
-				info += '<li class="list-group-item"><strong>Field Name:</strong> ' + col + '</li>';
-				info += '<li class="list-group-item"><strong>Fieldless Searching:</strong> ' + blurconsole.browserUtils.booleanImg(def.fieldLess) + '</li>';
-				info += '<li class="list-group-item"><strong>Field Type:</strong> ' + def.type + '</li>';
-				if (def.extra) {
-					$.each(def.extra, function(key, value) {
-						info += '<li class="list-group-item"><strong>' + key + ':</strong> ' + value + '</li>';
-					});
-				}
-				if (def.type !== 'stored') {
-					info += '<li class="list-group-item"><a href="#" class="termsTrigger" data-fam="' + family + '" data-col="' + col + '">View Terms</a></li>';
-				}
-				info += '</ul></div>';
-			});
-		});
-		return info;
-	}
-
-	function _viewTerms(evt) {
-		jqueryMap.termList.html('<div class="center-block"><img src="img/ajax-loader.gif"></div>');
-		jqueryMap.termSearch.val('');
-		jqueryMap.columnTermsSection.show();
-		var $this = $(evt.currentTarget);
-
-		stateMap.termFamily = $this.data('fam');
-		stateMap.termColumn = $this.data('col');
-
-		jqueryMap.termSearchButton.trigger('click');
-	}
-
-	function _loadTerms(terms) {
-		jqueryMap.termList.html('');
-		$.each(terms, function(i, term){
-			jqueryMap.termList.append('<li class="list-group-item">' + term + ' <span class="badge badge-success searchTrigger" title="Search for this value" data-value="' + term + '" data-table="' + stateMap.table + '"><i class="glyphicon glyphicon-search"></i></span></li>');
-		});
-	}
-
-	function _switchToSearch(evt){
-		blurconsole.shell.changeAnchorPart({
-			tab: 'search',
-			_tab: {
-				query: encodeURIComponent(stateMap.termFamily + '.' + stateMap.termColumn + ':' + $(evt.currentTarget).data('value')),
-				table: $(evt.currentTarget).data('table'),
-				rr: 'rowrow'
-			}
-		});
-		jqueryMap.modal.modal('hide');
-	}
-
-    //----------------------------- Public API ----------------------------
-	function initModule() {
-		$.gevent.subscribe($(document), 'schema-show', _showSchema);
-	}
-
-	return {
-		initModule : initModule
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.search.js b/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
deleted file mode 100644
index a35da9e..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.search.js
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-/*global blurconsole:false, confirm:false */
-blurconsole.search = (function () {
-	'use strict';
-    
-    //----------------------------- Configuration and State --------------------------------
-	var configMap = {
-		view : 'views/search.tpl.html',
-		superQueryMap: {
-			'rowrow' : 'Search Row / Retrieve Row',
-			'recordrow' : 'Search Record / Retrieve Row',
-			'recordrecord' : 'Search Record / Retrieve Record'
-		},
-		optionsHtml:
-			'<label for="superQuery">Search & Retrieve</label>' +
-			'<select id="superQuery">' +
-				'<option value="rowrow">Search Row / Retrieve Row</option>' +
-				'<option value="recordrow">Search Record / Retrieve Row</option>' +
-				'<option value="recordrecord">Search Record / Retrieve Record</option>' +
-			'</select>'
-	},
-	stateMap = {
-		$container : null,
-		$currentTable : null,
-		$currentQuery : null,
-		$schemaForCurrentTable : null,
-		$start : 0,
-		$fetch : 10,
-		$filter : null,
-		$rowRecordOption : 'rowrow'
-	},
-	jqueryMap = {};
-    
-    //----------------- Private Methods ----------------------------------
-	function _setJqueryMap() {
-		var $container = stateMap.$container;
-		jqueryMap = {
-			$container : $container,
-			$queryField : $('#queryField'),
-			$tableField : $('#tableChooser'),
-			$tableSelectorStatusOption : $('#statusOption'),
-			$tableWarning : $('#tableGoneWarning'),
-			$resultsHolder : $('#results'),
-			$optionsDisplay : $('#searchOptionsDisplay'),
-			$countHolder : $('#resultCount'),
-			$facetTrigger : $('#facetTrigger'),
-			$optionsTrigger: $('#searchOptionsTrigger'),
-			$searchTrigger : $('#searchTrigger')
-		};
-	}
-
-	function _parseQueryForTypeahead(query) {
-		var ret = {
-			family: null,
-			column: null,
-			term: null,
-			mode: null
-		};
-		query = query.toLowerCase();
-		var dotIndex = query.lastIndexOf('.');
-		var colonIndex = query.lastIndexOf(':');
-		var lParenIndex = query.lastIndexOf('(');
-		var rParenIndex = query.lastIndexOf(')');
-		var inParen = lParenIndex > -1 && lParenIndex > rParenIndex;
-		var spaceIndex = query.lastIndexOf(' ');
-		var lastIndex = Math.max(0,dotIndex,colonIndex,lParenIndex,rParenIndex,spaceIndex);
-		if(dotIndex === lastIndex) { // column mode
-			ret.family = query.substring(spaceIndex+1, dotIndex);
-			ret.column = query.substring(dotIndex+1);
-			ret.mode = 'column';
-		} else if(colonIndex === lastIndex || (inParen && lParenIndex === colonIndex+1)) { // term mode
-			var familyStart = query.lastIndexOf(' ', dotIndex);
-			if(familyStart === -1) {
-				familyStart = 0;
-			}
-			ret.family = query.substring(familyStart, dotIndex);
-			ret.column = query.substring(dotIndex+1, colonIndex);
-			ret.term = query.substring(lastIndex+1);
-			ret.mode = 'term';
-		} else if(query.length === 1 || query.length -1 !== lastIndex) { // family mode
-			ret.family = query.substring(spaceIndex+1);
-			ret.mode = 'family';
-		}
-		if(ret.family) {
-			ret.family = ret.family.replace(/[\.\:\(\)\+\- ]/g,'');
-		}
-		if(ret.term) {
-			ret.term = ret.term.replace(/[\+\-]/g,'');
-		}
-		return ret;
-	}
-
-	var _queryTypeaheadDataset = {
-		name:'query-dataset',
-		source: function _queryTypeaheadSource(query, cb) {
-			function buildSuggestionObject(query, hint, value) {
-				return {value:query.substring(0,query.lastIndexOf(hint)) + value, display:value};
-			}
-			var table = stateMap.$currentTable;
-			if(table && table !== '' && blurconsole.model.tables.isDataLoaded()) {
-				query = query.toLowerCase();
-				var parsedQuery = _parseQueryForTypeahead(query);
-				console.log(parsedQuery.mode);
-				switch(parsedQuery.mode) {
-				case 'family':
-					var families = blurconsole.model.tables.getFamilies(table);
-					families = $.map(families, function(fam) {
-						if(fam.indexOf(parsedQuery.family) === 0) {
-							return buildSuggestionObject(query, parsedQuery.family, fam);
-						}
-					});
-					cb(families);
-					break;
-				case 'column':
-					blurconsole.model.tables.getSchema(table, function(schema) {
-						var columnMap = schema[parsedQuery.family];
-						if(columnMap) {
-							var columns = $.map(columnMap, function(data, col) {
-								if(col.indexOf(parsedQuery.column) === 0) {
-									return buildSuggestionObject(query, parsedQuery.column, col);
-								}
-							});
-							cb(columns);
-						}
-					});
-					break;
-				case 'term':
-					if(parsedQuery.term.length > 0) {
-						blurconsole.model.tables.findTerms(table, parsedQuery.family, parsedQuery.column, parsedQuery.term, function(terms){
-							terms = $.map(terms, function(suggestedTerm){
-								return buildSuggestionObject(query, parsedQuery.term, suggestedTerm);
-							});
-							cb(terms);
-						});
-					} else {
-						cb(null);
-					}
-					break;
-				default:
-					cb(null);
-				}
-			}
-		},
-		templates: {
-			suggestion: function(suggestion) {
-				return '<p>' + suggestion.display + '</p>';
-			}
-		}
-	};
-
-	function _registerPageEvents() {
-		jqueryMap.$searchTrigger.on('click', _sendSearch);
-		jqueryMap.$queryField.typeahead({}, _queryTypeaheadDataset);
-		jqueryMap.$queryField.on('keyup', function(evt) {
-			if (evt.keyCode === 13) {
-				_sendSearch();
-			}
-		});
-		jqueryMap.$resultsHolder.on('shown.bs.collapse', '.panel-collapse:not(.loaded)', _getMoreData);
-		jqueryMap.$resultsHolder.on('click', '.nextPage', _getMoreData);
-		jqueryMap.$optionsTrigger.popover({
-			html: true,
-			placement: 'bottom',
-			title: 'Extra Search Options',
-			container: 'body',
-			content: configMap.optionsHtml
-		});
-		jqueryMap.$optionsTrigger.on('shown.bs.popover', _updateOptionPopover);
-		$(document).on('change', '.popover select', _persistOptions);
-		jqueryMap.$facetTrigger.on('click', _popupFacetDialog);
-		jqueryMap.$tableField.on('change', function(evt) {
-			stateMap.$currentTable = $(evt.currentTarget).val();
-		});
-	}
-
-	function _unregisterPageEvents() {
-		if (jqueryMap.$searchTrigger) {
-			jqueryMap.$searchTrigger.off('click');
-			jqueryMap.$queryField.typeahead('destroy');
-			jqueryMap.$queryField.off('keyup');
-			jqueryMap.$resultsHolder.off('shown.bs.collapse');
-			jqueryMap.$resultsHolder.off('click');
-			jqueryMap.$optionsTrigger.popover('destroy');
-			jqueryMap.$optionsTrigger.off('shown.bs.popover');
-			$(document).off('change');
-			jqueryMap.$tableField.off('change');
-			//jqueryMap.$facetTrigger.off('click');
-		}
-	}
-
-    function _getColList(row) {
-		var cols = blurconsole.utils.reject(blurconsole.utils.keys(row), function(i) {
-			return i === 'recordid';
-		});
-
-		if (cols.length === 0) {
-			return [];
-		}
-
-		cols.sort();
-
-		cols = ['recordid'].concat(cols);
-		return cols;
-	}
-
-    //------------------------------ Event Handlers and DOM Methods ---------------------
-	function _updateOptionDisplay() {
-		var displayText = '';
-		displayText += configMap.superQueryMap[stateMap.$rowRecordOption];
-		jqueryMap.$optionsDisplay.html(displayText);
-	}
-
-	function _updateOptionPopover() {
-		if ($('#superQuery').length > 0) {
-			$('#superQuery').val(stateMap.$rowRecordOption);
-		}
-	}
-
-	function _persistOptions() {
-		var resendSearch = false;
-		if (jqueryMap.$resultsHolder.children().length > 0) {
-			if (confirm('You have existing results on the screen, changing the search options will erase your results.  Continue?')) {
-				resendSearch = true;
-			} else {
-				$('#superQuery').val(stateMap.$rowRecordOption);
-				return false;
-			}
-		}
-		stateMap.$rowRecordOption = $('#superQuery').val();
-		if (resendSearch) {
-			_sendSearch();
-		}
-		_updateOptionDisplay();
-		$('#searchOptionsTrigger').popover('hide');
-	}
-
-	function _sendSearch() {
-		stateMap.$currentTable = jqueryMap.$tableField.val();
-		stateMap.$currentQuery = jqueryMap.$queryField.val();
-
-		blurconsole.shell.changeAnchorPart({
-			tab: 'search',
-			_tab: {
-				query: encodeURIComponent(stateMap.$currentQuery),
-				table: stateMap.$currentTable,
-				rr: stateMap.$rowRecordOption
-			}
-		});
-		_drawResultHolders();
-		jqueryMap.$countHolder.html('');
-		blurconsole.model.search.runSearch(stateMap.$currentQuery, stateMap.$currentTable, {start: 0, fetch: 10, rowRecordOption: stateMap.$rowRecordOption});
-	}
-
-	function _getMoreData(evt) {
-		var family = $(evt.currentTarget).attr('href') ? $(evt.currentTarget).attr('href').substring(1) : $(evt.currentTarget).attr('id');
-		blurconsole.model.search.loadMoreResults(family);
-		return false;
-	}
-
-	function _reviewTables() {
-		var tableFound = false;
-
-		if (stateMap.$currentTable) {
-			var tableMap = blurconsole.model.tables.getAllEnabledTables();
-			$.each(tableMap, function(cluster, tables){
-				var tableList = $.map(tables, function(t){ return t.name; });
-				if (tableList.indexOf(stateMap.$currentTable) > -1) {
-					tableFound = true;
-				}
-			});
-		}
-
-		if (tableFound) {
-			jqueryMap.$tableWarning.hide();
-			_loadTableList();
-		} else if (stateMap.$currentTable) {
-			jqueryMap.$tableWarning.show();
-		} else {
-			_loadTableList();
-		}
-	}
-
-	function _drawResultHolders() {
-		var familyMarkup = '', parsedFamilies = blurconsole.utils.findFamilies(stateMap.$currentQuery);
-
-		jqueryMap.$resultsHolder.html('');
-
-		// Redraw families
-		var allFamilies = blurconsole.model.tables.getFamilies(stateMap.$currentTable);
-		var extraFamilies = blurconsole.utils.reject(allFamilies, function(fam){ return parsedFamilies.indexOf(fam) >= 0; });
-
-		parsedFamilies.sort();
-		extraFamilies.sort();
-
-		var sortedFamilies = parsedFamilies.concat(extraFamilies);
-
-		$.each(sortedFamilies, function(i, fam) {
-			var famId = blurconsole.browserUtils.cleanId(fam);
-			familyMarkup += '<div class="panel panel-default"><div class="panel-heading">';
-			familyMarkup += '<h4 class="panel-title" data-toggle="collapse" data-parent="#results" data-target="#' + famId + '">' + fam + '</h4></div>';
-			familyMarkup += '<div id="' + famId + '" class="panel-collapse collapse' + (parsedFamilies.indexOf(fam) >= 0 ? ' in' : '') + '">';
-			familyMarkup += '<div class="panel-body"><img src="img/ajax-loader.gif"></div></div></div>';
-		});
-
-		jqueryMap.$resultsHolder.html(familyMarkup);
-	}
-
-	function _drawResults(evt, families) {
-		var results = blurconsole.model.search.getResults();
-		jqueryMap.$countHolder.html('<small>Found ' + blurconsole.model.search.getTotal() + ' total results</small>');
-		//jqueryMap.$facetTrigger.show();
-
-		if (typeof families !== 'undefined' && families !== null) {
-			$.each(families, function(i, fam) {
-				var famResults = results[fam],
-					famId = '#' + blurconsole.browserUtils.cleanId(fam),
-					famHolder = $(famId + ' .panel-body');
-
-				if (typeof famResults === 'undefined' || famResults.length === 0) {
-					famHolder.html('<div class="alert alert-info">No Data Found</div>');
-				} else {
-					var table;
-					var cols;
-					if (blurconsole.utils.keys(famResults[0]).indexOf('rowid') === -1 ) {
-						// Record results
-						table = '<table class="table table-condensed table-hover table-bordered"><thead><tr>';
-						cols = _getColList(famResults[0]);
-
-						$.each(cols, function(i, col) {
-							table += '<th>' + col + '</th>';
-						});
-						table += '</tr></thead><tbody>';
-						$.each(famResults, function(i, row) {
-							table += '<tr>';
-							$.each(cols, function(c, col) {
-								table += '<td>' + (row[col] || '') + '</td>';
-							});
-							table += '</tr>';
-						});
-						table += '</tbody></table>';
-					} else {
-						// Row results
-						$.each(famResults, function(i, row){
-							if (row.records.length > 0) {
-								var tmpCols = _getColList(row.records[0]);
-								if (tmpCols.length > 0) {
-									cols = tmpCols;
-									return false;
-								}
-							}
-						});
-
-						cols = cols || [];
-						table = '';
-
-						$.each(famResults, function(r, row) {
-							table += '<table class="table table-condensed table-hover table-bordered"><thead>';
-							table += '<tr class="row-separator"><th colspan="' + (cols.length === 0 ? 1 : cols.length) + '">' + (r+1) + '. <strong>rowid:</strong> ' + row.rowid + ' (<em>' + (row.records === null ? 0 : row.records.length) + ' records</em>)</th></tr>';
-							table += '<tr>';
-							$.each(cols, function(i, col) {
-								table += '<th>' + col + '</th>';
-							});
-							table += '</tr></thead><tbody>';
-
-							if (row.records === null || row.records.length === 0) {
-								table += '<tr><td colspan="' + (cols.length === 0 ? 1 : cols.length) + '"><em>No Data Found</em></td></tr>';
-							} else {
-								$.each(row.records, function(i, rec) {
-									table += '<tr>';
-									$.each(cols, function(c, col) {
-										table += '<td>' + (rec[col] || '') + '</td>';
-									});
-									table += '</tr>';
-								});
-							}
-							table += '</tbody></table>';
-						});
-					}
-
-					if (famResults.length < blurconsole.model.search.getTotal()) {
-						table += '<div class="pull-left"><a href="' + famId + '" class="btn btn-primary nextPage">Load More...</a></div>';
-					}
-
-					famHolder.html(table);
-				}
-				if (!$(famId).hasClass('loaded')) {
-					$(famId).addClass('loaded');
-				}
-			});
-		}
-	}
-
-	function _loadTableList() {
-		var tableMap = blurconsole.model.tables.getAllEnabledTables();
-
-		jqueryMap.$tableField.find('optgroup').remove();
-
-		$.each(tableMap, function(cluster, tables) {
-			var optGroupString;
-
-			if (tables.length > 0) {
-				optGroupString = '<optgroup label="' + cluster + '">';
-				$.each(tables, function(t, table){
-					optGroupString += '<option value="' + table.name + '"' + (table.name === stateMap.$currentTable ? ' selected' : '') + '>' + table.name + '</option>';
-				});
-				optGroupString += '</optgroup>';
-				jqueryMap.$tableField.append(optGroupString);
-			}
-		});
-
-		if (jqueryMap.$tableSelectorStatusOption && blurconsole.utils.keys(tableMap).length > 0) {
-			jqueryMap.$tableSelectorStatusOption.remove();
-			jqueryMap.$tableSelectorStatusOption = null;
-		}
-	}
-
-	function _popupFacetDialog() {
-		jqueryMap.facetModal = $(blurconsole.browserUtils.modal('facetDialog', 'Facets for Current Search', 'TBD', null, 'large'));
-		jqueryMap.facetModal.modal();
-	}
-
-    //--------------------------------- Public API ------------------------------------------
-	function initModule($container) {
-		$container.load(configMap.view, function() {
-			stateMap.$container = $container;
-			_setJqueryMap();
-			$.gevent.subscribe(jqueryMap.$container, 'tables-updated', _reviewTables);
-			$.gevent.subscribe(jqueryMap.$container, 'results-updated', _drawResults);
-			_registerPageEvents();
-			_loadTableList();
-
-			var startupMap = $.uriAnchor.makeAnchorMap();
-
-			if (startupMap._tab) {
-				stateMap.$currentQuery = startupMap._tab.query;
-				jqueryMap.$queryField.val(stateMap.$currentQuery);
-				stateMap.$currentTable = startupMap._tab.table;
-				jqueryMap.$tableField.val(stateMap.$currentTable);
-				stateMap.$rowRecordOption = startupMap._tab.rr;
-			}
-
-			_updateOptionDisplay();
-			stateMap.loaded = true;
-		});
-		return true;
-	}
-
-	function unloadModule() {
-		$.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
-		_unregisterPageEvents();
-	}
-
-	return {
-		initModule : initModule,
-		unloadModule : unloadModule
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.shell.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.shell.js b/contrib/blur-console/src/main/webapp/js/blurconsole.shell.js
deleted file mode 100644
index 23ce5f4..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.shell.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/**
- * blurconsole.shell.js
- * Shell module for Blur Console
- */
-/* global blurconsole:false, $:false */
-blurconsole.shell = (function () {
-	'use strict';
-    
-    //---------------------------- Configuration and State ----------------------------
-	var configMap = {
-		anchorSchemaMap : {
-			tab : { dashboard : true, tables : true, queries : true, search : true },
-			_tab : { query: true, table: true, rr: true }
-		},
-		defaultTab : 'dashboard',
-		allTabs : ['dashboard', 'tables', 'queries', 'search']
-	},
-	stateMap = {
-		$container : null,
-		currentTab : null,
-		anchorMap  : {}
-	},
-	jqueryMap = {};
-    
-    //---------------------------- Private Methods -------------------------
-    function _setJqueryMap() {
-		var $container = stateMap.$container;
-		jqueryMap = {
-			$container   : $container,
-			$sideNavTabs : $('.side-nav a')
-		};
-	}
-    
-    function _copyAnchorMap() {
-		return $.extend( true, {}, stateMap.anchorMap );
-	}
-    
-    function _switchView( tab ) {
-		if (stateMap.currentTab !== tab) {
-			for ( var i = 0; i < configMap.allTabs.length; i++ ) {
-				if (blurconsole[configMap.allTabs[i]]) {
-					blurconsole[configMap.allTabs[i]].unloadModule();
-				}
-			}
-
-			stateMap.currentTab = tab;
-			jqueryMap.$sideNavTabs.removeClass('active');
-			jqueryMap.$sideNavTabs.filter('a[href$="' + tab + '"]').addClass('active');
-			if (blurconsole[tab]) {
-				blurconsole[tab].initModule( jqueryMap.$container );
-			}
-		}
-
-		return true;
-	}
-    
-    //---------------------------- Event Handlers and DOM Methods ----------
-    function _onHashChange() {
-		var anchorMapPrevious = _copyAnchorMap(), anchorMapProposed;
-
-		try {
-            anchorMapProposed = $.uriAnchor.makeAnchorMap();
-        } catch ( error ) {
-			$.uriAnchor.setAnchor( anchorMapPrevious, null, true );
-			return false;
-		}
-
-		stateMap.anchorMap = anchorMapProposed;
-
-		var _sTabPrevious = anchorMapPrevious._s_tab; // jshint ignore:line
-		var _sTabProposed = anchorMapProposed._s_tab; // jshint ignore:line
-
-		if ( ! anchorMapPrevious || _sTabPrevious !== _sTabProposed ){
-			var sTabProposed = anchorMapProposed.tab;
-			switch ( sTabProposed ) {
-				case 'dashboard':
-				case 'tables':
-				case 'queries':
-				case 'search':
-					_switchView( sTabProposed );
-					break;
-				default:
-					$.uriAnchor.setAnchor( anchorMapPrevious, null, true );
-			}
-		}
-
-		return false;
-	}
-    
-    function _onClickTab(evt) {
-		var target = $(evt.currentTarget);
-		changeAnchorPart({
-			tab : target.attr('href').split('=')[1]
-		});
-		return false;
-	}
-    
-    //---------------------------- Public API ------------------------------
-	function changeAnchorPart( argMap ) {
-		var anchorMapRevise = _copyAnchorMap(), boolReturn = true;
-
-		KEYVAL:
-		for ( var keyName in argMap ) {
-			if ( argMap.hasOwnProperty( keyName ) ) {
-				if ( keyName.indexOf( '_' ) === 0 ) { continue KEYVAL; }
-				anchorMapRevise[keyName] = argMap[keyName];
-				var keyNameDep = '_' + keyName;
-				if ( argMap[keyNameDep] ) {
-					anchorMapRevise[keyNameDep] = argMap[keyNameDep];
-				} else {
-					delete anchorMapRevise[keyNameDep];
-					delete anchorMapRevise['_s' + keyNameDep];
-				}
-			}
-		}
-
-		try {
-			$.uriAnchor.setAnchor( anchorMapRevise );
-		} catch ( error ) {
-			$.uriAnchor.setAnchor( stateMap.anchorMap, null, true );
-			boolReturn = false;
-		}
-
-		return boolReturn;
-	}
-
-	function initModule( $container ) {
-		stateMap.$container = $container;
-		_setJqueryMap();
-
-		blurconsole.schema.initModule();
-		blurconsole.logging.initModule();
-
-		$('#view_logging_trigger').on('click', function() {
-			$.gevent.publish('show-logging');
-		});
-
-		$('.side-nav li').tooltip();
-
-		jqueryMap.$sideNavTabs.click( _onClickTab );
-
-		$.uriAnchor.configModule({
-			schema_map : configMap.anchorSchemaMap // jshint ignore:line
-		});
-
-		$(window).bind('hashchange', _onHashChange).trigger('hashchange');
-
-		var startupMap = $.uriAnchor.makeAnchorMap();
-
-		if ( !startupMap.tab ) {
-			changeAnchorPart({
-				tab: configMap.defaultTab
-			});
-		}
-
-		$.gevent.subscribe($(document), 'logging-updated', function() {
-			var errors = blurconsole.model.logs.getLogs();
-			if (errors.length === 0) {
-				$('#view_logging_trigger .badge').html('');
-			} else {
-				$('#view_logging_trigger .badge').html(errors.length);
-			}
-		});
-	}
-
-	return {
-		initModule: initModule,
-		changeAnchorPart : changeAnchorPart
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.tables.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.tables.js b/contrib/blur-console/src/main/webapp/js/blurconsole.tables.js
deleted file mode 100644
index 2803e4c..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.tables.js
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*global blurconsole:false */
-blurconsole.tables = (function () {
-	'use strict';
-    
-    //------------------------ Configuration and State ----------------------
-	var configMap = {
-		view : 'views/tables.tpl.html',
-		enabledDef : [
-			{label:'Table Name', key: function(row){
-				return row.name + ' <i class="glyphicon glyphicon-exclamation-sign" data-table="' + row.name + '" style="display:none" title="Activity detected"></i>';
-			}},
-			{label:'Row Count', key: 'rowCount'},
-			{label:'Record Count', key: 'recordCount'},
-			{label:'Actions', key: function(row) {
-				var actions = '', table = row.name;
-				actions += '<a href="#" class="schemaTrigger btn btn-default" data-name="' + table + '"><i class="glyphicon glyphicon-list-alt"></i> Schema</a> ';
-				actions += '<a href="#" class="disableTrigger btn btn-danger" data-name="' + table + '"><i class="glyphicon glyphicon-cloud-download"></i> Disable</a> ';
-				return actions;
-			}}
-		],
-		disabledDef : [
-			{label:'Table Name', key:'name'},
-			{label:'Actions', key: function(row) {
-				var actions = '', table = row.name;
-				actions += '<a href="#" class="enableTrigger btn btn-default" data-name="' + table + '"><i class="glyphicon glyphicon-cloud-upload"></i> Enable</a> ';
-				actions += '<a href="#" class="deleteTrigger btn btn-danger" data-name="' + table + '"><i class="glyphicon glyphicon-trash"></i> Delete</a> ';
-				return actions;
-			}}
-		]
-	},
-	stateMap = { $container : null },
-	jqueryMap = {};
-
-    //----------------------------- Private Methods ----------------------------
-	function _setJqueryMap() {
-		var $container = stateMap.$container;
-		jqueryMap = {
-			$container : $container,
-			$tableInfoHolder : $('#tableInfoHolder'),
-			$tables : {}
-		};
-	}
-
-	function _waitForData() {
-		if (blurconsole.model.tables.getClusters().length > 0) {
-			_buildTabs();
-		} else {
-			setTimeout(_waitForData, 100);
-		}
-	}
-    
-    function _registerPageEvents() {
-		// Tab control
-		jqueryMap.$tableInfoHolder.on('click', 'ul.nav a', function(e) {
-			e.preventDefault();
-			$(this).tab('show');
-		});
-
-		// View Schema
-		jqueryMap.$tableInfoHolder.on('click', 'a.schemaTrigger', function() {
-			$.gevent.publish('schema-show', $(this).data('name'));
-			return false;
-		});
-
-		// Disable Table
-		jqueryMap.$tableInfoHolder.on('click', 'a.disableTrigger', function() {
-			blurconsole.model.tables.disableTable($(this).data('name'));
-			return false;
-		});
-
-		// Enable Table
-		jqueryMap.$tableInfoHolder.on('click', 'a.enableTrigger', function() {
-			blurconsole.model.tables.enableTable($(this).data('name'));
-			return false;
-		});
-
-		// Delete Table
-		jqueryMap.$tableInfoHolder.on('click', 'a.deleteTrigger', function() {
-			var tableName = $(this).data('name');
-			var modalContent = blurconsole.browserUtils.modal('confirmDelete', 'Confirm Table Deletion', 'You are about to delete table ' + tableName + '.  Are you sure you want to do this? If so, do you also want to delete the underlying table data?', [
-				{classes: 'btn-warning tableOnly', label: 'Table Only'},
-				{classes: 'btn-danger tableAndData', label: 'Table And Data'},
-				{classes: 'btn-default cancel', label: 'Cancel', data: {dismiss:'modal'}}
-			], 'medium');
-
-			var modal = $(modalContent).modal().on('shown.bs.modal', function(e){
-				$(e.currentTarget).on('click', '.tableOnly', function() {
-					blurconsole.model.tables.deleteTable(tableName, false);
-					modal.modal('hide');
-				}).on('click', '.tableAndData', function() {
-					blurconsole.model.tables.deleteTable(tableName, true);
-					modal.modal('hide');
-				});
-			}).on('hidden.bs.modal', function(e) {
-				$(e.currentTarget).remove();
-			});
-			return false;
-		});
-	}
-
-	function _unregisterPageEvents() {
-		if (jqueryMap.$tableInfoHolder) {
-			jqueryMap.$tableInfoHolder.off();
-		}
-	}
-    
-    //------------------------- Event Handling and DOM Methods ---------------------------
-	function _buildTabs() {
-		var clusters = blurconsole.model.tables.getClusters();
-		var needsTabs = clusters.length > 1;
-
-		if (needsTabs) {
-			var tabMarkup = '<ul class="nav nav-tabs">';
-			tabMarkup += $.map(clusters, function(cluster, idx) {
-				return '<li class="' + (idx === 0 ? 'active' : '') + '"><a href="#' + cluster + '_pane" data-toggle="tab">' + cluster + ' <i class="glyphicon glyphicon-exclamation-sign" style="display:none" title="Activity detected"></i></a></li>';
-			}).join('');
-			tabMarkup += '</ul>';
-
-			jqueryMap.$tableInfoHolder.html($(tabMarkup));
-		}
-
-		var paneMarkup = needsTabs ? '<div class="tab-content">' : '';
-		paneMarkup += $.map(clusters, function(cluster, idx) {
-			return '<div id="' + cluster + '_pane" class="tab-pane' + (idx === 0 ? ' active' : '') + '"><h3>Enabled Tables</h3><div class="enabledSection"></div><h3>Disabled Tables</h3><div class="disabledSection"></div></div>';
-		}).join('');
-		paneMarkup += needsTabs ? '</div>' : '';
-
-		if (needsTabs) {
-			jqueryMap.$tableInfoHolder.append(paneMarkup);
-		} else {
-			jqueryMap.$tableInfoHolder.html(paneMarkup);
-		}
-
-		$.each(clusters, function(idx, cluster){
-			var clusterPane = $('#' + cluster + '_pane');
-			clusterPane.find('.enabledSection').html(blurconsole.browserUtils.table(configMap.enabledDef, blurconsole.model.tables.getEnabledTables(cluster)));
-			clusterPane.find('.disabledSection').html(blurconsole.browserUtils.table(configMap.disabledDef, blurconsole.model.tables.getDisabledTables(cluster)));
-		});
-	}
-
-	function _updateTableList() {
-		var clusters = blurconsole.model.tables.getClusters();
-
-		$.each(clusters, function(idx, cluster) {
-			var clusterPane = $('#' + cluster + '_pane'), enabledSection, disabledSection;
-			enabledSection = clusterPane.find('.enabledSection');
-			disabledSection = clusterPane.find('.disabledSection');
-
-			if (enabledSection.length > 0) {
-				enabledSection.html(blurconsole.browserUtils.table(configMap.enabledDef, blurconsole.model.tables.getEnabledTables(cluster)));
-			}
-			if (disabledSection.length > 0) {
-				disabledSection.html(blurconsole.browserUtils.table(configMap.disabledDef, blurconsole.model.tables.getDisabledTables(cluster)));
-			}
-		});
-	}
-	
-	function _updateActivityIndicators() {
-		var clusters = blurconsole.model.tables.getClusters();
-
-		$.each(clusters, function(i, cluster) {
-			var clusterHasActivity = false,
-				tables = blurconsole.model.tables.getEnabledTables(cluster);
-
-			$.each(tables, function(i, table){
-				if (blurconsole.model.queries.tableHasActivity(table.name)) {
-					clusterHasActivity = true;
-					$('i[data-table="' + table.name + '"]').show();
-				} else {
-					$('i[data-table="' + table.name + '"]').hide();
-				}
-			});
-
-			if (clusterHasActivity) {
-				$('a[href="#' + cluster +'_pane"] i').show();
-			} else {
-				$('a[href="#' + cluster +'_pane"] i').hide();
-			}
-		});
-	}
-    
-    //-------------------------- Public API ------------------------------
-    function unloadModule() {
-		$.gevent.unsubscribe(jqueryMap.$container, 'tables-updated');
-		$.gevent.unsubscribe(jqueryMap.$container, 'queries-updated');
-		_unregisterPageEvents();
-	}
-
-	function initModule($container) {
-		$container.load(configMap.view, function() {
-			stateMap.$container = $container;
-			_setJqueryMap();
-			$.gevent.subscribe(jqueryMap.$container, 'tables-updated', _updateTableList);
-			$.gevent.subscribe(jqueryMap.$container, 'queries-updated', _updateActivityIndicators);
-			_waitForData();
-			_registerPageEvents();
-		});
-		return true;
-	}
-
-	return {
-		initModule : initModule,
-		unloadModule : unloadModule
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/blurconsole.utils.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/blurconsole.utils.js b/contrib/blur-console/src/main/webapp/js/blurconsole.utils.js
deleted file mode 100644
index b2eeff8..0000000
--- a/contrib/blur-console/src/main/webapp/js/blurconsole.utils.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-/*global blurconsole:false */
-blurconsole.utils = (function(){
-	'use strict';
-    
-    //-------------------------- Public API ----------------------------
-	function inject(collection, initial, block) {
-		if (collection === null || collection.length === 0) {
-			return initial;
-		}
-
-		var accumulator = initial || collection[0];
-		$.each(collection, function(idx, item) {
-			accumulator = block(accumulator, item);
-		});
-
-		return accumulator;
-	}
-
-	function unique(collection, sort) {
-		var uniqueList = [];
-
-		$.each(collection, function(idx, item){
-			if (uniqueList.indexOf(item) === -1) {
-				uniqueList.push(item);
-			}
-		});
-
-		if (sort) {
-			uniqueList.sort();
-		}
-
-		return uniqueList;
-	}
-
-	function equals(obj1, obj2) {
-		return JSON.stringify(obj1) === JSON.stringify(obj2);
-	}
-
-	function keys(map) {
-		return $.map(map, function(v, key){ return key; });
-	}
-
-	function findFamilies(query) {
-		// Determine regex to find column families in lucene query
-		var matches = query.match(/[^ \(\)\+\-]+(\w+)\.\w+:/g);
-
-		if (matches === null) {
-			return [];
-		}
-
-		var families = [];
-		$.each(matches, function(idx, match) {
-			families.push(match.split('.')[0]);
-		});
-		return families;
-	}
-
-	function reject(collection, block) {
-		var newArray = [];
-		$.each(collection, function(i, item){
-			if (!block(item)) {
-				newArray.push(item);
-			}
-		});
-		return newArray;
-	}
-
-	return {
-		inject: inject,
-		reduce: inject,
-		unique: unique,
-		equals: equals,
-		keys: keys,
-		findFamilies: findFamilies,
-		reject: reject
-	};
-}());
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/e599710c/contrib/blur-console/src/main/webapp/js/utils/jquery.event.gevent.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/webapp/js/utils/jquery.event.gevent.js b/contrib/blur-console/src/main/webapp/js/utils/jquery.event.gevent.js
deleted file mode 100755
index db78a3b..0000000
--- a/contrib/blur-console/src/main/webapp/js/utils/jquery.event.gevent.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * jQuery global custom event plugin (gevent)
- *
- * Copyright (c) 2013 Michael S. Mikowski
- * (mike[dot]mikowski[at]gmail[dotcom])
- *
- * Dual licensed under the MIT or GPL Version 2
- * http://jquery.org/license
- *
- * Versions
- *  0.1.5 - initial release
- *  0.1.6 - enhanced publishEvent (publish) method pass
- *          a non-array variable as the second argument
- *          to a subscribed function (the first argument
- *          is always the event object).
- *  0.1.7-10
- *        - documentation changes
- *
-*/
-
-/*jslint         browser : true, continue : true,
-  devel  : true, indent  : 2,    maxerr   : 50,
-  newcap : true, nomen   : true, plusplus : true,
-  regexp : true, sloppy  : true, vars     : false,
-  white  : true
-*/
-/*global jQuery */
-
-(function ( $ ) {
-  'use strict';
-  $.gevent = ( function () {
-    //---------------- BEGIN MODULE SCOPE VARIABLES --------------
-    var
-      subscribeEvent, publishEvent, unsubscribeEvent,
-      $customSubMap = {}
-      ;
-    //----------------- END MODULE SCOPE VARIABLES ---------------
-
-    //------------------- BEGIN PUBLIC METHODS -------------------
-    // BEGIN public method /publishEvent/
-    // Example  :
-    //   $.gevent.publish(
-    //     'spa-model-msg-receive',
-    //     [ { user : 'fred', msg : 'Hi gang' } ]
-    //   );
-    // Purpose  :
-    //   Publish an event with an optional list of arguments
-    //   which a subscribed handler will receive after the event object.
-    // Arguments (positional)
-    //   * 0 ( event_name )  - The global event name
-    //   * 2 ( data )        - Optional data to be passed as argument(s)
-    //                         to subscribed functions after the event
-    //                         object. Provide an array for multiple
-    //                         arguments.
-    // Throws   : none
-    // Returns  : none
-    //
-    publishEvent = function ( event_name, data ) {
-      var data_list;
-
-      if ( ! $customSubMap[ event_name ] ){ return false; }
-
-      if ( data ){
-        data_list = Array.isArray( data ) ? data : [ data ];
-        $customSubMap[ event_name ].trigger( event_name, data_list );
-        return true;
-      }
-
-      $customSubMap[ event_name ].trigger( event_name );
-      return true;
-    };
-    // END public method /publishEvent/
-
-    // BEGIN public method /subscribeEvent/
-    // Example  :
-    //   $.gevent.subscribe(
-    //     $( '#msg' ),
-    //     'spa-msg-receive',
-    //     onModelMsgReceive
-    //   );
-    // Purpose  :
-    //   Subscribe a function to a published event on a jQuery collection
-    // Arguments (positional)
-    //   * 0 ( $collection ) - The jQuery collection on which to bind event
-    //   * 1 ( event_name )  - The global event name
-    //   * 2 ( fn ) - The function to bound to the event on the collection
-    // Throws   : none
-    // Returns  : none
-    //
-    subscribeEvent = function ( $collection, event_name, fn ) {
-      $collection.on( event_name, fn );
-
-      if ( ! $customSubMap[ event_name ] ) {
-        $customSubMap[ event_name ] = $collection;
-      }
-      else {
-        $customSubMap[ event_name ]
-          = $customSubMap[ event_name ].add( $collection );
-      }
-    };
-    // END public method /subscribeEvent/
-
-    // BEGIN public method /unsubscribeEvent/
-    // Example  :
-    //   $.gevent.unsubscribe(
-    //     $( '#msg' ),
-    //     'spa-model-msg-receive'
-    //   );
-    // Purpose  :
-    //   Remove a binding for the named event on a provided collection
-    // Arguments (positional)
-    //   * 0 ( $collection ) - The jQuery collection on which to bind event
-    //   * 1 ( event_name )  - The global event name
-    // Throws   : none
-    // Returns  : none
-    //
-    unsubscribeEvent = function ( $collection, event_name ) {
-      if ( ! $customSubMap[ event_name ] ){ return false; }
-
-      $customSubMap[ event_name ]
-        = $customSubMap[ event_name ].not( $collection );
-
-      if ( $customSubMap[ event_name ].length === 0 ){
-        delete $customSubMap[ event_name ];
-      }
-
-      return true;
-    };
-    // END public method /unsubscribeEvent/
-    //------------------- END PUBLIC METHODS ---------------------
-
-    // return public methods
-    return {
-      publish     : publishEvent,
-      subscribe   : subscribeEvent,
-      unsubscribe : unsubscribeEvent
-    };
-  }());
-}( jQuery ));
-


Mime
View raw message