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
Cédric Le Ninivin
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
Show 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) {
...
@@ -208,15 +208,15 @@ jIO.addStorageType('revision', function (spec, my) {
* @method postToDocumentTree
* @method postToDocumentTree
* @param {object} doctree The document tree object
* @param {object} doctree The document tree object
* @param {object} doc The document 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
* @return {array} The added document revs_info
*/
*/
priv
.
postToDocumentTree
=
function
(
doctree
,
doc
,
set_node_to_deleted
)
{
priv
.
postToDocumentTree
=
function
(
doctree
,
doc
,
set_node_to_deleted
)
{
var
i
,
revs_info
,
next_rev
,
next_rev_str
,
next_rev_status
,
var
i
,
revs_info
,
next_rev
,
next_rev_str
,
selectNode
,
selected_node
,
selectNode
,
selected_node
,
flag
;
revs_info
=
[],
flag
=
set_node_to_deleted
===
true
?
"
deleted
"
:
"
available
"
;
revs_info
=
[];
selected_node
=
doctree
;
selected_node
=
doctree
;
selectNode
=
function
(
node
)
{
selectNode
=
function
(
node
)
{
var
i
;
var
i
;
if
(
typeof
node
.
rev
!==
"
undefined
"
)
{
if
(
typeof
node
.
rev
!==
"
undefined
"
)
{
...
@@ -255,28 +255,26 @@ jIO.addStorageType('revision', function (spec, my) {
...
@@ -255,28 +255,26 @@ jIO.addStorageType('revision', function (spec, my) {
doc
.
_rev
||
0
,
doc
,
priv
.
revsInfoToHistory
(
revs_info
),
doc
.
_rev
||
0
,
doc
,
priv
.
revsInfoToHistory
(
revs_info
),
set_node_to_deleted
);
set_node_to_deleted
);
next_rev_str
=
next_rev
.
join
(
"
-
"
);
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
// don't add if the next rev already exists
for
(
i
=
0
;
i
<
selected_node
.
children
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
selected_node
.
children
.
length
;
i
+=
1
)
{
if
(
selected_node
.
children
[
i
].
rev
===
next_rev_str
)
{
if
(
selected_node
.
children
[
i
].
rev
===
next_rev_str
)
{
revs_info
.
unshift
({
revs_info
.
unshift
({
"
rev
"
:
next_rev_str
,
"
rev
"
:
next_rev_str
,
"
status
"
:
next_rev_status
"
status
"
:
flag
});
});
if
(
selected_node
.
children
[
i
].
status
!==
next_rev_status
)
{
if
(
selected_node
.
children
[
i
].
status
!==
flag
)
{
selected_node
.
children
[
i
].
status
=
next_rev_status
;
selected_node
.
children
[
i
].
status
=
flag
;
}
}
return
revs_info
;
return
revs_info
;
}
}
}
}
revs_info
.
unshift
({
revs_info
.
unshift
({
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
status
"
:
"
available
"
"
status
"
:
flag
});
});
selected_node
.
children
.
unshift
({
selected_node
.
children
.
unshift
({
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
rev
"
:
next_rev
.
join
(
'
-
'
),
"
status
"
:
"
available
"
,
"
status
"
:
flag
,
"
children
"
:
[]
"
children
"
:
[]
});
});
return
revs_info
;
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