From de712c0e5ed5661139001a9fe94301de818f0a58 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 28 Dec 2013 17:18:29 +0400 Subject: [PATCH] seporated url history depth and history dialog item limits... Signed-off-by: Alex A. Naanou --- ui/urlhistory.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/urlhistory.js b/ui/urlhistory.js index 9bb54f6f..a29238f8 100755 --- a/ui/urlhistory.js +++ b/ui/urlhistory.js @@ -10,7 +10,8 @@ /*********************************************************************/ var BASE_URL_HISTORY = [] -var BASE_URL_LIMIT = 15 +var BASE_URL_HISTORY_LIMIT = 50 +var BASE_URL_HISTORY_DIALOG_LIMIT = 15 @@ -62,8 +63,8 @@ function setupBaseURLHistory(){ } // truncate the history if needed... - if(BASE_URL_HISTORY.length > BASE_URL_LIMIT){ - BASE_URL_HISTORY.splice(BASE_URL_LIMIT, BASE_URL_HISTORY.length) + if(BASE_URL_HISTORY.length > BASE_URL_HISTORY_LIMIT){ + BASE_URL_HISTORY.splice(BASE_URL_HISTORY_LIMIT, BASE_URL_HISTORY.length) updated = true } @@ -182,7 +183,12 @@ function recentlyOpenedDialog(){ var not_available = getNonExistingBaseURLs() var cfg = {} - cfg[title] = BASE_URL_HISTORY.map(function(e){ + var c = 0 + cfg[title] = $.map(BASE_URL_HISTORY, function(e){ + c += 1 + if(c > BASE_URL_HISTORY_DIALOG_LIMIT){ + return + } // cleanup the urls... var ee = e.replace('file:///', '') var disabled = not_available.indexOf(e) >= 0