I used Coverage to identify unused CSS and JavaScript Code on my landing page. This helped tremendously to reduce loading times. But now I experience the problem that when I view my page on a small device there seems to be missing css code (or javascript code not sure about that) for a drop down menu which should transform into a burger menu.
So my question is how does coverage calculate code which is not used. Does it do this just with the current browser view (which probably does not use all css code in case of responsive design?)
If this is true how can I find out whats really not used. Try various resolutions and run coverage several times?
Anyone experience the same problems?
The coverage panel is "live", as you use the page more CSS and JS will be used.
What I mean is that when you first load the page all of the CSS and JS required to render and make interactive that initial view will be highlighted as green and needed. If you then opened your menu that CSS would turn green as it was used. If you never open your menu with the coverage panel running it will not count the CSS as needed.
So because your menu CSS code was not needed when you ran the coverage panel and you removed the CSS for the menu you obviously will have issues.
You are kind of misusing the coverage panel, it is more intended to help you optimise your critical CSS or to find libraries that are completely unused.
If you want to use it to identify CSS and JS that is not used at all you would have to resize the screen to every break point (to account for different screen sizes and the different layouts you use for mobile, tablet etc.), open every menu item, tab to all areas of the site, fill in all the forms, both correctly and incorrectly etc. to ensure all states were covered and the relevant CSS and JS was used.
If you did manage to successfully do the above, that would show you the coverage for one page, but what about other pages? You would have to repeat the process there to ensure you haven't removed a needed style. As you can imagine this is not likely to be successful without mistakes!
Instead you should use the coverage panel to identify items that are required for "above the fold" content as this means you can inline any critical CSS and JS within your initial page HTML and get sub 1 second First Contentful Paint etc. (Yet again you need to resize the screen here to account for different breakpoints, but you do not need to open menus etc.)
Don't use it to try and identify things that aren't used unless you are absolutely certain they will not be needed (for example if there is a whole library included by mistake that does not get used, you can safely remove that.)
Related
I noticed that the report's designs preview and printed are different.
I found it that all of the reports are the same.
So I tried to create new test report and notice that background colors are not rendered on print.
How too keep the design when printing?
Design:
+++
Printed:
By default Reports are rendered in HTML mode. As is often the case with HTML, the report as seen in the browser uses a different CSS style then the one sent to the browser print dialog. I'm pretty sure the reason for this is to accommodate printer technology. Printing solid dark backgrounds uses up a lot of ink and text is more legible when it's black text over a white background.
With HTML rendering, browser view and print preview differ to accommodate printer limitations:
HTML was never meant for accurate rendering anyway so I think the CSS change is for the better but if you want exact result just switch to PDF mode which is meant to provide accurate rendering. Print preview should match very closely the PDF rendering in browser when the report is displayed in PDF mode:
It can get tiring to manually switch to PDF each time by clicking the rendering mode button so you can change the default mode in the report configuration:
It is also possible to edit your custom reports or the standard ones so they default to PDF rendering in the browser instead of the current HTML default:
To edit report you will need to install Acumatica Report Designer (it is in Acumatica ERP Windows Installer) and use the EDIT REPORT button and then use Save to Server file menu item in the report designer to save the report modifications:
Have you checked the Background Graphics checkbox in the printing dialog of your printing preview program? It's primarily in the More Settings section.
Please find below example for Google Chrome's dialog:
in case that you have no choice and had to do css image resize (in my case about 20% smaller than natural image size) browser addons like Hoverzoom for Google Chrome, or Thumbnail Zoom Plus for Mozilla would show popup when you hover over that images.
I want to prevent that behaviour because it totally change user experience in one my UI form.
I understand that there is options to analyse all that addons and how they works, eg. use some event (onmouseover/mouseover) steal src tag - analyse - add some layer, id, class...
Eg. inside Hoverzoom addon for Google Chrome we can find some parts like:
z-index:2147483647
or
$('<div id="hzImg"></div>').appendTo(document.body);
and temporarily solution to disable only that addon is to hide that layer with
#hzImg{display:none!important;}
but it's not way to go because there is many addons like that.
My question is what is your opinion, or solution how to prevent all that browsers type addons to show popups when user mouse hover over css resized images?
Thanks.
I am developing a chrome extension that would like to add a tab at the bottom of the page to manipulate DOM elements. Chrome 'manifest.json' file doesn't provide such feature. So how to do it or rather how does Firebug add a tab at the bottom of the Chrome?
I would suggest inserting a panel in every page through a content script. You can style it in order to appear at the bottom of the page and be always visible.
In order for it to retain its state between navigation from one page to another, you need to persist it some how (example use chrome.storage or a similar mechanism through the background page to persist the content (or whatever you need).
See this answer on how to insert (and style) a toolbar-like div or iframe in a page through a content script. (It is fixed to the top of the page, but you can easily modify the code to fix its position at the bottom.)
Iwould like to add a button at the end of a listView in the same way as the bing apps do (see picture for example).
I looked for hours in google and in the microsoft documentation but canøt find anything that can give me an idea of how to do this.
Did anyone achieved this?
thanks
If you run that app (Health & Fitness), then run Visual Studio and use Debug > Attach to Process, you can open the DOM Explorer and examine how that UI is implemented.
What you'll see in this case is that it's not using a ListView at all, but rather it's own custom control that's just based on a CSS grid. That is, just because there's a grid-like view doesn't mean it's a ListView. You can always use straight HTML/CSS layout to achieve these sorts of things, which is all that's happening here. As such, it just makes separate div's for those two "More" elements.
Now if you do want to use a ListView, there are a few things you can do. First of all, if you want to render any item in a ListView differently than others, you have to make sure to use a different template. What this means is that you use an item rendering function rather than a declarative template, which then enables you to examine the item data and programmatically decide what kind of rendering to perform.
Second, if you want to have items of different sizes, then you need to use cell spanning. In Windows 8.0/WinJS 1.0 this is a property of the GridLayout. In Windows 8.1/WinJS 2.0 you instead use the CellSpanningLayout.
I have all the details for both rending functions and cell spanning written up in Chapter 7 of my second edition preview of Programming Windows Store Apps with HTML, CSS, and JavaScript, which is a free ebook from Microsoft Press so it doesn't cost you anything. :)
I've created a nav menu like in the screenshot below. It spans the entire width of the container and the left/right padding of each menu item is constant. This was easy to do by hardcoding the left/right padding in the CSS, but I want the paddings to be able to change as the site admin edits the menus.
Is there a way to do this with pure CSS (CSS3 is okay)?
This was easy enough to do with jQuery (I totaled up the width of the menu items and calculated the necessary padding). But I ran into some issues on some browsers due to our use of Google Web Fonts. On Chrome and Firefox 4 on Windows (not on Mac), the web font was not loaded at the time that my script ran, resulting in incorrect width measurements. I tried running the script in the jQuery's DOM ready event and in the Google Font API's active event. The active event worked in Chrome but in Firefox 4 it was often fired before the font had been applied.
Thanks in advance.
Here's a jsfiddle of a potential different solution.
Using that layout, and assuming the number of menu items is going to change, you call a recalculation method once a list item is added/removed. In this example provided, I've used YUI3 to do the DOM manipulation, but you could do that a number of ways. Note - I didn't test the javascript function, its "probably working pseudo code".
(You may need to make subtract a further 2% or so from the list item widths, if you're trying to deal with IE6/7)
Use jQuery's .load event as suggested by user thirtydot.