Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
disable android support in this release
Browse files Browse the repository at this point in the history
  • Loading branch information
regnete committed Dec 11, 2014
1 parent 1d015f4 commit 76a1299
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions www/sitewaertsdocumentviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,13 @@ var SitewaertsDocumentViewer = {

getSupportInfo : function(onSuccess, onError)
{
// // TODO: fix this
// if(navigator.userAgent.match(/Android.*AppleWebKit/i) !== null)
// {
// onSuccess({supported: []});
// }
// else
// {
// onSuccess({supported : ['application/pdf']});
// }
// return;
//
// android not yet supported in this release
if(navigator.userAgent.match(/Android.*AppleWebKit/i) !== null)
{
onSuccess({supported: []});
return;
}

var errorPrefix = "Error in " + JS_HANDLE + ".getSupportInfo(): ";
try {
exec(
Expand Down Expand Up @@ -166,6 +162,14 @@ var SitewaertsDocumentViewer = {

canViewDocument: function (url, contentType, options, onPossible, onMissingApp, onImpossible, onError)
{
// android not yet supported in this release
if(navigator.userAgent.match(/Android.*AppleWebKit/i) !== null)
{
if(onImpossible)
onImpossible();
return;
}

var errorPrefix = "Error in " + JS_HANDLE + ".canViewDocument(): ";
try
{
Expand Down Expand Up @@ -224,6 +228,16 @@ var SitewaertsDocumentViewer = {

viewDocument: function (url, contentType, options, onShow, onClose, onMissingApp, onError)
{
// android not yet supported in this release
if(navigator.userAgent.match(/Android.*AppleWebKit/i) !== null)
{
var errorMsg = "No viewer for " + contentType;
window.console.log(errorPrefix + errorMsg);
if (onError)
onError(errorMsg);
return;
}

var me = this;
var errorPrefix = "Error in " + JS_HANDLE + ".viewDocument(): ";
try
Expand Down

0 comments on commit 76a1299

Please sign in to comment.