From f64d91b19496b5fe7271f7cb2833903080648a26 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Fri, 15 Jul 2011 10:26:06 -0500 Subject: [PATCH] Added setting for timeout length --- fancy-settings/manifest.js | 23 +++++++++++++++++++++++ js/common.js | 1 + 2 files changed, 24 insertions(+) diff --git a/fancy-settings/manifest.js b/fancy-settings/manifest.js index fc1fd06..7bf51fd 100755 --- a/fancy-settings/manifest.js +++ b/fancy-settings/manifest.js @@ -26,6 +26,29 @@ this.manifest = { "type": "description", "text": "

Mostly Harmless grabs data from the Reddit API every time you load a page. However, that data can be cached, or saved for a short time, to improve performance and reduce the load on the reddit API.

This option allows you to change how long a page's data is cached. Longer cache times mean less bandwidth, faster results, and less load on reddit. Shorter cache times mean fresher data.

" }, + { + "tab": "Performance", + "group": "Timeout Length", + "name": "timeoutLength", + "type": "slider", + "label": "", + "max": 15, + "min": 1, + "step": 1, + "display": true, + "displayModifier": function(value) { + if(value === 1) + return value.toString() + " second"; + return value.toString() + " seconds"; + } + }, + { + "tab": "Performance", + "group": "Timeout Length", + "name": "tiemoutDescription", + "type": "description", + "text": "

Mostly Harmless uses the reddit API, but sometimes the API will be slow or down. If that happens, Mostly Harmless can display an error after trying to reach the API for a certain amount of time.

This option allows you to change how long Mostly Harmless should try to reach the Reddit API. Longer timeout lengths mean more time waiting for a result from the reddit API. Shorter timeout lengths mean a higher possibility of timing out when reddit may only be slow instead of down." + }, { "tab": "Privacy", "group": "Warning!", diff --git a/js/common.js b/js/common.js index b522ace..ef83310 100644 --- a/js/common.js +++ b/js/common.js @@ -2,6 +2,7 @@ var settings, cache, utils, button, reddit, background; settings = new Store('settings', { 'cacheTime': 3, + 'timeoutLength': 5, 'freshCutoff': 7, 'popupWidth': 640 });