From: znek Date: Mon, 18 Jul 2005 12:55:01 +0000 (+0000) Subject: changed dhtml behavior to squash bugs #1067 and #1464 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012f14fb9e2498ffe93d7f76ab8fe748075849b0;p=scalable-opengroupware.org changed dhtml behavior to squash bugs #1067 and #1464 git-svn-id: http://svn.opengroupware.org/SOGo/trunk@790 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index 98abf9cc..a4852eb7 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Marcus Mueller + + * UIxMailToSelection.m: changed behavior for adding/removing text + fields and changing focus (v0.9.145) + 2005-07-18 Helge Hess * product.plist: properly bind a 'getMail' method to the account diff --git a/SOGo/UI/MailerUI/UIxMailToSelection.m b/SOGo/UI/MailerUI/UIxMailToSelection.m index 9e992378..6fc52c46 100644 --- a/SOGo/UI/MailerUI/UIxMailToSelection.m +++ b/SOGo/UI/MailerUI/UIxMailToSelection.m @@ -314,6 +314,7 @@ static NSArray *headers = nil; // TODO: might be better to use -stringByReplacingBindings: etc static NSString *script = \ @"var currentIndex = %d;\n" + @"var lastIndex = currentIndex;\n" @"\n" @"function hasAddress(email) {\n" @" var e = document.getElementById(email);\n" @@ -362,19 +363,30 @@ static NSArray *headers = nil; @"}\n" @"\n" @"function fancyAddRow(shouldEdit, text) {\n" - @" var table, lastChild, proto, row, select, input;\n" + @" var addr, table, lastChild, proto, row, select, input;\n" @"\n" + @" addr = document.getElementById('addr_' + lastIndex);\n" + @" if (addr && addr.value == '') {\n" + @" input = document.getElementById('compose_subject_input');\n" + @" if (input) {\n" + @" input.focus();\n" + @" input.select();\n" + @" return;\n" + @" }\n" + @" }\n" @" table = this.getTable();\n" @" lastChild = document.getElementById('row_last');\n" @"\n" @" currentIndex++;\n" @"\n" - @" proto = document.getElementById('row_0');\n" + @" proto = document.getElementById('row_' + lastIndex);\n" @" row = proto.cloneNode(true);\n" @" row.id = 'row_' + currentIndex;\n" @"\n" + @" // select popup\n" @" select = row.childNodes[1].childNodes[1];\n" @" select.name = 'popup_' + currentIndex;\n" + @" select.value = proto.childNodes[1].childNodes[1].value;\n" @" input = row.childNodes[3].childNodes[1];\n" @" input.name = 'addr_' + currentIndex;\n" @" input.id = 'addr_' + currentIndex;\n" @@ -387,7 +399,19 @@ static NSArray *headers = nil; @" }\n" @"}\n" @"\n" + @"function addressFieldGotFocus(sender) {\n" + @" var idx;\n" + @"\n" + @" idx = this.getIndexFromIdentifier(sender.id);\n" + @" if ((lastIndex == idx) || (idx == 0)) return;\n" + @" this.removeLastEditedRowIfEmpty();\n" + @"}\n" + @"function addressFieldLostFocus(sender) {\n" + @" lastIndex = this.getIndexFromIdentifier(sender.id);\n" + @"}\n" + @"\n" @"function removeIfNecessary(sender) {\n" + @"/*" @" var idx, addr, table, senderRow;\n" @"\n" @" if(sender.value != '')\n" @@ -403,6 +427,24 @@ static NSArray *headers = nil; @" table = this.getTable();\n" @" senderRow = this.findRowWithIndex(idx);\n" @" table.removeChild(senderRow);\n" + @"*/" + @"}\n" + @"\n" + @"function removeLastEditedRowIfEmpty() {\n" + @" var idx, addr, table, senderRow;\n" + @"\n" + @" idx = lastIndex;\n" + @" addr = document.getElementById('addr_' + idx);\n" + @" if (!addr) return;\n" + @" if (addr.value != '') return;\n" + @" addr = this.findAddressWithIndex(idx);\n" + @" if(addr) {\n" + @" var addresses = document.getElementById('addr_addresses');\n" + @" addresses.removeChild(addr);\n" + @" }\n" + @" table = this.getTable();\n" + @" senderRow = this.findRowWithIndex(idx);\n" + @" table.removeChild(senderRow);\n" @"}\n" @"\n" @"function findAddressWithIndex(idx) {\n" diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index bbe1a21b..d4e4663d 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=144 +SUBMINOR_VERSION:=145 # v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index e4df4d1d..d4816b02 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Marcus Mueller + + * UIxMailToSelection.wox: changed JavaScript functions to be more + generic + 2005-07-15 Helge Hess * MailPartViewers/UIxMailPartICalViewer.wox: prepared support for iMIP diff --git a/SOGo/UI/Templates/UIxMailToSelection.wox b/SOGo/UI/Templates/UIxMailToSelection.wox index 92d2bd34..6e217ef3 100644 --- a/SOGo/UI/Templates/UIxMailToSelection.wox +++ b/SOGo/UI/Templates/UIxMailToSelection.wox @@ -29,7 +29,8 @@ var:name="currentAddressId" type="text" var:value="address" - onblur="removeIfNecessary(this);" + onfocus="addressFieldGotFocus(this);" + onblur="addressFieldLostFocus(this);" style="width: 100%;" />