Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_MATH01
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
JM_MATH01
Commits
34d59929
Commit
34d59929
authored
Nov 20, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: custom formula input
parent
4d9a6bcd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
formula-input.component.ts
src/app/common/formula-input/formula-input.component.ts
+17
-7
formula-board.js
src/assets/formula-board/formula-board.js
+1
-1
formula-board.js.map
src/assets/formula-board/formula-board.js.map
+1
-1
index.html
src/index.html
+2
-0
No files found.
src/app/common/formula-input/formula-input.component.ts
View file @
34d59929
...
...
@@ -8,6 +8,7 @@ import {
OnInit
,
Output
,
ViewChild
}
from
'
@angular/core
'
;
import
{
fromEvent
,
Observable
,
Subscription
}
from
'
rxjs
'
;
declare
global
{
interface
Window
{
...
...
@@ -18,6 +19,9 @@ declare global {
}
}
@
Component
({
selector
:
'
app-formula-input
'
,
templateUrl
:
'
./formula-input.component.html
'
,
...
...
@@ -36,6 +40,10 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
@
Output
()
ngfBlur
=
new
EventEmitter
();
FB_id
=
'
FormulaBoard
'
;
private
esc
:
Subscription
;
constructor
()
{
...
...
@@ -78,23 +86,25 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
id
:
this
.
FB_id
,
path
:
'
assets/formula-board/
'
,
options
:
{
width
:
60
0
,
mode
:
'
android
'
,
width
:
192
0
,
mode
:
'
pc
'
,
bottom
:
false
,
}});
document
.
addEventListener
(
'
documentMessage
'
,
(
e
)
=>
{
// @ts-ignore
if
(
e
.
detail
.
type
===
'
common.setFormula
'
)
{
const
{
type
}
=
e
.
detail
;
if
(
type
===
'
common.setFormula
'
)
{
// @ts-ignore
const
{
formula
}
=
e
.
detail
.
data
.
body
;
console
.
log
(
formula
);
window
.
FBOARD
.
clear
();
// @ts-ignore
window
.
__tmp_fp_input_model__
.
updateValue
(
formula
);
const
fb
=
document
.
getElementById
(
this
.
FB_id
);
fb
.
style
.
visibility
=
'
hidden
'
;
this
.
ngfBlur
.
emit
();
window
.
FBOARD
.
editor
.
style
.
visibility
=
'
hidden
'
;
this
.
ngfBlur
.
emit
();
}
if
(
type
===
'
common.closeModal
'
)
{
window
.
FBOARD
.
editor
.
style
.
visibility
=
'
hidden
'
;
}
});
}
...
...
src/assets/formula-board/formula-board.js
View file @
34d59929
This diff is collapsed.
Click to expand it.
src/assets/formula-board/formula-board.js.map
View file @
34d59929
This diff is collapsed.
Click to expand it.
src/index.html
View file @
34d59929
...
...
@@ -15,6 +15,8 @@
/*visibility: visible!important;*/
/*position: relative!important;*/
transition
:
none
;
transform
:
scale
(
.8
)
!important
;
transform-origin
:
left
top
!important
;
}
.kf-placeholder
{
display
:
none
!important
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment