Skip to content

Commit

Permalink
Update stuff that I didn't commit many months ago
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed May 29, 2012
1 parent 69574f9 commit 45f3e8a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 16 deletions.
13 changes: 6 additions & 7 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<title>jquery.eventsource.unit</title>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen" />
<link rel="stylesheet" href="https://raw.github.com/jquery/qunit/master/qunit/qunit.css" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<script src="https://raw.github.com/jquery/qunit/master/qunit/qunit.js"></script>

<script src="../jquery.eventsource.js"></script>
<script src="jquery.eventsource.unit.js"></script>

Expand All @@ -17,7 +16,7 @@ <h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
</body>

<iframe src="specit.html" style="width:100%;height:600px;border:0px;"></iframe>

</html>
18 changes: 9 additions & 9 deletions test/specit.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>jquery.eventsource.specit</title>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen" />
<link rel="stylesheet" href="https://raw.github.com/jquery/qunit/master/qunit/qunit.css" type="text/css" media="screen" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<script src="http://github.com/joshuaclayton/specit/raw/master/specit.js"></script>
<script src="https://raw.github.com/jquery/qunit/master/qunit/qunit.js"></script>
<script src="https://raw.github.com/joshuaclayton/specit/master/specit.js"></script>

<script src="../jquery.eventsource.js"></script>
<script src="jquery.eventsource.specit.js"></script>

<script>

$(function () {

if(top.location != location) {

$('body').css({
marginLeft: '0px',
marginTop: '0px'
});

}
});
</script>
Expand Down
45 changes: 45 additions & 0 deletions test/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';

if ($action == 'stream') {
//set event handler
header("Content-Type: text/event-stream");
header('Cache-Control: no-cache'); // recommended to prevent caching of event data.
ob_implicit_flush(true);
//ini_set('output_buffering', 'off');
for ($i=1;$i<50;$i++) {
echo 'data: ' . $i . "\n\n";
ob_flush();
flush();

sleep(1);
}
//exit();
} else {
?>

<!DOCTYPE html>
<html>
<head>
<title>jQuery.eventsource.js</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="../jquery.eventsource.js"></script>
<script>
$(document).ready(function(){
$.eventsource({
label: "event-source-label",
url: "test.php?action=stream",
dataType: "text",
message: function(data) {
console.log( data + "<br>" );

}
});
})
</script>
</head>
<body></body>
</html>
<?php
}

0 comments on commit 45f3e8a

Please sign in to comment.