This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created create-ria skeleton project, updated dependency versions
- Loading branch information
Reto Bachmann-Gmür
committed
Jun 14, 2012
1 parent
9b61a08
commit 3533212
Showing
32 changed files
with
1,321 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>sling-stanbol</artifactId> | ||
<groupId>org.wymiwyg.sling-stanbol</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.wymiwyg</groupId> | ||
<artifactId>create-ria</artifactId> | ||
<version>0.1-SNAPSHOT</version> | ||
<name>JavaScript RIA</name> | ||
<packaging>js</packaging> | ||
<description>A JavaScript Rich Internet Application using jQuery and jQuery UI.</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>jquery-amd</artifactId> | ||
<version>1.7.1-alpha-1</version> | ||
<type>js</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>jquery-ui-amd</artifactId> | ||
<version>1.8.16-alpha-1</version> | ||
<type>js</type> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>javascript-maven-plugin</artifactId> | ||
<version>2.0.0-alpha-1</version> | ||
</extension> | ||
</extensions> | ||
</build> | ||
|
||
<!-- FIXME: Temporary declaration of Codehaus repos until this moves to Maven Central --> | ||
<repositories> | ||
<repository> | ||
<id>snapshots</id> | ||
<url>https://nexus.codehaus.org/content/repositories/snapshots/</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>snapshots</id> | ||
<url>https://nexus.codehaus.org/content/repositories/snapshots/</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.6.1</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/*global define */ | ||
|
||
define( ["jquery"], function($) { | ||
|
||
/** | ||
* Controls the showing of a 'Hello World' message. | ||
* | ||
* This is a "supervising controller" otherwise known as a "presenter". | ||
* @see http://martinfowler.com/eaaDev/SupervisingPresenter.html | ||
* | ||
* @class Controls the showing of a 'Hello World' message. | ||
* @name HelloWorldController | ||
*/ | ||
function HelloWorldController() { | ||
} | ||
|
||
/** | ||
* The HelloWorldView instance (injected) | ||
*/ | ||
HelloWorldController.prototype.view = undefined; | ||
|
||
/** | ||
* The HelloWorldCommand instance (injected) | ||
*/ | ||
HelloWorldController.prototype.command = undefined; | ||
|
||
/** | ||
* Success callback for the HelloWorldCommand. | ||
* Show the 'Hello World' message using the view. | ||
* | ||
* @param message The message to show. | ||
*/ | ||
HelloWorldController.prototype.getTextSuccess = function(message) { | ||
var self = this; | ||
|
||
self.view.setHelloWorldDivText(message); | ||
}; | ||
|
||
/** | ||
* Failure callback for the HelloWorldCommand. | ||
* Show the error message using the view. | ||
* | ||
* @param errorMessage A description of the error | ||
*/ | ||
HelloWorldController.prototype.getTextFailure = function(errorMessage) { | ||
var self = this; | ||
|
||
self.view.showError(errorMessage); | ||
}; | ||
|
||
/** | ||
* Initialization method for this controller. | ||
*/ | ||
HelloWorldController.prototype.start = function() { | ||
var self = this, text; | ||
|
||
// Inject our helloButtonClick handler into the view | ||
self.view.helloButtonClick = $.proxy(self.helloButtonClick, self); | ||
// Initialize the view | ||
self.view.initialize(); | ||
|
||
// Fetch the 'hello world' text using a command object | ||
text = self.command.execute( $.proxy(self.getTextSuccess, self), $.proxy(self.getTextFailure, self) ); | ||
}; | ||
|
||
/** | ||
* Handle a click on the #helloButton element. | ||
* | ||
* @param event The event object which triggered this handler. | ||
*/ | ||
HelloWorldController.prototype.helloButtonClick = function(event) { | ||
var self = this; | ||
|
||
self.view.setHelloButtonText("Clicked"); | ||
}; | ||
|
||
// Return the function | ||
return HelloWorldController; | ||
|
||
}); |
82 changes: 82 additions & 0 deletions
82
create-ria/src/main/js/HelloWorld/desktop/HelloWorldView.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/*global define, window */ | ||
|
||
define( ["jquery-ui"], function($) { | ||
|
||
/** | ||
* User interface part of HelloWorld*. | ||
* Shows messages to the user and reacts to user input. | ||
* This view is part of the desktop view implementation. | ||
* | ||
* This is a "view" as defined by "supervising controller". | ||
* @see http://martinfowler.com/eaaDev/SupervisingPresenter.html | ||
* | ||
* @class User interface part of HelloWorld*. | ||
* @name HelloWorldView | ||
*/ | ||
function HelloWorldView() { | ||
} | ||
|
||
/** | ||
* The div used for the hello world message. | ||
*/ | ||
HelloWorldView.prototype.div = undefined; | ||
|
||
/** | ||
* The event handler for a click on #helloButton. | ||
*/ | ||
HelloWorldView.prototype.helloButtonClick = undefined; | ||
|
||
/** | ||
* Initialize the view. | ||
* - Setup buttons | ||
*/ | ||
HelloWorldView.prototype.initialize = function() { | ||
var self = this; | ||
|
||
// Setup #helloButton as a button and bind click to helloButtonClick event | ||
$("#helloButton", self.div).button() | ||
.click( function(event){ | ||
self.helloButtonClick(event); | ||
}); | ||
}; | ||
|
||
/** | ||
* Sets the hello world message in the #helloWorld div. | ||
* | ||
* @param message The message to set. | ||
*/ | ||
HelloWorldView.prototype.setHelloWorldDivText = function(message) { | ||
var self = this; | ||
|
||
// Set message on the hello world div | ||
$("#helloMessage", self.div).text(message); | ||
}; | ||
|
||
/** | ||
* Sets the hello world message in the #helloButton button. | ||
* | ||
* @param message The message to set. | ||
*/ | ||
HelloWorldView.prototype.setHelloButtonText = function(message) { | ||
var self = this; | ||
|
||
// Set message on the hello world div | ||
$("#helloButton span", self.div).text(message); | ||
}; | ||
|
||
/** | ||
* Show an error message. | ||
* | ||
* @param message The message to show. | ||
*/ | ||
HelloWorldView.prototype.showError = function(message) { | ||
var self = this; | ||
|
||
// Show error message | ||
window.alert("Error: " + message); | ||
}; | ||
|
||
// Return the function | ||
return HelloWorldView; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*global define */ | ||
|
||
define([ "jquery", "HelloWorld/HelloWorldController", "HelloWorld/desktop/HelloWorldView", "model/HelloWorldCommand" ], | ||
function($, HelloWorldController, HelloWorldView, HelloWorldCommand) { | ||
|
||
/** | ||
* Context for our index.html entry point. | ||
* | ||
* Sets up required objects, handles dependency injection, and starts | ||
* the HelloWorldController. | ||
* | ||
* @class Context for our index.html entry point. | ||
* @name IndexContext | ||
*/ | ||
function IndexContext(){} | ||
|
||
/** | ||
* Initialize this context. | ||
* | ||
* Instantiates HelloWorld components, injects dependencies, and starts | ||
* the HelloWorldController. | ||
*/ | ||
IndexContext.prototype.initialize = function() { | ||
var controller, view, command; | ||
|
||
// Instantiate objects | ||
controller = new HelloWorldController(); | ||
view = new HelloWorldView(); | ||
command = new HelloWorldCommand(); | ||
|
||
// Perform dependency injection by extending objects | ||
$.extend(view, { | ||
div: $("#helloWorld") | ||
}); | ||
|
||
$.extend(controller, { | ||
view: view, | ||
command: command | ||
}); | ||
|
||
// Start the HelloWorldController | ||
controller.start(); | ||
}; | ||
|
||
// Return the function | ||
return IndexContext; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/*global $, require */ | ||
|
||
// When the document is ready: | ||
$().ready(function() { | ||
|
||
require([ "IndexContext" ], function(IndexContext) { | ||
|
||
// Create a new IndexContext and initialize it which will create and | ||
// start a HelloWorldController | ||
var indexContext = new IndexContext(); | ||
indexContext.initialize(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*global define*/ | ||
|
||
define( [] ,function() { | ||
|
||
/** | ||
* Command object to retrieve the 'Hello World' text. | ||
* | ||
* @class Command object to retrieve the 'Hello World' text. | ||
* @name HelloWorldCommand | ||
*/ | ||
function HelloWorldCommand() { | ||
} | ||
|
||
/** | ||
* Execute this command and then call the supplied success or | ||
* failure callback as appropriate. | ||
* | ||
* @param success Callback function for a successful execution. | ||
* @param failure Callback function for a failed execution. | ||
*/ | ||
HelloWorldCommand.prototype.execute = function(success, failure) { | ||
success("Hello World"); | ||
}; | ||
|
||
// Return the function | ||
return HelloWorldCommand; | ||
|
||
}); |
Binary file added
BIN
+260 Bytes
create-ria/src/main/resources/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+251 Bytes
create-ria/src/main/resources/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+178 Bytes
create-ria/src/main/resources/css/images/ui-bg_flat_10_000000_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+104 Bytes
create-ria/src/main/resources/css/images/ui-bg_glass_100_f6f6f6_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+125 Bytes
create-ria/src/main/resources/css/images/ui-bg_glass_100_fdf5ce_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 Bytes
create-ria/src/main/resources/css/images/ui-bg_glass_65_ffffff_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.67 KB
create-ria/src/main/resources/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90 Bytes
create-ria/src/main/resources/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 Bytes
create-ria/src/main/resources/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@CHARSET "UTF-8"; | ||
|
||
@import url("jquery-ui-1.8.16.custom.css"); | ||
|
||
body { | ||
padding: 1em; | ||
font-family: Verdana, sans-serif; | ||
font-size: 10px; | ||
} | ||
|
||
h1 { | ||
font-size: 3em; | ||
color: #444; | ||
} | ||
|
||
#helloWorld { | ||
border: 1px dashed #ddd; | ||
padding: 1em; | ||
margin-top: 2em; | ||
} | ||
#helloWorld #helloMessage { | ||
font-size: 2em; | ||
color: #888; | ||
margin-bottom: 1em; | ||
} | ||
#helloWorld #helloButton {} |
Oops, something went wrong.