494 lines
14 KiB
JavaScript
494 lines
14 KiB
JavaScript
/******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
/******/
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId]) {
|
|
/******/ return installedModules[moduleId].exports;
|
|
/******/ }
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ i: moduleId,
|
|
/******/ l: false,
|
|
/******/ exports: {}
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
/******/
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.l = true;
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/******/
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
/******/
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
/******/
|
|
/******/ // define getter function for harmony exports
|
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
/******/ }
|
|
/******/ };
|
|
/******/
|
|
/******/ // define __esModule on exports
|
|
/******/ __webpack_require__.r = function(exports) {
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
/******/ }
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
/******/ };
|
|
/******/
|
|
/******/ // create a fake namespace object
|
|
/******/ // mode & 1: value is a module id, require it
|
|
/******/ // mode & 2: merge all properties of value into the ns
|
|
/******/ // mode & 4: return value when already ns object
|
|
/******/ // mode & 8|1: behave like require
|
|
/******/ __webpack_require__.t = function(value, mode) {
|
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
/******/ if(mode & 8) return value;
|
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
/******/ var ns = Object.create(null);
|
|
/******/ __webpack_require__.r(ns);
|
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
/******/ return ns;
|
|
/******/ };
|
|
/******/
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
/******/ __webpack_require__.n = function(module) {
|
|
/******/ var getter = module && module.__esModule ?
|
|
/******/ function getDefault() { return module['default']; } :
|
|
/******/ function getModuleExports() { return module; };
|
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
/******/ return getter;
|
|
/******/ };
|
|
/******/
|
|
/******/ // Object.prototype.hasOwnProperty.call
|
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
/******/
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
/******/
|
|
/******/
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(__webpack_require__.s = 490);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ({
|
|
|
|
/***/ 490:
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* ---------------------------------------------------------------------
|
|
* GLPI - Gestionnaire Libre de Parc Informatique
|
|
* Copyright (C) 2015-2020 Teclib' and contributors.
|
|
*
|
|
* http://glpi-project.org
|
|
*
|
|
* based on GLPI - Gestionnaire Libre de Parc Informatique
|
|
* Copyright (C) 2003-2014 by the INDEPNET Development Team.
|
|
*
|
|
* ---------------------------------------------------------------------
|
|
*
|
|
* LICENSE
|
|
*
|
|
* This file is part of GLPI.
|
|
*
|
|
* GLPI is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* GLPI is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with GLPI. If not, see <http://www.gnu.org/licenses/>.
|
|
* ---------------------------------------------------------------------
|
|
*/
|
|
|
|
// Fuzzy base lib
|
|
// 'fuzzy' object has to be declared in global scope
|
|
window.fuzzy = __webpack_require__(491);
|
|
|
|
// Required to open search menu with "CTRL+ALT+G"
|
|
__webpack_require__(492);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 491:
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/*
|
|
* Fuzzy
|
|
* https://github.com/myork/fuzzy
|
|
*
|
|
* Copyright (c) 2012 Matt York
|
|
* Licensed under the MIT license.
|
|
*/
|
|
|
|
(function() {
|
|
|
|
var root = this;
|
|
|
|
var fuzzy = {};
|
|
|
|
// Use in node or in browser
|
|
if (true) {
|
|
module.exports = fuzzy;
|
|
} else {}
|
|
|
|
// Return all elements of `array` that have a fuzzy
|
|
// match against `pattern`.
|
|
fuzzy.simpleFilter = function(pattern, array) {
|
|
return array.filter(function(str) {
|
|
return fuzzy.test(pattern, str);
|
|
});
|
|
};
|
|
|
|
// Does `pattern` fuzzy match `str`?
|
|
fuzzy.test = function(pattern, str) {
|
|
return fuzzy.match(pattern, str) !== null;
|
|
};
|
|
|
|
// If `pattern` matches `str`, wrap each matching character
|
|
// in `opts.pre` and `opts.post`. If no match, return null
|
|
fuzzy.match = function(pattern, str, opts) {
|
|
opts = opts || {};
|
|
var patternIdx = 0
|
|
, result = []
|
|
, len = str.length
|
|
, totalScore = 0
|
|
, currScore = 0
|
|
// prefix
|
|
, pre = opts.pre || ''
|
|
// suffix
|
|
, post = opts.post || ''
|
|
// String to compare against. This might be a lowercase version of the
|
|
// raw string
|
|
, compareString = opts.caseSensitive && str || str.toLowerCase()
|
|
, ch;
|
|
|
|
pattern = opts.caseSensitive && pattern || pattern.toLowerCase();
|
|
|
|
// For each character in the string, either add it to the result
|
|
// or wrap in template if it's the next string in the pattern
|
|
for(var idx = 0; idx < len; idx++) {
|
|
ch = str[idx];
|
|
if(compareString[idx] === pattern[patternIdx]) {
|
|
ch = pre + ch + post;
|
|
patternIdx += 1;
|
|
|
|
// consecutive characters should increase the score more than linearly
|
|
currScore += 1 + currScore;
|
|
} else {
|
|
currScore = 0;
|
|
}
|
|
totalScore += currScore;
|
|
result[result.length] = ch;
|
|
}
|
|
|
|
// return rendered string if we have a match for every char
|
|
if(patternIdx === pattern.length) {
|
|
// if the string is an exact match with pattern, totalScore should be maxed
|
|
totalScore = (compareString === pattern) ? Infinity : totalScore;
|
|
return {rendered: result.join(''), score: totalScore};
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
// The normal entry point. Filters `arr` for matches against `pattern`.
|
|
// It returns an array with matching values of the type:
|
|
//
|
|
// [{
|
|
// string: '<b>lah' // The rendered string
|
|
// , index: 2 // The index of the element in `arr`
|
|
// , original: 'blah' // The original element in `arr`
|
|
// }]
|
|
//
|
|
// `opts` is an optional argument bag. Details:
|
|
//
|
|
// opts = {
|
|
// // string to put before a matching character
|
|
// pre: '<b>'
|
|
//
|
|
// // string to put after matching character
|
|
// , post: '</b>'
|
|
//
|
|
// // Optional function. Input is an entry in the given arr`,
|
|
// // output should be the string to test `pattern` against.
|
|
// // In this example, if `arr = [{crying: 'koala'}]` we would return
|
|
// // 'koala'.
|
|
// , extract: function(arg) { return arg.crying; }
|
|
// }
|
|
fuzzy.filter = function(pattern, arr, opts) {
|
|
if(!arr || arr.length === 0) {
|
|
return [];
|
|
}
|
|
if (typeof pattern !== 'string') {
|
|
return arr;
|
|
}
|
|
opts = opts || {};
|
|
return arr
|
|
.reduce(function(prev, element, idx, arr) {
|
|
var str = element;
|
|
if(opts.extract) {
|
|
str = opts.extract(element);
|
|
}
|
|
var rendered = fuzzy.match(pattern, str, opts);
|
|
if(rendered != null) {
|
|
prev[prev.length] = {
|
|
string: rendered.rendered
|
|
, score: rendered.score
|
|
, index: idx
|
|
, original: element
|
|
};
|
|
}
|
|
return prev;
|
|
}, [])
|
|
|
|
// Sort by score. Browsers are inconsistent wrt stable/unstable
|
|
// sorting, so force stable by using the index in the case of tie.
|
|
// See http://ofb.net/~sethml/is-sort-stable.html
|
|
.sort(function(a,b) {
|
|
var compare = b.score - a.score;
|
|
if(compare) return compare;
|
|
return a.index - b.index;
|
|
});
|
|
};
|
|
|
|
|
|
}());
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 492:
|
|
/***/ (function(module, exports) {
|
|
|
|
/*jslint browser: true*/
|
|
/*jslint jquery: true*/
|
|
|
|
/*
|
|
* jQuery Hotkeys Plugin
|
|
* Copyright 2010, John Resig
|
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
*
|
|
* Based upon the plugin by Tzury Bar Yochay:
|
|
* https://github.com/tzuryby/jquery.hotkeys
|
|
*
|
|
* Original idea by:
|
|
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
|
*/
|
|
|
|
/*
|
|
* One small change is: now keys are passed by object { keys: '...' }
|
|
* Might be useful, when you want to pass some other data to your handler
|
|
*/
|
|
|
|
(function(jQuery) {
|
|
|
|
jQuery.hotkeys = {
|
|
version: "0.2.0",
|
|
|
|
specialKeys: {
|
|
8: "backspace",
|
|
9: "tab",
|
|
10: "return",
|
|
13: "return",
|
|
16: "shift",
|
|
17: "ctrl",
|
|
18: "alt",
|
|
19: "pause",
|
|
20: "capslock",
|
|
27: "esc",
|
|
32: "space",
|
|
33: "pageup",
|
|
34: "pagedown",
|
|
35: "end",
|
|
36: "home",
|
|
37: "left",
|
|
38: "up",
|
|
39: "right",
|
|
40: "down",
|
|
45: "insert",
|
|
46: "del",
|
|
59: ";",
|
|
61: "=",
|
|
96: "0",
|
|
97: "1",
|
|
98: "2",
|
|
99: "3",
|
|
100: "4",
|
|
101: "5",
|
|
102: "6",
|
|
103: "7",
|
|
104: "8",
|
|
105: "9",
|
|
106: "*",
|
|
107: "+",
|
|
109: "-",
|
|
110: ".",
|
|
111: "/",
|
|
112: "f1",
|
|
113: "f2",
|
|
114: "f3",
|
|
115: "f4",
|
|
116: "f5",
|
|
117: "f6",
|
|
118: "f7",
|
|
119: "f8",
|
|
120: "f9",
|
|
121: "f10",
|
|
122: "f11",
|
|
123: "f12",
|
|
144: "numlock",
|
|
145: "scroll",
|
|
173: "-",
|
|
186: ";",
|
|
187: "=",
|
|
188: ",",
|
|
189: "-",
|
|
190: ".",
|
|
191: "/",
|
|
192: "`",
|
|
219: "[",
|
|
220: "\\",
|
|
221: "]",
|
|
222: "'"
|
|
},
|
|
|
|
shiftNums: {
|
|
"`": "~",
|
|
"1": "!",
|
|
"2": "@",
|
|
"3": "#",
|
|
"4": "$",
|
|
"5": "%",
|
|
"6": "^",
|
|
"7": "&",
|
|
"8": "*",
|
|
"9": "(",
|
|
"0": ")",
|
|
"-": "_",
|
|
"=": "+",
|
|
";": ": ",
|
|
"'": "\"",
|
|
",": "<",
|
|
".": ">",
|
|
"/": "?",
|
|
"\\": "|"
|
|
},
|
|
|
|
// excludes: button, checkbox, file, hidden, image, password, radio, reset, search, submit, url
|
|
textAcceptingInputTypes: [
|
|
"text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime",
|
|
"datetime-local", "search", "color", "tel"],
|
|
|
|
// default input types not to bind to unless bound directly
|
|
textInputTypes: /textarea|input|select/i,
|
|
|
|
options: {
|
|
filterInputAcceptingElements: true,
|
|
filterTextInputs: true,
|
|
filterContentEditable: true
|
|
}
|
|
};
|
|
|
|
function keyHandler(handleObj) {
|
|
if (typeof handleObj.data === "string") {
|
|
handleObj.data = {
|
|
keys: handleObj.data
|
|
};
|
|
}
|
|
|
|
// Only care when a possible input has been specified
|
|
if (!handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string") {
|
|
return;
|
|
}
|
|
|
|
var origHandler = handleObj.handler,
|
|
keys = handleObj.data.keys.toLowerCase().split(" ");
|
|
|
|
handleObj.handler = function(event) {
|
|
// Don't fire in text-accepting inputs that we didn't directly bind to
|
|
if (this !== event.target &&
|
|
(jQuery.hotkeys.options.filterInputAcceptingElements &&
|
|
jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
|
|
(jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) ||
|
|
(jQuery.hotkeys.options.filterTextInputs &&
|
|
jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) {
|
|
return;
|
|
}
|
|
|
|
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[event.which],
|
|
character = String.fromCharCode(event.which).toLowerCase(),
|
|
modif = "",
|
|
possible = {};
|
|
|
|
jQuery.each(["alt", "ctrl", "shift"], function(index, specialKey) {
|
|
|
|
if (event[specialKey + 'Key'] && special !== specialKey) {
|
|
modif += specialKey + '+';
|
|
}
|
|
});
|
|
|
|
// metaKey is triggered off ctrlKey erronously
|
|
if (event.metaKey && !event.ctrlKey && special !== "meta") {
|
|
modif += "meta+";
|
|
}
|
|
|
|
if (event.metaKey && special !== "meta" && modif.indexOf("alt+ctrl+shift+") > -1) {
|
|
modif = modif.replace("alt+ctrl+shift+", "hyper+");
|
|
}
|
|
|
|
if (special) {
|
|
possible[modif + special] = true;
|
|
}
|
|
else {
|
|
possible[modif + character] = true;
|
|
possible[modif + jQuery.hotkeys.shiftNums[character]] = true;
|
|
|
|
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
|
if (modif === "shift+") {
|
|
possible[jQuery.hotkeys.shiftNums[character]] = true;
|
|
}
|
|
}
|
|
|
|
for (var i = 0, l = keys.length; i < l; i++) {
|
|
if (possible[keys[i]]) {
|
|
return origHandler.apply(this, arguments);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
jQuery.each(["keydown", "keyup", "keypress"], function() {
|
|
jQuery.event.special[this] = {
|
|
add: keyHandler
|
|
};
|
|
});
|
|
|
|
})(jQuery || this.jQuery || window.jQuery);
|
|
|
|
|
|
/***/ })
|
|
|
|
/******/ });
|
|
//# sourceMappingURL=fuzzy.js.map
|