Don't show PDF Export on Windows

pull/122/merge
Peter 'Pita' Martischka 2011-08-21 20:09:25 +01:00
parent 8c301d4fe8
commit 177abdd29e
2 changed files with 22 additions and 2 deletions

View File

@ -27,6 +27,7 @@ var readOnlyManager = require("../db/ReadOnlyManager");
var settings = require('../utils/Settings'); var settings = require('../utils/Settings');
var securityManager = require("../db/SecurityManager"); var securityManager = require("../db/SecurityManager");
var log4js = require('log4js'); var log4js = require('log4js');
var os = require("os");
var messageLogger = log4js.getLogger("message"); var messageLogger = log4js.getLogger("message");
/** /**
@ -752,6 +753,13 @@ function handleClientReady(client, message)
var apool = attribsForWire.pool.toJsonable(); var apool = attribsForWire.pool.toJsonable();
atext.attribs = attribsForWire.translated; atext.attribs = attribsForWire.translated;
//check if abiword is avaiable
var abiwordAvailable = settings.abiword != null ? "yes" : "no";
if(settings.abiword != null && os.type().indexOf("Windows") != -1)
{
abiwordAvailable = "withoutPDF";
}
var clientVars = { var clientVars = {
"accountPrivs": { "accountPrivs": {
"maxRevisions": 100 "maxRevisions": 100
@ -788,7 +796,7 @@ function handleClientReady(client, message)
"fullWidth": false, "fullWidth": false,
"hideSidebar": false "hideSidebar": false
}, },
"abiwordAvailable": settings.abiword != null, "abiwordAvailable": abiwordAvailable,
"hooks": {} "hooks": {}
} }

View File

@ -236,7 +236,7 @@ var padimpexp = (function()
$("#exportwordlea").attr("href", document.location.href + "/export/wordle"); $("#exportwordlea").attr("href", document.location.href + "/export/wordle");
//hide stuff thats not avaible if abiword is disabled //hide stuff thats not avaible if abiword is disabled
if(!clientVars.abiwordAvailable) if(clientVars.abiwordAvailable == "no")
{ {
$("#exportworda").remove(); $("#exportworda").remove();
$("#exportpdfa").remove(); $("#exportpdfa").remove();
@ -245,6 +245,18 @@ var padimpexp = (function()
$("#importexportline").css({"height":"95px"}); $("#importexportline").css({"height":"95px"});
$("#import").html("Import is not available"); $("#import").html("Import is not available");
} }
else if(clientVars.abiwordAvailable == "withoutPDF")
{
$("#exportpdfa").remove();
$("#exportworda").attr("href", document.location.href + "/export/doc");
$("#exportopena").attr("href", document.location.href + "/export/odt");
$("#importexport").css({"height":"142px"});
$("#importexportline").css({"height":"142px"});
$("#importform").get(0).setAttribute('action', document.location.href + "/import");
}
else else
{ {
$("#exportworda").attr("href", document.location.href + "/export/doc"); $("#exportworda").attr("href", document.location.href + "/export/doc");