Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
jio
Commits
f1a032a0
Commit
f1a032a0
authored
Jan 08, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postToDocumentTree from revisionstorage.js updated
parent
770d537c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
src/jio.storage/revisionstorage.js
src/jio.storage/revisionstorage.js
+11
-13
No files found.
src/jio.storage/revisionstorage.js
View file @
f1a032a0
...
...
@@ -208,15 +208,15 @@ jIO.addStorageType('revision', function (spec, my) {
* @method postToDocumentTree
* @param {object} doctree The document tree object
* @param {object} doc The document object
* @param {boolean} set_node_to_deleted
true/false
* @param {boolean} set_node_to_deleted
Set the revision to deleted
* @return {array} The added document revs_info
*/
priv
.
postToDocumentTree
=
function
(
doctree
,
doc
,
set_node_to_deleted
)
{
var
i
,
revs_info
,
next_rev
,
next_rev_str
,
next_rev_status
,
selectNode
,
selected_node
,
revs_info
=
[],
selected_node
=
doctree
;
var
i
,
revs_info
,
next_rev
,
next_rev_str
,
selectNode
,
selected_node
,
flag
;
flag
=
set_node_to_deleted
===
true
?
"
deleted
"
:
"
available
"
;
revs_info
=
[]
;
selected_node
=
doctree
;
selectNode
=
function
(
node
)
{
var
i
;
if
(
typeof
node
.
rev
!==
"
undefined
"
)
{
...
...
@@ -255,28 +255,26 @@ jIO.addStorageType('revision', function (spec, my) {
doc
.
_rev
||
0
,
doc
,
priv
.
revsInfoToHistory
(
revs_info
),
set_node_to_deleted
);
next_rev_str
=
next_rev
.
join
(
"
-
"
);
next_rev_status
=
set_node_to_deleted
===
true
?
"
deleted
"
:
"
available
"
;
// don't add if the next rev already exists
for
(
i
=
0
;
i
<
selected_node
.
children
.
length
;
i
+=
1
)
{
if
(
selected_node
.
children
[
i
].
rev
===
next_rev_str
)
{
revs_info
.
unshift
({
"
rev
"
:
next_rev_str
,
"
status
"
:
next_rev_status
"
status
"
:
flag
});
if
(
selected_node
.
children
[
i
].
status
!==
next_rev_status
)
{
selected_node
.
children
[
i
].
status
=
next_rev_status
;
if
(
selected_node
.
children
[
i
].
status
!==
flag
)
{
selected_node
.
children
[
i
].
status
=
flag
;
}
return
revs_info
;
}
}
revs_info
.
unshift
({
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
status
"
:
"
available
"
"
status
"
:
flag
});
selected_node
.
children
.
unshift
({
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
status
"
:
"
available
"
,
"
status
"
:
flag
,
"
children
"
:
[]
});
return
revs_info
;
...
...
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