-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathauto.js
More file actions
83 lines (71 loc) · 3.3 KB
/
auto.js
File metadata and controls
83 lines (71 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// $(function() {
// $("document").ready(function() {
// // The tags we will be looking for
// var categoryTags = ["interest", "research", "personal", "social", "inventory"];
// var interestTags = ["company", "ticker", "sector", "currency", "region"];
// var researchTags = ["report", "analyst", "notes", "ideas"];
// var personalTags = ["spouse", "wife", "husband", "son", "daughter", "birthday", "anniversary", "school", "college", "university"];
// var inventoryTags = ["software", "hardware", "OMS", "EMS", "SOR", "algos", "network", "routing network"];
// var htmlTags = ["<!DOCTYPE HTML", "<html", "</html", "<head", "</head", "<body", "</body", "<link", "<meta", "<script", "</script", "<h1", "</h1", "<h2", "</h2", "<h3>", "</h3", "<h4", "</h4", "<h5", "</h5", "<h6", "</h6", "<p", "</p", "<a", "</a", "<br /", "<button", "</button", "<canvas", "</canvas", "<div", "</div", "<form", "</form", "<hr /", "<iframe", "</iframe", "<img", "<input", "<label", "</label", "<noscript", "</noscript", "<span", "</span", "<style", "</style", "<table", "</table", "<tbody", "</tbody", "<td", "</td", "<textarea", "</textarea", "<tfoot", "</tfoot", "<th", "</th", "<thead", "</thead", "<title", "</title", "<ol", "</ol", "<ul", "</ul", "<li", "</li"]
// // State variable to keep track of which category we are in
// tagState = htmlTags;
// // Helper functions
// function split(val) {
// return val.split(/>\s*/);
// }
// function extractLast(term) {
// return split(term).pop();
// }
// $("#tags")
// // Create the autocomplete box
// .autocomplete({
// minLength: 0,
// autoFocus: true,
// source: function(request, response) {
// // Use only the last entry from the textarea (exclude previous matches)
// lastEntry = extractLast(request.term);
// var filteredArray = $.map(tagState, function(item) {
// if (item.indexOf(lastEntry) === 0) {
// return item;
// } else {
// return null;
// }
// });
// // delegate back to autocomplete, but extract the last term
// response($.ui.autocomplete.filter(filteredArray, lastEntry));
// },
// focus: function() {
// // prevent value inserted on focus
// return false;
// },
// select: function(event, ui) {
// var terms = split(this.value);
// // remove the current input
// terms.pop();
// // add the selected item
// terms.push(ui.item.value);
// // add placeholder to get the comma-and-space at the end
// terms.push("");
// this.value = terms.join(">");
// return false;
// }
// }).on("keydown", function(event) {
// // don't navigate away from the field on tab when selecting an item
// if (event.keyCode === $.ui.keyCode.TAB /** && $(this).data("ui-autocomplete").menu.active **/ ) {
// event.preventDefault();
// return;
// }
// if (event.keyCode === 27) {
// return
// }
// // Code to position and move the selection box as the user types
// var newY = $(this).textareaHelper('caretPos').top + (parseInt($(this).css('font-size'), 10) * 1.5);
// var newX = $(this).textareaHelper('caretPos').left;
// var posString = "left+" + newX + "px top+" + newY + "px";
// $(this).autocomplete("option", "position", {
// my: "left top",
// at: posString
// });
// });
// });
// });