';
$('#controls').append(odfToolbarHtml);
});
// fade out file list and show WebODF canvas
$('table').fadeOut('slow').promise().done(function() {
var odfelement, odfcanvas, canvashtml = '
'+
'
'+
''+
'
'+
''+
'
'+
'
'+
'
';
$('table').after(canvashtml);
// in case we are on the public sharing page we shall display the odf into the preview tag
// $('#preview').html(canvashtml);
webodfEditor.boot(
{
collaborative: 0,
docUrl: doclocation,
callback: function() { alert('live!'); }
}
);
// odfelement = document.getElementById("odf-canvas");
// odfcanvas = new odf.OdfCanvas(odfelement);
// odfcanvas.load(doclocation);
});
});
});
},
onClose: function() {
// Fade out odf-toolbar
$('#odf-toolbar').fadeOut('slow');
// Fade out editor
$('#odf-canvas').fadeOut('slow', function() {
$('#odf-toolbar').remove();
$('#odf-canvas').remove();
$('.actions,#file_access_panel').fadeIn('slow');
$('table').fadeIn('slow');
});
is_editor_shown = false;
}
};
$(document).ready(function() {
$('.documentslist tr').click(function(event) {
event.preventDefault();
officeMain.onView('', $(this).attr('data-file'));
});
$('#odf_close').live('click', officeMain.onClose);
OC.addScript('office', 'dojo-amalgamation', officeMain.onStartup);
});