cubing / AnimCubeJS

▶️ Play around with a Rubik's Cube simulator.
https://animcubejs.cubing.net/animcubejs.html
MIT License
25 stars 8 forks source link

clickable time-line is not working properly #6

Closed bcube2 closed 8 years ago

bcube2 commented 8 years ago

Intended situation: scrambled cube at the beginning, solved cube at the end (via applied moves); time-line clickable

When pressed "play" button, then clicking on the time-line, then clicking "play" button again, it results in a scrambled cube at the end of animation. It can be also reproduced by pressing "play" button, then clicking on time-line, then clicking on "to the end" button - the cube will be scrambled instead of solved.

Personally, it doesn´t bother me much, because it won´t be clicked on time-line too much I think.

mfeather1 commented 8 years ago

Fixed (I think, working for me anyways). Try it now on my web-site, I enabled click-progress, or copy the JS files to yours.

molarmanful commented 8 years ago

Works in the demo.

mfeather1 commented 8 years ago

I had to make a change to animcube to fix that. I do see the problem occurring on the Demo (press play, when it gets close to the end click on the progress bar near the beginning and then press play again, final result is incorrect). I think this should remain open until Tadeas can confirm that the fix works for him as well, either on my site or on his if he copies the new JS files, or can the Demo be used to test? I assume it won't be a problem to re-release JS files as a new version? (after testing is completed)

On Wed, 2015-07-15 at 16:46 -0700, Benjamin Pang wrote:

Closed #6.

— Reply to this email directly or view it on GitHub.

bcube2 commented 8 years ago

"Works in the demo."

Since I don't see changed JS files (as Michael suggested), what changes did you make in order to fix it? It can be best tested on fully scrambled cube (the more moves needed to solve it the better, I think. Although maybe 4 or 5 move are sufficient enough too...).

So could you please upload the new JS files into your .zip file? I would download it and test it on my webpages... Thank you in advance :-)

Thank you, Michael, in advance for fixing it.

mfeather1 commented 8 years ago

You can test on my web-site with the solver at following link which will give you a 20 move solution (more or less), click the Random button, then Solve: http://irbsystems.com/test2/rc/solver/index.cgi

One thing I should mention is that if your browser has already cached the JS files from my site (from before) then you may need to refresh to get the new version, what I do is View Source on the page, then click on the AnimCube.html link (within the source) and when that source comes up, click on the animcube.nocache.js link then when the minified source comes up click within the page and press F5 to refresh.

Another way to refresh (in Firefox) is to click History, then click "Show All History" then right-click on a link to my-web site and and select "Forget About This Site".

You can see which JS file is getting called in the browser by doing: Tools -> Web Developer -> Debugger (or just press ctrl-shift-s in Firefox), press F5 and then hover over the js file (on left side) to see the full name of the file. That should match one of the files in: http://irbsystems.com/test2/rc/AnimCube/animcube see the compilation-mappings.txt for the file name that matches the user-agent of the browser you are using.

Sorry about the complexity but it's because of the way the browser does caching (with Firefox, it may not be an issue with Safari depending on how it does caching).

Another way you can test is to copy all the JS files in http://irbsystems.com/test2/rc/AnimCube/animcube/ to your site (at a minimum you need to copy animcube.nocache.js and the js file for the browser user-agent you are using). I've found that it refreshes more easily when testing locally (don't have to do above refresh procedure).

bcube2 commented 8 years ago

Thank you Michael for your guideline. Since I was impatient to wait for Benjamin to change/update those JS files, I went ahead and downloaded them from your site. I replaced old JS files by new ones (6 files in total).

I deleted all history (including chache) in both FF and Chrome, but in both browsers the problem still occurs. Any ideaq what am I doing wrong?

bcube2 commented 8 years ago

P.S. at least it looks like I am not entirely dumb because the problem is still present even in case of your website for me too.

bcube2 commented 8 years ago

Sorry for triple-post but Chrome 23.0 can not make edit of a post... Anyway, I figured out that if it is clicked (after pressing play button) on a time-line say before a half of it (if a solution has 20 moves, then say 1-10), and then clicked either on play button or to the end button, the cube will be solved.

On contrary, if it is clicked (after pressing play button) on a time-line say after a half of it (if a solution has 20 moves, then say 11-19), and then clicked either on play button or to the end button, the cube will be scrambled.

bcube2 commented 8 years ago

Hm, thas was behaviour on your website. On my site, it doesn´t matter if clicked prior to or after the half of the time-line, it behaves randomly (sometimes it even gives a solved cube at the end)...

Maybe the problem is not in a time-line but in a play button, because when play button is not pressed, the time-line behaves as expected...

molarmanful commented 8 years ago

Oh, click progress is a parameter. You can set it to 1 or 0 using the .cfg or the URL.

bcube2 commented 8 years ago

You are right, it is also discussed in issue no. 4. This issue deals with something different. I can imagine it is not understandable by my words, maybe Michael will re-phrase me one more time... Anyway, Michael knows where the trouble is so it is reasonable to predict he will fix it by himself, i.e. without your help (or someone's else).

mfeather1 commented 8 years ago

Ok, I know you cleared the cache but can you confirm with Firefox that it is pulling in the right .js file by doing Ctrl-Shift-S to bring up the debugger then F5 to refresh and hover over the .js file name on the left, it should be: 39531646E7260C645E93FB8CC20F8F22.cache.js

With that version, I can't get it to mess up no matter what I do (back & forth between timeline & play multiple times, backward play & timeline, etc).

bcube2 commented 8 years ago

Since I don't have online version yet, I am running it through localhost.

When running Console in Chrome, it gives me Uncaught TypeError: Cannot call method 'getContext' of null. It is pointing at cube.html, line 20. When srolling up in this file, I can see script src = animcube.nocache.js.

When doing the same in FF, I can also see animcube.nocache.js on the left hand side.

I am not using .cfg file, hoping that it isn't the cause of this issue.

bcube2 commented 8 years ago

When browsing your site (http://irbsystems.com/test2/rc/edges.html for example), the Console in Chrome tells me C17C53F7FA7653F7D17888E2F49BA6FA.cache, but the problem still occurs for me (in both 5 and 7 moves simulators).

bcube2 commented 8 years ago

Oh, besides C17C53F7FA7653F7D17888E2F49BA6FA.cache.js the Console in Chrome also shows animcube.nocache.js in case of http://irbsystems.com/test2/rc/edges.html. In the console in AnimCube.html the src = animcube.nocache.js, when I open AnimCube.html in a browser and search in the source code, I also see src = animcube.nocache.js

In FF on http://irbsystems.com/test2/rc/edges.html I only see 2 viewable JS files in the Console - resources/download/data/gallery-content.js and sdk/content/content-worker.js. There is a message at the bottom that sign coding of HTML document was not defined for both files.

mfeather1 commented 8 years ago

When I use the debugger on your web-site it shows that it is pulling in http://hlavolam.maweb.eu/Applets/Michael-Feather/AE36935EDCF07BC5D3A8A7EB084B5271.cache.js which is the old version.

bcube2 commented 8 years ago

You are right. For a clarification see issue no. 7 on this github. I am terribly sorry for a confusion :-(

mfeather1 commented 8 years ago

Ok I screwed up, I had put in some code to handle touch events to try to address Issue #5 "rotation of the cube for mobile users possible?" but obviously that did not work. From now on I will stick to my usual rule of only doing one thing at a time. Focus is now exclusively on fixing the timeline problem. Sorry for the trouble that caused.

I backed out the touch event mods, now there are new .js files on my site, it should pull in 007DF5FF88193958EB5E7CD5290E8CAC.cache.js for Firefox.

I'm not exactly sure how you are testing but if we could start with testing Firefox on a non-touch device (using a mouse) to see if at least that setup works (which is what I am using and is working correctly). I am in the process of getting a touch device that I can use.

mfeather1 commented 8 years ago

Just got a touch device that I can use. The fix is not working properly on it, so I will have an update to address this shortly.

bcube2 commented 8 years ago

"Ok I screwed up"

Thanks for covering ;-)

"From now on I will stick to my usual rule of only doing one thing at a time."

Unlike others, this way works best for me as well.

"I backed out the touch event mods, now there are new .js files on my site, it should pull in 007DF5FF88193958EB5E7CD5290E8CAC.cache.js for Firefox."

Thank you for an information. Sadly, I won't be able to test it on a computer till yesterday or even sunday :-(. So far it was not working for me in FF no matter what number-letter-chain.cache.js for FF I used.

"I'm not exactly sure how you are testing"

By the easiest imaginable way. Since I am no computer-man like you (it is a compliment, not an insult), I can not afford to order some console/debugger to do my job and find some bugs. I must do it manually, i.e. do some action and see a result. Since the simulator is useful for people instead of computers (at least in my case), it seems to be not that bad approach at all ;-)

"we could start with testing Firefox on a non-touch device (using a mouse) to see if at least that setup works"

Deal. If no-one else tests it earlier than me, I will post my result ASAP.

"Just got a touch device that I can use."

Exciting stuff! Thank you for caring so much, it is highly appreciated.

mfeather1 commented 8 years ago

I've already made another update so disregard the name of the .js file mentioned earlier, just use whatever is on my site at the time you want to do a test (still working on it). My development method is not advanced, only thing I use debugger for is to see that it's loading latest .js file. I just make a change to the .java, compile with GWT and test the result in the browser.

As for the touch device, it will be a little longer before I can do further testing with that because at this point I don't know how to do basics like View Source (so I can load the latest version of source).

bcube2 commented 8 years ago

Got it regarding JS files and their updates.

"As for the touch device, it will be a little longer before I can do further testing with that because at this point I don't know how to do basics"

If in doubt or having a problem, don't hesitate to ask on speedsolving.com forum. Some of the people there tried to solve your problem and they succeeded. Out of my mind, Lucas Garron and Lars Petrus could be very useful. Werner Randelshofer (not a member of speedsolving.com) could be very helpful as well, but as far as I know he is very busy right now. Josef Jelinek (inactive forum member) said to me several months ago that his main coding language is JS now, and when I asked him about making JS version of his applet, he answered in a way he would do it as a teamwork - you two would be perfect for each other I think.

mfeather1 commented 8 years ago

The touch device appears to have reloaded the .js when I turned it back on so now the timeline (progress bar) is working on both Firefox and Android Chrome. I will be interested to know if it works for you also.

I think the team for now is you & me, your valuable testing input is a great asset to this project. Until such a time when Josef wants to do a release then I guess what we are doing here is the best way to proceed.

bcube2 commented 8 years ago

"now the timeline (progress bar) is working on both Firefox and Android Chrome."

I use the default Android browser instead of Chrome on Android (samsung galaxy ace 3). Still, can't wait to test it. I will in a several of hours together with FF.

"your valuable testing input is a great asset to this project."

You sound like a Michiel van der Blonk :-p. Please take a look at his wonderful GLube github project if you haven't already. In my opinion there are way more important people than me, I am just simply very glad to be a tiny part of your/Michiel's projects :-)

mfeather1 commented 8 years ago

"You sound like a Michiel van der Blonk"

Yes, I was agreeing with what he said. I wasn't able to see the GLube Cube before I got this tablet. On my desktop, Firefox has my video card blacklisted for webgl and when I set webgl.force-enabled in about:config the browser crashes when I access the page with the cubes. But it looks good on the notepad, the faces turn by using the buttons although can't turn the whole cube, same issue as with animcube. Nice to be able to work on the JS code directly as opposed to this indirect GWT method that I'm using.

bcube2 commented 8 years ago

Please note his simulator is in a development phase yet, I think Michiel plans to add several useful features in the future. For some of them see the issues (both closed and open) on his github.

Once again, you did amazing job. Not only it works as expected on Android (viewing through default browser), it also works perfectly in case of your website for both Chrome and FF as well as in case of my offline version in FF + Chrome (after downloading animcube.nocache.js and 35E98EC7808EE0601BF74598E5B457E6.cache.js + BBAFDAA9A67ACC7A4837C2D31E409CB8.cache.js). I tried really hard but could not find any bug regarding the timeline whatsoever :-)

Thank you for fixing that, from now on this issue is put into the right (i.e. closed) folder.

mfeather1 commented 8 years ago

Glad to hear it!