User tests: Successful: Unsuccessful:
Change the keepalive function to use jQuery instead of MooTools.
What about moving the keepAlive function to the jQuery().ready
so it doesn't leak to global scope?
Also I'd like to see newlines at the beginning and end of script, otherwise rendered page source code becomes unreadable when there are few scripts placed one after another.
// Attach keep alive to document
JFactory::getDocument()->addScriptDeclaration('
jQuery(document).ready(function() {
window.setInterval(
function(){ new jQuery.ajax({ type: "GET" }); },
' . $refreshTime . '
);
});
');
Thanks, didn't notice the failing test (my bad). I will fix it and update this PR.
@piotr-cz I will add the newlines in, but the jQuery().ready is not the recommended syntax - according to the jQuery API.
=== http://api.jquery.com/ready/ ===
All three of the following syntaxes are equivalent:
$( document ).ready( handler )
$().ready( handler ) (this is not recommended)
Chris.
From what I can tell, the code looks good. We just need some test instructions and good tests. @KISS-Web-Design can you provide instructions on testing this?
No problem, I'll write something up and post it here and on the tracker.
Chris.
On Wednesday, 11 December 2013, Matt Thomas wrote:
From what I can tell, the code looks good. We just need some test
instructions and good tests. @KISS-Web-Designhttps://github.com/KISS-Web-Designcan you provide instructions on testing this?—
Reply to this email directly or view it on GitHub#2494 (comment)
.
Chris Jones-Gill
KISS Web Design
Company number: 7486736
VAT Registration: 107800539
No problem, I'll write something up and post it here and on the tracker.
Awesome, thanks.
You will need to be comfortable using the web inspector tools of your preferred browser, I use Chrome Inspector and Firebug (on Firefox).
visit yoursitename/index.php/component/users/?view=login
Check the <head> for the following code
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
It will look something like this
Wait for at least 15 minutes, then use the inspector to check that the site has been reloaded in the background - evidenced by a GET of the page.
It will look something like this
Or navigate back to yoursitename/index.php/component/users/?view=login
Check the <head> for the following code
jQuery(document).ready(function() {
window.setInterval(
function(){ new jQuery.ajax({ type: "GET" }); },
840000
);
});
It will look something like this
Wait for at least 15 minutes, then use the inspector to check that the site has been reloaded in the background - evidenced by a GET of the page.
It will look something like this
With a +1, success, or other positive test result affirmation.
OR
With a -1, fails, or other negative test result affirmation - along with a good description of your environment, which part doesn't work (with screenshots and/or source copy/paste), and any other helpful information.
Thanks for testing.
Chris.
Thanks for the instructions. Just a note: The test results should be posted in the tracker. Of course you can also add them here, but the tracker is currently still the point of thruth.
@Bakual , I have also posted the same instructions on the tracker - but there are some people that don't have tracker accounts (or refuse to use it), so I would rather have test results posted here and there than exclude people.
I don't mind doing a copy/paste from here to the tracker to keep all the results together.
@KISS-Web-Design agreed :)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-04-08 23:31:26 |
Title |
|
You need to fix the unit tests for this :) To do so just remove the JHtml framework part of the array out here: https://github.com/KISS-Web-Design/joomla-cms/blob/feature-jquery-keepalive/tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php#L640
If you being really good you might even add to the test to make sure jQuery is present