Commit ade981ac authored by Tristan Cavelier's avatar Tristan Cavelier

Updating and Improving conflict solver

parent 5cc60ab5
<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="span12">
A conflict occured while saving this document:
</div>
</div>
<div class="row-fluid">
<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 id="revisions">
</div>
<div class="row-fluid">
<div class="span12">
......@@ -43,21 +17,34 @@
window.basic_conflict_solver = {
conflict_object:{},
keepLocalRevision: function () {
// TODO : keep local
OfficeJS.solveConflict(
this.conflict_object,
document.querySelector('#basic_conflict_solver_div '+
'#local_revision').textContent);
delete window.basic_conflict_solver;
addRevision: function (revision,content) {
document.querySelector ('#basic_conflict_solver_div #revisions').
innerHTML += '<div class="row-fluid"><div class="span12">'+
'<div><textarea id="'+revision+'">'+content+'</textarea></div>'+
'<div><button onclick="console.log('+"'"+revision+"'"+');'+
'basic_conflict_solver.keepRevision('+"'"+revision+"'"+');'+
'">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 () {
// TODO : keep other
keepRevision: function (revision) {
OfficeJS.solveConflict(
this.conflict_object,
document.querySelector('#basic_conflict_solver_div '+
'#local_revision').textContent);
delete window.basic_conflict_solver;
$('#'+revision).text()
);
},
abort: function () {
// TODO :
}
};
......
......@@ -42,7 +42,8 @@
<script type="text/javascript">
<!--
(function () {
window.OfficeJS_slickgrid = {};
window.OfficeJS_slickgrid.reload = function () {
var grid, onSortFunction, onClickFunction, check_box_selector,
onRemoveSeveral, showIconFormatter,
document_list = OfficeJS.cloneCurrentDocumentList(),
......@@ -156,7 +157,8 @@
grid.onClick.subscribe(onClickFunction);
grid.onSort.subscribe(onSortFunction);
});
}());
};
window.OfficeJS_slickgrid.reload();
//-->
</script>
</body>
......
This diff is collapsed.
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