X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/118b83d442f52feca33ba6568ef39df2092568b7..f61fd6fa1d5871782b079ee50fb6bb10777cadc2:/modules/diffViewer/diffViewer.js?ds=sidebyside diff --git a/modules/diffViewer/diffViewer.js b/modules/diffViewer/diffViewer.js new file mode 100644 index 0000000..254a19a --- /dev/null +++ b/modules/diffViewer/diffViewer.js @@ -0,0 +1,35 @@ +define([ +'libs/jquery-1.9.1.min', +'libs/underscore-min', +'views/tabs/tabs', +'libs/text!./diff.html' +], function($, _, tabs, diffTemplateSrc) { + +'use strict'; + +return function(sandbox) { + + var dom = $('
').addClass('rng-module-diffViewer'); + var tabsView = (new tabs.View({position: 'right'})).render(); + dom.append(tabsView.getAsView()); + + var DiffView = function() { + this.dom = $(diffTemplateSrc) + } + DiffView.prototype.setTable = function(table) { + this.dom.append(table); + } + + + return { + start: function() {sandbox.publish('ready');}, + getView: function() {return dom;}, + setDiff: function(diff) { + var diffView = new DiffView(); + diffView.setTable(diff.table); + tabsView.addTab(diff.ver1 + '->' + diff.ver2, diff.ver1 + '-' + diff.ver2, diffView.dom); + } + }; +}; + +}); \ No newline at end of file