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