diff --git a/.npmignore b/.npmignore index d48c759..ec4bafe 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ .idea -.vscode \ No newline at end of file +.vscode +README.md \ No newline at end of file diff --git a/email.android.js b/email.android.js index 22ed379..95f72bb 100755 --- a/email.android.js +++ b/email.android.js @@ -1,11 +1,11 @@ var application = require("tns-core-modules/application"); var fs = require("tns-core-modules/file-system"); -(function() { +(function () { _cleanAttachmentFolder(); })(); -var _determineAvailability = function() { +var _determineAvailability = function () { var uri = android.net.Uri.fromParts("mailto", "", null); var intent = new android.content.Intent(android.content.Intent.ACTION_SENDTO, uri); var packageManager = application.android.context.getPackageManager(); @@ -132,7 +132,9 @@ function _getUriForAssetPath(path, fileName, ctx) { } var localFile = fs.File.fromPath(path); - var localFileContents = localFile.readSync(function(e) { error = e; }); + var localFileContents = localFile.readSync(function (e) { + error = e; + }); var cacheFileName = _writeBytesToFile(ctx, fileName, localFileContents); if (cacheFileName.indexOf("file://") === -1) { @@ -167,7 +169,9 @@ function _writeBytesToFile(ctx, fileName, contents) { var cacheFileName = storage + "/" + fileName; var toFile = fs.File.fromPath(cacheFileName); - toFile.writeSync(contents, function(e) { error = e; }); + toFile.writeSync(contents, function (e) { + error = e; + }); if (cacheFileName.indexOf("file://") === -1) { cacheFileName = "file://" + cacheFileName; diff --git a/email.ios.js b/email.ios.js index b339331..38fb836 100755 --- a/email.ios.js +++ b/email.ios.js @@ -4,7 +4,7 @@ var frame = require("tns-core-modules/ui/frame"); var _isEmailAvailable = null; -var _determineAvailability = function() { +var _determineAvailability = function () { if (_isEmailAvailable === null) { var isSimulator; var processInfo = utils.ios.getter(NSProcessInfo, NSProcessInfo.processInfo); @@ -48,15 +48,15 @@ exports.compose = function (arg) { var topMostFrame = frame.topmost(); if (topMostFrame) { - var viewController = topMostFrame.currentPage && topMostFrame.currentPage.ios; - if (viewController) { - while (viewController.parentViewController) { - viewController = viewController.parentViewController; - } - while (viewController.presentedViewController) { - viewController = viewController.presentedViewController; - } + var viewController = topMostFrame.currentPage && topMostFrame.currentPage.ios; + if (viewController) { + while (viewController.parentViewController) { + viewController = viewController.parentViewController; } + while (viewController.presentedViewController) { + viewController = viewController.presentedViewController; + } + } } var mail = MFMailComposeViewController.new(); @@ -135,7 +135,7 @@ function _getDataForAttachmentPath(path) { } function _dataFromBase64(base64String) { - base64String = base64String.substring(base64String.indexOf("://")+3); + base64String = base64String.substring(base64String.indexOf("://") + 3); return NSData.alloc().initWithBase64EncodedStringOptions(base64String, 0); } @@ -148,7 +148,9 @@ function _dataForAsset(path) { } var localFile = fs.File.fromPath(path); - return localFile.readSync(function(e) { error = e; }); + return localFile.readSync(function (e) { + error = e; + }); } function _dataForAbsolutePath(path) { @@ -165,6 +167,7 @@ function _dataForAbsolutePath(path) { var MFMailComposeViewControllerDelegateImpl = (function (_super) { __extends(MFMailComposeViewControllerDelegateImpl, _super); + function MFMailComposeViewControllerDelegateImpl() { _super.apply(this, arguments); } diff --git a/package.json b/package.json index eb99c12..9243a64 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-email", - "version": "1.5.3", + "version": "1.5.4", "description": "Email plugin for your NativeScript app", "main": "email", "typings": "index.d.ts",