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