Best way to add validation ticks/cross in checkout /w autocomplete - checkout

What is: the Best way to add validation ticks/cross in checkout /w autocomplete
We are looking to add those green check marks or ticks to checkout fornfields when data entry is valid.
we add validation class to the form
add observer that calls validation.validate
(And validation.validate adds CSS class)
then we set CSS background for validation-passed class to green tick image in background
This works fine ... Until we turn in autocomplete. In google chrome the yellow background auto fill overrides any background.
So now what?
- use CSS::after?
- use jquery after to add span class?
- try to outsmart google chrome
Any experiences to share on programming green ticks and red crosses on checkout form template?
Help appreciated

Take a look at Google Chrome form autofill and its yellow background
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px white inset;
}
You may need to add 3 variations (normal - on site load, validation pass and validation fail)

Related

How to change color of MS Fabric control /button without affecting hovering affect

I am using Microsoft Fabric UI for build my Office WebApp:
http://dev.office.com/fabric/components/button
I want to change the color of a button, but if I change the color of it using some CSS, hovering effect is lost. What is the right way of changing the color of Microsoft Fabric controls?
Even I've had that question for more than a week now. It just seems like no one from the Office Fabric Teams (or even just those who know better) want to answer questions.
If you colorized your button manually using CSS, then just add the :hover to the CSS class like so:
.btn-color-red {
background-color: #FF0000; /* red */
}
.btn-color-red:hover {
background-color: #b50000; / * a darker red when hovered upon */
}
I apologize for this manual solution. Even I don't know how to do it using just Office Fabric classes and there are just no useful documentations out there.

Disabling Vaadin Errorindicator

I'm using validators on several TextFields, which causes to show a popup next to them. As far as I found out, this is realted to the Vaadin errorindicator.
I now want to disable this popup-message, because it creates unhandy behaviour when it comes to using the application on tablets, e.g. an iPad. I already created a separate label showing the error-message and set the errorindicator to hide using CSS as follows:
.v-errorindicator { display: none; }
The pop up keeps showing anyway. Does anyone know how to disable the popup irrevocable?
Thanks, Hendrik
You should cover the validators with try-catch blocks, in the catch block you can remove the errorstyle with yourTextfield.removeStyleName("v-textfield-error"), also the pop-up won't show.

Reduce initial load time - google web designer

We are developing some ads using google web designer tool
so far its good but one main issue with it is, slow loading.
its taking almost 3 seconds to load and we feel very bad about that.
can anyone know how to optimize it?
thanks.
In developing html5 banners, by default the 'polite load' is checked.
Which means you banner will not be visible and will not load until the page is loaded.
And when testing your banner, there is some moments before showing the banner to simulate the webpage load.
Why?
Because no publisher(Website) allows you to make their website slow. That is the rule. There is no way for you to force yourself to show first on a publisher website.
If you want this option. You should directly talk to the publisher/ when you get approval from them, you can uncheck 'Polite Load' when you are publishing your ad. Then your banner will show faster without any delay.
#cnu - I have experienced the same issue. The only workaround I have at the moment is to set an initial loading image - while the Ad is loading
Try adding a div with an ID of 'loading' immediately after your opening body tag.
<div id="loading" class="loading-image">
<img src="default.png"/>
</div>
Then find the following function, and set the div to block display
function handleDomContentLoaded(event) {
// This is a good place to show a loading or branding image while
// the ad loads.
document.getElementById('loading').style.display = 'block';
}
Then find the following function, and set the div to none - to hide the image after loading
function handleAdInitialized(event) {
// This marks the end of the polite load phase of the Ad. If a
// loading image was shown to the user, this is a good place to
// remove it.
document.getElementById('loading').style.display = 'none';
}
The official GWD instructions don’t match the functions actually generated in the source, which initially made this setup confusing. The code comments in the source indicate these are the correct functions to use. You can use the first frame of the Ad as the loading image, rather than a loading gif - so the user experience isn't affected too much.
Hope this helps.

TinyMCE4 icons not displayed when web font downloading disabled

Our product is used by many corporate and government bodies.
Many of them are only allowed use IE and have security policies applied to their IE which they are not allowed adjust.
One such setting is the disabling of downloading web fonts.
We have work around in place to check if the font can be downloaded.
If not, we replace all <i> on the page with <img>.
var haveFont = detectFontIcons();
//Iterate over each icon on the page and replace if necessary
if (!haveFont)
$('[class^="mce-i-"]').each( function(e) {
console.log("Found element = ", this);
// Replace all <i></i> with <img>
....
}
}
This works fine for all our custom Html.
The Problem:
For some reason it will not work for tinyMCE <i> tags.
I have adjusted the class prefeix to allow for the TinyMCE 'mce-i-'.
It finds no elements in the DOM with 'mce-i' even though I can see them using firebug.
I have even set a timeout on the call to do this check, incase it was an issue with the DOM not been fully rendered yet. No luck.
Questions:
1: Any ideas on why no TinyMCE elements are not been found?
2: How can I update tinyMCE to use images directly instead of web fonts?
Thanks
I can't take credit for this, but I found a font-free, custom skin that replaces the fonts with images. I added the skin, updated my init method and it appears to work as I'd hoped.
It can be found here:
- https://pollyshaw.wordpress.com/2014/02/03/a-font-free-skin-for-tinymce-version-4/
- https://bitbucket.org/pollyshaw1/tinymce-4-lightgray-no-fonts-skin

Google chart API styling tooltips

Is there a way to style Tooltips in Google chart API? I've managed to only change the color of text using tooltip.textStyle. So is there any solution to change the white background to some other color (as shown on picture):
Test playground http://jsfiddle.net/nyNAg/
I found a solution through serendipity:
<style>
path {
fill: yellow;
}
</style>
Anyway, I did not find any configuration option for background in the google charts API.
Enable the tooltip to be handled by the HTML by writing this code in your options of google charts
CODE: tooltip: { isHtml: true } (,) add a comma if needed. :)
Now you can style tooltip using HTML and css. :)
/CSS Styling/
To style the tooltip box :
div.google-visualization-tooltip {}
To style the content like font size, color, etc
div.google-visualization-tooltip > ul > li > span {}
Use !important whenever needed ;)
http://jsfiddle.net/nyNAg/66/
It's possible to completely replace the label with custom HTML. It's maybe a bit complicated, but gives you full control of the content and style. See https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#custom_html_content
As the Google Chart Tools API implements its SVG charts via an iframe hosted on it's servers, as per the Same Origin Policy you may not access or modify the content of another domain, unless via server-side manipulation prior to sending the client a response.
Given that, I'm not sure how you managed to change the text colour - perhaps a browser bug?
Another option might be to override inline-style rules e.g.
li.google-visualization-tooltip-item span[style] { font-weight: normal !important; }
http://css-tricks.com/override-inline-styles-with-css/