From 13b9ddb2e6704e7aba09a1ca55e70c6d08dfecc1 Mon Sep 17 00:00:00 2001 From: Kesavan D Date: Thu, 14 Nov 2019 10:50:11 +0530 Subject: [PATCH] Added getting started sample for Javascript Word Processor. --- .gitignore | 3 ++ README.md | 8 +++- e2e/index.spec.js | 0 e2e/protractor.conf.js | 20 ++++++++ gulpfile.js | 96 ++++++++++++++++++++++++++++++++++++++ license | 10 ++++ package.json | 29 ++++++++++++ src/app/app.ts | 5 ++ src/index.html | 23 +++++++++ src/resources/favicon.ico | Bin 0 -> 6574 bytes src/styles/styles.css | 1 + src/system.config.js | 32 +++++++++++++ tsconfig.json | 23 +++++++++ 13 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 e2e/index.spec.js create mode 100644 e2e/protractor.conf.js create mode 100644 gulpfile.js create mode 100644 license create mode 100644 package.json create mode 100644 src/app/app.ts create mode 100644 src/index.html create mode 100644 src/resources/favicon.ico create mode 100644 src/styles/styles.css create mode 100644 src/system.config.js create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8832057 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src/**/*.js +!src/system.config.js +node_modules/ diff --git a/README.md b/README.md index 129fea0..2f95a6c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ -# ej2-javascript-word-processor -Getting started with Syncfusion JavaScript Word Processor - https://www.syncfusion.com/javascript-ui-controls/js-word-processor +# Syncfusion JavaScript Word Processor +Getting started sample of Syncfusion JavaScript Word Processor +Feature Tour - https://www.syncfusion.com/javascript-ui-controls/js-word-processor +Demos - https://ej2.syncfusion.com/demos/#/material/document-editor/default +Documentation - https://ej2.syncfusion.com/documentation/introduction/ +KB - https://www.syncfusion.com/kb/essential-js2/documenteditor diff --git a/e2e/index.spec.js b/e2e/index.spec.js new file mode 100644 index 0000000..e69de29 diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js new file mode 100644 index 0000000..1bbe030 --- /dev/null +++ b/e2e/protractor.conf.js @@ -0,0 +1,20 @@ +exports.config = { + + allScriptsTimeout: 11000, + + capabilities: { + 'browserName': 'chrome' + }, + + framework: 'jasmine', + + jasmineNodeOpts: { + defaultTimeoutInterval: 10000 + }, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + }, + + specs: ['./*.spec.js'] +}; \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..8156c63 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,96 @@ +'use strict'; + +var gulp = require('gulp'); + +/** + * Load the sample in src/app/index + */ +gulp.task('start', ['compile'], function(done) { + var browserSync = require('browser-sync'); + var bs = browserSync.create('Essential JS 2'); + var options = { + server: { + baseDir: ['./src', './'] + }, + ui: false + }; + bs.init(options, done); + + /** + * Watching typescript file changes + */ + gulp.watch('src/**/*.ts', ['compile', bs.reload]).on('change', reportChanges); +}); + +/** + * Compile TypeScript to JS + */ +gulp.task('compile', function(done) { + var ts = require('gulp-typescript'); + // Default typescript config + var defaultConfig = { + typescript: require('typescript') + }; + var tsProject, tsResult; + // Create the typescript project + tsProject = ts.createProject('tsconfig.json', defaultConfig); + // Get typescript result + tsResult = gulp.src(['./src/**/*.ts'], { base: '.' }) + .pipe(ts(tsProject)) + .pipe(gulp.dest('./')) + .on('error', function(e) { + done(e); + process.exit(1); + }).on('end', function() { + done(); + }); +}); + +function reportChanges(event) { + console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); +} +/** + * Testing spec files + */ +var protractor = require('gulp-protractor').protractor; +var webdriver_standalone = require('gulp-protractor').webdriver_standalone; +var webdriver_update = require('gulp-protractor').webdriver_update_specific; + +gulp.task('e2e-serve', webdriver_standalone); + +gulp.task('e2e-webdriver-update', webdriver_update({ + webdriverManagerArgs: ['--ie', '--edge'] +})); + +gulp.task('e2e-test', ['compile'], function(done) { + var browserSync = require('browser-sync'); + var bs = browserSync.create('Essential JS 2'); + var options = { + server: { + baseDir: [ + './src/app/', + './src/resource/', + './node_modules/@syncfusion/ej2/' + ], + directory: true + }, + ui: false, + open: false, + notify: false + }; + bs.init(options, function() { + gulp.src(['./spec/**/*.spec.js']) + .pipe(protractor({ + configFile: 'e2e/protractor.conf.js' + })) + .on('error', function(e) { + console.error('Error: ' + e.message); + done(); + process.exit(1); + }) + .on('end', function() { + done(); + process.exit(0); + }); + }); +}); \ No newline at end of file diff --git a/license b/license new file mode 100644 index 0000000..111c12a --- /dev/null +++ b/license @@ -0,0 +1,10 @@ +Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license. + +To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions. + +Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options. + +Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions. + +The Syncfusion license that contains the terms and conditions can be found at +https://www.syncfusion.com/content/downloads/syncfusion_license.pdf diff --git a/package.json b/package.json new file mode 100644 index 0000000..fdf22c9 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "ej2-quickstart", + "version": "0.0.1", + "description": "Essential JS 2 typescript quick start application", + "author": "Syncfusion Inc.", + "license": "SEE LICENSE IN license", + "repository": { + "type": "git", + "url": "https://github.com/syncfusion/ej2-quickstart.git" + }, + "dependencies": { + "@syncfusion/ej2": "*" + }, + "devDependencies": { + "browser-sync": "^2.18.12", + "gulp": "^3.9.1", + "gulp-protractor": "^4.1.0", + "gulp-typescript": "^2.13.0", + "jasmine": "^2.6.0", + "systemjs": "^0.20.14", + "typescript": "2.3.4" + }, + "scripts": { + "start": "gulp start", + "serve": "gulp e2e-serve", + "test": "gulp e2e-test", + "update-webdriver": "gulp e2e-webdriver-update" + } +} \ No newline at end of file diff --git a/src/app/app.ts b/src/app/app.ts new file mode 100644 index 0000000..f131a5e --- /dev/null +++ b/src/app/app.ts @@ -0,0 +1,5 @@ +import { DocumentEditorContainer,Toolbar } from '@syncfusion/ej2-documenteditor'; + +DocumentEditorContainer.Inject(Toolbar); +let documenteditor: DocumentEditorContainer = new DocumentEditorContainer(); +documenteditor.appendTo('#DocumentEditor'); \ No newline at end of file diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..ccb2d85 --- /dev/null +++ b/src/index.html @@ -0,0 +1,23 @@ + + + + Essential JS 2 - Document Editor + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/src/resources/favicon.ico b/src/resources/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d8d5c152e7353a07c3e519c9e53ac9328e515fa8 GIT binary patch literal 6574 zcmeHLZ)jUp6o1J}(=>U>YhL@3w0TL>C8MsL+H`gkEVxdkmO9tb;jBuvbG9p5I^2g+ zoQ_RobEu4M#mx^QI7C|n@y`&)zU<3BbPQB*vVCzdnHEGebfLH<{!U+RdizYC2_~~j z1HasR&O7J+&b{}%bKiS{U=c*2x>`UR5q8-GVZ9(Mk>7TV@$vY-_rFZ=hz7$<%I*YLf(BcUQQv$12qd1n5&7W;6a-9p|6b zEhm49g@-KH`gmCjM%xIyj%eKs>3FcY z7n(o3J#i>co_LArxZI=s%9(%6R(@pPpgxCWiu%Ry6DQk0y}gm7yr6rAVRyV~hT>x~ zwUqzFqjN9j0FA-VgT-jp@-Yrp@Q=->eJHEXYL9=tkj!kdk!e*gDhmYScQgOFnb;OE~-vz&&w zQajg1Pn+N~)SZTV{K{q%o6~)<&}%H8s9lI*l^4D+KY9dvo5Ozg=*(Ki>YA>-a|SZ~p!SYpRMR literal 0 HcmV?d00001 diff --git a/src/styles/styles.css b/src/styles/styles.css new file mode 100644 index 0000000..e18f6d4 --- /dev/null +++ b/src/styles/styles.css @@ -0,0 +1 @@ +@import '../../node_modules/@syncfusion/ej2/material.css'; diff --git a/src/system.config.js b/src/system.config.js new file mode 100644 index 0000000..b4da656 --- /dev/null +++ b/src/system.config.js @@ -0,0 +1,32 @@ +System.config({ + paths: { + 'syncfusion:': './node_modules/@syncfusion/', + }, + map: { + app: 'app', + + //Syncfusion packages mapping + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js", + "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-office-chart": "syncfusion:ej2-office-chart/dist/ej2-office-chart.umd.min.js", + "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js", + "@syncfusion/ej2-charts": "syncfusion:ej2-charts/dist/ej2-charts.umd.min.js", + "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js", + "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js", + "@syncfusion/ej2-documenteditor": "syncfusion:ej2-documenteditor/dist/ej2-documenteditor.umd.min.js" + }, + packages: { + 'app': { main: 'app', defaultExtension: 'js' } + } +}); + +System.import('app'); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8c9efbb --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "removeComments": true, + "noLib": false, + "sourceMap": true, + "pretty": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "allowJs": false, + "noEmitOnError": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "suppressImplicitAnyIndexErrors": true, + "lib": ["es6", "dom"] + }, + "compileOnSave": false +} \ No newline at end of file