Skip to content

Commit

Permalink
Merge aerogear/as-quickstart '1.0.0.M6'
Browse files Browse the repository at this point in the history
  • Loading branch information
kborchers committed Sep 24, 2012
2 parents dad9ef1 + 8557c25 commit 4679111
Show file tree
Hide file tree
Showing 156 changed files with 19,056 additions and 59 deletions.
2 changes: 1 addition & 1 deletion helloworld-html5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Development notes
=================

You can test the REST endpoint using the following URL
http://localhost:8080/jboss-as-helloworld-html5/hello/json/David
[http://localhost:8080/\<artifactId>/hello/json/David/]("http://localhost:8080/<artifactId>/hello/json/David/").

HelloWorld.java - establishes the RESTful endpoints using JAX-RS

Expand Down
19 changes: 19 additions & 0 deletions helloworld-html5/src/main/webapp/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
JBoss, Home of Professional Open Source
Copyright 2012, Red Hat, Inc., and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.invalid {
color: red;
}
48 changes: 28 additions & 20 deletions helloworld-html5/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,47 @@
<html>
<head>
<title>HTML5 + REST Hello World</title>
<link rel="stylesheet" href="css/styles.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$( document ).ready( function() {
$( '#sayHello' ).click( function( event ) {
event.preventDefault();

<script type="text/javascript">
$(document).ready(function() {
$('#sayHello').click(function() {
var name = $('#name').val();
//console.log("clicked: " + name);
var jqxhr = $.ajax('hello/json/' + name, {
var result = $( '#result' ),
name = $.trim( $( '#name' ).val() );

result.removeClass( 'invalid' );

if( !name || !name.length ) {
result.addClass( 'invalid' ).text( 'A name is required!' );
return;
}
//console.log("clicked: " + name);
$.ajax( 'hello/json/' + name, {
dataType:'json',
data:{},
type:'POST',
success:function (data) {
success:function ( data ) {
//console.log("success: " + data.result);
$('#result').text(data.result);
$( '#result' ).text( data.result );
}
})
.error(function() {
//console.log("error");
}
);
return false; // prevents submit of the form
});
}); // (document).read
.error( function() {
//console.log("error");
});
});
}); // (document).ready
</script>
</head>
<body>
HTML5 + REST Hello World<br>
<form name="theForm">
<fieldset>
<label for="name" id="name_label">Name</label>
<input name="name" id="name" type="text" required placeholder="Your Name"/>
<input type="submit" id="sayHello" value="Say Hello"/><span id="result"></span>
</fieldset>
<fieldset>
<label for="name" id="name_label">Name</label>
<input name="name" id="name" type="text" required placeholder="Your Name"/>
<input type="submit" id="sayHello" value="Say Hello"/><span id="result"></span>
</fieldset>
</form>

</body>
Expand Down
3 changes: 3 additions & 0 deletions kitchensink-cordova/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ios/KitchensinkCordova.xcodeproj/xcuserdata/
ios/KitchensinkCordova.xcodeproj/project.xcworkspace/xcuserdata/
android/gen/
24 changes: 24 additions & 0 deletions kitchensink-cordova/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
kitchensink-cordova: Example AeroGear Application Using Hybrid HTML5 + REST with Apache Cordova
===============================================================================================
Author: Kris Borchers
Level: Intermediate
Technologies: HTML5, REST, Apache Cordova
Summary: Based on kitchensink, but uses hybrid HTML5 running as a native application on mobiles

What is it?
-----------

This project serves as an example of AeroGear's [kitchensink quickstart](http://www.github.com/aerogear/as-quickstarts/tree/master/kitchensink-html5-mobile), converted to an [Apache Cordova](http://incubator.apache.org/cordova/) based, hybrid application.

What does all of that mean? Basically, this takes our https://community.jboss.org/docs/DOC-17326[HTML5 + REST] / http://www.jquerymobile.com"[jQuery Mobile] based web app and converts it to a native app for both iOS and Android. Currently, these apps will need to be built separately but in the future, we hope to provide a single build step for all supported mobile OS types. These concepts can be applied to the conversion of most HTML5/JS based web apps by just replacing the specific paths described in this article with paths that match your environment.

Available Hybrid Applications
-----------------------------

The following is a list of the currently available hybrid applications.
For more detailed information about a quickstart, click on the quickstart name.

This quickstart contains the following mobile OS types:

1. [ios](kitchensink-cordova/ios/README.md)
2. [android](kitchensink-cordova/android/README.md)
Binary file not shown.
Loading

0 comments on commit 4679111

Please sign in to comment.