Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yannis Barlas
editoria
Commits
88bb685e
Commit
88bb685e
authored
7 years ago
by
chris
Committed by
john
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
isolated node created for first note and saved
parent
a891f078
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/SimpleEditor/panes/Notes/Notes.js
+9
-19
9 additions, 19 deletions
app/components/SimpleEditor/panes/Notes/Notes.js
app/components/SimpleEditor/panes/Notes/NotesProvider.js
+3
-17
3 additions, 17 deletions
app/components/SimpleEditor/panes/Notes/NotesProvider.js
with
12 additions
and
36 deletions
app/components/SimpleEditor/panes/Notes/Notes.js
+
9
−
19
View file @
88bb685e
...
...
@@ -17,6 +17,13 @@ class Notes extends Component {
// use toc:updated to avoid rewriting TOCProvider's this.handleDocumentChange
didMount
()
{
this
.
context
.
editorSession
.
onUpdate
(
'
document
'
,
this
.
onNotesUpdated
,
this
)
const
provider
=
this
.
getProvider
()
const
notes
=
provider
.
computeEntries
()
for
(
var
i
=
0
;
i
<
notes
.
main
.
length
;
i
++
)
{
provider
.
createIsolatedNote
(
notes
.
main
[
i
])
}
}
initResize
(
e
)
{
...
...
@@ -63,23 +70,10 @@ class Notes extends Component {
_initMiniEditor
(
tx
)
{
const
configurator
=
new
Configurator
().
import
(
config
)
configurator
.
addImporter
(
'
html
'
,
Importer
)
console
.
log
(
'
tx
'
,
tx
)
const
importer
=
configurator
.
createImporter
(
'
html
'
)
const
provider
=
this
.
getProvider
()
const
notes
=
provider
.
computeEntries
()
let
nontesContent
=
''
if
(
this
.
context
.
notesProvider
.
config
.
miniEditorSession
!==
''
)
{
for
(
var
i
=
0
;
i
<
notes
.
main
.
length
;
i
++
)
{
console
.
log
(
'
old
'
,
provider
)
console
.
log
(
'
createIsolated
'
,
provider
.
createIsolatedNote
(
notes
.
main
[
i
]))
nontesContent
+=
provider
.
createIsolatedNote
(
notes
.
main
[
i
])
}
}
const
importer
=
configurator
.
createImporter
(
'
html
'
)
const
doc
=
importer
.
importDocument
(
notesContent
)
const
doc
=
importer
.
importDocument
(
''
)
const
editorSession
=
new
EditorSession
(
doc
,
{
configurator
:
configurator
...
...
@@ -95,8 +89,6 @@ class Notes extends Component {
const
notes
=
provider
.
computeEntries
()
let
self
=
this
console
.
log
(
'
notes
'
,
notes
)
forEach
(
notes
.
main
,
function
(
mainNote
)
{
forEach
(
notes
.
mini
,
function
(
miniNote
)
{
if
(
miniNote
.
parentNoteId
===
mainNote
.
id
)
{
...
...
@@ -107,8 +99,6 @@ class Notes extends Component {
}
})
})
// this.context.editor.rerender()
console
.
log
(
'
notes after
'
,
notes
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
()
})
...
...
This diff is collapsed.
Click to expand it.
app/components/SimpleEditor/panes/Notes/NotesProvider.js
+
3
−
17
View file @
88bb685e
...
...
@@ -23,7 +23,7 @@ class NotesProvider extends TOCProvider {
const
entriesMain
=
this
.
sortNodes
(
notesMain
)
const
entriesMini
=
this
.
sortNodesMini
(
notesMini
)
console
.
log
(
entriesMain
,
entriesMini
)
//
console.log(entriesMain, entriesMini)
const
entries
=
{
main
:
entriesMain
,
mini
:
entriesMini
...
...
@@ -61,10 +61,7 @@ class NotesProvider extends TOCProvider {
let
notes
=
_
.
clone
(
nodes
)
if
(
this
.
config
.
miniEditorSession
===
''
)
return
const
doc
=
this
.
config
.
miniEditorSession
.
document
const
container
=
doc
.
get
(
'
body
'
)
// console.log(notes)
// const doc = this.config.miniEditorSession.document
notes
=
_
.
map
(
notes
,
function
(
note
)
{
// const blockId = note.path[0]
// const blockPosition = container.getPosition(blockId)
...
...
@@ -84,8 +81,6 @@ class NotesProvider extends TOCProvider {
}
createShowNote
(
note
)
{
console
.
log
(
'
in provider
'
,
note
)
console
.
log
(
'
this
'
,
this
)
if
(
note
[
'
note-content
'
]
!==
''
)
{
console
.
log
(
'
empty
'
)
...
...
@@ -106,18 +101,9 @@ class NotesProvider extends TOCProvider {
createIsolatedNote
(
note
)
{
let
self
=
this
let
node
=
{}
console
.
log
(
'
this
'
,
this
)
this
.
config
.
miniEditorSession
.
transaction
(
function
(
tx
)
{
var
container
=
tx
.
get
(
'
body
'
)
// console.log('container', container)
// var textType = tx.getSchema().getDefaultTextType()
// console.log('tx', tx)
let
nodeData
=
self
.
createNodeData
(
tx
,
note
)
// console.log('nodeData', nodeData)
node
=
tx
.
insertBlockNode
(
nodeData
)
console
.
log
(
'
node
'
,
node
)
tx
.
insertBlockNode
(
nodeData
)
})
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment