3
* author: Anthony Dillon
6
function LibreSystem($parent){
10
this.init = function(){
11
$('#libreoffice-calc-window .control .close').bind('click', function(){
14
$('#libreoffice-writer-window .control .close').bind('click', function(){
15
_this.close('writer');
17
$('#libreoffice-impress-window .control .close').bind('click', function(){
18
_this.close('impress');
20
$('#libreoffice-calc-window .content').bind('click', function(){
21
_parent.errorMessage.open();
23
$('#libreoffice-writer-window .content').bind('click', function(){
24
_parent.errorMessage.open();
26
$('#libreoffice-impress-window .content').bind('click', function(){
27
_parent.errorMessage.open();
31
this.center('writer');
34
this.open = function($type){
35
$('#libreoffice-'+$type+'-window').show();
36
$('#libreoffice-'+$type+'-window ').trigger('mousedown');
38
if($('css3-container').length > 0){
39
$('#libreoffice-'+$type+'-window').prev().css('top', $('#libreoffice-'+$type+'-window').css('top'));
40
$('#libreoffice-'+$type+'-window').prev().css('left', $('#libreoffice-'+$type+'-window').css('left'));
44
this.close = function($type){
45
if($('#libreoffice-'+$type+'-window').is(':visible')){
46
_parent.openWindows['libreoffice-'+$type+'-window'] = false;
47
$('#libreoffice-'+$type+'-window').hide();
49
_parent.systemMenu.closeWindow($type);
53
this.center = function($type){
54
var left = ($(document).width() / 2) - ($('#libreoffice-'+$type+'-window').width() / 2);
55
var top = Math.max(24,($(document).height() / 2) - ($('#libreoffice-'+$type+'-window').height() / 2));
56
$('#libreoffice-'+$type+'-window').css('left',left);
57
$('#libreoffice-'+$type+'-window').css('top',top);