Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
using amd for create
Browse files Browse the repository at this point in the history
  • Loading branch information
Reto Bachmann-Gmür committed Jun 16, 2012
1 parent f539280 commit a49a14a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
20 changes: 19 additions & 1 deletion create-ria/src/main/js/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*global $, require */
/*global $, require, Backbone, window */

// When the document is ready:
$().ready(function() {

var console = window.console;
/*require([ "IndexContext" ], function(IndexContext) {
// Create a new IndexContext and initialize it which will create and
Expand All @@ -16,4 +17,21 @@ $().ready(function() {
//console.log('ss');
});


$('body').midgardCreate({
url: function () {
return false;
},
stanbolUrl: 'http://dev.iks-project.eu:8081',
tags: true
});

// Fake Backbone.sync since there is no server to communicate with
Backbone.sync = function(method, model, options) {
if (console && console.log) {
console.log('Model contents', model.toJSONLD());
}
options.success(model);
};

});
17 changes: 1 addition & 16 deletions create-ria/src/main/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,7 @@
<!-- <script type="text/javascript" src="js/org/wymiwyg/sling-stanbol/createjs/1.0-SNAPSHOT/createjs-1.0-SNAPSHOT.js"></script> -->
<!-- <link rel="stylesheet" type="text/css" href="css/index.css" /> -->
<script>
jQuery(document).ready(function () {
jQuery('body').midgardCreate({
url: function () {
return 'javascript:false;';
},
stanbolUrl: 'http://dev.iks-project.eu:8081',
tags: true
});
});
// Fake Backbone.sync since there is no server to communicate with
Backbone.sync = function(method, model, options) {
if (console && console.log) {
console.log('Model contents', model.toJSONLD());
}
options.success(model);
};

</script>
<link rel="stylesheet" href="./font-awesome/css/font-awesome.css"
/>
Expand Down
5 changes: 0 additions & 5 deletions create-ria/src/main/webapp/WEB-INF/web.xml

This file was deleted.

4 changes: 4 additions & 0 deletions createjs/src/main/js/create-amd.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
define("createjs",["jquery", "jquery-ui"], function() {
return $;
});

define("Backbone",["jquery", "jquery-ui"], function() {
return Backbone;
});
5 changes: 4 additions & 1 deletion createjs/src/main/resources/createjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script type="text/javascript" src="${deps/jquery-ui-1.8.18.custom.min.js}"></script> -->


<script type="text/javascript" src="${create-amd.js}"></script>

<script type="text/javascript" src="${deps/modernizr.custom.80485.js}"></script>
<script type="text/javascript" src="${deps/underscore-min.js}"></script>
<script type="text/javascript" src="${deps/backbone-min.js}"></script>
Expand Down Expand Up @@ -42,6 +42,9 @@
<!-- <script type="text/javascript" src="${collectionWidgets/jquery.Midgard.midgardCollectionAddBetween.js}"></script> -->
<script type="text/javascript" src="${collectionWidgets/jquery.Midgard.midgardCollectionAdd.js}"></script>
<script type="text/javascript" src="${jquery.Midgard.midgardTags.js}"></script>


<script type="text/javascript" src="${create-amd.js}"></script>
</head>

</html>

0 comments on commit a49a14a

Please sign in to comment.