update jquery and remove obsolete js/css files
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
.autocomplete,.autocomplete.open{transition:all .5s ease 0s;overflow-y:hidden}.autocomplete{position:absolute;max-height:0;transition-duration:.3s;transition-property:all;transition-timing-function:cubic-bezier(0,1,.5,1)}.autocomplete.open{display:block;background-color:#FAFAFA;max-height:500px;transition-duration:.3s;transition-property:all;transition-timing-function:cubic-bezier(0,1,.5,1)}.autocomplete.open:empty,.autocomplete:empty{display:none}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:#FAFAFA;transition:all .5s ease 0s}.autocomplete>ul{list-style-type:none;margin:0;padding:0}.autocomplete>ul>li{cursor:pointer;padding:5px 0 5px 10px}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus,.autocomplete>ul>li:hover{background-color:#EEE;transition:all .5s ease 0s}.autocomplete>ul>li.active a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:focus a:hover,.autocomplete>ul>li:hover a:active,.autocomplete>ul>li:hover a:focus,.autocomplete>ul>li:hover a:hover{text-decoration:none}input[data-autocomplete]{border-color:grey;border-style:none none solid;border-width:0 0 1px;margin:0;padding:5px;width:100%}
|
|
||||||
@@ -10,6 +10,16 @@ body {
|
|||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body, p, td, th, textarea
|
||||||
|
{
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
font-size:1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'FontAwesome';
|
font-family: 'FontAwesome';
|
||||||
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
|
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
|
||||||
|
|||||||
@@ -1,189 +0,0 @@
|
|||||||
.uil-cube-css {
|
|
||||||
background: none;
|
|
||||||
position: relative;
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
width: 100%;
|
|
||||||
@-webkit-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-webkit-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-moz-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-ms-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-moz-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-webkit-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@-o-keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes uil-cube-css {
|
|
||||||
0% {
|
|
||||||
-ms-transform: scale(1.4);
|
|
||||||
-moz-transform: scale(1.4);
|
|
||||||
-webkit-transform: scale(1.4);
|
|
||||||
-o-transform: scale(1.4);
|
|
||||||
transform: scale(1.4);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
-ms-transform: scale(1);
|
|
||||||
-moz-transform: scale(1);
|
|
||||||
-webkit-transform: scale(1);
|
|
||||||
-o-transform: scale(1);
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.uil-cube-css > div {
|
|
||||||
position: absolute;
|
|
||||||
width: 80px;
|
|
||||||
height: 80px;
|
|
||||||
-ms-animation: uil-cube-css 1s cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite;
|
|
||||||
-moz-animation: uil-cube-css 1s cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite;
|
|
||||||
-webkit-animation: uil-cube-css 1s cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite;
|
|
||||||
-o-animation: uil-cube-css 1s cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite;
|
|
||||||
animation: uil-cube-css 1s cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite;
|
|
||||||
}
|
|
||||||
.uil-cube-css > div:nth-of-type(1) {
|
|
||||||
top: 10px;
|
|
||||||
left: 10px;
|
|
||||||
background: #cec9c9;
|
|
||||||
opacity: 0.9;
|
|
||||||
-ms-animation-delay: 0s;
|
|
||||||
-moz-animation-delay: 0s;
|
|
||||||
-webkit-animation-delay: 0s;
|
|
||||||
-o-animation-delay: 0s;
|
|
||||||
animation-delay: 0s;
|
|
||||||
}
|
|
||||||
.uil-cube-css > div:nth-of-type(2) {
|
|
||||||
top: 10px;
|
|
||||||
left: 110px;
|
|
||||||
background: #cec9c9;
|
|
||||||
opacity: 0.8;
|
|
||||||
-ms-animation-delay: 0.1s;
|
|
||||||
-moz-animation-delay: 0.1s;
|
|
||||||
-webkit-animation-delay: 0.1s;
|
|
||||||
-o-animation-delay: 0.1s;
|
|
||||||
animation-delay: 0.1s;
|
|
||||||
}
|
|
||||||
.uil-cube-css > div:nth-of-type(3) {
|
|
||||||
top: 110px;
|
|
||||||
left: 10px;
|
|
||||||
background: #cec9c9;
|
|
||||||
opacity: 0.7;
|
|
||||||
-ms-animation-delay: 0.3s;
|
|
||||||
-moz-animation-delay: 0.3s;
|
|
||||||
-webkit-animation-delay: 0.3s;
|
|
||||||
-o-animation-delay: 0.3s;
|
|
||||||
animation-delay: 0.3s;
|
|
||||||
}
|
|
||||||
.uil-cube-css > div:nth-of-type(4) {
|
|
||||||
top: 110px;
|
|
||||||
left: 110px;
|
|
||||||
background: #cec9c9;
|
|
||||||
opacity: 0.6;
|
|
||||||
-ms-animation-delay: 0.2s;
|
|
||||||
-moz-animation-delay: 0.2s;
|
|
||||||
-webkit-animation-delay: 0.2s;
|
|
||||||
-o-animation-delay: 0.2s;
|
|
||||||
animation-delay: 0.2s;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
body, p, td, th, textarea
|
|
||||||
{
|
|
||||||
font-family: sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
font-size:1.2em;
|
|
||||||
}
|
|
||||||
@@ -1,450 +0,0 @@
|
|||||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AutoComplete = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
||||||
/*
|
|
||||||
* @license MIT
|
|
||||||
*
|
|
||||||
* Autocomplete.js v2.1.0
|
|
||||||
* Developed by Baptiste Donaux
|
|
||||||
* https://autocomplete-js.com
|
|
||||||
*
|
|
||||||
* (c) 2016, Baptiste Donaux
|
|
||||||
*/
|
|
||||||
"use strict";
|
|
||||||
var ConditionOperator;
|
|
||||||
(function (ConditionOperator) {
|
|
||||||
ConditionOperator[ConditionOperator["AND"] = 0] = "AND";
|
|
||||||
ConditionOperator[ConditionOperator["OR"] = 1] = "OR";
|
|
||||||
})(ConditionOperator || (ConditionOperator = {}));
|
|
||||||
/**
|
|
||||||
* Core
|
|
||||||
*
|
|
||||||
* @class
|
|
||||||
* @author Baptiste Donaux <baptiste.donaux@gmail.com> @baptistedonaux
|
|
||||||
*/
|
|
||||||
var AutoComplete = (function () {
|
|
||||||
// Constructor
|
|
||||||
function AutoComplete(params, selector) {
|
|
||||||
if (params === void 0) { params = {}; }
|
|
||||||
if (selector === void 0) { selector = "[data-autocomplete]"; }
|
|
||||||
if (Array.isArray(selector)) {
|
|
||||||
selector.forEach(function (s) {
|
|
||||||
new AutoComplete(params, s);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if (typeof selector == "string") {
|
|
||||||
var elements = document.querySelectorAll(selector);
|
|
||||||
Array.prototype.forEach.call(elements, function (input) {
|
|
||||||
new AutoComplete(params, input);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
AutoComplete.prototype.create(AutoComplete.merge(AutoComplete.defaults, params, {
|
|
||||||
DOMResults: document.createElement("div")
|
|
||||||
}), selector);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AutoComplete.prototype.create = function (params, element) {
|
|
||||||
params.Input = element;
|
|
||||||
if (params.Input.nodeName.match(/^INPUT$/i) && (params.Input.hasAttribute("type") === false || params.Input.getAttribute("type").match(/^TEXT|SEARCH$/i))) {
|
|
||||||
params.Input.setAttribute("autocomplete", "off");
|
|
||||||
params._Position(params);
|
|
||||||
params.Input.parentNode.appendChild(params.DOMResults);
|
|
||||||
params.$Listeners = {
|
|
||||||
blur: params._Blur.bind(params),
|
|
||||||
destroy: AutoComplete.prototype.destroy.bind(null, params),
|
|
||||||
focus: params._Focus.bind(params),
|
|
||||||
keyup: AutoComplete.prototype.event.bind(null, params),
|
|
||||||
keydown: function (event) {
|
|
||||||
if (event.keyCode == 38 || event.keyCode == 40) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
position: params._Position.bind(params)
|
|
||||||
};
|
|
||||||
for (var event in params.$Listeners) {
|
|
||||||
params.Input.addEventListener(event, params.$Listeners[event]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AutoComplete.prototype.event = function (params, event) {
|
|
||||||
var eventIdentifier = function (condition) {
|
|
||||||
if ((match === true && mapping.Operator == ConditionOperator.AND) || (match === false && ConditionOperator.OR)) {
|
|
||||||
condition = AutoComplete.merge({
|
|
||||||
Not: false
|
|
||||||
}, condition);
|
|
||||||
if (condition.hasOwnProperty("Is")) {
|
|
||||||
if (condition.Is == event.keyCode) {
|
|
||||||
match = !condition.Not;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
match = condition.Not;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (condition.hasOwnProperty("From") && condition.hasOwnProperty("To")) {
|
|
||||||
if (event.keyCode >= condition.From && event.keyCode <= condition.To) {
|
|
||||||
match = !condition.Not;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
match = condition.Not;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
for (var name in params.KeyboardMappings) {
|
|
||||||
var mapping = AutoComplete.merge({
|
|
||||||
Operator: ConditionOperator.AND
|
|
||||||
}, params.KeyboardMappings[name]), match = ConditionOperator.AND == mapping.Operator;
|
|
||||||
mapping.Conditions.forEach(eventIdentifier);
|
|
||||||
if (match === true) {
|
|
||||||
mapping.Callback.bind(params, event)();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AutoComplete.prototype.ajax = function (params, callback, timeout) {
|
|
||||||
if (timeout === void 0) { timeout = true; }
|
|
||||||
if (params.$AjaxTimer) {
|
|
||||||
window.clearTimeout(params.$AjaxTimer);
|
|
||||||
}
|
|
||||||
if (timeout === true) {
|
|
||||||
params.$AjaxTimer = window.setTimeout(AutoComplete.prototype.ajax.bind(null, params, callback, false), params.Delay);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (params.Request) {
|
|
||||||
params.Request.abort();
|
|
||||||
}
|
|
||||||
var propertyHttpHeaders = Object.getOwnPropertyNames(params.HttpHeaders), method = params._HttpMethod(), url = params._Url(), queryParams = params._QueryArg() + "=" + params._Pre();
|
|
||||||
if (method.match(/^GET$/i)) {
|
|
||||||
url += "?" + queryParams;
|
|
||||||
}
|
|
||||||
params.Request = new XMLHttpRequest();
|
|
||||||
params.Request.open(method, url, true);
|
|
||||||
for (var i = propertyHttpHeaders.length - 1; i >= 0; i--) {
|
|
||||||
params.Request.setRequestHeader(propertyHttpHeaders[i], params.HttpHeaders[propertyHttpHeaders[i]]);
|
|
||||||
}
|
|
||||||
params.Request.onreadystatechange = callback;
|
|
||||||
params.Request.send(queryParams);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
AutoComplete.prototype.destroy = function (params) {
|
|
||||||
for (var event in params.$Listeners) {
|
|
||||||
params.Input.removeEventListener(event, params.$Listeners[event]);
|
|
||||||
}
|
|
||||||
params.DOMResults.parentNode.removeChild(params.DOMResults);
|
|
||||||
};
|
|
||||||
AutoComplete.merge = function () {
|
|
||||||
var merge = {}, tmp;
|
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
|
||||||
for (tmp in arguments[i]) {
|
|
||||||
merge[tmp] = arguments[i][tmp];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return merge;
|
|
||||||
};
|
|
||||||
AutoComplete.defaults = {
|
|
||||||
Delay: 150,
|
|
||||||
EmptyMessage: "No result here",
|
|
||||||
Highlight: {
|
|
||||||
getRegex: function (value) {
|
|
||||||
return new RegExp(value, "ig");
|
|
||||||
},
|
|
||||||
transform: function (value) {
|
|
||||||
return "<strong>" + value + "</strong>";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
HttpHeaders: {
|
|
||||||
"Content-type": "application/x-www-form-urlencoded"
|
|
||||||
},
|
|
||||||
Limit: 0,
|
|
||||||
HttpMethod: "GET",
|
|
||||||
QueryArg: "q",
|
|
||||||
Url: null,
|
|
||||||
KeyboardMappings: {
|
|
||||||
"Enter": {
|
|
||||||
Conditions: [{
|
|
||||||
Is: 13,
|
|
||||||
Not: false
|
|
||||||
}],
|
|
||||||
Callback: function () {
|
|
||||||
if (this.DOMResults.getAttribute("class").indexOf("open") != -1) {
|
|
||||||
var liActive = this.DOMResults.querySelector("li.active");
|
|
||||||
if (liActive !== null) {
|
|
||||||
this._Select(liActive);
|
|
||||||
this.DOMResults.setAttribute("class", "autocomplete");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Operator: ConditionOperator.AND
|
|
||||||
},
|
|
||||||
"KeyUpAndDown": {
|
|
||||||
Conditions: [{
|
|
||||||
Is: 38,
|
|
||||||
Not: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Is: 40,
|
|
||||||
Not: false
|
|
||||||
}],
|
|
||||||
Callback: function (event) {
|
|
||||||
event.preventDefault();
|
|
||||||
var first = this.DOMResults.querySelector("li:first-child:not(.locked)"), last = this.DOMResults.querySelector("li:last-child:not(.locked)"), active = this.DOMResults.querySelector("li.active");
|
|
||||||
if (active) {
|
|
||||||
var currentIndex = Array.prototype.indexOf.call(active.parentNode.children, active), position = currentIndex + (event.keyCode - 39), lisCount = this.DOMResults.getElementsByTagName("li").length;
|
|
||||||
if (position < 0) {
|
|
||||||
position = lisCount - 1;
|
|
||||||
}
|
|
||||||
else if (position >= lisCount) {
|
|
||||||
position = 0;
|
|
||||||
}
|
|
||||||
active.setAttribute("class", "");
|
|
||||||
active.parentElement.childNodes.item(position).setAttribute("class", "active");
|
|
||||||
active.scrollIntoView(event.keyCode == 40);
|
|
||||||
}
|
|
||||||
else if (last && event.keyCode == 38) {
|
|
||||||
last.setAttribute("class", "active");
|
|
||||||
}
|
|
||||||
else if (first) {
|
|
||||||
first.setAttribute("class", "active");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Operator: ConditionOperator.OR
|
|
||||||
},
|
|
||||||
"AlphaNum": {
|
|
||||||
Conditions: [{
|
|
||||||
Is: 13,
|
|
||||||
Not: true
|
|
||||||
}, {
|
|
||||||
From: 35,
|
|
||||||
To: 40,
|
|
||||||
Not: true
|
|
||||||
}],
|
|
||||||
Callback: function () {
|
|
||||||
var oldValue = this.Input.getAttribute("data-autocomplete-old-value"), currentValue = this._Pre();
|
|
||||||
if (currentValue !== "") {
|
|
||||||
if (!oldValue || currentValue != oldValue) {
|
|
||||||
this.DOMResults.setAttribute("class", "autocomplete open");
|
|
||||||
}
|
|
||||||
AutoComplete.prototype.ajax(this, function () {
|
|
||||||
if (this.Request.readyState == 4 && this.Request.status == 200) {
|
|
||||||
this._Render(this._Post(this.Request.response));
|
|
||||||
this._Open();
|
|
||||||
}
|
|
||||||
}.bind(this));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Operator: ConditionOperator.AND
|
|
||||||
}
|
|
||||||
},
|
|
||||||
DOMResults: null,
|
|
||||||
Request: null,
|
|
||||||
Input: null,
|
|
||||||
/**
|
|
||||||
* Return the message when no result returns
|
|
||||||
*/
|
|
||||||
_EmptyMessage: function () {
|
|
||||||
var emptyMessage = "";
|
|
||||||
if (this.Input.hasAttribute("data-autocomplete-empty-message")) {
|
|
||||||
emptyMessage = this.Input.getAttribute("data-autocomplete-empty-message");
|
|
||||||
}
|
|
||||||
else if (this.EmptyMessage !== false) {
|
|
||||||
emptyMessage = this.EmptyMessage;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
emptyMessage = "";
|
|
||||||
}
|
|
||||||
return emptyMessage;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the maximum number of results
|
|
||||||
*/
|
|
||||||
_Limit: function () {
|
|
||||||
var limit = this.Input.getAttribute("data-autocomplete-limit");
|
|
||||||
if (isNaN(limit)) {
|
|
||||||
return this.Limit;
|
|
||||||
}
|
|
||||||
return parseInt(limit);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Apply transformation on labels response
|
|
||||||
*/
|
|
||||||
_Highlight: function (label) {
|
|
||||||
return label.replace(this.Highlight.getRegex(this._Pre()), this.Highlight.transform);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the HHTP method to use
|
|
||||||
*/
|
|
||||||
_HttpMethod: function () {
|
|
||||||
if (this.Input.hasAttribute("data-autocomplete-method")) {
|
|
||||||
return this.Input.getAttribute("data-autocomplete-method");
|
|
||||||
}
|
|
||||||
return this.HttpMethod;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the query param to use
|
|
||||||
*/
|
|
||||||
_QueryArg: function () {
|
|
||||||
if (this.Input.hasAttribute("data-autocomplete-param-name")) {
|
|
||||||
return this.Input.getAttribute("data-autocomplete-param-name");
|
|
||||||
}
|
|
||||||
return this.QueryArg;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the URL to use for AJAX request
|
|
||||||
*/
|
|
||||||
_Url: function () {
|
|
||||||
if (this.Input.hasAttribute("data-autocomplete")) {
|
|
||||||
return this.Input.getAttribute("data-autocomplete");
|
|
||||||
}
|
|
||||||
return this.Url;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Manage the close
|
|
||||||
*/
|
|
||||||
_Blur: function (now) {
|
|
||||||
if (now === void 0) { now = false; }
|
|
||||||
if (now) {
|
|
||||||
this.DOMResults.setAttribute("class", "autocomplete");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var params = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
params._Blur(true);
|
|
||||||
}, 150);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Manage the open
|
|
||||||
*/
|
|
||||||
_Focus: function () {
|
|
||||||
var oldValue = this.Input.getAttribute("data-autocomplete-old-value");
|
|
||||||
if (!oldValue || this.Input.value != oldValue) {
|
|
||||||
this.DOMResults.setAttribute("class", "autocomplete open");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Bind all results item if one result is opened
|
|
||||||
*/
|
|
||||||
_Open: function () {
|
|
||||||
var params = this;
|
|
||||||
Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"), function (li) {
|
|
||||||
if (li.getAttribute("class") != "locked") {
|
|
||||||
li.onclick = function () {
|
|
||||||
params._Select(li);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Position the results HTML element
|
|
||||||
*/
|
|
||||||
_Position: function () {
|
|
||||||
this.DOMResults.setAttribute("class", "autocomplete");
|
|
||||||
this.DOMResults.setAttribute("style", "top:" + (this.Input.offsetTop + this.Input.offsetHeight) + "px;left:" + this.Input.offsetLeft + "px;width:" + this.Input.offsetWidth + "px;");
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Execute the render of results DOM element
|
|
||||||
*/
|
|
||||||
_Render: function (response) {
|
|
||||||
var ul;
|
|
||||||
if (typeof response == "string") {
|
|
||||||
ul = this._RenderRaw(response);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ul = this._RenderResponseItems(response);
|
|
||||||
}
|
|
||||||
if (this.DOMResults.hasChildNodes()) {
|
|
||||||
this.DOMResults.removeChild(this.DOMResults.childNodes[0]);
|
|
||||||
}
|
|
||||||
this.DOMResults.appendChild(ul);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* ResponseItems[] rendering
|
|
||||||
*/
|
|
||||||
_RenderResponseItems: function (response) {
|
|
||||||
var ul = document.createElement("ul"), li = document.createElement("li");
|
|
||||||
// Order
|
|
||||||
if (this._Limit() < 0) {
|
|
||||||
response = response.reverse();
|
|
||||||
}
|
|
||||||
for (var item = 0; item < response.length; item++) {
|
|
||||||
li.innerHTML = response[item].Label;
|
|
||||||
li.setAttribute("data-autocomplete-value", response[item].Value);
|
|
||||||
ul.appendChild(li);
|
|
||||||
li = document.createElement("li");
|
|
||||||
}
|
|
||||||
return ul;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* string response rendering (RAW HTML)
|
|
||||||
*/
|
|
||||||
_RenderRaw: function (response) {
|
|
||||||
var ul = document.createElement("ul"), li = document.createElement("li");
|
|
||||||
if (response.length > 0) {
|
|
||||||
this.DOMResults.innerHTML = response;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var emptyMessage = this._EmptyMessage();
|
|
||||||
if (emptyMessage !== "") {
|
|
||||||
li.innerHTML = emptyMessage;
|
|
||||||
li.setAttribute("class", "locked");
|
|
||||||
ul.appendChild(li);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ul;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Deal with request response
|
|
||||||
*/
|
|
||||||
_Post: function (response) {
|
|
||||||
try {
|
|
||||||
var returnResponse = [];
|
|
||||||
//JSON return
|
|
||||||
var json = JSON.parse(response);
|
|
||||||
if (Object.keys(json).length === 0) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (Array.isArray(json)) {
|
|
||||||
for (var i = 0; i < Object.keys(json).length; i++) {
|
|
||||||
returnResponse[returnResponse.length] = { "Value": json[i], "Label": this._Highlight(json[i]) };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (var value in json) {
|
|
||||||
returnResponse.push({
|
|
||||||
"Value": value,
|
|
||||||
"Label": this._Highlight(json[value])
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return returnResponse;
|
|
||||||
}
|
|
||||||
catch (event) {
|
|
||||||
//HTML return
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Return the autocomplete value to send (before request)
|
|
||||||
*/
|
|
||||||
_Pre: function () {
|
|
||||||
return this.Input.value;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Choice one result item
|
|
||||||
*/
|
|
||||||
_Select: function (item) {
|
|
||||||
if (item.hasAttribute("data-autocomplete-value")) {
|
|
||||||
this.Input.value = item.getAttribute("data-autocomplete-value");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.Input.value = item.innerHTML;
|
|
||||||
}
|
|
||||||
this.Input.setAttribute("data-autocomplete-old-value", this.Input.value);
|
|
||||||
},
|
|
||||||
$AjaxTimer: null,
|
|
||||||
$Listeners: {}
|
|
||||||
};
|
|
||||||
return AutoComplete;
|
|
||||||
}());
|
|
||||||
module.exports = AutoComplete;
|
|
||||||
|
|
||||||
},{}]},{},[1])(1)
|
|
||||||
});
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
pdb-ui/src/main/resources/resources/js/jquery-3.3.1.min.js
vendored
Normal file
2
pdb-ui/src/main/resources/resources/js/jquery-3.3.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,494 +0,0 @@
|
|||||||
|
|
||||||
var splitBy = {
|
|
||||||
field: '',
|
|
||||||
query: '',
|
|
||||||
values: [],
|
|
||||||
index: 0
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
$('#search-submit').click(plot);
|
|
||||||
|
|
||||||
renderGroupBy();
|
|
||||||
updateSearchLimitValue();
|
|
||||||
|
|
||||||
$('#search-limit-by').change(updateSearchLimitValue);
|
|
||||||
disableSplitBy();
|
|
||||||
|
|
||||||
$('#plot-type').change(updatePlotType);
|
|
||||||
updatePlotType();
|
|
||||||
|
|
||||||
$('#nav_left').click(dateLeftShift);
|
|
||||||
$('#nav_left_half').click(dateHalfLeftShift);
|
|
||||||
$('#nav_right_half').click(dateHalfRightShift);
|
|
||||||
$('#nav_right').click(dateRightShift);
|
|
||||||
$('#prev_image').click(prev_image);
|
|
||||||
$('#next_image').click(next_image);
|
|
||||||
|
|
||||||
$('#zoom_in').click(zoomIn);
|
|
||||||
$('#refresh').click(refresh);
|
|
||||||
$('#zoom_out').click(zoomOut);
|
|
||||||
|
|
||||||
AutoComplete({
|
|
||||||
HttpMethod: "GET",
|
|
||||||
Delay: 300,
|
|
||||||
_QueryArg: function() {
|
|
||||||
var caretIndex = document.getElementById('search-input').selectionStart + 1;
|
|
||||||
return 'caretIndex=' + caretIndex + '&query';
|
|
||||||
},
|
|
||||||
_Pre: function() {
|
|
||||||
return encodeURI(this.Input.value);
|
|
||||||
},
|
|
||||||
_Post: function(response) {
|
|
||||||
var result = [];
|
|
||||||
var responseObject = JSON.parse(response);
|
|
||||||
responseObject['proposals'].forEach(function(item, index){
|
|
||||||
var proposal = {};
|
|
||||||
proposal['Label'] = item.value;
|
|
||||||
proposal['Value'] = item.proposedQuery;
|
|
||||||
|
|
||||||
result.push(proposal);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(JSON.stringify(result));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
initInvaders('result-image');
|
|
||||||
//startInvaders();
|
|
||||||
});
|
|
||||||
|
|
||||||
function refresh()
|
|
||||||
{
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoomIn()
|
|
||||||
{
|
|
||||||
shiftDate(0.25);
|
|
||||||
zoom(0.5);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoomOut()
|
|
||||||
{
|
|
||||||
shiftDate(-0.5);
|
|
||||||
zoom(2);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
function dateLeftShift()
|
|
||||||
{
|
|
||||||
shiftDate(-1);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
function dateHalfLeftShift()
|
|
||||||
{
|
|
||||||
shiftDate(-0.5);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
function dateHalfRightShift()
|
|
||||||
{
|
|
||||||
shiftDate(0.5);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
function dateRightShift()
|
|
||||||
{
|
|
||||||
shiftDate(1);
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoom(factor)
|
|
||||||
{
|
|
||||||
if (!$('#search-date-range').is(":invalid")) {
|
|
||||||
|
|
||||||
var dateRange = $('#search-date-range').val();
|
|
||||||
var tokens = dateRange.split(/ +/,2);
|
|
||||||
|
|
||||||
if(tokens.length == 2)
|
|
||||||
{
|
|
||||||
var value = parseInt(tokens[0]);
|
|
||||||
var period = tokens[1];
|
|
||||||
|
|
||||||
var newValue = value*factor;
|
|
||||||
while (newValue != Math.round(newValue)){
|
|
||||||
|
|
||||||
switch (period) {
|
|
||||||
case "second":
|
|
||||||
case "seconds":
|
|
||||||
if (value == 1) {
|
|
||||||
// we reached the smallest range
|
|
||||||
}
|
|
||||||
else if (value % 2 == 1){
|
|
||||||
value = value -1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "minute":
|
|
||||||
case "minutes":
|
|
||||||
value = value * 60;
|
|
||||||
period = "seconds";
|
|
||||||
break;
|
|
||||||
case "hour":
|
|
||||||
case "hours":
|
|
||||||
value = value * 60;
|
|
||||||
period = "minutes";
|
|
||||||
break;
|
|
||||||
case "day":
|
|
||||||
case "days":
|
|
||||||
value = value * 24;
|
|
||||||
period = "hours";
|
|
||||||
break;
|
|
||||||
case "week":
|
|
||||||
case "weeks":
|
|
||||||
value = value * 7;
|
|
||||||
period = "days";
|
|
||||||
break;
|
|
||||||
case "month":
|
|
||||||
case "months":
|
|
||||||
value = value * 30;
|
|
||||||
period = "days";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("unhandled value: "+ period);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
newValue = value*factor
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$('#search-date-range').val(newValue + " " + period);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function shiftDate(directionalFactor)
|
|
||||||
{
|
|
||||||
var dateBefore = Date.parse($('#search-date-from').val());
|
|
||||||
var newDate = shiftByInterval(dateBefore, directionalFactor);
|
|
||||||
$('#search-date-from').val(newDate.toString("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function shiftByInterval(date, directionalFactor)
|
|
||||||
{
|
|
||||||
if (!$('#search-date-range').is(":invalid")) {
|
|
||||||
|
|
||||||
var dateRange = $('#search-date-range').val();
|
|
||||||
var tokens = dateRange.split(/ +/,2);
|
|
||||||
|
|
||||||
if(tokens.length == 2)
|
|
||||||
{
|
|
||||||
var value = parseInt(tokens[0]);
|
|
||||||
var period = tokens[1];
|
|
||||||
var config = {};
|
|
||||||
|
|
||||||
value = directionalFactor * value;
|
|
||||||
|
|
||||||
switch (period) {
|
|
||||||
case "second":
|
|
||||||
case "seconds":
|
|
||||||
config = { seconds: value };
|
|
||||||
break;
|
|
||||||
case "minute":
|
|
||||||
case "minutes":
|
|
||||||
config = { minutes: value };
|
|
||||||
break;
|
|
||||||
case "hour":
|
|
||||||
case "hours":
|
|
||||||
config = { minutes: 60*value };
|
|
||||||
break;
|
|
||||||
case "day":
|
|
||||||
case "days":
|
|
||||||
config = { days: value };
|
|
||||||
break;
|
|
||||||
case "week":
|
|
||||||
case "weeks":
|
|
||||||
config = { days: 7*value };
|
|
||||||
break;
|
|
||||||
case "month":
|
|
||||||
case "months":
|
|
||||||
config = { days: 30*value };
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newDate = date.add(config);
|
|
||||||
return newDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
function prev_image()
|
|
||||||
{
|
|
||||||
if (splitBy['values'].length > 0)
|
|
||||||
{
|
|
||||||
splitBy['index'] = (splitBy['index']+ splitBy['values'].length-1) % splitBy['values'].length;
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function next_image()
|
|
||||||
{
|
|
||||||
if (splitBy['values'].length > 0)
|
|
||||||
{
|
|
||||||
splitBy['index'] = (splitBy['index']+1) % splitBy['values'].length;
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSearchLimitValue () {
|
|
||||||
var optionSelected = $('#search-limit-by').find("option:selected");
|
|
||||||
var valueSelected = optionSelected.val();
|
|
||||||
|
|
||||||
if (valueSelected == "NO_LIMIT"){
|
|
||||||
$('#search-limit-value').hide();
|
|
||||||
}else{
|
|
||||||
$('#search-limit-value').show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePlotType(){
|
|
||||||
var optionSelected = $('#plot-type').find("option:selected");
|
|
||||||
var valueSelected = optionSelected.val();
|
|
||||||
if (valueSelected == "PERCENTILES"){
|
|
||||||
$('#group-show-aggregate').hide();
|
|
||||||
}else{
|
|
||||||
$('#group-show-aggregate').show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function enableSplitBy(fieldValues) {
|
|
||||||
splitBy['field'] = $('#split-by').val();
|
|
||||||
splitBy['values'] = fieldValues;
|
|
||||||
splitBy['index'] = 0;
|
|
||||||
splitBy['query'] = $('#search-input').val();
|
|
||||||
showSplitBy();
|
|
||||||
}
|
|
||||||
|
|
||||||
function disableSplitBy() {
|
|
||||||
splitBy['field'] = '';
|
|
||||||
splitBy['values'] = [];
|
|
||||||
splitBy['index'] = 0;
|
|
||||||
splitBy['query'] = '';
|
|
||||||
hideSplitBy();
|
|
||||||
}
|
|
||||||
|
|
||||||
function showSplitBy(){
|
|
||||||
if(splitBy['values'].length > 0) {
|
|
||||||
$('#prev_image').show();
|
|
||||||
$('#next_image').show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideSplitBy(){
|
|
||||||
$('#prev_image').hide();
|
|
||||||
$('#next_image').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderGroupBy()
|
|
||||||
{
|
|
||||||
var request = {};
|
|
||||||
|
|
||||||
var success = function(response){
|
|
||||||
|
|
||||||
initSearchGroupBy('#search-group-by-1', response);
|
|
||||||
initSearchGroupBy('#search-group-by-2', response);
|
|
||||||
initSearchGroupBy('#search-group-by-3', response);
|
|
||||||
initFieldsDropDown('#split-by', response);
|
|
||||||
};
|
|
||||||
var error = function(e) {
|
|
||||||
$('#result-view').text("FAILED: " + JSON.parse(e.responseText).message);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
getJson("fields", request, success, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
function initSearchGroupBy(selector, response)
|
|
||||||
{
|
|
||||||
$(selector).empty();
|
|
||||||
var option = new Option("", "");
|
|
||||||
$(selector).append($(option));
|
|
||||||
|
|
||||||
response.forEach(
|
|
||||||
(item, index) => {
|
|
||||||
var option = new Option(item, item);
|
|
||||||
$(selector).append($(option));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function initFieldsDropDown(selector, response)
|
|
||||||
{
|
|
||||||
$(selector).empty();
|
|
||||||
var option = new Option("", "");
|
|
||||||
$(selector).append($(option));
|
|
||||||
|
|
||||||
response.forEach(
|
|
||||||
(item, index) => {
|
|
||||||
var option = new Option(item, item);
|
|
||||||
$(selector).append($(option));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showLoadingIcon()
|
|
||||||
{
|
|
||||||
//$('#result-view').html("<div class='center'><div class='uil-cube-css' style='-webkit-transform:scale(0.41)'><div /><div></div><div></div><div></div></div></div>");
|
|
||||||
$('#result-image').html("");
|
|
||||||
hideSplitBy();
|
|
||||||
startInvaders();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Called by the 'plot' button
|
|
||||||
*/
|
|
||||||
function plot(event){
|
|
||||||
if(event){
|
|
||||||
event.preventDefault(); // prevent submit of form which would reload the page
|
|
||||||
}
|
|
||||||
showLoadingIcon();
|
|
||||||
|
|
||||||
var splitByField = $('#split-by').val();
|
|
||||||
if (splitByField){
|
|
||||||
splitQueries(function (fieldValues) {
|
|
||||||
splitBy['values'] = fieldValues;
|
|
||||||
enableSplitBy(fieldValues);
|
|
||||||
plotCurrent();
|
|
||||||
});
|
|
||||||
|
|
||||||
}else{
|
|
||||||
splitBy['field'] = '';
|
|
||||||
splitBy['values'] = [];
|
|
||||||
splitBy['index'] = 0;
|
|
||||||
splitBy['query'] = '';
|
|
||||||
plotCurrent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function plotCurrent()
|
|
||||||
{
|
|
||||||
showLoadingIcon();
|
|
||||||
|
|
||||||
if (splitBy['field']) {
|
|
||||||
var query = createQuery();
|
|
||||||
sendPlotRequest(query);
|
|
||||||
}else{
|
|
||||||
var query = $('#search-input').val();
|
|
||||||
sendPlotRequest(query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createQuery()
|
|
||||||
{
|
|
||||||
var query = splitBy['query'];
|
|
||||||
if (query.length > 0) {
|
|
||||||
query = "("+query+") and "+splitBy['field']+ " = " +splitBy['values'][splitBy['index']];
|
|
||||||
} else {
|
|
||||||
query = splitBy['field']+ " = " +splitBy['values'][splitBy['index']];
|
|
||||||
}
|
|
||||||
return query;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendPlotRequest(query){
|
|
||||||
|
|
||||||
var request = {};
|
|
||||||
request['query'] = query;
|
|
||||||
request['height'] = $('#result-image').height();
|
|
||||||
request['width'] = $('#result-image').width();
|
|
||||||
request['groupBy'] = groupBy();
|
|
||||||
request['limitBy'] = $('#search-limit-by').val();
|
|
||||||
request['limit'] = parseInt($('#search-limit-value').val());
|
|
||||||
request['dateFrom'] = $('#search-date-from').val();
|
|
||||||
request['dateRange'] = $('#search-date-range').val();
|
|
||||||
request['axisScale'] = $('#search-y-axis-scale').val();
|
|
||||||
request['plotType'] = $('#plot-type').val();
|
|
||||||
request['aggregate'] = $('#show-aggregate').val();
|
|
||||||
request['keyOutside'] = $('#key-outside').is(":checked");
|
|
||||||
|
|
||||||
|
|
||||||
var success = function(response){
|
|
||||||
$('#result-image').html('<img src=\"'+response.imageUrls+'" />');
|
|
||||||
showSplitBy();
|
|
||||||
};
|
|
||||||
var error = function(e) {
|
|
||||||
showSplitBy();
|
|
||||||
if (e.status == 404){
|
|
||||||
$('#result-image').text("No data points found for query: " + query);
|
|
||||||
}
|
|
||||||
else if (e.status == 503){
|
|
||||||
$('#result-image').text("Too many parallel requests.");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$('#result-image').text("FAILED: " + JSON.parse(e.responseText).message);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
postJson("plots", request, success, error);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function splitQueries(successCallback)
|
|
||||||
{
|
|
||||||
var request = {};
|
|
||||||
request['query'] = $('#search-input').val();
|
|
||||||
|
|
||||||
var error = function(e) {
|
|
||||||
$('#result_image').text("FAILED: " + JSON.parse(e.responseText).message);
|
|
||||||
};
|
|
||||||
|
|
||||||
var url = "/fields/"+encodeURIComponent($('#split-by').val())+"/values";
|
|
||||||
getJson(url, request, successCallback, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
function groupBy()
|
|
||||||
{
|
|
||||||
var result = [];
|
|
||||||
|
|
||||||
for (var i = 1; i <= 3; i++)
|
|
||||||
{
|
|
||||||
if ($('#search-group-by-'+i).val() != "")
|
|
||||||
{
|
|
||||||
result.push($('#search-group-by-'+i).val());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function postJson(url, requestData, successCallback, errorCallback) {
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: url,
|
|
||||||
data: JSON.stringify(requestData),
|
|
||||||
contentType: 'application/json'
|
|
||||||
})
|
|
||||||
.done(successCallback)
|
|
||||||
.fail(errorCallback)
|
|
||||||
.always(pauseInvaders);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getJson(url, requestData, successCallback, errorCallback) {
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "GET",
|
|
||||||
url: url,
|
|
||||||
data: requestData,
|
|
||||||
contentType: 'application/json'
|
|
||||||
})
|
|
||||||
.done(successCallback)
|
|
||||||
.fail(errorCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript" src="js/jquery-3.2.0.min.js"></script>
|
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
|
||||||
<script type="text/javascript" src="js/autocomplete.js"></script>
|
|
||||||
<!--<script type="text/javascript" src="js/search.js"></script>-->
|
|
||||||
<script type="text/javascript" src="js/date.js"></script>
|
<script type="text/javascript" src="js/date.js"></script>
|
||||||
<script type="text/javascript" src="js/invaders.js"></script>
|
<script type="text/javascript" src="js/invaders.js"></script>
|
||||||
{{#isProduction}}
|
{{#isProduction}}
|
||||||
@@ -13,10 +11,7 @@
|
|||||||
<script type="text/javascript" src="js/vue-2.5.16-dev.js"></script>
|
<script type="text/javascript" src="js/vue-2.5.16-dev.js"></script>
|
||||||
{{/isProduction}}
|
{{/isProduction}}
|
||||||
<script type="text/javascript" src="js/ui.js"></script>
|
<script type="text/javascript" src="js/ui.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="css/typography.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/design.css">
|
<link rel="stylesheet" type="text/css" href="css/design.css">
|
||||||
<link rel="stylesheet" type="text/css" href="css/loading.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/autocomplete.min.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
|
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="css/invaders.css">
|
<link rel="stylesheet" type="text/css" href="css/invaders.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user