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
19 DiffView.prototype.setTable = function(table) {
\r
20 this.dom.append(table);
\r
25 start: function() {sandbox.publish('ready');},
\r
26 getView: function() {return dom;},
\r
27 setDiff: function(diff) {
\r
28 var diffView = new DiffView();
\r
29 diffView.setTable(diff.table);
\r
30 var slug = diff.ver1 + '-' + diff.ver2;
\r
31 tabsView.addTab(diff.ver1 + '->' + diff.ver2, slug, diffView.dom);
\r
32 tabsView.selectTab(slug);
\r