From f4eb8ee43524168eb0028399596899488172aa27 Mon Sep 17 00:00:00 2001 From: Dave Willmer Date: Thu, 5 Nov 2015 20:17:13 +0000 Subject: [PATCH 01/10] Initial commit --- README.md | 90 + example/build/index.d.ts | 0 example/build/index.js | 20 + example/build/index.js.map | 1 + example/bundle.js | 3853 +++++++++++++ example/ext/codemirror.css | 320 + example/ext/codemirror.js | 8645 ++++++++++++++++++++++++++++ example/ext/jquery-2.1.4.min.js | 4 + example/ext/pythonmode.js | 359 ++ example/index.css | 10 + example/index.html | 14 + example/src/index.ts | 29 + example/tsconfig.json | 15 + package.json | 64 + scripts/copycss.js | 3 + scripts/travis_after_success.sh | 17 + scripts/travis_install.sh | 19 + scripts/travis_script.sh | 12 + src/codemirror-ipython.js | 38 + src/index.ts | 296 + src/settings.ts | 48 + src/tsconfig.json | 16 + typings/codemirror/codemirror.d.ts | 919 +++ typings/es6-promise.d.ts | 71 + typings/expect.js/expect.js.d.ts | 227 + typings/mocha/mocha.d.ts | 220 + 26 files changed, 15310 insertions(+) create mode 100644 README.md create mode 100644 example/build/index.d.ts create mode 100644 example/build/index.js create mode 100644 example/build/index.js.map create mode 100644 example/bundle.js create mode 100644 example/ext/codemirror.css create mode 100644 example/ext/codemirror.js create mode 100644 example/ext/jquery-2.1.4.min.js create mode 100644 example/ext/pythonmode.js create mode 100644 example/index.css create mode 100644 example/index.html create mode 100644 example/src/index.ts create mode 100644 example/tsconfig.json create mode 100644 package.json create mode 100644 scripts/copycss.js create mode 100644 scripts/travis_after_success.sh create mode 100644 scripts/travis_install.sh create mode 100644 scripts/travis_script.sh create mode 100644 src/codemirror-ipython.js create mode 100644 src/index.ts create mode 100644 src/settings.ts create mode 100644 src/tsconfig.json create mode 100644 typings/codemirror/codemirror.d.ts create mode 100644 typings/es6-promise.d.ts create mode 100644 typings/expect.js/expect.js.d.ts create mode 100644 typings/mocha/mocha.d.ts diff --git a/README.md b/README.md new file mode 100644 index 0000000..c66a2ed --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ +Jupyter JS Editor +================= + +Code/text editor for Jupyter. + +[API Docs](http://jupyter.github.io/jupyter-js-editor/) + + +Package Install +--------------- + +**Prerequisites** +- [node](http://nodejs.org/) + +```bash +npm install --save jupyter-js-editor +``` + + +Source Build +------------ + +**Prerequisites** +- [git](http://git-scm.com/) +- [node 0.12+](http://nodejs.org/) + +```bash +git clone https://github.com/jupyter/jupyter-js-editor.git +cd jupyter-js-editor +npm install +npm run build +``` + +**Rebuild** +```bash +npm run clean +npm run build +``` + + +Run Tests +--------- + +Follow the source build instructions first. + +```bash +npm test +``` + + +Build Docs +---------- + +Follow the source build instructions first. + +```bash +npm run docs +``` + +Navigate to `docs/index.html`. + + +Supported Runtimes +------------------ + +The runtime versions which are currently *known to work* are listed below. +Earlier versions may also work, but come with no guarantees. + +- Node 0.12.7+ +- IE 11+ +- Firefox 32+ +- Chrome 38+ + + +Bundle for the Browser +---------------------- + +Follow the package install instructions first. + +```bash +npm install --save-dev browserify +browserify myapp.js -o mybundle.js +``` + + +Usage Examples +-------------- + +**Note:** This module is fully compatible with Node/Babel/ES6/ES5. Simply +omit the type declarations when using a language other than TypeScript. diff --git a/example/build/index.d.ts b/example/build/index.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/example/build/index.js b/example/build/index.js new file mode 100644 index 0000000..1e29c94 --- /dev/null +++ b/example/build/index.js @@ -0,0 +1,20 @@ +/*----------------------------------------------------------------------------- +| Copyright (c) 2014-2015, PhosphorJS Contributors +| +| Distributed under the terms of the BSD 3-Clause License. +| +| The full license is in the file LICENSE, distributed with this software. +|----------------------------------------------------------------------------*/ +'use-strict'; +var phosphor_widget_1 = require('phosphor-widget'); +var index_1 = require('../../lib/index'); +function main() { + var model = new index_1.EditorModel(); + var viewmodel = new index_1.EditorViewModel(model); + var view = new index_1.EditorWidget(viewmodel); + phosphor_widget_1.Widget.attach(view, document.getElementById('main')); + view.update(); + window.onresize = function () { return view.update(); }; +} +window.onload = main; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/example/build/index.js.map b/example/build/index.js.map new file mode 100644 index 0000000..af5a633 --- /dev/null +++ b/example/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":["main"],"mappings":"AAAA;;;;;;+EAM+E;AAC/E,YAAY,CAAC;AAEb,gCAEO,iBAAiB,CAAC,CAAA;AAEzB,sBAEO,iBAAiB,CAAC,CAAA;AAEzB;IACEA,IAAIA,KAAKA,GAAGA,IAAIA,mBAAWA,EAAEA,CAACA;IAC9BA,IAAIA,SAASA,GAAGA,IAAIA,uBAAeA,CAACA,KAAKA,CAACA,CAACA;IAC3CA,IAAIA,IAAIA,GAAGA,IAAIA,oBAAYA,CAACA,SAASA,CAACA,CAACA;IAEvCA,wBAAMA,CAACA,MAAMA,CAACA,IAAIA,EAAEA,QAAQA,CAACA,cAAcA,CAACA,MAAMA,CAACA,CAACA,CAACA;IACrDA,IAAIA,CAACA,MAAMA,EAAEA,CAACA;IAEdA,MAAMA,CAACA,QAAQA,GAAGA,cAAMA,OAAAA,IAAIA,CAACA,MAAMA,EAAEA,EAAbA,CAAaA,CAACA;AACxCA,CAACA;AAED,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/example/bundle.js b/example/bundle.js new file mode 100644 index 0000000..d2573f0 --- /dev/null +++ b/example/bundle.js @@ -0,0 +1,3853 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o tag with optional data attributes + createLink: function(href, attributes) { + var head = document.head || document.getElementsByTagName('head')[0]; + var link = document.createElement('link'); + + link.href = href; + link.rel = 'stylesheet'; + + for (var key in attributes) { + if ( ! attributes.hasOwnProperty(key)) { + continue; + } + var value = attributes[key]; + link.setAttribute('data-' + key, value); + } + + head.appendChild(link); + }, + // Create a