Browse Source

Simple example added.

Jason Grout 9 years ago
parent
commit
90f33b9bb4
6 changed files with 49 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 0 0
      example/data/data.json
  3. 3 0
      example/index.css
  4. 9 0
      example/index.html
  5. 20 0
      example/index.ts
  6. 16 0
      example/tsconfig.json

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@ npm-debug.log
 test/build
 lib
 docs
+example/index.js

File diff suppressed because it is too large
+ 0 - 0
example/data/data.json


+ 3 - 0
example/index.css

@@ -0,0 +1,3 @@
+.jp-Cell {
+	border: 1px solid gray;
+}

+ 9 - 0
example/index.html

@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="index.css">
+<script src="../node_modules/steal/steal.js" data-main="example/index"></script>
+</head>
+<body>
+</body>
+</html>

+ 20 - 0
example/index.ts

@@ -0,0 +1,20 @@
+'use-strict';
+
+import {
+  Widget
+} from 'phosphor-widget';
+
+import {
+  NotebookViewModel, NotebookWidget, makeModels
+} from '../lib/index';
+
+
+function main(): void {
+  System.import('example/data/data.json').then((data: any) => {
+    let nbModel = makeModels(data);
+    let nbWidget = new NotebookWidget(nbModel);
+    Widget.attach(nbWidget, document.body);    
+  });
+}
+
+main();

+ 16 - 0
example/tsconfig.json

@@ -0,0 +1,16 @@
+{
+  "compilerOptions": {
+    "noImplicitAny": true,
+    "noEmitOnError": true,
+    "module": "commonjs",
+    "moduleResolution": "node",
+    "target": "ES5",
+    "sourceMap": false
+  },
+
+    "files": [
+      "../typings/es6/es6-promise.d.ts",
+      "../typings/es6/systemjs.d.ts",
+    "index.ts"
+  ]
+}

Some files were not shown because too many files changed in this diff