Creating a Progress Bar for an email - html-email

I have created a progress bar which changes by adjusting the width. It looks like this:
Progress bar code:
<tr>
<td valign="top" class="textContent" style="background-color:#65b9a6;text- align:center;color:#FFFFFF;font-size:20px;padding-top:5px;padding-bottom:5px;" >
100%
</td>
</tr>
<tr>
<td valign="top" class="textContent" style="font- size:16px;color:#616161;padding-top:10px;" >
</td>
</tr>
I really like the look and feel of the progress bar above, but I am looking for a way to adjust the progress of the bar through an API, which I think could be done with the code below as it can be adjusted based on progress such as: https://www.w3schools.com/TAgs/tryit.asp?filename=tryhtml5_progress
Is there a way to incorporate both these codes to create a better progress bar?

Not sure what you're asking. If you want to modify the progress bar as result of an action, you can run this JavaScript code every time you want to update the progress:
document.getElementById("elementName").style.width = "100";
(In which elementName is the name of the ID assigned to the green portion, and "100" is the width of the progress bar)
If you have text, you can update it like so:
document.getElementById("elementName").innerHTML = "Text";
(In which elementName is the name of the ID assigned to the text element, and "Text" is the text you want it to display)
If you use the progress element, you can update it like this:
document.getElementById("elementName").value = "100";
(In which elementName is the name of the id assigned to the progress element, and "100" is the amount completed in relation to the max value assigned in your HTML.)
If you want it to be a static animation that fills up over a static amount of time, you can animate it using CSS:
#elementName {
animation: progressFill 1s;
}
#keyframes progressFill {
from {width: 0%;}
to {width: 100%;}
}
(In which #elementName is the name of the id assigned to the green portion, progressFill is the desired name for the animation, and 1s is the length of the animation. This is, of course, assuming that width: 0%; and width: 100%; provide the desired results.)
I hope this helps.

Related

How to bind string properties from object in repeat.for

I have a list of arrays in a table displayed using repeat.for. I need to display tr row in blue color when "receiving.supplier === Scrap Separated" and blue color row when the result is "receiving.supplier === Scrap Sorted". Is there any way I can do it with if.bind but for String that I got in network tab. Here is my network and code.
I think this is purely a CSS question. You can have CSS rules based on [data-supplier] and assign a different background color based on the value of the supplier property.
The example CSS rules can be as follows.
tr[data-supplier="Scrap Separated"] {
background-color: blue;
}
tr[data-supplier="Scrap Sorted"] {
background-color: green;
}
And then bind the data-supplier property in the markup.
<tr data-supplier="${recieving.supplier}">
...
</tr>
Note that you cannot possibly nest div directly under tbody as that will be evicted by browser being non-conformed element as per the expected schema.

Is it possible to Style Angular-Strap TypeAhead

I am using AngularStrap, (TypeAhead), trying to make the substring in the matched items to stand out, like either make them bold (like jquery autocomplete) or change the background of the characters ta different color
California
Technical
I thought this should be possible by changing css (if I know they have a selector for the matched substring) Or use of template/$templatecache
no luck so far
EDIT: In this plnkr I can see the drop down menu items have user input highlighted/bolded but cannot see why and how it happens:
<input type="text" class="span3" ng-model="typeaheadValue" bs-typeahead="typeahead">
plnkr -> http://plnkr.co/edit/Yjff9DiLnGqi2x1E5D2q?p=preview
The typeahead dropdown menu items can be styled through .dropdown-menu a. Matched text is regexed' to <strong>match></strong> i.e style those through .dropdown-menu a strong. Example :
/* style the dropdown items */
.dropdown-menu a {
font-family : 'courier new';
font-size: 110%;
}
/* styling matched text */
.dropdown-menu a strong {
color: white;
background-color: red;
}
forked plnkr -> http://plnkr.co/edit/LpdRiH9DxeRiAib3MOnn?p=preview

Sending Personalised RSS to EMAIL campaigns using Mailchimp

I've got a custom RSS feed set up for each user so that the user's email_address can be used as a parameter. e.g., www.website.com/feed/personal?user_email=test#email.com
If I code this URL in my MailChimp campaign using the |FEEDBLOCK:URL| MERGE tag, I'm able to retrieve posts and create an RSS newsletter for the recipient.
However, when I try to make the URL dynamic by combining it with the |EMAIL| merge tag MailChimp is unable to retrieve the posts.
|FEEDBLOCK:www.website.com/feed/personal?user_email=|EMAIL||
Instead, when I get the test email I just see the FEEDBLOCK tag in the email body (along with the EMAIL tag) as shown below.
|FEEDBLOCK:www.website.com/feed/personal?user_email=user#email.com|
I've read on another StackOverflow chain that Mandrill (and I assume MailChimp as well) cannot process nested tags. So I'm wondering whether there is another way for me to harvest the value of the |EMAIL| tag and assign it to a variable before the |FEEDBLOCK:URL| tag gets processed so that I can reference the variable rather than the EMAIL merge tag in the FEEDBLOCK:URL tag instead?
e.g.,
<%>emailAddress = *|EMAIL|*</%>
*|FEEDBLOCK:http://www.website.com/feed/personal?user_email=<%emailAddress%>|*
In short, I'm trying to figure out how to assign a Mailchimp merge tag value into a variable and then use that variable as part of another merge tag, in lieu of nesting merge tags, which apparently cannot be done.
(p.s., In case its confusing, I just want to clarify that for some reason asterisks are not showing up in the above text but I do have all the merge tags enclosed within asterisks)
I've been trying to do this exact same thing. You can do this in ExactTarget quite simply as detailed here.
Basically, once you have your custom RSS feed URL done, you create something called a content syndication link. For you, it would look like this:
%%httpget "www.website.com/feed/personal?user_email=[Email Address]"%%
Please note the square brackets around the term "Email Address". The brackets tell the system to replace the brackets and the content inside with whatever that term happens to reference (in this case their email address). You could swap it out for their first name, last name, wp user id...whatever you happen to have stored within your subscriber(s)' data.
Inside the content of your email, you will need to reference this link in order to dynamically generate your content, which will be unique for each user. Here's that:
%%[Var #xml, #titles, #title, #descs, #desc, #links, #link, #cnt
Set #xml = ContentAreaByName("my contents\RSSParse\RSSParse") /* This line specifies the content area from which the RSS content will be pulled for the email message. */
Set #titles = BuildRowsetFromXML(#xml,"//item/title",1)
Set #descs = BuildRowsetFromXML(#xml,"//item/description",1)
Set #links = BuildRowsetFromXML(#xml,"//item/link",1)
If RowCount(#titles) > 5 THEN
SET #rows = 5
ELSE
SET #rows = RowCount(#titles)
ENDIF
IF #rows >= 1 THEN
for #cnt = 1 to #rows do
Set #title = Field(Row(#titles,#cnt),"Value")
Set #desc = Field(Row(#descs,#cnt), "Value")
Set #link = Field(Row(#links,#cnt), "Value") ]%%
<div style="border: 1px solid #444; background-color: #F7F7F7; margin: 0.76em 0; padding: 0.76em;">
<h1 style="font: bold normal 1.0em Arial, Helvetica, sans-serif;">%%=v(#title)=%%</h1>
<span style="font: normal normal 0.76em Arial, Helvetica, sans-serif; color: #444;">%%=v(#desc)=%%</span>
</div>
%%[
NEXT #cnt
ENDIF
]%%
To clarify, the following code found above limits the amount of posts to pull to 5:
If RowCount(#titles) > 5 THEN
SET #rows = 5
ELSE
SET #rows = RowCount(#titles)
ENDIF
And the following, again found above, is where the content for the email is output and thereby available to allow you some customization of the look and feel:
<div style="border: 1px solid #444; background-color: #F7F7F7; margin: 0.76em 0; padding: 0.76em;">
<h1 style="font: bold normal 1.0em Arial, Helvetica, sans-serif;">%%=v(#title)=%%</h1>
<span style="font: normal normal 0.76em Arial, Helvetica, sans-serif; color: #444;">%%=v(#desc)=%%</span>
</div>

How to: Fixed Table Header with ONE table (no jQuery)

I know, there are at least 3 dozen questions like this on stackoverflow and still, I could not make this happen:
A simple table where thead is sticked/fixed at the top, and the tbody is scrolled.
I tried so much in the past days and now I ended up here crying for help.
A solution should work in IE8+ and newest FF, Chrome & Safari.
The difference to other "possible duplicates like this one is that I don't want to use two nested tables or jQuery (plain javascript is fine though).
Demo of what I want:
http://www.imaputz.com/cssStuff/bigFourVersion.html.
Problem is it doesn't work in IE, and I would be fine to use some JS.
Ok i got it:
You need to wrap the table in two DIVs:
<div class="outerDIV">
<div class="innerDIV">
<table></table>
</div>
</div>
The CSS for the DIVs is this:
.outerDIV {
position: relative;
padding-top: 20px; //height of your thead
}
.innerDIV {
overflow-y: auto;
height: 200px; //the actual scrolling container
}
The reason is, that you basically make the inner DIV scrollable, and pull the THEAD out of it by sticking it to the outer DIV.
Now stick the thead to the outerDIV by giving it
table thead {
display: block;
position: absolute;
top: 0;
left: 0;
}
The tbody needs to have display: block as well.
Now you'll notice that the scrolling works, but the widths are completely messep up. That's were Javascript comes in.
You can choose on your own how you want to assign it. I for myself gave the TH's in the table fixed widths and built a simple script which takes the width and assigns them to the first TD-row in the tbody.
Something like this should work:
function scrollingTableSetThWidth(tableId)
{
var table = document.getElementById(tableId);
ths = table.getElementsByTagName('th');
tds = table.getElementsByTagName('td');
if(ths.length > 0) {
for(i=0; i < ths.length; i++) {
tds[i].style.width = getCurrentComputedStyle(ths[i], 'width');
}
}
}
function getCurrentComputedStyle(element, attribute)
{
var attributeValue;
if (window.getComputedStyle)
{ // class A browsers
var styledeclaration = document.defaultView.getComputedStyle(element, null);
attributeValue = styledeclaration.getPropertyValue(attribute);
} else if (element.currentStyle) { // IE
attributeValue = element.currentStyle[vclToCamelCases(attribute)];
}
return attributeValue;
}
With jQuery of course this would be a lot easier but for now i was not allowed to use a third party library for this project.
Maybe we should change a method to archieve this goal.Such as:
<div><ul><li>1</li><li>2</li></ul></div> //make it fixed
<table>
<thead>
<tr><th>1</th><th>2</th></tr>
</thead>
<tfoot></tfoot>
<tbody></tbody>
</table>
Of course, this is not good to sematic.But it is the simplest way without js or jq.
Don't you think so?

GWT background image

I am using gwt for showing a dynamic image inside a td and the image is coming from a imagebundle but its showing the whole big image, which gwt makes during compilation, inside that td rather than showing specific part from that big image. I don't know what I am missing here... The problem is the image will be added and selected dynamically and I can't define a css everytime I add an image. If anyone of you can help me regarding it. Here is my code
My table cell is defined inside the UiBinder something like....
<ui:style>
.colourPickerCell {
background-repeat:no-repeat;
}
</ui:style>
<tr>
<td class="{style.colourPickerCell}" ui:field="colourPreviewSlot" rowspan="3" width="50%"></td>
</tr>
Function inside the presenter class:
public void newColorSelected(Image patternImage) {
Style patternImageStyle = patternImage.getElement().getStyle();
Style style = getColourPreviewSlot().getStyle();
style.setWidth(patternImage.getWidth(), Unit.PX);
style.setBackgroundImage(patternImageStyle.getBackgroundImage());
style.setLeft(-patternImage.getOriginLeft(), Unit.PX);
style.setTop(-patternImage.getOriginTop(), Unit.PX);
style.setHeight(patternImage.getHeight(), Unit.PX);
}
When I debug my code I get the html for patternImage object as:
<img id="..." style="backgrond:url(....) no-repeat -149px 12px;"/>
Best regards,
If you are using this image as a background sprite, it think you have to use background-position css property to "move" your image "behind" the td.
"left" and "top" properties are relative to the element you set the style on, not its underlying background image.