From 25bba80c9eb112b8ded40d2baf9f202c79d4e2ad Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 25 Jun 2008 19:25:28 +0000 Subject: Adds a simple API and a standalone script that can be used to forward emails from a local or remote email server to Redmine (#1110). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1584 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/application.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'public') diff --git a/public/javascripts/application.js b/public/javascripts/application.js index a8b6c0e46..4e5b67e55 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -107,6 +107,15 @@ function scmEntryLoaded(id) { Element.removeClassName(id, 'loading'); } +function randomKey(size) { + var chars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); + var key = ''; + for (i = 0; i < size; i++) { + key += chars[Math.floor(Math.random() * chars.length)]; + } + return key; +} + /* shows and hides ajax indicator */ Ajax.Responders.register({ onCreate: function(){ -- cgit v1.2.3