About opening of links in new tabs or browser windows (Features)

by Auge ⌂ @, Monday, October 26, 2020, 11:19 (358 days ago) @ Micha


One further question about the issue of readable code. The main.min.js has only half the size of the main.js (25 versus 50 kB)....

We can omit to compress the sources for CSS and JS files. I believe, 50 kb is not a traffic problem (today) and these files are (usually) cached by the browser.

The file size of 50kB/25kB/4.5kB (to name also the other script files) does not seem to cause much traffic but for users with a data limit (i.e. per month) every bit counts. The second argument (browser cache) fits IMHO much better.

Isn't it time to tidy up the code from compatibility … errr … legacy code for long dead browsers so we could minify the JS-code without minifying it?

Most of the file size comes from comments and not from the code itself.

I thought, indentation and line breaks (that got removed in the minified code) and also the variable names (that got shortened (often to a single char)) would save more file size. But I havn't counted and compared.

To reduce the size, it is more reasonable to remove such comments than to look for some dead codes. Moreover, I'm not up-to-date which browser supports a function and which one not.

Code that you call "dead code" is the target of my consideration. The forum code (especially the JS-code) keeps compatibility to (for example) IE down to 5.anything (afaik).

[getElementsByClassName] … For this example: all modern browsers support this function and the code can reduced.

This is a good example. You rebuilt the functionallity for browsers with no support for getElementsByClassName (as shown in your code example). CanIUse? tells us, that this method works beginning with IE9 and FF3. Other browsers seem to had support from the beginning, so there's no problem with them.

Now to the latest versions with no support. FF2 is dead, so it's no problem at all. IE8 is the latest IE-version that was released for Windwos XP. Anyone who use Windows XP with an internet connection nowadays is stupid, foolish and a gambler in relation to system security and has the alternative to use other browsers that are not so stone-age (same argument is valid for the OS). Additionally Windows XP is outdated and gets no support since more than six years. So we should not cosider to support ist.

Which version is your preferred version that we should support?

I propose to remove the support for IE of version lower than 9 in our JS-scripts. All other browsers get updates very often so we can assume that all browsers (beside from IE) are more or less up-to-date. On the other hand we should keep the comments, especially if we do not minify the code. In this case we will have only the one script file (for every use case) and the comments enhances the understandability of the code.

Therefore we should also translate the comments to English language (many comments are in german language).

I will open a dedicated PR for the HTML code adaption today.


Do you also create a PR for the user_settings and the corresponding changes in PHP/MySQL?

Yes I will.

Tschö, Auge

Trenne niemals Müll, denn er hat nur eine Silbe!

Complete thread:

 RSS Feed of thread

powered by my little forum