summaryrefslogtreecommitdiff
path: root/scripts/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/base.js')
-rw-r--r--scripts/base.js37
1 files changed, 22 insertions, 15 deletions
diff --git a/scripts/base.js b/scripts/base.js
index dae765cc..fdfa86f6 100644
--- a/scripts/base.js
+++ b/scripts/base.js
@@ -9,6 +9,8 @@ Object.freeze((function () {
};
var globals = {
active : null,
+ matchHint : -1,
+ escapeChar : "\\",
activeArr : [],
activeInput : null,
elements : [],
@@ -216,7 +218,7 @@ Object.freeze((function () {
var inArr = input.split(" ");
for (i=0; i<inArr.length; i++)
{
- if (!this.element.textContent.toUpperCase().match(inArr[i]))
+ if (!this.element.textContent.toUpperCase().match(inArr[i].toUpperCase()))
return false;
}
return true;
@@ -243,7 +245,7 @@ Object.freeze((function () {
{
if (element.hasAttribute("onclick"))
{
- p_mouseEvent(element, ev, !globals.newTab);
+ p_mouseEvent(element, "click", !globals.newTab);
clicked = true;
}
if (element.hasAttribute("onmousedown"))
@@ -506,7 +508,16 @@ Object.freeze((function () {
globals.lastInput = input;
if (input)
{
- if (globals.style == "number")
+ if (input[input.length-1] == globals.escapeChar && globals.matchHint == -1)
+ {
+ globals.matchHint = input.indexOf(globals.escapeChar) + 1;
+ return null;
+ }
+ if (globals.matchHint != -1)
+ {
+ input = input.substring(globals.matchHint);
+ }
+ else if (globals.style == "number")
{
if (input[input.length-1].isInt())
{
@@ -602,6 +613,7 @@ Object.freeze((function () {
globals.lastPosition = 0;
globals.lastInput = null;
globals.positions = [];
+ globals.matchHint = -1;
if (globals.notify && globals.notify.parentNode)
{
globals.notify.parentNode.removeChild(globals.notify);
@@ -620,20 +632,15 @@ Object.freeze((function () {
{
e.target = null;
}
- if (type > 0)
+ if (type == HintTypes.HINT_T_IMAGES)
{
- switch (type)
- {
- case HintTypes.HINT_T_IMAGES:
- ret = e.src; p_clear();
- return ret;
- case HintTypes.HINT_T_URL :
- ret = e.hasAttribute("href") ? e.href : e.src; p_clear();
- return ret;
- default: break;
- }
+ ret = e.src;
+ }
+ else if (type == HintTypes.HINT_T_URL)
+ {
+ ret = e.hasAttribute("href") ? e.href : e.src;
}
- if ((tagname && (tagname == "input" || tagname == "textarea")))
+ else if ((tagname && (tagname == "input" || tagname == "textarea")))
{
if (type == "radio" || type == "checkbox")
{