4 'libs/text!./diff.html'
5 ], function($, tabs, diffTemplateSrc) {
9 return function(sandbox) {
11 var dom = $('<div>').addClass('rng-module-diffViewer');
12 var tabsView = (new tabs.View({position: 'right'})).render();
13 dom.append(tabsView.getAsView());
15 var DiffView = function() {
16 this.dom = $(diffTemplateSrc);
19 DiffView.prototype.setTable = function(table) {
20 this.dom.append(table);
25 start: function() {sandbox.publish('ready');},
26 getView: function() {return dom;},
27 setDiff: function(diff) {
28 var diffView = new DiffView();
29 diffView.setTable(diff.table);
30 var slug = diff.ver1 + '-' + diff.ver2;
31 tabsView.addTab(diff.ver1 + '->' + diff.ver2, slug, diffView.dom);
32 tabsView.selectTab(slug);