Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Ramdayal Munda
a-doc-editor
Commits
1cc790b5
Commit
1cc790b5
authored
Dec 01, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc editor fixes
parent
44af4271
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
a-doc-editor.css
dist/assets/a-doc-editor.css
+0
-4
a-doc-editor.js
dist/assets/a-doc-editor.js
+3
-6
script.js
dist/script.js
+6
-0
No files found.
dist/assets/a-doc-editor.css
View file @
1cc790b5
...
...
@@ -88,10 +88,6 @@
.a-doc-editor
.body
.sidebar-body
{
flex
:
1
;
padding
:
8px
;
left
:
20%
;
right
:
20%
;
top
:
0
;
bottom
:
0
;
text-align
:
center
;
overflow
:
auto
;
display
:
flex
;
...
...
dist/assets/a-doc-editor.js
View file @
1cc790b5
...
...
@@ -31,7 +31,8 @@ var ADocEditor = function (customConfig) {
var
config
=
null
;
var
canvasList
=
[]
const
dataTypes
=
[
"paragraph"
,
"paragraph"
,
// simple text filled line by line
"list"
,
// sequence of line that preserves indentation
]
var
dataSet
=
[
{
...
...
@@ -184,10 +185,8 @@ var ADocEditor = function (customConfig) {
ctx
.
save
()
let
maxWidth
=
config
.
pageSetup
.
canvasWidth
let
lines
=
[]
let
wordStartIndex
=
0
let
wordEndIndex
=
0
let
words
=
""
let
wordsLength
=
0
;
dataSet
.
formatedText
=
[]
for
(
let
i
=
0
;
i
<
dataSet
.
plainContent
.
length
;
i
++
)
{
...
...
@@ -229,7 +228,6 @@ var ADocEditor = function (customConfig) {
}
for
(
let
i
=
0
;
i
<
dataSet
.
formatedText
.
length
;
i
++
)
{
ctx
.
save
()
ctx
.
font
=
`
${
dataSet
.
formatedText
[
i
].
fontSize
}
px
${
dataSet
.
formatedText
[
i
].
fontFamily
}
`
...
...
@@ -383,10 +381,9 @@ var ADocEditor = function (customConfig) {
destory
,
loadContent
:
function
(
data
)
{
dataSet
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
reRenderPages
(
dataSet
)
caretData
.
activeData
=
null
caretData
.
activeData
=
dataSet
[
0
]
caretData
.
index
=
dataSet
[
0
].
plainContent
.
length
reRenderPages
(
dataSet
)
},
getContent
:
function
(){
return
JSON
.
parse
(
JSON
.
stringify
(
dataSet
)
)
...
...
dist/script.js
View file @
1cc790b5
...
...
@@ -10,6 +10,12 @@ function setData() {
{
id
:
`1`
,
type
:
"text"
,
plainContent
:
"Hello World!"
,
},
{
id
:
`2`
,
type
:
"text"
,
plainContent
:
"Did you ever hear about the Great Ice Age or the Pleistocene Epoch? Less than one million years ago, in fact, some 12,000 years ago, an ice sheet many thousands of feet thick rode over Burke Mountain in a southeastward direction."
,
},
...
...
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