Commit ee5d9a4e by ramdayalmunda

loadExternalContent completed

parent c1a38610
......@@ -20,28 +20,18 @@ var ADocEditor = function (customConfig) {
fontFamily: 'Arial',
bold: false,
italic: false,
fontColor: "#0007"
fontColor: "#1e1f77"
},
}
var config = null;
var canvasList = []
var dataSet = [
{
id: `${++counter}`,
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.",
},
// {
// id: `${++counter}`,
// 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."
// }
{ id: 1, plainContent: "" }
]
var caretData = {
activeData: dataSet[0],
index: dataSet[0].plainContent.length,
index: 0,
interval: null,
intervalDuration: 800,
blink: false,
......@@ -77,6 +67,7 @@ var ADocEditor = function (customConfig) {
}
function reRenderPages(dataList, blinking = false) {
console.log('rendering', dataList)
if (renderInProgress) return
renderInProgress = true
......@@ -88,15 +79,18 @@ var ADocEditor = function (customConfig) {
// to clear the canvases
for (let i = 0; i < canvasList.length; i++) {
let ctx = canvasList[i].getContext('2d', { willReadFrequently: true })
ctx.save()
ctx.clearRect(0, 0, canvasList[i].width, canvasList[i].height)
ctx.fillStyle = config.format.background
ctx.fillRect(0, 0, canvasList[i].width, canvasList[i].height)
ctx.restore()
}
for (let i = 0; i < dataList.length; i++) {
let canvas = canvasList[canvasIndex]
canvas.setAttribute("tabIndex", -1)
renderText(canvas, dataList[i])
x = 0;
if (dataList[i].id == caretData.activeData.id) {
caretData.canvasIndex = canvasIndex;
......@@ -123,16 +117,19 @@ var ADocEditor = function (customConfig) {
let style = { ...config.style, ...dataSet?.style?.[i] }
if (i==0){
y += style.fontSize
}
ctx.save()
ctx.font = `28px Arial`
ctx.fillStyle = '#0007'
ctx.font = `${style.fontSize}px ${style.fontFamily}`
ctx.fillStyle = style.fontColor
let charWidth = ctx.measureText(dataSet.plainContent[i]).width
ctx.restore()
dataSet.formatedText[i] = {
char: dataSet.plainContent[i],
width: charWidth,
x: x,
y: y+style.fontSize,
y: y,
...style,
}
x+= charWidth
......@@ -154,6 +151,7 @@ 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}`
console.log('dataSet.formatedText[i].fontColor', dataSet.formatedText[i].fontColor)
ctx.fillStyle = dataSet.formatedText[i].fontColor
ctx.fillText(dataSet.formatedText[i].char, dataSet.formatedText[i].x, dataSet.formatedText[i].y)
ctx.restore()
......@@ -173,8 +171,10 @@ var ADocEditor = function (customConfig) {
function renderCaret() {
let ctx = canvasList[caretData.canvasIndex].getContext('2d', { willReadFrequently: true })
let activeTextData = caretData.activeData.formatedText[caretData.index-1]
let rectX = activeTextData.x+activeTextData.width;
let rectY = activeTextData.y-activeTextData.fontSize;
let rectX = activeTextData?.x+activeTextData?.width;
let rectY = activeTextData?.y-activeTextData?.fontSize;
rectX = rectX?rectX:0
rectY = rectY?rectY:0
let rectWidth = 2;
let rectHeight = caretData.caretSize;
......@@ -206,12 +206,12 @@ var ADocEditor = function (customConfig) {
function onFocusHandler(e) {
focusedCanvas = e.target
caretData.blink = false
reRenderPages(dataList)
reRenderPages(dataSet)
}
function onBlurHandler(e) {
focusedCanvas = null
caretData.blink = true
reRenderPages(dataList)
reRenderPages(dataSet)
}
......@@ -255,7 +255,7 @@ var ADocEditor = function (customConfig) {
else if (e.keyCode == 40) { }// down key
else { } // unhandled cases
reRenderPages(dataList)
reRenderPages(dataSet)
clearInterval(caretData.interval)
caretData.interval = setInterval(() => {
caretData.blink = !caretData.blink
......@@ -276,9 +276,20 @@ var ADocEditor = function (customConfig) {
function destory() {
clearInterval(caretData.interval)
}
return {
var returnObj = {
destory,
loadContent: function(data){
console.log('to load', JSON.parse( JSON.stringify( dataSet)))
dataSet = JSON.parse( JSON.stringify(data) )
console.log('new Data', JSON.parse( JSON.stringify( dataSet)))
caretData.activeData = null
caretData.activeData = dataSet[0]
caretData.index = dataSet[0].plainContent.length
reRenderPages(dataSet)
},
}
return returnObj
}
......
var tempDocData = [
{
"id": "1",
"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.",
"formatedText": [
{
"char": "D",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 20.220703125
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "d",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "y",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "v",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "b",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "G",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 21.779296875
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "I",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "A",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 18.67578125
},
{
"char": "g",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "P",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 18.67578125
},
{
"char": "l",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "E",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 18.67578125
},
{
"char": "p",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "?",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "L",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "m",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 23.32421875
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "l",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "l",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "y",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "g",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": ",",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "f",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": ",",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "m",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 23.32421875
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "1",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "2",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": ",",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "0",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "0",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "0",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "y",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "g",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": ",",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "m",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 23.32421875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "y",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "d",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "f",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "f",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "k",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "d",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "v",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "B",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 18.67578125
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "k",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "M",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 23.32421875
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "u",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "h",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "s",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "w",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 20.220703125
},
{
"char": "a",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "d",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": " ",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "d",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "r",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 9.32421875
},
{
"char": "e",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "c",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 14
},
{
"char": "t",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 7.779296875
},
{
"char": "i",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 6.220703125
},
{
"char": "o",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": "n",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
},
"width": 15.572265625
},
{
"char": ".",
"style": {
"fontSize": 28,
"fontFamily": "Arial",
"bold": false,
"italic": false,
"fontColor": "#0007"
id: `1`,
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.",
},
"width": 7.779296875
}
]
}
// {
// id: `2`,
// type: "text",
// plainContent: "The drug seekers would come into the emergency room and scream about how much pain they were in. When you told them that you would start elevating their pain with Tylenol or Advil instead of a narcotic they became nasty and combative. They would start telling you what drug and dose they had to have to make their pain tolerable.",
// },
]
export {
......
import { tempDocData } from "./randomDataSet.js"
!(async function(){
let editor = new ADocEditor({ element: document.getElementById("user-container-for-editor") })
editor.loadContent(tempDocData)
})()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment