The first link displays a map of the
specified address in Boston, while the second link provides driving directions between Holden, MA
and the Boston address. Once again, to get around the way iUI handles events in iui.jss, you need to
specify the target=???_self??? parameter.
Back over in cui.css, one new style needs to be added:
.cuiServiceButton {
display: block;
margin: 0;
border: none;
padding: 12px 10px 0 0px;
(continued)
Chapter 7: Integrating with iPhone Services
172
text-align: center;
font-weight: bold;
text-decoration: inherit;
height: 42px;
color: #7388a5;
box-sizing: border-box;
}
This style emulates the look of the action buttons (centered blue text, and so on) in the native iPhone
Contact UI.
There is one final tweak that needs to be made to iui.jss before the cuiServiceButton links work as
expected. If you recall, an else if condition is added to trap for service links inside of the
addEventListener( ???click???, event(function) ) function. You need to add an additional test so
that both cuiServiceLink and cuiServiceButton classes are evaluated. To do so, modify the line of
code as specified here:
else if ( (link.getAttribute(???class???) == ???cuiServiceLink??? ) ||
( link.getAttribute(???class???) == ???cuiServiceButton???) )
Now that the cuiServiceButton link class is ready to go, you need to add one last button to the
iProspector Contact panel to finish it off ??” a services button that automatically composes a reminder
email to the Contact.
Pages:
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203