Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
ade981ac
Commit
ade981ac
authored
Aug 02, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating and Improving conflict solver
parent
5cc60ab5
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
149 deletions
+177
-149
OfficeJS/component/basic_conflict_solver.html
OfficeJS/component/basic_conflict_solver.html
+27
-40
OfficeJS/component/slickgrid_document_lister.html
OfficeJS/component/slickgrid_document_lister.html
+4
-2
OfficeJS/js/officejs.js
OfficeJS/js/officejs.js
+146
-107
No files found.
OfficeJS/component/basic_conflict_solver.html
View file @
ade981ac
<div
id=
"basic_conflict_solver_div"
style=
"text-align:center;"
>
<div
id=
"basic_conflict_solver_div"
style=
"text-align:center;"
class=
"well"
>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span12"
>
<div
class=
"span12"
>
A conflict occured while saving this document:
A conflict occured while saving this document:
</div>
</div>
</div>
</div>
<div
class=
"row-fluid"
>
<div
id=
"revisions"
>
<div
class=
"span6"
>
<div>
<strong>
local revision
</strong>
</div>
<div>
<textarea
id=
"local_revision"
style=
"width:100%;"
>
loading...
</textarea>
</div>
<div>
<button
onclick=
"window.basic_conflict_solver.keepLocalRevision();"
>
keep this revision
</button>
</div>
</div>
<div
class=
"span6"
>
<div>
<strong>
conflicting revision
</strong>
</div>
<div>
<textarea
id=
"conflicting_revision"
style=
"width:100%;"
>
loading...
</textarea>
</div>
<div>
<button
onclick=
"window.basic_conflict_solver.keepOtherRevision();"
>
keep this revision
</button>
</div>
</div>
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span12"
>
<div
class=
"span12"
>
...
@@ -43,21 +17,34 @@
...
@@ -43,21 +17,34 @@
window
.
basic_conflict_solver
=
{
window
.
basic_conflict_solver
=
{
conflict_object
:{},
conflict_object
:{},
keepLocalRevision
:
function
()
{
addRevision
:
function
(
revision
,
content
)
{
// TODO : keep local
document
.
querySelector
(
'
#basic_conflict_solver_div #revisions
'
).
OfficeJS
.
solveConflict
(
innerHTML
+=
'
<div class="row-fluid"><div class="span12">
'
+
this
.
conflict_object
,
'
<div><textarea id="
'
+
revision
+
'
">
'
+
content
+
'
</textarea></div>
'
+
document
.
querySelector
(
'
#basic_conflict_solver_div
'
+
'
<div><button onclick="console.log(
'
+
"
'
"
+
revision
+
"
'
"
+
'
);
'
+
'
#local_revision
'
).
textContent
);
'
basic_conflict_solver.keepRevision(
'
+
"
'
"
+
revision
+
"
'
"
+
'
);
'
+
delete
window
.
basic_conflict_solver
;
'
">Save this one</button></div><hr/>
'
+
// window.basic_conflict_solver.keepRevision('+
// '
<
div
><
button
onclick
=
"
alert('+
"'
"+
'
cobra
'
+"
'"
+');'+
//
"'
"+revision+"
'"
+'); alert(
"
after
"
); return false;
"
>
Save
this
one
<
/button></
div
><
hr
/>
'
+
'
<
/div></
div
>
'
;
},
addRemovedRevision: function (revision) {
document.querySelector (
'
#
basic_conflict_solver_div
#
revisions
'
).
innerHTML +=
'
<
div
class
=
"
row-fluid
"
><
div
class
=
"
span12
"
>
'
+
'
<
div
>
Removed
<
/div>'
+
'
<div><button onclick="window.basic_conflict_solver.keepRevision(
'
+
"
'
"
+
revision
+
"
'
"
+
'
); return false;">Save this one</button></div><hr/>
'
+
'
</div></div>
'
;
},
},
keepOtherRevision
:
function
()
{
keepRevision
:
function
(
revision
)
{
// TODO : keep other
OfficeJS
.
solveConflict
(
OfficeJS
.
solveConflict
(
this
.
conflict_object
,
this
.
conflict_object
,
document
.
querySelector
(
'
#basic_conflict_solver_div
'
+
$
(
'
#
'
+
revision
).
text
()
'
#local_revision
'
).
textContent
);
);
delete
window
.
basic_conflict_solver
;
},
abort
:
function
()
{
// TODO :
}
}
};
};
...
...
OfficeJS/component/slickgrid_document_lister.html
View file @
ade981ac
...
@@ -42,7 +42,8 @@
...
@@ -42,7 +42,8 @@
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
<!--
<!--
(
function
()
{
window
.
OfficeJS_slickgrid
=
{};
window
.
OfficeJS_slickgrid
.
reload
=
function
()
{
var
grid
,
onSortFunction
,
onClickFunction
,
check_box_selector
,
var
grid
,
onSortFunction
,
onClickFunction
,
check_box_selector
,
onRemoveSeveral
,
showIconFormatter
,
onRemoveSeveral
,
showIconFormatter
,
document_list
=
OfficeJS
.
cloneCurrentDocumentList
(),
document_list
=
OfficeJS
.
cloneCurrentDocumentList
(),
...
@@ -156,7 +157,8 @@
...
@@ -156,7 +157,8 @@
grid
.
onClick
.
subscribe
(
onClickFunction
);
grid
.
onClick
.
subscribe
(
onClickFunction
);
grid
.
onSort
.
subscribe
(
onSortFunction
);
grid
.
onSort
.
subscribe
(
onSortFunction
);
});
});
}());
};
window
.
OfficeJS_slickgrid
.
reload
();
//-->
//-->
</script>
</script>
</body>
</body>
...
...
OfficeJS/js/officejs.js
View file @
ade981ac
This diff is collapsed.
Click to expand it.
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