Skip to content

Commit 7f94a32

Browse files
897552: Added sample in different method
1 parent 10d3f5a commit 7f94a32

File tree

11 files changed

+314
-88
lines changed

11 files changed

+314
-88
lines changed

Annotations/How to add handwritten signature programmatically/index.html

Lines changed: 51 additions & 88 deletions
Large diffs are not rendered by default.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Essential JS 2 QuickStart
2+
3+
This project is a skeleton application used to create [Essential JS 2](https://www.syncfusion.com/products/essential-js2) web application.
4+
5+
>This application uses the latest version of the [webpack-cli](https://webpack.js.org/api/cli/#commands). It requires node `v14.15.0` or higher.
6+
7+
## Getting Started
8+
9+
To get started you need to clone the `ej2-quickstart` repository and navigate to `ej2-quickstart` location.
10+
11+
```
12+
git clone https://github.com/syncfusion/ej2-quickstart.git quickstart
13+
cd quickstart
14+
```
15+
16+
## Installing
17+
18+
We can get all the Essential JS 2 components in a single npm package [`ej2`](https://www.npmjs.com/package/@syncfusion/ej2).
19+
20+
We already configure the required packages in the `package.json` file.
21+
22+
You can run the below command to install all dependent packages related to this seed project.
23+
24+
```
25+
npm install
26+
```
27+
28+
## Testing
29+
30+
This application is preconfigured with End-to-End testing and the test case is written in Jasmine.
31+
32+
We run the test scripts with [Protractor](http://www.protractortest.org/#/) end-to-end test runner. The test case file can be found in the `e2e` folder.
33+
34+
Protractor can interact with our web application and verify the test scripts.
35+
36+
We have to install WebDriver and also need to ensure it is updated. Open a separate terminal and run the below npm script.
37+
38+
```
39+
npm run update-webdriver
40+
```
41+
42+
Open another terminal and run the below npm script. It will start web server to serve our application.
43+
44+
```
45+
npm run serve
46+
```
47+
48+
Once the web server is up and running, we can run the end-to-end tests using the below npm script
49+
50+
```
51+
npm run test
52+
```
53+
54+
> **Note:** Since Protractor is using the Selenium Standalone Server, the Java Development Kit (JDK) need to be installed in your local machine.
55+
56+
If JDK is not installed in your local machine, you can download it from [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
57+
58+
## Running
59+
60+
The application is configured with [webpack-dev-server](https://webpack.js.org/configuration/dev-server/#devserver), so it will serve the web application in your default browser.
61+
62+
We have used [Webpack](https://github.com/webpack/webpack) for module loading.
63+
64+
You can use the below npm script to run the web application.
65+
66+
```
67+
npm run start
68+
```
69+
70+
## Resources
71+
72+
You can also refer the below resources to know more details about Essential JS 2 components.
73+
74+
* [Pure JS Demos](http://ej2.syncfusion.com/demos/)
75+
* [Pure JS Documentation](http://ej2.syncfusion.com/documentation/)

How to/Add Handwritten Signature Programmatically/e2e/index.spec.js

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
exports.config = {
2+
3+
allScriptsTimeout: 11000,
4+
5+
capabilities: {
6+
'browserName': 'chrome'
7+
},
8+
9+
framework: 'jasmine',
10+
11+
jasmineNodeOpts: {
12+
defaultTimeoutInterval: 10000
13+
},
14+
directConnect: true,
15+
16+
onPrepare: function() {
17+
browser.waitForAngularEnabled(false);
18+
},
19+
20+
specs: ['./*.spec.js']
21+
};
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
require("@syncfusion/ej2-sample-helper-test");
2+
3+
'use strict';
4+
5+
var gulp = require('gulp');
6+
7+
/**
8+
* Compile TypeScript to JS
9+
*/
10+
gulp.task('compile', function (done) {
11+
var webpack = require('webpack');
12+
var webpackStream = require('webpack-stream');
13+
gulp.src(['./src/app/app.ts']).pipe(webpackStream({
14+
config: require('./webpack.config.js')
15+
}, webpack))
16+
.pipe(gulp.dest('./dist'))
17+
.on('end', function () {
18+
done();
19+
});
20+
});
21+
22+
/**
23+
* Testing spec files
24+
*/
25+
var protractor = require('gulp-protractor').protractor;
26+
var webdriver_standalone = require('gulp-protractor').webdriver_standalone;
27+
var webdriver_update = require('gulp-protractor').webdriver_update_specific;
28+
29+
gulp.task('e2e-serve', webdriver_standalone);
30+
31+
gulp.task('e2e-webdriver-update', webdriver_update({
32+
webdriverManagerArgs: ['--ie', '--edge']
33+
}));
34+
35+
gulp.task('e2e-test', gulp.series('compile', function (done) {
36+
var browserSync = require('browser-sync');
37+
var bs = browserSync.create('Essential JS 2');
38+
var options = {
39+
server: {
40+
baseDir: [
41+
'./dist/',
42+
],
43+
directory: true
44+
},
45+
ui: false,
46+
open: false,
47+
notify: false
48+
};
49+
bs.init(options, function () {
50+
gulp.src(['./spec/**/*.spec.js'])
51+
.pipe(protractor({
52+
configFile: 'e2e/protractor.conf.js'
53+
}))
54+
.on('error', function (e) {
55+
console.error('Error: ' + e.message);
56+
done();
57+
process.exit(1);
58+
})
59+
.on('end', function () {
60+
done();
61+
process.exit(0);
62+
});
63+
});
64+
}));
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
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.
2+
3+
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.
4+
5+
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
6+
7+
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.
8+
9+
The Syncfusion license that contains the terms and conditions can be found at
10+
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf

How to/Add Handwritten Signature Programmatically/src/app/app.ts

Lines changed: 50 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>Essential JS 2</title>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
8+
<meta name="description" content="Essential JS 2" />
9+
<meta name="author" content="Syncfusion" />
10+
<link rel="shortcut icon" href="resources/favicon.ico" />
11+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
12+
</head>
13+
14+
<body>
15+
<!--Element which will render as PDF Viewer -->
16+
<br><br><br>
17+
<button id="addHandwrttenSignature "> Add Handwrtten signature</button>
18+
<div id="PdfViewer"></div>
19+
</body>
20+
21+
</html>
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import '../../node_modules/@syncfusion/ej2-base/styles/material.css';
2+
@import '../../node_modules/@syncfusion/ej2-buttons/styles/material.css';
3+
@import '../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
4+
@import '../../node_modules/@syncfusion/ej2-inputs/styles/material.css';
5+
@import '../../node_modules/@syncfusion/ej2-navigations/styles/material.css';
6+
@import '../../node_modules/@syncfusion/ej2-popups/styles/material.css';
7+
@import '../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
8+
@import "../../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css";
9+
@import "../../node_modules/@syncfusion/ej2-notifications/styles/material.css";

0 commit comments

Comments
 (0)