Check URLs for stop-words
This commit is contained in:
parent
17c0c06e97
commit
31dd47268f
|
@ -3,7 +3,11 @@
|
||||||
|
|
||||||
var SHOW_TIMEOUT = 1000,
|
var SHOW_TIMEOUT = 1000,
|
||||||
LOAD_TIMEOUT = SHOW_TIMEOUT / 4,
|
LOAD_TIMEOUT = SHOW_TIMEOUT / 4,
|
||||||
STORAGE = {};
|
STORAGE = {}
|
||||||
|
STOP_WORDS = [
|
||||||
|
'signout', 'sign-out', 'sign_out',
|
||||||
|
'logout', 'log-out', 'log_out'
|
||||||
|
];
|
||||||
|
|
||||||
var links = document.getElementsByTagName('a');
|
var links = document.getElementsByTagName('a');
|
||||||
for (var i = 0; i < links.length; i++) {
|
for (var i = 0; i < links.length; i++) {
|
||||||
|
@ -17,6 +21,16 @@
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Checking for "stop-words"
|
||||||
|
for (var i = 0; i < STOP_WORDS.length; i++) {
|
||||||
|
if (href.indexOf(STOP_WORDS[i]) > -1) {
|
||||||
|
var word = '' + STOP_WORDS[i];
|
||||||
|
el.addEventListener('mouseover', function(e) {
|
||||||
|
log('Link contains a stop-word "'+ word +'":', href);
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
STORAGE[i] = {};
|
STORAGE[i] = {};
|
||||||
(function(i) {
|
(function(i) {
|
||||||
|
@ -164,12 +178,12 @@
|
||||||
log('Event: '+ e_left +','+ e_top);
|
log('Event: '+ e_left +','+ e_top);
|
||||||
|
|
||||||
// Default positioning
|
// Default positioning
|
||||||
var t_top = e_top - t_height - 20,
|
var t_top = s_top + e_top - t_height - 20,
|
||||||
t_left = s_left + e_left - t_width / 2;
|
t_left = s_left + e_left - t_width / 2;
|
||||||
|
|
||||||
log('Initial position: '+ t_left +','+ t_top);
|
log('Initial position: '+ t_left +','+ t_top);
|
||||||
|
|
||||||
if (t_top < 10) {
|
if (e_top - t_height - 20 < 10) {
|
||||||
// Vertical positioning correction
|
// Vertical positioning correction
|
||||||
t_top = s_top + 10;
|
t_top = s_top + 10;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue