diff --git a/.gitignore b/.gitignore index f12a06e0..a4fc70c4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ dist .pytest_cache android/app/src/main/assets/vendor.js android/app/src/main/assets/android.js +ios/send-ios/assets/ios.js +ios/send-ios/assets/vendor.js diff --git a/ios/generate-bundle.js b/ios/generate-bundle.js new file mode 100644 index 00000000..70f60c3d --- /dev/null +++ b/ios/generate-bundle.js @@ -0,0 +1,21 @@ +const child_process = require('child_process'); +const fs = require('fs'); +const path = require('path'); + +child_process.execSync('npm run build'); + +const prefix = path.join('..', 'dist'); +const json_string = fs.readFileSync(path.join(prefix, 'manifest.json')); +const manifest = JSON.parse(json_string); + +const ios_filename = manifest['ios.js']; +fs.writeFileSync( + 'send-ios/assets/ios.js', + fs.readFileSync(`${prefix}${ios_filename}`) +); + +const vendor_filename = manifest['vendor.js']; +fs.writeFileSync( + 'send-ios/assets/vendor.js', + fs.readFileSync(`${prefix}${vendor_filename}`) +); diff --git a/ios/ios.js b/ios/ios.js new file mode 100644 index 00000000..6575c6e8 --- /dev/null +++ b/ios/ios.js @@ -0,0 +1,158 @@ +/* global window, document, fetch */ + +const MAXFILESIZE = 1024 * 1024 * 1024 * 2; + +const EventEmitter = require('events'); +const emitter = new EventEmitter(); + +function dom(tagName, attributes, children = []) { + const node = document.createElement(tagName); + for (const name in attributes) { + if (name.indexOf('on') === 0) { + node[name] = attributes[name]; + } else if (name === 'htmlFor') { + node.htmlFor = attributes.htmlFor; + } else if (name === 'className') { + node.className = attributes.className; + } else { + node.setAttribute(name, attributes[name]); + } + } + if (!(children instanceof Array)) { + children = [children]; + } + for (let child of children) { + if (typeof child === 'string') { + child = document.createTextNode(child); + } + node.appendChild(child); + } + return node; +} + +function uploadComplete(file) { + document.body.innerHTML = ''; + const input = dom('input', { id: 'url', value: file.url }); + const copy = dom( + 'button', + { + id: 'copy-button', + className: 'button', + onclick: () => { + window.webkit.messageHandlers['copy'].postMessage(input.value); + copy.textContent = 'Copied!'; + setTimeout(function() { + copy.textContent = 'Copy to clipboard'; + }, 2000); + } + }, + 'Copy to clipboard' + ); + const node = dom( + 'div', + { id: 'striped' }, + dom('div', { id: 'white' }, [ + input, + copy, + dom( + 'button', + { id: 'send-another', className: 'button', onclick: render }, + 'Send another file' + ) + ]) + ); + document.body.appendChild(node); +} + +const state = { + storage: { + files: [], + remove: function(fileId) { + console.log('REMOVE FILEID', fileId); + }, + writeFile: function(file) { + console.log('WRITEFILE', file); + }, + addFile: uploadComplete, + totalUploads: 0 + }, + transfer: null, + uploading: false, + settingPassword: false, + passwordSetError: null, + route: '/' +}; + +function upload(event) { + console.log('UPLOAD'); + event.preventDefault(); + const target = event.target; + const file = target.files[0]; + if (file.size === 0) { + return; + } + if (file.size > MAXFILESIZE) { + console.log('file too big (no bigger than ' + MAXFILESIZE + ')'); + return; + } + + emitter.emit('upload', { file: file, type: 'click' }); +} + +function render() { + document.body.innerHTML = ''; + const striped = dom( + 'div', + { id: 'striped' }, + dom('div', { id: 'white' }, [ + dom('label', { id: 'label', htmlFor: 'input' }, 'Choose file'), + dom('input', { + id: 'input', + type: 'file', + name: 'input', + onchange: upload + }) + ]) + ); + document.body.appendChild(striped); +} + +emitter.on('render', function() { + document.body.innerHTML = ''; + const percent = + (state.transfer.progress[0] / state.transfer.progress[1]) * 100; + const node = dom( + 'div', + { style: 'background-color: white; width: 100%' }, + dom('span', { + style: `display: inline-block; width: ${percent}%; background-color: blue` + }) + ); + document.body.appendChild(node); +}); + +emitter.on('pushState', function(path) { + console.log('pushState ' + path + ' ' + JSON.stringify(state)); +}); + +const fileManager = require('../app/fileManager').default; +try { + fileManager(state, emitter); +} catch (e) { + console.error('error' + e); + console.error(e); +} + +function sendBase64EncodedFromSwift(encoded) { + fetch(encoded) + .then(res => res.blob()) + .then(blob => { + emitter.emit('upload', { file: blob, type: 'share' }); + }); +} + +window.sendBase64EncodedFromSwift = sendBase64EncodedFromSwift; + +render(); + +window.webkit.messageHandlers['loaded'].postMessage(''); diff --git a/ios/send-ios-action-extension/ActionViewController.swift b/ios/send-ios-action-extension/ActionViewController.swift new file mode 100644 index 00000000..61122511 --- /dev/null +++ b/ios/send-ios-action-extension/ActionViewController.swift @@ -0,0 +1,77 @@ +// +// ActionViewController.swift +// send-ios-action-extension +// +// Created by Donovan Preston on 7/26/18. +// Copyright © 2018 Donovan Preston. All rights reserved. +// + +import UIKit +import WebKit +import MobileCoreServices + +var typesToLoad = [("com.adobe.pdf", "application/pdf"), ("public.png", "image/png"), + ("public.jpeg", "image/jpeg"), ("com.compuserve.gif", "image/gif"), + ("com.microsoft.bmp", "image/bmp"), ("public.plain-text", "text/plain")] + +class ActionViewController: UIViewController, WKScriptMessageHandler { + + @IBOutlet var webView: WKWebView! + var typeToSend: String? + var dataToSend: Data? + + override func viewDidLoad() { + super.viewDidLoad() + self.webView.frame = self.view.bounds + self.webView?.configuration.userContentController.add(self, name: "loaded") + self.webView?.configuration.userContentController.add(self, name: "copy") + + if let url = Bundle.main.url( + forResource: "index", + withExtension: "html", + subdirectory: "assets") { + self.webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) + } + // Get the item[s] we're handling from the extension context. + + for item in self.extensionContext!.inputItems as! [NSExtensionItem] { + for provider in item.attachments! as! [NSItemProvider] { + for (type, mimeType) in typesToLoad { + if provider.hasItemConformingToTypeIdentifier(type) { + provider.loadDataRepresentation(forTypeIdentifier: type, completionHandler: { (data, error) in + OperationQueue.main.addOperation { + self.typeToSend = mimeType + self.dataToSend = data + } + }) + return + } + } + } + } + } + + public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { + print("Message received: \(message.name) with body: \(message.body)") + if (message.name == "loaded") { + let stringToSend = "window.sendBase64EncodedFromSwift('data:\(self.typeToSend ?? "application/octet-stream");base64,\(self.dataToSend?.base64EncodedString() ?? "")')"; + self.webView.evaluateJavaScript(stringToSend) { (object: Any?, error: Error?) -> Void in + print("completed") + } + } else if (message.name == "copy") { + UIPasteboard.general.string = "\(message.body)" + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func done() { + // Return any edited content to the host app. + // This template doesn't do anything, so we just echo the passed in items. + self.extensionContext!.completeRequest(returningItems: self.extensionContext!.inputItems, completionHandler: nil) + } + +} diff --git a/ios/send-ios-action-extension/Base.lproj/MainInterface.storyboard b/ios/send-ios-action-extension/Base.lproj/MainInterface.storyboard new file mode 100644 index 00000000..5939032d --- /dev/null +++ b/ios/send-ios-action-extension/Base.lproj/MainInterface.storyboard @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/send-ios-action-extension/Info.plist b/ios/send-ios-action-extension/Info.plist new file mode 100644 index 00000000..10caa73e --- /dev/null +++ b/ios/send-ios-action-extension/Info.plist @@ -0,0 +1,53 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + send-ios-action-extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionAttributes + + NSExtensionActivationRule + SUBQUERY ( + extensionItems, + $extensionItem, + SUBQUERY ( + $extensionItem.attachments, + $attachment, + ( + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg-2000" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.microsoft.bmp" + ) + ).@count == 1 + ).@count == 1 + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.ui-services + + + diff --git a/ios/send-ios.xcodeproj/project.pbxproj b/ios/send-ios.xcodeproj/project.pbxproj new file mode 100644 index 00000000..83f460b2 --- /dev/null +++ b/ios/send-ios.xcodeproj/project.pbxproj @@ -0,0 +1,526 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + E34149C621017A3A00930775 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34149C521017A3A00930775 /* AppDelegate.swift */; }; + E34149C821017A3A00930775 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34149C721017A3A00930775 /* ViewController.swift */; }; + E34149CB21017A3A00930775 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E34149C921017A3A00930775 /* Main.storyboard */; }; + E34149CD21017A3D00930775 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E34149CC21017A3D00930775 /* Assets.xcassets */; }; + E34149D021017A3D00930775 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E34149CE21017A3D00930775 /* LaunchScreen.storyboard */; }; + E355478521028193009D206E /* help.html in Resources */ = {isa = PBXBuildFile; fileRef = E355478421028193009D206E /* help.html */; }; + E355478921092E22009D206E /* assets in Resources */ = {isa = PBXBuildFile; fileRef = E355478821092E22009D206E /* assets */; }; + E355478C210A534F009D206E /* ios.js in Resources */ = {isa = PBXBuildFile; fileRef = E355478B210A534F009D206E /* ios.js */; }; + E355478E210A5357009D206E /* generate-bundle.js in Resources */ = {isa = PBXBuildFile; fileRef = E355478D210A5357009D206E /* generate-bundle.js */; }; + E397A0B2210A641C00A978D4 /* ActionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E397A0B1210A641C00A978D4 /* ActionViewController.swift */; }; + E397A0B5210A641C00A978D4 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E397A0B3210A641C00A978D4 /* MainInterface.storyboard */; }; + E397A0B9210A641C00A978D4 /* send-ios-action-extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = E397A0AF210A641C00A978D4 /* send-ios-action-extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + E397A0BF210A6B5500A978D4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = E397A0BE210A6B5500A978D4 /* assets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E397A0B7210A641C00A978D4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E34149BA21017A3900930775 /* Project object */; + proxyType = 1; + remoteGlobalIDString = E397A0AE210A641C00A978D4; + remoteInfo = "send-ios-action-extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E397A0BD210A641C00A978D4 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + E397A0B9210A641C00A978D4 /* send-ios-action-extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + E34149C221017A3900930775 /* send-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "send-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + E34149C521017A3A00930775 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E34149C721017A3A00930775 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + E34149CA21017A3A00930775 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + E34149CC21017A3D00930775 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E34149CF21017A3D00930775 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + E34149D121017A3D00930775 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E355478421028193009D206E /* help.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = help.html; sourceTree = ""; }; + E355478821092E22009D206E /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; path = assets; sourceTree = ""; }; + E355478B210A534F009D206E /* ios.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ios.js; sourceTree = SOURCE_ROOT; }; + E355478D210A5357009D206E /* generate-bundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "generate-bundle.js"; sourceTree = SOURCE_ROOT; }; + E397A0AF210A641C00A978D4 /* send-ios-action-extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "send-ios-action-extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + E397A0B1210A641C00A978D4 /* ActionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionViewController.swift; sourceTree = ""; }; + E397A0B4210A641C00A978D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + E397A0B6210A641C00A978D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E397A0BE210A6B5500A978D4 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = "send-ios/assets"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E34149BF21017A3900930775 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E397A0AC210A641C00A978D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E34149B921017A3900930775 = { + isa = PBXGroup; + children = ( + E34149C421017A3900930775 /* send-ios */, + E397A0B0210A641C00A978D4 /* send-ios-action-extension */, + E34149C321017A3900930775 /* Products */, + ); + sourceTree = ""; + }; + E34149C321017A3900930775 /* Products */ = { + isa = PBXGroup; + children = ( + E34149C221017A3900930775 /* send-ios.app */, + E397A0AF210A641C00A978D4 /* send-ios-action-extension.appex */, + ); + name = Products; + sourceTree = ""; + }; + E34149C421017A3900930775 /* send-ios */ = { + isa = PBXGroup; + children = ( + E355478D210A5357009D206E /* generate-bundle.js */, + E355478B210A534F009D206E /* ios.js */, + E34149C521017A3A00930775 /* AppDelegate.swift */, + E34149C721017A3A00930775 /* ViewController.swift */, + E34149C921017A3A00930775 /* Main.storyboard */, + E34149CC21017A3D00930775 /* Assets.xcassets */, + E34149CE21017A3D00930775 /* LaunchScreen.storyboard */, + E34149D121017A3D00930775 /* Info.plist */, + E355478421028193009D206E /* help.html */, + E355478821092E22009D206E /* assets */, + ); + path = "send-ios"; + sourceTree = ""; + }; + E397A0B0210A641C00A978D4 /* send-ios-action-extension */ = { + isa = PBXGroup; + children = ( + E397A0BE210A6B5500A978D4 /* assets */, + E397A0B1210A641C00A978D4 /* ActionViewController.swift */, + E397A0B3210A641C00A978D4 /* MainInterface.storyboard */, + E397A0B6210A641C00A978D4 /* Info.plist */, + ); + path = "send-ios-action-extension"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E34149C121017A3900930775 /* send-ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = E34149D421017A3D00930775 /* Build configuration list for PBXNativeTarget "send-ios" */; + buildPhases = ( + E355478A210A4C43009D206E /* ShellScript */, + E34149BE21017A3900930775 /* Sources */, + E34149BF21017A3900930775 /* Frameworks */, + E34149C021017A3900930775 /* Resources */, + E397A0BD210A641C00A978D4 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + E397A0B8210A641C00A978D4 /* PBXTargetDependency */, + ); + name = "send-ios"; + productName = "send-ios"; + productReference = E34149C221017A3900930775 /* send-ios.app */; + productType = "com.apple.product-type.application"; + }; + E397A0AE210A641C00A978D4 /* send-ios-action-extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = E397A0BC210A641C00A978D4 /* Build configuration list for PBXNativeTarget "send-ios-action-extension" */; + buildPhases = ( + E397A0AB210A641C00A978D4 /* Sources */, + E397A0AC210A641C00A978D4 /* Frameworks */, + E397A0AD210A641C00A978D4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "send-ios-action-extension"; + productName = "send-ios-action-extension"; + productReference = E397A0AF210A641C00A978D4 /* send-ios-action-extension.appex */; + productType = "com.apple.product-type.app-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E34149BA21017A3900930775 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Donovan Preston"; + TargetAttributes = { + E34149C121017A3900930775 = { + CreatedOnToolsVersion = 9.4.1; + }; + E397A0AE210A641C00A978D4 = { + CreatedOnToolsVersion = 9.4.1; + }; + }; + }; + buildConfigurationList = E34149BD21017A3900930775 /* Build configuration list for PBXProject "send-ios" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E34149B921017A3900930775; + productRefGroup = E34149C321017A3900930775 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E34149C121017A3900930775 /* send-ios */, + E397A0AE210A641C00A978D4 /* send-ios-action-extension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E34149C021017A3900930775 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E355478C210A534F009D206E /* ios.js in Resources */, + E355478921092E22009D206E /* assets in Resources */, + E355478E210A5357009D206E /* generate-bundle.js in Resources */, + E34149D021017A3D00930775 /* LaunchScreen.storyboard in Resources */, + E355478521028193009D206E /* help.html in Resources */, + E34149CD21017A3D00930775 /* Assets.xcassets in Resources */, + E34149CB21017A3A00930775 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E397A0AD210A641C00A978D4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E397A0B5210A641C00A978D4 /* MainInterface.storyboard in Resources */, + E397A0BF210A6B5500A978D4 /* assets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + E355478A210A4C43009D206E /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "node generate-bundle.js\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E34149BE21017A3900930775 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E34149C821017A3A00930775 /* ViewController.swift in Sources */, + E34149C621017A3A00930775 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E397A0AB210A641C00A978D4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E397A0B2210A641C00A978D4 /* ActionViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E397A0B8210A641C00A978D4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E397A0AE210A641C00A978D4 /* send-ios-action-extension */; + targetProxy = E397A0B7210A641C00A978D4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + E34149C921017A3A00930775 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E34149CA21017A3A00930775 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + E34149CE21017A3D00930775 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E34149CF21017A3D00930775 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + E397A0B3210A641C00A978D4 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E397A0B4210A641C00A978D4 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E34149D221017A3D00930775 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + E34149D321017A3D00930775 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + E34149D521017A3D00930775 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "send-ios/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.mozilla.send-ios"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E34149D621017A3D00930775 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "send-ios/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.mozilla.send-ios"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + E397A0BA210A641C00A978D4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "send-ios-action-extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.mozilla.send-ios.send-ios-action-extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E397A0BB210A641C00A978D4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "send-ios-action-extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.mozilla.send-ios.send-ios-action-extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E34149BD21017A3900930775 /* Build configuration list for PBXProject "send-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E34149D221017A3D00930775 /* Debug */, + E34149D321017A3D00930775 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E34149D421017A3D00930775 /* Build configuration list for PBXNativeTarget "send-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E34149D521017A3D00930775 /* Debug */, + E34149D621017A3D00930775 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E397A0BC210A641C00A978D4 /* Build configuration list for PBXNativeTarget "send-ios-action-extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E397A0BA210A641C00A978D4 /* Debug */, + E397A0BB210A641C00A978D4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E34149BA21017A3900930775 /* Project object */; +} diff --git a/ios/send-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/send-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..883bc6f4 --- /dev/null +++ b/ios/send-ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/send-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/send-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios/send-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/send-ios.xcodeproj/project.xcworkspace/xcuserdata/donovan.xcuserdatad/UserInterfaceState.xcuserstate b/ios/send-ios.xcodeproj/project.xcworkspace/xcuserdata/donovan.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..5effd940 Binary files /dev/null and b/ios/send-ios.xcodeproj/project.xcworkspace/xcuserdata/donovan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 00000000..a53fd357 --- /dev/null +++ b/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..566d89e1 --- /dev/null +++ b/ios/send-ios.xcodeproj/xcuserdata/donovan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,19 @@ + + + + + SchemeUserState + + send-ios-action-extension.xcscheme + + orderHint + 1 + + send-ios.xcscheme + + orderHint + 0 + + + + diff --git a/ios/send-ios/AppDelegate.swift b/ios/send-ios/AppDelegate.swift new file mode 100644 index 00000000..ca22e5ed --- /dev/null +++ b/ios/send-ios/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// send-ios +// +// Created by Donovan Preston on 7/19/18. +// Copyright © 2018 Donovan Preston. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/ios/send-ios/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/send-ios/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/ios/send-ios/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/send-ios/Assets.xcassets/Contents.json b/ios/send-ios/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/ios/send-ios/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/send-ios/Base.lproj/LaunchScreen.storyboard b/ios/send-ios/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/ios/send-ios/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/send-ios/Base.lproj/Main.storyboard b/ios/send-ios/Base.lproj/Main.storyboard new file mode 100644 index 00000000..09ae84fd --- /dev/null +++ b/ios/send-ios/Base.lproj/Main.storyboard @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/send-ios/Info.plist b/ios/send-ios/Info.plist new file mode 100644 index 00000000..16be3b68 --- /dev/null +++ b/ios/send-ios/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ios/send-ios/ViewController.swift b/ios/send-ios/ViewController.swift new file mode 100644 index 00000000..ca5efe47 --- /dev/null +++ b/ios/send-ios/ViewController.swift @@ -0,0 +1,40 @@ +// +// ViewController.swift +// send-ios +// +// Created by Donovan Preston on 7/19/18. +// Copyright © 2018 Donovan Preston. All rights reserved. +// + +import UIKit +import WebKit + +class ViewController: UIViewController, WKScriptMessageHandler { + @IBOutlet var webView: WKWebView! + + override func viewDidLoad() { + super.viewDidLoad() + self.webView.frame = self.view.bounds + self.webView?.configuration.userContentController.add(self, name: "loaded") + self.webView?.configuration.userContentController.add(self, name: "copy") + if let url = Bundle.main.url( + forResource: "index", + withExtension: "html", + subdirectory: "assets") { + webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) + } + } + + public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { + print("Message received: \(message.name) with body: \(message.body)") + UIPasteboard.general.string = "\(message.body)" + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/ios/send-ios/assets/background_1.jpg b/ios/send-ios/assets/background_1.jpg new file mode 100644 index 00000000..c92d3fb1 Binary files /dev/null and b/ios/send-ios/assets/background_1.jpg differ diff --git a/ios/send-ios/assets/index.css b/ios/send-ios/assets/index.css new file mode 100644 index 00000000..3dd18d2d --- /dev/null +++ b/ios/send-ios/assets/index.css @@ -0,0 +1,84 @@ +body { + background: url('background_1.jpg'); + display: flex; + flex-direction: row; + flex: auto; + justify-content: center; + align-items: center; + padding: 0 20px; + box-sizing: border-box; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +#striped { + background-image: repeating-linear-gradient( + 45deg, + white, + white 5px, + #ea000e 5px, + #ea000e 25px, + white 25px, + white 30px, + #0083ff 30px, + #0083ff 50px + ); + height: 350px; + width: 480px; +} + +#white { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + height: 100%; + background-color: white; + margin: 0 10px; + padding: 1px 10px 0 10px; +} + +#label { + background: #0297f8; + border: 1px solid #0297f8; + color: white; + font-size: 24px; + font-weight: 500; + height: 60px; + width: 200px; + display: flex; + justify-content: center; + align-items: center; +} + +#input { + display: none; +} + +#url { + flex: 1; + width: 100%; + height: 32px; + font-size: 24px; + margin-top: 1em; +} + +.button { + flex: 1; + display: block; + background: #0297f8; + border: 1px solid #0297f8; + color: white; + font-size: 24px; + font-weight: 500; + width: 95%; + height: 32px; + margin-top: 1em; +} + +#send-another { + margin-bottom: 1em; +} diff --git a/ios/send-ios/assets/index.html b/ios/send-ios/assets/index.html new file mode 100644 index 00000000..d63c6298 --- /dev/null +++ b/ios/send-ios/assets/index.html @@ -0,0 +1,17 @@ + + + + + Firefox Send + + + + + + + + + + diff --git a/ios/send-ios/help.html b/ios/send-ios/help.html new file mode 100644 index 00000000..afbd39d5 --- /dev/null +++ b/ios/send-ios/help.html @@ -0,0 +1,5 @@ + + + HELLO WORLD + + diff --git a/webpack.config.js b/webpack.config.js index 24b5f291..6e7f51ca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -32,7 +32,8 @@ const web = { // because they are not explicitly referenced by app vendor: ['babel-polyfill', 'fluent'], app: ['./app/main.js'], - android: ['./android/android.js'] + android: ['./android/android.js'], + ios: ['./ios/ios.js'] }, output: { filename: '[name].[hash:8].js',