From 1c5380712d2bc44f209d4ddcb4b85f36f2354634 Mon Sep 17 00:00:00 2001 From: theglu Date: Wed, 7 May 2008 16:52:57 +0000 Subject: [PATCH] See changelog git-svn-id: http://svn.getfiregpg.org/firegpg@388 1e1cc2a3-b62a-0410-bc93-fb3b3b0a0737 --- ChangeLog | 4 +++ content/list.js | 58 ++++++++++++++++++++++++++++++++++++++++---- content/list.xul | 2 +- content/misc.js | 10 ++++++-- content/options.js | 5 +--- content/showtext.xul | 2 +- 6 files changed, 68 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc248c4..f3ae78e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-07 Maximilien Cuony + * Implemented sub key for key selection (but widout the new keys' list system) + * Add flexibility to some dialogs + 2008-05-06 Maximilien Cuony * Reforming key lists communication system, implementing subkey system. * New key list implemented for options. diff --git a/content/list.js b/content/list.js index c7c8078..a5033a7 100644 --- a/content/list.js +++ b/content/list.js @@ -135,16 +135,64 @@ function onLoad(win) savedList[k] = new Array(list[id].keyName, list[id].keyId, list[id].keyDate, list[id].keyExpi, (list[id].keyName + list[id].keyId+ list[id].keyDate + list[id].keyExpi) .toLowerCase() ); k++; - //var newItem = listInDialog.appendItem(list[id], id); - - if (selected == true) { listOfAutoSelect[j] = item; j++; - //listInDialog.addItemToSelection(newItem); - //newItem.setAttribute('selected', selected); } + //TODO : Find a better way + if (list[id].subKeys.length > 0) { + + for(var kid in list[id].subKeys){ + + if (list[id].subKeys[kid].keyName == "") + continue; + + selected = false; + + if (autoSelectMode == true) { + + var reg = new RegExp('[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}', 'gi'); + + var theMail = reg.exec(list[id].subKeys[kid].keyName); + + if (theMail != null) { + if (testList.indexOf(theMail) != -1) + selected = true; + } + + } + + var item = document.createElement('listitem'); + + var child1 = document.createElement('listcell'); + child1.setAttribute('label', "> " +list[id].subKeys[kid].keyName); + item.appendChild(child1); + + var child2 = document.createElement('listcell'); + child2.setAttribute('label', list[id].keyId); + item.appendChild(child2); + + var child3 = document.createElement('listcell'); + child3.setAttribute('label', list[id].subKeys[kid].keyDate); + item.appendChild(child3); + + var child4 = document.createElement('listcell'); + child4.setAttribute('label', list[id].subKeys[kid].keyExpi); + item.appendChild(child4); + + listInDialog.appendChild(item); + + savedList[k] = new Array("> " + list[id].subKeys[kid].keyName, list[id].keyId, list[id].subKeys[kid].keyDate, list[id].subKeys[kid].keyExpi, (list[id].subKeys[kid].keyName + list[id].subKeys[kid].keyId+ list[id].subKeys[kid].keyDate + list[id].subKeys[kid].keyExpi) .toLowerCase() ); + k++; + + if (selected == true) { + listOfAutoSelect[j] = item; + j++; + } + } + } + } // description diff --git a/content/list.xul b/content/list.xul index 530e391..a6233fb 100644 --- a/content/list.xul +++ b/content/list.xul @@ -43,7 +43,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ondialogaccept="return onAccept()">