Skip to content

Commit 6df44ca

Browse files
committed
Add the expression builder to JQuery and include the parser inside the funciton
1 parent 14db63e commit 6df44ca

8 files changed

Lines changed: 1604 additions & 946 deletions

File tree

demo/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
99
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
1010
<script src="index.js"></script>
11-
<script src="../parser/script.js"></script>
1211
<script src="../src/expression-builder-v2.js"></script>
1312
<title>exp-js</title>
1413
</head>

demo/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let funcs = {
2525

2626

2727
$(function () {
28-
expressionBuilder2('#txt', {
28+
$('#txt').expressionBuilder({
2929
funcs: funcs,
3030
variables: [
3131
{
@@ -42,7 +42,7 @@ $(function () {
4242
}
4343
]
4444
});
45-
expressionBuilder2('#txt2', {
45+
$('#txt2').expressionBuilder({
4646
variables: [
4747
{
4848
variableId: 1,
@@ -59,7 +59,7 @@ $(function () {
5959

6060
$('#txt').keypress(function () {
6161
setTimeout(function () {
62-
let txtExp = expressionBuilder2('#txt');
62+
let txtExp = $('#txt').expressionBuilder();
6363
let exp = txtExp.getExpression();
6464
$('.res-1-1').html("Expression: " + exp);
6565

@@ -69,7 +69,7 @@ $(function () {
6969
});
7070

7171
$('#btn-1-2').click(function () {
72-
let txtExp = expressionBuilder2('#txt2');
72+
let txtExp = $('#txt2').expressionBuilder();
7373
txtExp.setExpression($('#txt-1-2').val());
7474
});
7575
});

parser/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
interface ParserOption {
44
funcs?: any,
5-
variables?: Array<ExpVariable>
5+
variables?: Array<ExpressionBuilderVariable>
66
}
77

88
let parser = function (expression: string, options?: ParserOption) {

0 commit comments

Comments
 (0)