Permalink
Browse files

start of demo

  • Loading branch information...
hakanson committed Oct 7, 2011
1 parent d8e97e9 commit 1bb9adaa93e974987a2abfc6eda2a5355388ca36
Showing with 340 additions and 235 deletions.
  1. +63 −0 demo.html
  2. +1 −1 tests/AmplifyTestRunner.html
  3. +1 −1 tests/TestRunner.html
  4. +26 −0 tests/jQueryHubTestRunner.html
  5. +1 −1 tests/jQueryTestRunner.html
  6. +248 −232 tests/jquery-hub.tests.js
View
@@ -0,0 +1,63 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Demo</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <script type="text/javascript">window.JSON || document.write('<script src="json2.js"><\/script>')</script>
+ <script type="text/javascript" src="jquery-1.6.3.js"></script>
+ <script type="text/javascript" src="OpenAjax.js"></script>
+ <script type="text/javascript" src="jquery-hub.js"></script>
+
+ <script type="text/javascript">
+ $( document ).ready(function () {
+ var counter = 0;
+ function reset() {
+ $( "#name" ).val( "" ).focus();
+ $( "#key" ).val( "" );
+
+ $ ( "#save" ).prop( "disabled", true );
+ $ ( "#cancel" ).prop( "disabled", true );
+ }
+ $( "#name" ).change(function () {
+ $ ( "#save" ).prop( "disabled", !$( this ).val() );
+ $ ( "#cancel" ).prop( "disabled", !$( this ).val() );
+ });
+ $( "#name" ).keyup(function() {
+ $( this ).change();
+ });
+ $( "#save" ).click(function () {
+ if ( $( "#key" ).val() ) {
+ $( "#" + $( "#key" ).val() ).text( $( "#name" ).val() );
+ } else {
+ $( "#list ul" ).append( "<li id='key" + counter++ + "'>" + $( "#name" ).val() + "</li>" );
+ }
+
+ reset();
+ });
+ $( "#cancel" ).click(function () {
+ reset();
+ });
+
+ $( "#list ul li" ).live("click", function() {
+ $( "#name" ).val( $( this ).text() ).change().focus();
+ $( "#key" ).val( $( this ).attr( "id" ) );
+ });
+ });
+ </script>
+ </head>
+ <body>
+ <h1>Demo</h1>
+ <div id="edit" style="border: 1px solid;">
+ <h2>Edit Widget</h2>
+ <label for="name">Name:</label> <input id="name" type="text" />
+ <input id="save" type="button" value="save" disabled />
+ <input id="cancel" type="button" value="cancel" disabled />
+ <input id="key" type="hidden" />
+ </div>
+
+ <div id="list" style="border: 1px solid; margin-top: 1em;" >
+ <h2>List Widget</h2>
+ <ul></ul>
+ </div>
+ </body>
+</html>
@@ -3,7 +3,7 @@
<head>
<title>$.hub Test Runner</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <script type="text/javascript">window.JSON || document.write('<script src="../JSON/json2.js"><\/script>')</script>
+ <script type="text/javascript">window.JSON || document.write('<script src="..\/json2.js"><\/script>')</script>
<script type="text/javascript" src="../jquery-1.6.3.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
<script type="text/javascript" src="qunit.js"></script>
View
@@ -3,7 +3,7 @@
<head>
<title>$.hub Test Runner</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <script type="text/javascript">window.JSON || document.write('<script src="../JSON/json2.js"><\/script>')</script>
+ <script type="text/javascript">window.JSON || document.write('<script src="..\/json2.js"><\/script>')</script>
<script type="text/javascript" src="../jquery-1.6.3.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
<script type="text/javascript" src="qunit.js"></script>
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>$.hub Test Runner</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <script type="text/javascript">window.JSON || document.write('<script src="..\/json2.js"><\/script>')</script>
+ <script type="text/javascript" src="../jquery-1.6.3.js"></script>
+ <link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
+ <script type="text/javascript" src="qunit.js"></script>
+
+ <!-- NOTE: Add references to your qunit scripts here -->
+ <script type="text/javascript" src="../OpenAjax.js"></script>
+ <script type="text/javascript" src="../jquery-hub.js"></script>
+
+ <script type="text/javascript" src="jquery-hub.tests.js"></script>
+
+ </head>
+ <body>
+ <h1 id="qunit-header">QUnit example</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture">test markup, will be hidden</div>
+ </body>
+</html>
@@ -3,7 +3,7 @@
<head>
<title>$.hub Test Runner</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <script type="text/javascript">window.JSON || document.write('<script src="../JSON/json2.js"><\/script>')</script>
+ <script type="text/javascript">window.JSON || document.write('<script src="..\/json2.js"><\/script>')</script>
<script type="text/javascript" src="../jquery-1.6.3.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
<script type="text/javascript" src="qunit.js"></script>
Oops, something went wrong.

0 comments on commit 1bb9ada

Please sign in to comment.