You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ko...@apache.org on 2014/06/12 14:41:37 UTC
[6/6] git commit: [OLINGO-324] start JSON reader, add demo,
is working version
[OLINGO-324] start JSON reader, add demo, is working version
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/54486148
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/54486148
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/54486148
Branch: refs/heads/OLINGO-324
Commit: 54486148e0926a49496a54510c5140673e335678
Parents: db4b77a
Author: Sven Kobler <sv...@sap.com>
Authored: Thu Jun 12 14:40:58 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Thu Jun 12 14:40:58 2014 +0200
----------------------------------------------------------------------
datajs/.gitignore | 9 +-
datajs/Gruntfile.js | 25 +-
datajs/demo/mypage.html | 28 +
datajs/demo/scripts/datajs-1.1.1.js | 10710 +++++++++++++++++++++++++
datajs/demo/scripts/datajs-1.1.1.min.js | 14 +
datajs/demo/scripts/datajs-1.1.2.js | 10577 ++++++++++++++++++++++++
datajs/demo/scripts/datajs-1.1.2.min.js | 13 +
datajs/demo/scripts/datajs_demo.js | 122 +
datajs/demo/tester.html | 98 +
datajs/demo/testerV2.html | 55 +
datajs/package.json | 4 +-
datajs/src/lib/odata.js | 10 +-
datajs/src/lib/odata/json-light.js | 2 +-
datajs/src/lib/odata/json.js | 22 +-
datajs/src/lib/odata/utils.js | 38 +-
15 files changed, 21698 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/54486148/datajs/.gitignore
----------------------------------------------------------------------
diff --git a/datajs/.gitignore b/datajs/.gitignore
index 55f5b46..a35bbcd 100644
--- a/datajs/.gitignore
+++ b/datajs/.gitignore
@@ -1,5 +1,6 @@
-demo/jscripts/
-demo/jscripts/*
-demo/jscripts/datajs-2.0.0.js
+demo/scripts/
+demo/scripts/*
+demo/scripts/datajs-2.0.0.js
node_modules/
-build
\ No newline at end of file
+build
+localgrunt.config
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/54486148/datajs/Gruntfile.js
----------------------------------------------------------------------
diff --git a/datajs/Gruntfile.js b/datajs/Gruntfile.js
index 1c6d369..f4429fb 100644
--- a/datajs/Gruntfile.js
+++ b/datajs/Gruntfile.js
@@ -1,6 +1,6 @@
module.exports = function(grunt) {
'use strict';
- grunt.initConfig({
+ var init = {
pkg: grunt.file.readJSON('package.json'),
banner: grunt.file.read('src/banner.txt'),
filename : '<%= pkg.name %>-<%= pkg.version %>',
@@ -32,6 +32,14 @@ module.exports = function(grunt) {
dest: 'build/<%= filename %>.min.js'
}
},
+ copy: {
+ forDemo: {
+ files: [
+ // includes files within path
+ {expand: true, cwd: 'build/', src: ['**'], dest: 'demo/jscripts/', filter: 'isFile'},
+ ]
+ }
+ },
connect: {
demo: {
options: {
@@ -51,7 +59,7 @@ module.exports = function(grunt) {
// start a node webserver with proxy to host the qunit-test html files
'test-browser': {
options: {
- port: 4002 ,
+ port: 4003 ,
hostname: "localhost",
base: "",
keepalive : true,
@@ -100,18 +108,27 @@ module.exports = function(grunt) {
}
},
},
- });
+ };
+
+ if (grunt.file.exists('localgrunt.config')) {
+ console.log("merge localgrunt.config");
+ var localGrundConfig = grunt.file.read('localgrunt.config');
+ init.connect['test-browser'].proxies = init.connect['test-browser'].proxies.concat(JSON.parse(localGrundConfig).proxies);
+ }
+
+ grunt.initConfig(init);
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks("grunt-connect-proxy");
grunt.loadNpmTasks("grunt-contrib-connect");
+ grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks('grunt-node-qunit');
// Default task.
- grunt.registerTask('build', ['browserify:datajs', 'uglify:build']);
+ grunt.registerTask('build', ['browserify:datajs', 'uglify:build', 'copy:forDemo']);
grunt.registerTask('test-browser', ['configureProxies:test-browser', 'connect:test-browser']);
grunt.registerTask('test-node', ['node-qunit:default-tests']);
};
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/54486148/datajs/demo/mypage.html
----------------------------------------------------------------------
diff --git a/datajs/demo/mypage.html b/datajs/demo/mypage.html
new file mode 100644
index 0000000..1243b99
--- /dev/null
+++ b/datajs/demo/mypage.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>data js demo</title>
+ <script type="text/javascript" src="Scripts/datajs-1.1.1.js"></script>
+ <script type="text/javascript" src="Scripts/jquery-2.0.3.js"></script>
+ <script type="text/javascript" src="Scripts/datajs_demo.js"></script>
+ <style type="text/css">.title { font-size: 30px;font-style: italic;}</style>
+</head>
+<body onload="run()">
+ <div>
+ <span class="title">Simple Read</span>
+ <pre id="simpleRead"></pre>
+ </div>
+ <div>
+ <span class="title">Simple Read With Metadata</span>
+ <pre id="simpleReadWithMetadata"></pre>
+ </div>
+ <div>
+ <span class="title">Simple Read with JSONP</span>
+ <pre id="simpleReadWithJSONP"></pre>
+ </div>
+ <div>
+ <span class="title">Metadata</span>
+ <pre id="metadata"></pre>
+ </div>
+</body>
+</html>