What is _Layout.es5.js? - javascript

I am working on an asp.net MVC project.
I noticed that there are 2 files in my script folder (can't remember how they got added, but I don't seem to be using them):
_Layout.es5.js
_Layout.es5.min.js
They never show up in Visual Studio, even when I choose 'Show All Files' options.
What are these files? Why don't they show up in Visual Studio? And should I delete them?

You can check if a script files are used anywhere in the project (js, css or any script/content file). You can follow the following steps:
In visual studio press Ctrl + Shift + I then search for _Layout.es5.js or _Layout.es5.min.js. Use the "Find all" option for faster result
Also do a search with partial name like _Layout.es
Your file might be referenced dynamically which will not show up in the previous search. If no reference was found in the previous search then from the browse check if the file is downloaded on any page by browsing the pages and inspecting which files are downloaded.
For example on Google Chrome open the Developer tool, Then check the Disabled cache and the js check boxes so that you can check the JS files only.

Related

How to reduce a unuse css file?

I am using bootstrap to build a mobile web page
only one page and use some of the bootstrap css and js code but I have to hold all the css and js.
since I only use some of it I want to reduce the unused css style and js code to reduce the file size
how to do it?
I mean if I only use the modal of the bootstrap how to reduce the css of col and alert and other css I do not used?
I'm not fully sure if this question really belongs here, but there is an answer to the question.
You can use Bootstrap's site to customize which elements of bootstrap you want and do not want, downloading a file with only the bits that you would like to keep.
This is available here: https://getbootstrap.com/docs/3.4/customize/
To read about it, go to their : https://www.labnol.org/internet/remove-unused-css/28635/
Remove Unused CSS from the Stylesheet
Here’s how you can easily find all the unused selectors in your CSS files in Google Chrome:
Open any page of your website inside Google Chrome and then launch the Dev Tools available under File -> Tools -> Developers Tools.
Click the Audits tab inside Dev Tools and select the “Web Page Performance” and “Reload Page and Audit on Load” options. Now click the “Run” button to begin the CSS audit process.
On the results page, expand the “Remove Unused CSS Rules” group and select the CSS file(s) that are linked from your site. You may ignore the CSS files added by social plugins and widgets since you do not have control over them.
Here you will get a sorted list of all styles that are defined in the CSS file but not used anywhere on the current page.
You can copy and save the results in a text file and repeat the steps for couple of other pages on your site. This is essential as not all selectors may be used on all pages. You can find the count of various selectors in the combined resultset, maybe using Google Sheets, and the selectors with the highest count can probably be “safely” removed.
read more this link
Chrome DevTools has coverage tool. It identifies which code is useful and which is not. I used it to reduce my css file from ~25K lines to ~2.3k lines.
Read more here: https://developers.google.com/web/tools/chrome-devtools/coverage

Removing google translate icon on .chm pages

I have a large number of (300+) help pages. The web version should display the Google Translate dropdown menu, but when these same files are used offline (in Windows help .chm files) the dropdown should be hidden. Obviously I would not want to maintain two separate help files.
So I have my Google Translate code inside a called and created a style sheet that tells the page whether or not to show the translate dropdown (web) or hide it (local file). This works pretty well, except that I get the Google Translate icon on my local .chm files.
Like I said, the dropdown is not displaying on these local pages, just as expected, but how can I get rid of the icon? Interesting, too, that this image (untitled.png) shows up with or without the style sheet enabled.
BTW, I am talking about the bigger, blue image, not the Google"G" right in front of the dropdown.
without dropdown
with dropdown
Thanks for your time!
You can ensure that the CSS files are compiled into the help file by adding their names to the [FILES] list in the project (.hhp) file in two ways.
You may add the *.css filename(s) by editing the *.hhp file with a plain text editor or to do this with HH Workshop:
Open the .hhp file in HTML Help Workshop. 
Click the Add/Remove Topic Files button on the Project tab.
In the Topic Files dialog box, click Add.
In the File Name field at the bottom of the Open dialog box, type *.css (or e.g. *.jpg)
Browse to the directory that contains the files (or e.g css), and then select them.
Click Open, and then click OK to close the Topic Files dialog box.
Additional information:
The help compiler automatically pulls into the help file all graphics that are referenced in elements via the "src=" attribute. For graphics that are referenced by other means, such as in a script or style sheet, you must use the above workaround to ensure that they are compiled into the .chm file

HTML file not working in Browser

I have created a simple - HelloWorld.html Webpage with HTML, JavaScript, CSS.
When I run it from Eclipse IDE, It works perfectly on browser.
What it does is like: the page has 5 buttons,
and hellow World is displayed from 5 different <div>'s
that remains hidden and appears as inline after button click.
When I navigate to the work-space and try to open the HelloWorld.html file in browser manually, nothing comes correctly.
All properties: positions and bgcolors etc declared in external css file has no effect on browser.
I know it sounds stupid, but I'm just hating myself for this.
Does anyone know why is it behaving in this way?
PS:
1. I have no Server-side scripting in the file.
2. HTML, JS, CSS are different file.
My best guess would be that you are trying to use the css file with a realtive path, which changes when you don't host it temporarily as eclipse IDE does.
First, open the developer toolbar (f12) & check the network tab to see if the css file is being loaded at all.
Try using an absolute path instead & see if it changes anything.
In my Exp. i have seen this kind of problems many times, the Inbuilt browser of eclipse some times does not support all features especially when you doing like designing purpose.
you can use MS-IE 6 or Above version for same.
or you can try some other browsers like:- Mozilla,Chrome etc.
because it has features for developers for scripting , div , css and many more . so u can check with them.
Thanks,
Arvind
It's because of file manager from which you have opened.
You just need to see the link in browser.
If it has a "content//:" in start then the css or JavaScript file you have linked in the HTML will not work.
What you need to do is change your file manager or create link manually.
To create a link manually you should use "file///:"in start for example if your file is in download then you should use something like that....
file:///storage/emulated/0/Download/My%20Web/index.html
Or you can use ZArchiver file manager and go to your file and use open with option to open file in browser.

TODOs in javascript files not showing up in Task list

For some reason the TODO Tags i added to my .js files are not showing up inside the Tasks View. I've already made sure, that the "TODO" tag itsself is set under Task Tags for javascript but thei're still not showing up in the list. I've made a filter for the view to show all Tasks in the working set i'm using but nothing is there.
nitind's answer is perfect. I would like to make it comprehensive.
Right click the project & select properties. In 'Builders' , select 'JavaScript Validator'.
Similarly, to parse tasks in HTML, CSS & XML files, goto Preferences->General->Editors->Structured Text Editors->Task Tags and click 'Enable searching for Task Tags'
NOTE: The answer is validated only in eclipse indigo (3.7.1)
You must have your files in JavaScript Source Folders within a project and be running the JavaScript Validator Builder (or having it installed and automatic builds enabled).

Trigger TinyMce File uload

I am using TinYMce WYSIWYG editor, It is working fine. I am using OpenSource product without MCFileManager, instead files/images are uploaded via TinyBrowser which is included.
Now I need to trigger this pop-up window where I can browse files to upload from element.
Is there any way to do that via upload files?
P.S Maybe there is a way to get that MCFileManager for free or some kind of license?
You can find the available licences and prices here, you won't get it for free (at least not leagaly).
I never used TinyBrowser, but i am sure you could write your own Tinymce plugin and include your own button to trigger the TinyBrowser.

Categories