mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 16:32:27 +01:00
Cleanup.
This commit is contained in:
@@ -1486,31 +1486,20 @@ liberator.Marks = function () //{{{
|
|||||||
|
|
||||||
function getSortedMarks()
|
function getSortedMarks()
|
||||||
{
|
{
|
||||||
|
var lmarks, umarks;
|
||||||
|
|
||||||
// local marks
|
// local marks
|
||||||
var lmarks = [];
|
lmarks = [[[mark, value[i]] for (i in value)
|
||||||
|
if (value[i].location == window.content.location.href)]
|
||||||
for (var mark in localMarks)
|
for ([mark, value] in Iterator(localMarks))];
|
||||||
{
|
lmarks = Array.concat.apply(Array, lmarks);
|
||||||
for (var i = 0; i < localMarks[mark].length; i++)
|
|
||||||
{
|
|
||||||
if (localMarks[mark][i].location == window.content.location.href)
|
|
||||||
lmarks.push([mark, localMarks[mark][i]]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lmarks.sort();
|
lmarks.sort();
|
||||||
|
|
||||||
// URL marks
|
// URL marks
|
||||||
var umarks = [];
|
|
||||||
|
|
||||||
// FIXME: why does umarks.sort() cause a "Component is not available =
|
// FIXME: why does umarks.sort() cause a "Component is not available =
|
||||||
// NS_ERROR_NOT_AVAILABLE" exception when used here?
|
// NS_ERROR_NOT_AVAILABLE" exception when used here?
|
||||||
for (var mark in urlMarks)
|
umarks = [[key, mark] for ([key, mark] in Iterator(urlMarks))];
|
||||||
umarks.push([mark, urlMarks[mark]]);
|
umarks.sort(function (a, b) a[0].localeCompare(b[0]));
|
||||||
|
|
||||||
umarks.sort(function (a, b) {
|
|
||||||
return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
return lmarks.concat(umarks);
|
return lmarks.concat(umarks);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -878,20 +878,16 @@ liberator.Editor = function () //{{{
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// blink the textbox after returning - TODO: could use setInterval
|
// blink the textbox after returning
|
||||||
if (textBox)
|
if (textBox)
|
||||||
{
|
{
|
||||||
var timeout = 100;
|
var timeout = 100;
|
||||||
textBox.style.backgroundColor = tmpBg;
|
var colors = [tmpBg, oldBg, tmpBg, oldBg];
|
||||||
setTimeout(function () {
|
(function() {
|
||||||
textBox.style.backgroundColor = oldBg;
|
textBox.style.backgroundColor = colors.shift();
|
||||||
setTimeout(function () {
|
if(colors.length > 0)
|
||||||
textBox.style.backgroundColor = tmpBg;
|
setTimeout(arguments.callee, timeout)
|
||||||
setTimeout(function () {
|
})();
|
||||||
textBox.style.backgroundColor = oldBg;
|
|
||||||
}, timeout);
|
|
||||||
}, timeout);
|
|
||||||
}, timeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpfile.remove(false);
|
tmpfile.remove(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user