From dee264cfe41e40ebdf7840f5b57182cb383a48b4 Mon Sep 17 00:00:00 2001 From: John Foerch Date: Sun, 28 Feb 2010 19:31:46 -0500 Subject: [PATCH] get_spaces: move to string.js --- modules/permission-manager.js | 7 ------- modules/string.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/permission-manager.js b/modules/permission-manager.js index 04dc704..6a1f960 100644 --- a/modules/permission-manager.js +++ b/modules/permission-manager.js @@ -10,15 +10,8 @@ * blocking whitelist, among other things. */ - let permission_manager = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager); -function get_spaces (n) { - var x = ""; - while (x.length < n) x += " "; - return x; -} - function word_wrap (str, line_length, line_prefix_first, line_prefix) { if (line_prefix === undefined) line_prefix = line_prefix_first; diff --git a/modules/string.js b/modules/string.js index c060809..366b25a 100644 --- a/modules/string.js +++ b/modules/string.js @@ -74,3 +74,14 @@ function html_escape (str) { .replace(/>/g, '>') .replace(/"/g, '"'); } + + +/** + * get_spaces returns a string of n spaces. + */ +function get_spaces (n) { + var x = ""; + while (x.length < n) x += " "; + return x; +} + -- 2.11.4.GIT