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="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 :
} }
}; };
......
...@@ -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>
......
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