HTML5 Development - Golden Rules
HTML5 Development - Golden Rules
1
HTML5 GOLDEN RULES
TABLE OF CONTENTS
1. Version Control ....................................................................................... 3
2. HTML5 Golden Rules ............................................................................. 4
2.1 Zip Structure .......................................................................................................... 4
2.2 Manage gestures and areas .................................................................................. 7
2.3 Personalize presentation with CRM data ............................................................. 12
2.4 Capture data during the presentation .................................................................. 15
2.5 Make dynamic presentation ................................................................................. 22
2.6 Display data elements captured during the presentation ..................................... 23
2.7 Include different types of contents ....................................................................... 25
2.8 Send presentation by e-mail ................................................................................ 30
3. Best Practices ....................................................................................... 39
4. Frequently Asked Questions? ............................................................... 39
5. References ........................................................................................... 46
5.1 Document References ......................................................................................... 46
6. Glosssary .............................................................................................. 47
2
HTML5 GOLDEN RULES
1. VERSION CONTROL
Author Date Version Description
CLM-Services 24/04/2015 1.0 First Version
3
HTML5 GOLDEN RULES
Zip structure must not contain sub-folder. Example: If you unzip “Sequence1.zip” it should not
contain a folder name “Sequence1”.
Follow the below steps to zip the content correctly
4
HTML5 GOLDEN RULES
5
HTML5 GOLDEN RULES
6. Then, you will get a zip folder. You will be able to upload this folder successfully now using MI
PC Online. Only HO user has the right to import sequence.
6
HTML5 GOLDEN RULES
In order to customize gesture, we need to atleast override any one of the 5 gestures available in
MI CLM by default. This can be done by following the below code.
<div data-prevent-tap="true">
...
</div>
There are five areas in the screen and each area is defined by its properties: top, bottom, left,
right. These properties are defined in pixels as shown:
In order to show the five areas, see the screen shot shown below.
7
HTML5 GOLDEN RULES
8
HTML5 GOLDEN RULES
#header
{
height: 61.44px;
width: 1018px;
color: white;
font-size: 24px;
text-align: center;
font-weight:bold;
display:block;
}
.header_color1
{
height: 61.44px;
width: 1018px;
background: rgb(22,157,218);
color: black;
font-size: 16px;
text-align: center;
font-weight:bold;
display:block;
border-style:solid;
border-color:rgb(22,157,218) rgb(22,157,218) white rgb(22,157,218);
}
Example:
#section-navigation
{
float: left;
margin-top: 0px;
height:639px;
width: 100.51px;
}
.section-navigation_color1
{
float: left;
margin-top: 0px;
height:639px;
9
HTML5 GOLDEN RULES
width: 100.51px;
background: rgb(22,157,218);
border-style:solid;
border-color:rgb(22,157,218) white rgb(22,157,218) rgb(22,157,218);
}
Example:
#aside
{
margin-top: 0px;
float: right;
width: 100.4px;
height: 639px;
}
.aside_color1
{
margin-top: 0px;
float: right;
width: 100.4px;
height: 639px;
background: rgb(22,157,218);
border-style:solid;
border-color: rgb(22,157,218) rgb(22,157,218) rgb(22,157,218) white;
background: rgb(22,157,218);
}
Example:
Area 4: Swipe left/right, pinching and double tap (Top: 84% Ymax, Bottom:
79.19% Xmax)
10
HTML5 GOLDEN RULES
#content
{
float:left;
width: 811px;
height:645px;
margin: 0px;
padding: 0px;
overflow: hidden;
}
.content_color1
{
float:left;
width: 810px;
height:645px;
background: rgb(22,157,218);
margin: 0px;
padding: 0px;
overflow: hidden;
background: rgb(22,157,218);
}
Example:
#footer
{
clear: left;
height: 61.44px;
width:1018px;
}
.footer_color1
{
clear: left;
background: rgb(22,157,218);
height: 61.44px;
width:1018px;
border-style:solid;
border-color:white rgb(22,157,218) rgb(22,157,218) rgb(22,157,218);
background: rgb(22,157,218);
}
11
HTML5 GOLDEN RULES
Example:
Inorder to personalize the presentation, customer’s information can be shown in the presentation
and this can be achieved by referring the above screen shot on Json structure.
The presentation has to be opened from the customer search page in MI Touch Offline, to show
the customer details inside the presentation. See the screen shots below.
12
HTML5 GOLDEN RULES
Screen Shot – 1: Customer search page – Before tapping the presentation icon
against the customer Abrams, Dominic.
13
HTML5 GOLDEN RULES
Screen Shot – 2: Showing list of presentations after tapping on the presentation icon
14
HTML5 GOLDEN RULES
This additional information refers to Agenda / Section item #8 “How to update MI data” in “MI
Touch - CLM Content Guidelines”.
15
HTML5 GOLDEN RULES
16
HTML5 GOLDEN RULES
17
HTML5 GOLDEN RULES
In order to save the call dialog to MI, the user needs to post the call by tapping
“PostCall” button. Please see the screen shots below.
18
HTML5 GOLDEN RULES
19
HTML5 GOLDEN RULES
20
HTML5 GOLDEN RULES
Screen Shot – 4: Records the questions and answers from the presentation in the call.
21
HTML5 GOLDEN RULES
While creating presentation, HO user has to activate the call dialog. See the screen shot
below for already activated call dialog. In case, it is not activated, link “Activate Call
Dialogue” is available.
In order to make a dynamic presentation, create a sequence like below and if user taps on ‘Yes’
option, it will navigate to one sequence and ‘No’, it will navigate to another sequence. This is
done through window.parent.navigateToSequence(id) function, where ‘id’ represents
‘Sequence Id’.
Also, in parameters/parameters.xml file, include <Links> tag like shown below. This is to establish
links between the sequences inorder to make it dynamic. Also, each of these sequences, should
have one unique Sequence Id
22
HTML5 GOLDEN RULES
This additional information refers to Agenda / Section item #8 “How to update MI data” in “MI
Touch - CLM Content Guidelines”.
This is to display the answers captured in the call dialog sequence to another sequence. This can
be done using the code window.parent.addData(id, value) function in the onclick or onchange
event.
23
HTML5 GOLDEN RULES
For example:
24
HTML5 GOLDEN RULES
This is additional information on how different types of contents such 3D Effects, Video and PDF
can be included in your presentation.
3D Effects
25
HTML5 GOLDEN RULES
Html5 coding
CSS3 coding
26
HTML5 GOLDEN RULES
27
HTML5 GOLDEN RULES
Video
This additional information refers to Agenda / Section item #5 “How to manage PDF” in in “MI
Touch - CLM Content Guidelines”.
In order to open pdf in the presentation, can use openPDF() function like shown below. This
function can be called on tapping a button or link.
28
HTML5 GOLDEN RULES
29
HTML5 GOLDEN RULES
In order to send an e-mail from each sequence, export/export.pdf should be present in the
sequence zip structure i.e. for email functionality, agency has to provide export.pdf.
By default, sample email template will be loaded to the tenant of all agencies. This is done
through "Compliant Field Email" module, which is used to provide covering letter while
sending email. Refer the screen shot below to see the "Compliant Field Email" module
from MI Touch and the sample email template.
30
HTML5 GOLDEN RULES
The sample email template has to be linked to the presentation in order to send emails. Refer
the screen shots below to see on how to link email template with presentation. Tap on the
arrow icon highlighted in the screen shot and tap on "Email" button. It will navigate to the
sample email template.
31
HTML5 GOLDEN RULES
32
HTML5 GOLDEN RULES
33
HTML5 GOLDEN RULES
Then, after opening the presentation from the customer search page, tap on the arrow icon
and then tap on the "Email" button to send email as shown in the screen shot below.
34
HTML5 GOLDEN RULES
It will navigate to the email template screen where the Rep user can see the Customer’s name,
Presentation name, Rep user’s name, date etc. making it a personalized covering letter. The
Rep user can tap on the "Envelope" icon, highlighted in the below screen shot to attach pdf
from each sequence and finally send email.
35
HTML5 GOLDEN RULES
Tap on the attachment text box as shown in the below screen shot to attach pdf from each
sequence. The Rep user can select the sequences, so that it will send pdf from only those
sequences, which are being selected. Inorder to enter email address of the customer, the
same can be done by entering email address below the customer name as shown below.
Finally tap on the "Done" button to send email.
36
HTML5 GOLDEN RULES
37
HTML5 GOLDEN RULES
38
HTML5 GOLDEN RULES
3. BEST PRACTICES
1. While developing pages, it’s advisable not to hard-code height or width values in pixels. Use
% as much as possible.
2. Never hard-code % for images, always use pixel.
3. Prefer converting images to PNG format for less file size.
4. Remove all unwanted images and JS files.
5. Make sure to add jQuery libraries only if required and also try to decrease its usage
6. Don’t call any scripts from the website directly; always copy the required scripts or libraries
in your JS folder.
7. Don’t write any inline styles in the HTML page.
8. Remove the empty <div> tags, if present.
9. Follow the naming convention for creating the sequences.
10. Make sure sequences are less in size.
11. Recommend to use Safari browser for testing, if you are developing for iOS
Answer: MI supports all the video formats which are supported by HTML5. Most of them
have used .mp4 format.
The video file should be part of the sequence zip structure. It is recommended to be
included under media/video folder. Please see the screen shot below from the “MI Touch –
CLM Content Guideline” for your reference.
39
HTML5 GOLDEN RULES
5. What is the maximum size of a PDF file that can be sent as attachment?
40
HTML5 GOLDEN RULES
Answer: If user wants to track number of button clicks in a sequence, this can be achieved
by using addAsset() function. The results can be retrieved from the predefined list "Event
presentation and product message". The HO user can see the predefined list by clicking
"List Builder" button in the Home page.
In the javascript file, the below code can be used to call addAsset() function.
The information will be captured in the predefined list. Refer see the screen shot below.
41
HTML5 GOLDEN RULES
10. When we have a button on the Zone 5 in presentation, we are not able to navigate to
the sequences using the MI bottom bar?
Answer: This is a known issue, you can use the below code as workaround.
$(function(){
//navigate to a different sequence
$('[data-sequence]').bind('click touchstart', function(e){
e.preventDefault();
window.parent.navigateToSequence($(this).attr('data-sequence'));
});
42
HTML5 GOLDEN RULES
$(function(){
//navigate to a different sequence
$('[data-sequence]').bind('touchend mouseleave', function(e){
e.preventDefault();
window.parent.navigateToSequence($(this).attr('data-sequence'));
});
11. I have installed the MI app and received the following message when syncing
‘Synchronization completed, your database is being created. Please connect later to
download’
Answer: This means that your Database is getting created, you need to wait for 20 minutes
and click on sync button again to download the DB and finish the process.
Answer: No, it is not possible. Only linking between one sequence to another sequence is
possible. MI will load only sequences, which are related to the current presentation into iPad
memory.
13. What could be the maximum recommended video size for MI platform?
Answer: There is no maximum size specified for MI platform. We use streaming so the full
video is not loaded into memory. Long videos should be avoided since time will not permit to
watch them and their size will unnecessarily overload the device memory.
14. Whether it is possible to reopen a presentation in a call that is not still finished?
43
HTML5 GOLDEN RULES
Answer:
The pages are defined as a child of the sequence node in the parameters.xml file
Example
window.parent.onEnterPage('page_2');
HO user has to associate each page-id with a key-message in the sequence screen
like shown in the below screen shot.
44
HTML5 GOLDEN RULES
If the rep has visited the pages, then it will get tracked in the MI Touch call page
once the user post the call from the presentation as shown in the below screen shot.
45
HTML5 GOLDEN RULES
5. REFERENCES
5.1 Document References
MI Touch - CLM Content Guidelines Version 1.5
Functional Description - CLM MI Touch Version 3.0
Functional Description - CLM MI PC Version 2.0
46
HTML5 GOLDEN RULES
6. GLOSSSARY
Terms Explanation
Presentation Grouping of one or more sequences that can be downloaded, presented,
and emailed in MI Touch.
Sequence A .pdf file or an HTML5 .zip file that supports various multimedia formats
(images, videos) and animations. A sequence could be a single piece of
content or multiple pieces of content.
Key Message Significant point about a product that can be associated with a sequence or
a page within a sequence
Call Dialogue Questions and answers specified within the sequence file.
List Builder Enables the user to create a variety of customized lists and to use these
lists to effectively target customers.
Predefined lists Extension of List Builder to allow users to create lists based on specifically
written SQL queries.
47