? Success

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
13 Mar 2015

Set the file to "use strict" which immediately revealed a couple of bugs.
There's no JS coding style standard but I reformatted to be similar to Joomla's PHPCS standard
Added docblock style comments
Moved the browser feature sniffing out of the class so that it only executes once instead of once per form.

There are more things that could be improved in this file but this should do for now.

avatar okonomiyaki3000 okonomiyaki3000 - open - 13 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 13 Mar 2015
Labels Added: ?
avatar okonomiyaki3000
okonomiyaki3000 - comment - 13 Mar 2015

Oh! thanks!

avatar okonomiyaki3000
okonomiyaki3000 - comment - 13 Mar 2015

Hmm. Why is our PHP standard like:

if ($something) 
{
    doSomething();
}

But our JS standard like:

if (something) {
    doSomething();
}
avatar brianteeman brianteeman - change - 13 Mar 2015
Category JavaScript
avatar Fedik
Fedik - comment - 13 Mar 2015

Because different languages, with different history, I guess :wink:
and

if ($something) 
{
    doSomething();
}

in javascript looks not good (from my point of view), it like use in css:

.style
{
   color: #fff;
}
avatar wilsonge
wilsonge - comment - 13 Mar 2015

Because the PHP standard is our own whereas like 80% of our javascript stuff came from the jQuery standard I think

avatar okonomiyaki3000
okonomiyaki3000 - comment - 29 Sep 2015

fixed some merge conflicts that came up somehow

avatar okonomiyaki3000
okonomiyaki3000 - comment - 5 Oct 2015

Hmm. Probably not. Let me have a look.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 5 Oct 2015

I hope that, at some point, we'll be converting all the names of these files from using the -uncompressed naming scheme to using the .min naming scheme. Also, I bet there are some obsolete files in this directory.

avatar zero-24 zero-24 - change - 5 Oct 2015
Easy No Yes
avatar designbengel
designbengel - comment - 24 Oct 2015

Testinstructions missing


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar roland-d
roland-d - comment - 11 Dec 2015

Hello @okonomiyaki3000

Thank you for your contribution.

The last comment here was on 24th October. So the question is, Is this issue/pull request still valid?
if so please provide clear test instructions to be able to test / reproduce this issue.
If no reply is received within 4 weeks we will close this issue.

Thanks for understanding!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 15 Dec 2015

The problems with this code are not apparent unless javascript is being run in "strict" mode so the first thing you need to do to test it is to put:

"use strict";

Just inside the closure. Then, go to any page that uses the html5fallback file. The article edit page in the administrator, for example. Look in your browser's console. You should see some errors. This patch fixes those errors.

avatar roland-d
roland-d - comment - 20 May 2016

@okonomiyaki3000 I am confused, how could I test this? I can't seem to turn off HTML5 in the browser. Should I use some old browser?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 20 May 2016

@roland-d The first thing you have to understand is that this file is pretty badly named. It's not like something that only runs on old browsers. It runs anyway but it provides some polyfills for old browsers.

To understand what's fixed, you must understand what was broken. You'd never notice because the original file was not in strict mode. Add "use strict" at the top of the closure in the original file and then open a page where this file used and look in your console. There should be some js errors. Probably none of the javascript on the page will work. Then switch to the updated file. Everything will work again. That is what is fixed.

avatar roland-d roland-d - test_item - 20 May 2016 - Tested successfully
avatar roland-d
roland-d - comment - 20 May 2016

I have tested this item successfully on 7c3f758

@okonomiyaki3000 Thank you, that was clearing things up. I was able to spot the errors and they were resolved after applying the PR.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 21 May 2016

Little by little, I want to get all of joomla's js files to use strict mode and I think it should be required for any new JavaScript.

avatar roland-d
roland-d - comment - 21 May 2016

We should see if we can enforce that for new files and implement it for existing files since it promotes better coding.

avatar Fedik
Fedik - comment - 21 May 2016

???? I am also for make "use strict" required

avatar andrepereiradasilva
andrepereiradasilva - comment - 22 May 2016

???? for use strict

avatar conconnl conconnl - test_item - 25 Jun 2016 - Tested successfully
avatar conconnl
conconnl - comment - 25 Jun 2016

I have tested this item successfully on 7c3f758

Tested the patch
"Use strict" is visible after applying and the website is still working.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar conconnl
conconnl - comment - 25 Jun 2016

@okonomiyaki3000 i just found out that this patch creates issues in the configuration screen of Joomla, as you can see in my screenshotscreen shot 2016-06-25 at 06 12 36


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar roland-d roland-d - alter_testresult - 25 Jun 2016 - conconnl: Tested unsuccessfully
avatar roland-d roland-d - alter_testresult - 25 Jun 2016 - roland-d: Tested unsuccessfully
avatar roland-d
roland-d - comment - 25 Jun 2016

@okonomiyaki3000 I can confirm the finding by @conconnl The error thrown is:
Error: TypeError: features.fields is undefined
Source File: http://localhost:8888/joomla-cms/media/system/js/html5fallback-uncompressed.js
Line: 383


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar joomla-cms-bot
joomla-cms-bot - comment - 5 Jul 2016

This PR has received new commits.

CC: @conconnl, @roland-d


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 5 Jul 2016

Thanks @conconnl, @roland-d! This should fix the issue.

avatar roland-d roland-d - test_item - 7 Jul 2016 - Tested successfully
avatar roland-d
roland-d - comment - 7 Jul 2016

I have tested this item successfully on 108cfdb

With the last change all is working fine now on frontend and backend as far as I can see.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar conconnl conconnl - test_item - 7 Jul 2016 - Tested successfully
avatar conconnl
conconnl - comment - 7 Jul 2016

I have tested this item successfully on 108cfdb

Retested everything, it's working fine now.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar brianteeman brianteeman - change - 7 Jul 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 7 Jul 2016

Rtc


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6409.

avatar joomla-cms-bot joomla-cms-bot - change - 7 Jul 2016
Labels Added: ?
avatar roland-d roland-d - change - 16 Jul 2016
Milestone Added:
avatar wilsonge
wilsonge - comment - 30 Jul 2016

Merged with a585c9b - Thanks!

avatar wilsonge wilsonge - change - 30 Jul 2016
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2016-07-30 14:40:13
Closed_By wilsonge
avatar wilsonge wilsonge - close - 30 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 30 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2016
Category JavaScript
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment