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
c1280274
Commit
c1280274
authored
Dec 20, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added fontColor on PDF
parent
686178f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
a-doc-editor.css
dist/assets/a-doc-editor.css
+6
-2
a-doc-editor.js
dist/assets/a-doc-editor.js
+13
-11
No files found.
dist/assets/a-doc-editor.css
View file @
c1280274
...
@@ -15,6 +15,12 @@
...
@@ -15,6 +15,12 @@
padding
:
3px
;
padding
:
3px
;
cursor
:
default
;
cursor
:
default
;
}
}
.a-doc-editor
.dropdown-label
{
display
:
flex
;
flex-direction
:
column
;
text-align
:
center
;
justify-content
:
center
;
}
.a-doc-editor
.dropdown-list
{
.a-doc-editor
.dropdown-list
{
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
...
@@ -88,8 +94,6 @@
...
@@ -88,8 +94,6 @@
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.a-doc-editor
.footer
{
.a-doc-editor
.footer
{
overflow
:
auto
;
overflow
:
auto
;
background-color
:
#91d8bd
;
background-color
:
#91d8bd
;
...
...
dist/assets/a-doc-editor.js
View file @
c1280274
...
@@ -26,7 +26,6 @@ var ADocEditor = function (customConfig) {
...
@@ -26,7 +26,6 @@ var ADocEditor = function (customConfig) {
var
fontColorLabel
;
var
fontColorLabel
;
var
fontBold
;
var
fontBold
;
var
fontItalic
;
var
fontItalic
;
var
fontUnderline
;
var
fullScreenLoadingOverlay
;
var
fullScreenLoadingOverlay
;
var
defaultConfig
=
{
var
defaultConfig
=
{
...
@@ -140,9 +139,6 @@ var ADocEditor = function (customConfig) {
...
@@ -140,9 +139,6 @@ var ADocEditor = function (customConfig) {
<div class="option" ade-action="font-italic">
<div class="option" ade-action="font-italic">
<div class="option-button"><em>I</em></div>
<div class="option-button"><em>I</em></div>
</div>
</div>
<div class="option" ade-action="font-underline">
<div class="option-button"><u>U</u></div>
</div>
</div>
</div>
</div>
</div>
...
@@ -242,8 +238,6 @@ var ADocEditor = function (customConfig) {
...
@@ -242,8 +238,6 @@ var ADocEditor = function (customConfig) {
fontBold
.
addEventListener
(
'click'
,
toggleBold
)
fontBold
.
addEventListener
(
'click'
,
toggleBold
)
fontItalic
=
container
.
querySelector
(
'[ade-action="font-italic"]'
)
fontItalic
=
container
.
querySelector
(
'[ade-action="font-italic"]'
)
fontItalic
.
addEventListener
(
'click'
,
toggleItalic
)
fontItalic
.
addEventListener
(
'click'
,
toggleItalic
)
fontUnderline
=
container
.
querySelector
(
'[ade-action="font-underline"]'
)
fontUnderline
.
addEventListener
(
'click'
,
toggleUnderline
)
fullScreenLoadingOverlay
=
document
.
createElement
(
'div'
)
fullScreenLoadingOverlay
=
document
.
createElement
(
'div'
)
fullScreenLoadingOverlay
.
innerText
=
'Loading...'
fullScreenLoadingOverlay
.
innerText
=
'Loading...'
...
@@ -809,7 +803,7 @@ var ADocEditor = function (customConfig) {
...
@@ -809,7 +803,7 @@ var ADocEditor = function (customConfig) {
y: (config.pageSetup.canvasHeight - y) / config.pageSetup.canvasMultiplier,
y: (config.pageSetup.canvasHeight - y) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
font: embededFonts[style.fontFamily],
font: embededFonts[style.fontFamily],
color: rgb(
0, 0, 0
),
color: rgb(
...getRgbArrayFromHex( style.fontColor )
),
})
})
}
}
...
@@ -827,7 +821,7 @@ var ADocEditor = function (customConfig) {
...
@@ -827,7 +821,7 @@ var ADocEditor = function (customConfig) {
y: (config.pageSetup.canvasHeight - style.y) / config.pageSetup.canvasMultiplier,
y: (config.pageSetup.canvasHeight - style.y) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
font: embededFonts[style.fontFamily],
font: embededFonts[style.fontFamily],
color: rgb(
0, 0, 0
),
color: rgb(
...getRgbArrayFromHex( style.fontColor )
),
})
})
setData.formatedText[c].x = x
setData.formatedText[c].x = x
setData.formatedText[c].y = y
setData.formatedText[c].y = y
...
@@ -852,6 +846,17 @@ var ADocEditor = function (customConfig) {
...
@@ -852,6 +846,17 @@ var ADocEditor = function (customConfig) {
hideLoader()
hideLoader()
}
}
function getRgbArrayFromHex(hexString){
let rgbArr= [ 0,0,0 ]
if (hexString.length==4 || hexString.length==5){
rgbArr = [ parseInt(hexString[1], 16)/15, parseInt(hexString[2], 16)/15, parseInt(hexString[3], 16)/15 ]
}else if (hexString.length==7 || hexString.length==9){
rgbArr = [ parseInt(hexString.slice(1,3), 16)/255, parseInt(hexString.slice(3,5), 16)/255, parseInt(hexString.slice(5,7), 16)/255 ]
}
return rgbArr
}
function addFonts(paths, name) {
function addFonts(paths, name) {
if (typeof paths == 'string') paths = [paths]
if (typeof paths == 'string') paths = [paths]
let fontObj = {
let fontObj = {
...
@@ -940,9 +945,6 @@ var ADocEditor = function (customConfig) {
...
@@ -940,9 +945,6 @@ var ADocEditor = function (customConfig) {
caretData.activeData.style.italic = !isItalic
caretData.activeData.style.italic = !isItalic
}
}
}
}
function toggleUnderline(e){
console.log('underline', fontUnderline)
}
function focusLastCanvas(){
function focusLastCanvas(){
if (!lastFocusCanvas) lastFocusCanvas = canvasList[0].el
if (!lastFocusCanvas) lastFocusCanvas = canvasList[0].el
...
...
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