-
-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,9 @@ | |
<config-file parent="NSPhotoLibraryUsageDescription" target="*-Info.plist"> | ||
<string>Library is use to insert images in the Journal.</string> | ||
</config-file> | ||
<config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist"> | ||
<false/> | ||
</config-file> | ||
<icon src="res/icon/ios/[email protected]" width="180" height="180" /> | ||
<icon src="res/icon/ios/icon-60.png" width="60" height="60" /> | ||
<icon src="res/icon/ios/[email protected]" width="120" height="120" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<!-- iOS dedicated page that displays the contents of a file that was opened using the InAppBrowser plugin. --> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Sugarizer In App Browser</title> | ||
<script data-main="js/inapp" src="lib/require.js"></script> | ||
</head> | ||
<body style="margin:0;"> | ||
<iframe style="display:block;width:100vw;height:100vh;max-width:100%;margin:0;padding:0;border:0 none;box-sizing: border-box;" id="frame" | ||
scrolling="yes"></iframe> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Script use by the inappbrowser on iOS to display the content of a file | ||
|
||
function base64toBlob(mimetype, base64) { | ||
var contentType = mimetype; | ||
var byteCharacters = atob(base64.substr(base64.indexOf(';base64,')+8)); | ||
var byteArrays = []; | ||
for (var offset = 0; offset < byteCharacters.length; offset += 1024) { | ||
var slice = byteCharacters.slice(offset, offset + 1024); | ||
var byteNumbers = new Array(slice.length); | ||
for (var i = 0; i < slice.length; i++) { | ||
byteNumbers[i] = slice.charCodeAt(i); | ||
} | ||
var byteArray = new Uint8Array(byteNumbers); | ||
byteArrays.push(byteArray); | ||
} | ||
var blob = new Blob(byteArrays, {type: contentType}); | ||
return blob; | ||
} | ||
|
||
requirejs.config({ | ||
baseUrl: "lib", | ||
paths: { | ||
activity: "../js" | ||
} | ||
}); | ||
|
||
requirejs(["sugar-web/datastore"], function (datastore) { | ||
var objectId = window.localStorage.getItem("sugar_inappbrowser_objectId"); | ||
var dataentry = new datastore.DatastoreObject(objectId); | ||
dataentry.loadAsText(function(err, metadata, text) { | ||
var blob = base64toBlob(metadata.mimetype, text); | ||
var frame = document.getElementById("frame"); | ||
frame.height = frame.contentWindow.document.documentElement.scrollHeight + 'px'; | ||
frame.src = URL.createObjectURL(blob); | ||
window.localStorage.removeItem("sugar_inappbrowser_objectId"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters