├── .gitattributes ├── .gitignore ├── .npmignore ├── .npmrc ├── README.md ├── assets ├── colored-logo.png ├── logo-text.png ├── logo.svg └── screenshot.png ├── benchmarks └── lighthouse-audit │ └── fluid-notion.github.io-20180624T035510.json ├── cordova-shell ├── .gitignore ├── README.md ├── config.xml ├── hooks │ └── README.md ├── package.json ├── platforms │ └── android │ │ ├── .gitignore │ │ ├── CordovaLib │ │ ├── AndroidManifest.xml │ │ ├── CordovaLib.iml │ │ ├── build.gradle │ │ ├── cordova.gradle │ │ ├── project.properties │ │ └── src │ │ │ └── org │ │ │ └── apache │ │ │ └── cordova │ │ │ ├── AuthenticationToken.java │ │ │ ├── BuildHelper.java │ │ │ ├── CallbackContext.java │ │ │ ├── CallbackMap.java │ │ │ ├── Config.java │ │ │ ├── ConfigXmlParser.java │ │ │ ├── CordovaActivity.java │ │ │ ├── CordovaArgs.java │ │ │ ├── CordovaBridge.java │ │ │ ├── CordovaClientCertRequest.java │ │ │ ├── CordovaDialogsHelper.java │ │ │ ├── CordovaHttpAuthHandler.java │ │ │ ├── CordovaInterface.java │ │ │ ├── CordovaInterfaceImpl.java │ │ │ ├── CordovaPlugin.java │ │ │ ├── CordovaPreferences.java │ │ │ ├── CordovaResourceApi.java │ │ │ ├── CordovaWebView.java │ │ │ ├── CordovaWebViewEngine.java │ │ │ ├── CordovaWebViewImpl.java │ │ │ ├── CoreAndroid.java │ │ │ ├── ExposedJsApi.java │ │ │ ├── ICordovaClientCertRequest.java │ │ │ ├── ICordovaCookieManager.java │ │ │ ├── ICordovaHttpAuthHandler.java │ │ │ ├── LOG.java │ │ │ ├── NativeToJsMessageQueue.java │ │ │ ├── PermissionHelper.java │ │ │ ├── PluginEntry.java │ │ │ ├── PluginManager.java │ │ │ ├── PluginResult.java │ │ │ ├── ResumeCallback.java │ │ │ ├── Whitelist.java │ │ │ └── engine │ │ │ ├── SystemCookieManager.java │ │ │ ├── SystemExposedJsApi.java │ │ │ ├── SystemWebChromeClient.java │ │ │ ├── SystemWebView.java │ │ │ ├── SystemWebViewClient.java │ │ │ └── SystemWebViewEngine.java │ │ ├── android.iml │ │ ├── android.json │ │ ├── app │ │ ├── app.iml │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── www │ │ │ │ ├── cordova-js-src │ │ │ │ ├── android │ │ │ │ │ ├── nativeapiprovider.js │ │ │ │ │ └── promptbasednativeapi.js │ │ │ │ ├── exec.js │ │ │ │ ├── platform.js │ │ │ │ └── plugin │ │ │ │ │ └── android │ │ │ │ │ └── app.js │ │ │ │ ├── cordova.js │ │ │ │ ├── cordova_plugins.js │ │ │ │ └── index.html │ │ │ ├── java │ │ │ ├── io │ │ │ │ └── cordova │ │ │ │ │ └── hellocordova │ │ │ │ │ └── MainActivity.java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── cordova │ │ │ │ └── whitelist │ │ │ │ └── WhitelistPlugin.java │ │ │ └── res │ │ │ ├── drawable-land-hdpi │ │ │ └── screen.png │ │ │ ├── drawable-land-ldpi │ │ │ └── screen.png │ │ │ ├── drawable-land-mdpi │ │ │ └── screen.png │ │ │ ├── drawable-land-xhdpi │ │ │ └── screen.png │ │ │ ├── drawable-land-xxhdpi │ │ │ └── screen.png │ │ │ ├── drawable-land-xxxhdpi │ │ │ └── screen.png │ │ │ ├── drawable-port-hdpi │ │ │ └── screen.png │ │ │ ├── drawable-port-ldpi │ │ │ └── screen.png │ │ │ ├── drawable-port-mdpi │ │ │ └── screen.png │ │ │ ├── drawable-port-xhdpi │ │ │ └── screen.png │ │ │ ├── drawable-port-xxhdpi │ │ │ └── screen.png │ │ │ ├── drawable-port-xxxhdpi │ │ │ └── screen.png │ │ │ ├── mipmap-hdpi │ │ │ └── icon.png │ │ │ ├── mipmap-ldpi │ │ │ └── icon.png │ │ │ ├── mipmap-mdpi │ │ │ └── icon.png │ │ │ ├── mipmap-xhdpi │ │ │ └── icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── icon.png │ │ │ ├── values │ │ │ └── strings.xml │ │ │ └── xml │ │ │ └── config.xml │ │ ├── build.gradle │ │ ├── cordova │ │ ├── Api.js │ │ ├── android_sdk_version │ │ ├── android_sdk_version.bat │ │ ├── build │ │ ├── build.bat │ │ ├── check_reqs │ │ ├── check_reqs.bat │ │ ├── clean │ │ ├── clean.bat │ │ ├── defaults.xml │ │ ├── lib │ │ │ ├── Adb.js │ │ │ ├── AndroidManifest.js │ │ │ ├── AndroidProject.js │ │ │ ├── AndroidStudio.js │ │ │ ├── android_sdk.js │ │ │ ├── build.js │ │ │ ├── builders │ │ │ │ ├── GenericBuilder.js │ │ │ │ ├── GradleBuilder.js │ │ │ │ ├── StudioBuilder.js │ │ │ │ └── builders.js │ │ │ ├── check_reqs.js │ │ │ ├── device.js │ │ │ ├── emulator.js │ │ │ ├── getASPath.bat │ │ │ ├── install-device │ │ │ ├── install-device.bat │ │ │ ├── install-emulator │ │ │ ├── install-emulator.bat │ │ │ ├── list-devices │ │ │ ├── list-devices.bat │ │ │ ├── list-emulator-images │ │ │ ├── list-emulator-images.bat │ │ │ ├── list-started-emulators │ │ │ ├── list-started-emulators.bat │ │ │ ├── log.js │ │ │ ├── plugin-build.gradle │ │ │ ├── pluginHandlers.js │ │ │ ├── prepare.js │ │ │ ├── retry.js │ │ │ ├── run.js │ │ │ ├── start-emulator │ │ │ └── start-emulator.bat │ │ ├── log │ │ ├── log.bat │ │ ├── loggingHelper.js │ │ ├── run │ │ ├── run.bat │ │ ├── version │ │ └── version.bat │ │ ├── platform_www │ │ ├── cordova-js-src │ │ │ ├── android │ │ │ │ ├── nativeapiprovider.js │ │ │ │ └── promptbasednativeapi.js │ │ │ ├── exec.js │ │ │ ├── platform.js │ │ │ └── plugin │ │ │ │ └── android │ │ │ │ └── app.js │ │ ├── cordova.js │ │ └── cordova_plugins.js │ │ ├── project.properties │ │ ├── settings.gradle │ │ └── wrapper.gradle ├── plugins │ ├── android.json │ ├── cordova-plugin-whitelist │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── RELEASENOTES.md │ │ ├── doc │ │ │ ├── de │ │ │ │ └── README.md │ │ │ ├── es │ │ │ │ └── README.md │ │ │ ├── fr │ │ │ │ └── README.md │ │ │ ├── it │ │ │ │ └── README.md │ │ │ ├── ja │ │ │ │ └── README.md │ │ │ ├── ko │ │ │ │ └── README.md │ │ │ ├── pl │ │ │ │ └── README.md │ │ │ └── zh │ │ │ │ └── README.md │ │ ├── package.json │ │ ├── plugin.xml │ │ └── src │ │ │ └── android │ │ │ └── WhitelistPlugin.java │ └── fetch.json ├── res │ ├── README.md │ ├── icon │ │ ├── android │ │ │ ├── icon-36-ldpi.png │ │ │ ├── icon-48-mdpi.png │ │ │ ├── icon-72-hdpi.png │ │ │ └── icon-96-xhdpi.png │ │ ├── bada-wac │ │ │ ├── icon-48-type5.png │ │ │ ├── icon-50-type3.png │ │ │ └── icon-80-type4.png │ │ ├── bada │ │ │ └── icon-128.png │ │ ├── blackberry │ │ │ └── icon-80.png │ │ ├── blackberry10 │ │ │ └── icon-80.png │ │ ├── ios │ │ │ ├── icon-57-2x.png │ │ │ ├── icon-57.png │ │ │ ├── icon-72-2x.png │ │ │ └── icon-72.png │ │ ├── tizen │ │ │ └── icon-128.png │ │ ├── webos │ │ │ └── icon-64.png │ │ └── windows-phone │ │ │ ├── icon-173-tile.png │ │ │ ├── icon-48.png │ │ │ └── icon-62-tile.png │ └── screen │ │ ├── android │ │ ├── screen-hdpi-landscape.png │ │ ├── screen-hdpi-portrait.png │ │ ├── screen-ldpi-landscape.png │ │ ├── screen-ldpi-portrait.png │ │ ├── screen-mdpi-landscape.png │ │ ├── screen-mdpi-portrait.png │ │ ├── screen-xhdpi-landscape.png │ │ └── screen-xhdpi-portrait.png │ │ ├── bada-wac │ │ ├── screen-type3.png │ │ ├── screen-type4.png │ │ └── screen-type5.png │ │ ├── bada │ │ └── screen-portrait.png │ │ ├── blackberry │ │ └── screen-225.png │ │ ├── blackberry10 │ │ ├── splash-1280x768.png │ │ ├── splash-720x720.png │ │ └── splash-768x1280.png │ │ ├── ios │ │ ├── screen-ipad-landscape-2x.png │ │ ├── screen-ipad-landscape.png │ │ ├── screen-ipad-portrait-2x.png │ │ ├── screen-ipad-portrait.png │ │ ├── screen-iphone-landscape-2x.png │ │ ├── screen-iphone-landscape.png │ │ ├── screen-iphone-portrait-2x.png │ │ ├── screen-iphone-portrait-568h-2x.png │ │ └── screen-iphone-portrait.png │ │ ├── tizen │ │ └── README.md │ │ ├── webos │ │ └── screen-64.png │ │ └── windows-phone │ │ └── screen-portrait.jpg ├── src │ ├── index.html │ └── index.tsx ├── webpack.config.ts └── yarn.lock ├── core ├── @types │ ├── fuzzy-search.ts │ └── react-octicon.tsx ├── components │ ├── App.tsx │ ├── AppFooter.tsx │ ├── Body.tsx │ ├── BodyErrorWrapper.tsx │ ├── BookmarkList.tsx │ ├── CloseButton.tsx │ ├── DrawerActionItem.tsx │ ├── DrawerSection.tsx │ ├── FileSelectionDialog.tsx │ ├── FileUploader.tsx │ ├── IconPair.tsx │ ├── KeyBindingsRefList.tsx │ ├── Link.tsx │ ├── Loader.tsx │ ├── MarkdownEditor.tsx │ ├── ModalContainer.tsx │ ├── NavBar.tsx │ ├── NodeActionToolbar.tsx │ ├── NodeEditor.tsx │ ├── NodeFoldControls.tsx │ ├── NodePlaceholder.tsx │ ├── NodeZoomControls.tsx │ ├── NoteOverview.tsx │ ├── NotesOverview.tsx │ ├── OutlineActionToolbar.tsx │ ├── OutlineDeletionDialog.tsx │ ├── OutlineEditor.tsx │ ├── OutlineTitleEditor.tsx │ ├── PrimaryDrawerMenu.tsx │ ├── PrivacyDialog.tsx │ ├── ResourceRefList.tsx │ ├── RichTextEditor.tsx │ ├── SecondaryActionLink.tsx │ ├── SecondaryDrawerMenu.tsx │ ├── SelectionOverview.tsx │ ├── SwitchSlider.tsx │ ├── ZoomStack.tsx │ ├── containers.tsx │ └── styles │ │ ├── drawer.ts │ │ ├── mde-overrides.css │ │ └── theme.ts ├── models │ ├── IProviderProps.ts │ ├── Marker.ts │ ├── Node.ts │ ├── Note.ts │ ├── Outline.ts │ ├── OutlineVisitState.ts │ └── Store.ts └── utils │ ├── Editable.ts │ ├── ModalRegistry.ts │ ├── UtilTypes.ts │ ├── collection-helpers.ts │ ├── fn-utils.ts │ ├── keyboard-handlers.ts │ ├── mobx-helpers.ts │ ├── offline-plugin-runtime.ts │ ├── persistence.ts │ └── type-overrides.ts ├── electron-shell ├── README.md ├── app │ ├── package.json │ ├── src │ │ ├── index.html │ │ ├── main.ts │ │ └── renderer.tsx │ └── yarn.lock ├── package.json ├── webpack.config.base.ts ├── webpack.config.main.ts ├── webpack.config.renderer.ts └── yarn.lock ├── package.json ├── prettier.config.js ├── pwa-shell ├── deploy │ └── deploy.js ├── package.json ├── src │ ├── index.html │ ├── index.tsx │ └── outdated-browser-check.js ├── webpack.config.ts └── yarn.lock ├── scripts ├── build.js ├── deploy.js ├── install.js └── pre-publish.js ├── server ├── package.json ├── src │ └── index.ts └── tsconfig.json ├── tsconfig.client.json ├── tsconfig.json ├── tslint.json ├── webpack.config.common.ts └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | cordova-shell/platforms/android/**/* linguist-generated=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist* 3 | yarn-error.log 4 | .idea 5 | .vscode 6 | .projectile 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ⚠️ This project is not actively maintained. I mostly use Logseq for my everyday needs now and strongly recommend it. 2 | 3 | ---- 4 | 5 | # Fluid Outliner 6 | 7 | Open source web based progressive outliner for your thoughts, ideas and daily tidbids. 8 | 9 | ![Screenshot](https://github.com/fluid-notion/fluid-outliner/raw/master/assets/screenshot.png) 10 | 11 | ## License 12 | 13 | [![License: GPL v3](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0) 14 | -------------------------------------------------------------------------------- /assets/colored-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/assets/colored-logo.png -------------------------------------------------------------------------------- /assets/logo-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/assets/logo-text.png -------------------------------------------------------------------------------- /assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/assets/screenshot.png -------------------------------------------------------------------------------- /cordova-shell/.gitignore: -------------------------------------------------------------------------------- 1 | /www 2 | /platforms/android/app/src/main/assets 3 | /platforms/android/.gradle 4 | /platforms/android/.idea 5 | /platforms/android/CordovaLib/build 6 | /platforms/android/CordovaLib/app/build 7 | 8 | -------------------------------------------------------------------------------- /cordova-shell/README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | This is the very early version of fluid-outliner electron app. 4 | 5 | Currently, the electron app does not provide any advantages over using the PWA, but in future it is expected to have better native integration and synchronization capabilities. 6 | 7 | ## Running the android app 8 | 9 | You will need to ensure that Android SDK is installed, ANDROID_HOME path is set and platform-tools is added to PATH. 10 | 11 | ``` 12 | cd fluid-outliner 13 | yarn 14 | cd cordova-shell 15 | yarn 16 | yarn run build 17 | yarn run emulate android 18 | ``` 19 | 20 | ## Running the ios app 21 | 22 | **TBD** 23 | 24 | The DX is expected to improve when the electron shell matures. 25 | 26 | ## Guidelines 27 | 28 | - As a general policy it is expected that if something can be handled at the PWA layer, it goes there. 29 | - For performance, or better native integration experience, it may be desirable to provide alternative implementation of a few features in cordova-shell. 30 | - Cordova specific feaures are to be added only as a last resort, when handling them at the PWA layer proves too restrictive or cumbersome even with latest HTML5/ES-next APIs. 31 | 32 | ## FAQs 33 | 34 | ### Why are there two package.json files 35 | 36 | Primarily to prevent contributors contributing to PWA (which constitutes the bulk of this application) from having to download all cordova related dependencies. 37 | -------------------------------------------------------------------------------- /cordova-shell/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HelloCordova 4 | 5 | A sample Apache Cordova application that responds to the deviceready event. 6 | 7 | 8 | Apache Cordova Team 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /cordova-shell/hooks/README.md: -------------------------------------------------------------------------------- 1 | 21 | # Cordova Hooks 22 | 23 | Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide. 24 | -------------------------------------------------------------------------------- /cordova-shell/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fluid-notion/fluid-outliner-cordova-shell", 3 | "displayName": "Fluid Outliner", 4 | "version": "0.0.1", 5 | "description": "Fluid Outliner Cordova Shell", 6 | "main": "index.js", 7 | "author": "Lorefnon ", 8 | "license": "GPL-v3.0", 9 | "private": true, 10 | "devDependencies": { 11 | "cordova": "^8.0.0" 12 | }, 13 | "scripts": { 14 | "build-client": "../node_modules/.bin/webpack", 15 | "build-app": "cordova build", 16 | "build": "yarn run build-client && yarn run build-app", 17 | "emulate": "cordova emulate", 18 | "webpack-dev-server": "../node_modules/.bin/webpack-dev-server --hot --progress --profile --colors" 19 | }, 20 | "dependencies": { 21 | "cordova-android": "^7.0.0", 22 | "cordova-plugin-whitelist": "^1.3.3" 23 | }, 24 | "cordova": { 25 | "plugins": { 26 | "cordova-plugin-whitelist": {} 27 | }, 28 | "platforms": [ 29 | "android" 30 | ] 31 | } 32 | } -------------------------------------------------------------------------------- /cordova-shell/platforms/android/.gitignore: -------------------------------------------------------------------------------- 1 | # Non-project-specific build files: 2 | build.xml 3 | local.properties 4 | /gradlew 5 | /gradlew.bat 6 | /gradle 7 | # Ant builds 8 | ant-build 9 | ant-gen 10 | # Eclipse builds 11 | gen 12 | out 13 | # Gradle builds 14 | /build 15 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Indicates whether an apk should be generated for each density. 11 | split.density=false 12 | # Project target. 13 | target=android-26 14 | apk-configurations= 15 | renderscript.opt.level=O0 16 | android.library=true 17 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/AuthenticationToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova; 20 | 21 | /** 22 | * The Class AuthenticationToken defines the userName and password to be used for authenticating a web resource 23 | */ 24 | public class AuthenticationToken { 25 | private String userName; 26 | private String password; 27 | 28 | /** 29 | * Gets the user name. 30 | * 31 | * @return the user name 32 | */ 33 | public String getUserName() { 34 | return userName; 35 | } 36 | 37 | /** 38 | * Sets the user name. 39 | * 40 | * @param userName 41 | * the new user name 42 | */ 43 | public void setUserName(String userName) { 44 | this.userName = userName; 45 | } 46 | 47 | /** 48 | * Gets the password. 49 | * 50 | * @return the password 51 | */ 52 | public String getPassword() { 53 | return password; 54 | } 55 | 56 | /** 57 | * Sets the password. 58 | * 59 | * @param password 60 | * the new password 61 | */ 62 | public void setPassword(String password) { 63 | this.password = password; 64 | } 65 | 66 | 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/BuildHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package org.apache.cordova; 21 | 22 | /* 23 | * This is a utility class that allows us to get the BuildConfig variable, which is required 24 | * for the use of different providers. This is not guaranteed to work, and it's better for this 25 | * to be set in the build step in config.xml 26 | * 27 | */ 28 | 29 | import android.app.Activity; 30 | import android.content.Context; 31 | 32 | import java.lang.reflect.Field; 33 | 34 | 35 | public class BuildHelper { 36 | 37 | 38 | private static String TAG="BuildHelper"; 39 | 40 | /* 41 | * This needs to be implemented if you wish to use the Camera Plugin or other plugins 42 | * that read the Build Configuration. 43 | * 44 | * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to 45 | * StackOverflow. This is annoying as hell! However, this method does not work with 46 | * ProGuard, and you should use the config.xml to define the application_id 47 | * 48 | */ 49 | 50 | public static Object getBuildConfigValue(Context ctx, String key) 51 | { 52 | try 53 | { 54 | Class clazz = Class.forName(ctx.getPackageName() + ".BuildConfig"); 55 | Field field = clazz.getField(key); 56 | return field.get(null); 57 | } catch (ClassNotFoundException e) { 58 | LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?"); 59 | e.printStackTrace(); 60 | } catch (NoSuchFieldException e) { 61 | LOG.d(TAG, key + " is not a valid field. Check your build.gradle"); 62 | } catch (IllegalAccessException e) { 63 | LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace."); 64 | e.printStackTrace(); 65 | } 66 | 67 | return null; 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/Config.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package org.apache.cordova; 21 | 22 | import java.util.List; 23 | 24 | import android.app.Activity; 25 | 26 | @Deprecated // Use Whitelist, CordovaPrefences, etc. directly. 27 | public class Config { 28 | private static final String TAG = "Config"; 29 | 30 | static ConfigXmlParser parser; 31 | 32 | private Config() { 33 | } 34 | 35 | public static void init(Activity action) { 36 | parser = new ConfigXmlParser(); 37 | parser.parse(action); 38 | //TODO: Add feature to bring this back. Some preferences should be overridden by intents, but not all 39 | parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras()); 40 | } 41 | 42 | // Intended to be used for testing only; creates an empty configuration. 43 | public static void init() { 44 | if (parser == null) { 45 | parser = new ConfigXmlParser(); 46 | } 47 | } 48 | 49 | public static String getStartUrl() { 50 | if (parser == null) { 51 | return "file:///android_asset/www/index.html"; 52 | } 53 | return parser.getLaunchUrl(); 54 | } 55 | 56 | public static String getErrorUrl() { 57 | return parser.getPreferences().getString("errorurl", null); 58 | } 59 | 60 | public static List getPluginEntries() { 61 | return parser.getPluginEntries(); 62 | } 63 | 64 | public static CordovaPreferences getPreferences() { 65 | return parser.getPreferences(); 66 | } 67 | 68 | public static boolean isInitialized() { 69 | return parser != null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/CordovaHttpAuthHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova; 20 | 21 | import android.webkit.HttpAuthHandler; 22 | 23 | /** 24 | * Specifies interface for HTTP auth handler object which is used to handle auth requests and 25 | * specifying user credentials. 26 | */ 27 | public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler { 28 | 29 | private final HttpAuthHandler handler; 30 | 31 | public CordovaHttpAuthHandler(HttpAuthHandler handler) { 32 | this.handler = handler; 33 | } 34 | 35 | /** 36 | * Instructs the WebView to cancel the authentication request. 37 | */ 38 | public void cancel () { 39 | this.handler.cancel(); 40 | } 41 | 42 | /** 43 | * Instructs the WebView to proceed with the authentication with the given credentials. 44 | * 45 | * @param username 46 | * @param password 47 | */ 48 | public void proceed (String username, String password) { 49 | this.handler.proceed(username, password); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/ExposedJsApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package org.apache.cordova; 21 | 22 | import org.json.JSONException; 23 | 24 | /* 25 | * Any exposed Javascript API MUST implement these three things! 26 | */ 27 | public interface ExposedJsApi { 28 | public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException; 29 | public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException; 30 | public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException; 31 | } 32 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaClientCertRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova; 20 | 21 | import java.security.Principal; 22 | import java.security.PrivateKey; 23 | import java.security.cert.X509Certificate; 24 | 25 | /** 26 | * Specifies interface for handling certificate requests. 27 | */ 28 | public interface ICordovaClientCertRequest { 29 | /** 30 | * Cancel this request 31 | */ 32 | public void cancel(); 33 | 34 | /* 35 | * Returns the host name of the server requesting the certificate. 36 | */ 37 | public String getHost(); 38 | 39 | /* 40 | * Returns the acceptable types of asymmetric keys (can be null). 41 | */ 42 | public String[] getKeyTypes(); 43 | 44 | /* 45 | * Returns the port number of the server requesting the certificate. 46 | */ 47 | public int getPort(); 48 | 49 | /* 50 | * Returns the acceptable certificate issuers for the certificate matching the private key (can be null). 51 | */ 52 | public Principal[] getPrincipals(); 53 | 54 | /* 55 | * Ignore the request for now. Do not remember user's choice. 56 | */ 57 | public void ignore(); 58 | 59 | /* 60 | * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests. 61 | * 62 | * @param privateKey The privateKey 63 | * @param chain The certificate chain 64 | */ 65 | public void proceed(PrivateKey privateKey, X509Certificate[] chain); 66 | } -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaCookieManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package org.apache.cordova; 21 | 22 | public interface ICordovaCookieManager { 23 | 24 | public void setCookiesEnabled(boolean accept); 25 | 26 | public void setCookie(final String url, final String value); 27 | 28 | public String getCookie(final String url); 29 | 30 | public void clearCookies(); 31 | 32 | public void flush(); 33 | }; 34 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/ICordovaHttpAuthHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova; 20 | 21 | /** 22 | * Specifies interface for HTTP auth handler object which is used to handle auth requests and 23 | * specifying user credentials. 24 | */ 25 | public interface ICordovaHttpAuthHandler { 26 | /** 27 | * Instructs the WebView to cancel the authentication request. 28 | */ 29 | public void cancel (); 30 | 31 | /** 32 | * Instructs the WebView to proceed with the authentication with the given credentials. 33 | * 34 | * @param username The user name 35 | * @param password The password 36 | */ 37 | public void proceed (String username, String password); 38 | } -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/PluginEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova; 20 | 21 | import org.apache.cordova.CordovaPlugin; 22 | 23 | /** 24 | * This class represents a service entry object. 25 | */ 26 | public final class PluginEntry { 27 | 28 | /** 29 | * The name of the service that this plugin implements 30 | */ 31 | public final String service; 32 | 33 | /** 34 | * The plugin class name that implements the service. 35 | */ 36 | public final String pluginClass; 37 | 38 | /** 39 | * The pre-instantiated plugin to use for this entry. 40 | */ 41 | public final CordovaPlugin plugin; 42 | 43 | /** 44 | * Flag that indicates the plugin object should be created when PluginManager is initialized. 45 | */ 46 | public final boolean onload; 47 | 48 | /** 49 | * Constructs with a CordovaPlugin already instantiated. 50 | */ 51 | public PluginEntry(String service, CordovaPlugin plugin) { 52 | this(service, plugin.getClass().getName(), true, plugin); 53 | } 54 | 55 | /** 56 | * @param service The name of the service 57 | * @param pluginClass The plugin class name 58 | * @param onload Create plugin object when HTML page is loaded 59 | */ 60 | public PluginEntry(String service, String pluginClass, boolean onload) { 61 | this(service, pluginClass, onload, null); 62 | } 63 | 64 | private PluginEntry(String service, String pluginClass, boolean onload, CordovaPlugin plugin) { 65 | this.service = service; 66 | this.pluginClass = pluginClass; 67 | this.onload = onload; 68 | this.plugin = plugin; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package org.apache.cordova.engine; 21 | 22 | import android.annotation.TargetApi; 23 | import android.os.Build; 24 | import android.webkit.CookieManager; 25 | import android.webkit.WebView; 26 | 27 | import org.apache.cordova.ICordovaCookieManager; 28 | 29 | class SystemCookieManager implements ICordovaCookieManager { 30 | 31 | protected final WebView webView; 32 | private final CookieManager cookieManager; 33 | 34 | //Added because lint can't see the conditional RIGHT ABOVE this 35 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 36 | public SystemCookieManager(WebView webview) { 37 | webView = webview; 38 | cookieManager = CookieManager.getInstance(); 39 | 40 | //REALLY? Nobody has seen this UNTIL NOW? 41 | cookieManager.setAcceptFileSchemeCookies(true); 42 | 43 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 44 | cookieManager.setAcceptThirdPartyCookies(webView, true); 45 | } 46 | } 47 | 48 | public void setCookiesEnabled(boolean accept) { 49 | cookieManager.setAcceptCookie(accept); 50 | } 51 | 52 | public void setCookie(final String url, final String value) { 53 | cookieManager.setCookie(url, value); 54 | } 55 | 56 | public String getCookie(final String url) { 57 | return cookieManager.getCookie(url); 58 | } 59 | 60 | public void clearCookies() { 61 | cookieManager.removeAllCookie(); 62 | } 63 | 64 | public void flush() { 65 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 66 | cookieManager.flush(); 67 | } 68 | } 69 | }; 70 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemExposedJsApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | package org.apache.cordova.engine; 20 | 21 | import android.webkit.JavascriptInterface; 22 | 23 | import org.apache.cordova.CordovaBridge; 24 | import org.apache.cordova.ExposedJsApi; 25 | import org.json.JSONException; 26 | 27 | /** 28 | * Contains APIs that the JS can call. All functions in here should also have 29 | * an equivalent entry in CordovaChromeClient.java, and be added to 30 | * cordova-js/lib/android/plugin/android/promptbasednativeapi.js 31 | */ 32 | class SystemExposedJsApi implements ExposedJsApi { 33 | private final CordovaBridge bridge; 34 | 35 | SystemExposedJsApi(CordovaBridge bridge) { 36 | this.bridge = bridge; 37 | } 38 | 39 | @JavascriptInterface 40 | public String exec(int bridgeSecret, String service, String action, String callbackId, String arguments) throws JSONException, IllegalAccessException { 41 | return bridge.jsExec(bridgeSecret, service, action, callbackId, arguments); 42 | } 43 | 44 | @JavascriptInterface 45 | public void setNativeToJsBridgeMode(int bridgeSecret, int value) throws IllegalAccessException { 46 | bridge.jsSetNativeToJsBridgeMode(bridgeSecret, value); 47 | } 48 | 49 | @JavascriptInterface 50 | public String retrieveJsMessages(int bridgeSecret, boolean fromOnlineEvent) throws IllegalAccessException { 51 | return bridge.jsRetrieveJsMessages(bridgeSecret, fromOnlineEvent); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/android.json: -------------------------------------------------------------------------------- 1 | { 2 | "prepare_queue": { 3 | "installed": [], 4 | "uninstalled": [] 5 | }, 6 | "config_munge": { 7 | "files": { 8 | "res/xml/config.xml": { 9 | "parents": { 10 | "/*": [ 11 | { 12 | "xml": "", 13 | "count": 1 14 | } 15 | ] 16 | } 17 | } 18 | } 19 | }, 20 | "installed_plugins": { 21 | "cordova-plugin-whitelist": { 22 | "PACKAGE_NAME": "io.cordova.hellocordova" 23 | } 24 | }, 25 | "dependent_plugins": {}, 26 | "modules": [], 27 | "plugin_metadata": { 28 | "cordova-plugin-whitelist": "1.3.3" 29 | } 30 | } -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/assets/www/cordova-js-src/android/nativeapiprovider.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. 22 | */ 23 | 24 | var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); 25 | var currentApi = nativeApi; 26 | 27 | module.exports = { 28 | get: function() { return currentApi; }, 29 | setPreferPrompt: function(value) { 30 | currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; 31 | }, 32 | // Used only by tests. 33 | set: function(value) { 34 | currentApi = value; 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/assets/www/cordova-js-src/android/promptbasednativeapi.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. 22 | * This is used pre-JellyBean, where addJavascriptInterface() is disabled. 23 | */ 24 | 25 | module.exports = { 26 | exec: function(bridgeSecret, service, action, callbackId, argsJson) { 27 | return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); 28 | }, 29 | setNativeToJsBridgeMode: function(bridgeSecret, value) { 30 | prompt(value, 'gap_bridge_mode:' + bridgeSecret); 31 | }, 32 | retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { 33 | return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/assets/www/cordova_plugins.js: -------------------------------------------------------------------------------- 1 | cordova.define('cordova/plugin_list', function(require, exports, module) { 2 | module.exports = []; 3 | module.exports.metadata = 4 | // TOP OF METADATA 5 | { 6 | "cordova-plugin-whitelist": "1.3.3" 7 | }; 8 | // BOTTOM OF METADATA 9 | }); -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/assets/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | 16 | 17 | Fluid Outliner 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/java/io/cordova/hellocordova/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | package io.cordova.hellocordova; 21 | 22 | import android.os.Bundle; 23 | import org.apache.cordova.*; 24 | 25 | public class MainActivity extends CordovaActivity 26 | { 27 | @Override 28 | public void onCreate(Bundle savedInstanceState) 29 | { 30 | super.onCreate(savedInstanceState); 31 | 32 | // enable Cordova apps to be started in the background 33 | Bundle extras = getIntent().getExtras(); 34 | if (extras != null && extras.getBoolean("cdvStartInBackground", false)) { 35 | moveTaskToBack(true); 36 | } 37 | 38 | // Set by in config.xml 39 | loadUrl(launchUrl); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-hdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-hdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-ldpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-ldpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-mdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-mdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-xhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-xhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-xxhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-xxhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-land-xxxhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-land-xxxhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-hdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-hdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-ldpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-ldpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-mdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-mdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-xhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-xhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-xxhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-xxhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/drawable-port-xxxhdpi/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/drawable-port-xxxhdpi/screen.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-ldpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/platforms/android/app/src/main/res/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | HelloCordova 4 | @string/app_name 5 | @string/launcher_name 6 | 7 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/app/src/main/res/xml/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HelloCordova 8 | 9 | A sample Apache Cordova application that responds to the deviceready event. 10 | 11 | 12 | Apache Cordova Team 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/build.gradle: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one 2 | or more contributor license agreements. See the NOTICE file 3 | distributed with this work for additional information 4 | regarding copyright ownership. The ASF licenses this file 5 | to you under the Apache License, Version 2.0 (the 6 | "License"); you may not use this file except in compliance 7 | with the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, 12 | software distributed under the License is distributed on an 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | KIND, either express or implied. See the License for the 15 | specific language governing permissions and limitations 16 | under the License. 17 | */ 18 | 19 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 20 | 21 | buildscript { 22 | repositories { 23 | jcenter() 24 | maven { 25 | url "https://maven.google.com" 26 | } 27 | } 28 | dependencies { 29 | 30 | // NOTE: Do not place your application dependencies here; they belong 31 | // in the individual module build.gradle files 32 | classpath 'com.android.tools.build:gradle:3.0.0' 33 | } 34 | } 35 | 36 | allprojects { 37 | repositories { 38 | jcenter() 39 | maven { 40 | url "https://maven.google.com" 41 | } 42 | } 43 | //This replaces project.properties w.r.t. build settings 44 | project.ext { 45 | defaultBuildToolsVersion="25.0.2" //String 46 | defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 47 | defaultTargetSdkVersion=26 //Integer - We ALWAYS target the latest by default 48 | defaultCompileSdkVersion=26 //Integer - We ALWAYS compile with the latest by default 49 | } 50 | } 51 | 52 | task clean(type: Delete) { 53 | delete rootProject.buildDir 54 | } 55 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/android_sdk_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var android_sdk = require('./lib/android_sdk'); 23 | 24 | android_sdk.print_newest_available_sdk_target().done(null, function(err) { 25 | console.error(err); 26 | process.exit(2); 27 | }); 28 | 29 | 30 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/android_sdk_version.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0android_sdk_version" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2 25 | EXIT /B 1 26 | ) 27 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var args = process.argv; 23 | var Api = require('./Api'); 24 | var nopt = require('nopt'); 25 | var path = require('path'); 26 | 27 | // Support basic help commands 28 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) 29 | require('./lib/build').help(); 30 | 31 | // Do some basic argument parsing 32 | var buildOpts = nopt({ 33 | 'verbose' : Boolean, 34 | 'silent' : Boolean, 35 | 'debug' : Boolean, 36 | 'release' : Boolean, 37 | 'nobuild': Boolean, 38 | 'buildConfig' : path 39 | }, { 'd' : '--verbose' }); 40 | 41 | // Make buildOptions compatible with PlatformApi build method spec 42 | buildOpts.argv = buildOpts.argv.original; 43 | 44 | require('./loggingHelper').adjustLoggerLevel(buildOpts); 45 | 46 | new Api().build(buildOpts) 47 | .catch(function(err) { 48 | console.error(err.stack); 49 | process.exit(2); 50 | }); 51 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/build.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0build" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/check_reqs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var check_reqs = require('./lib/check_reqs'); 23 | 24 | check_reqs.run().done( 25 | function success() { 26 | console.log('Looks like your environment fully supports cordova-android development!'); 27 | }, function fail(err) { 28 | console.log(err); 29 | process.exit(2); 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/check_reqs.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0check_reqs" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2 25 | EXIT /B 1 26 | ) 27 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/clean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('./Api'); 23 | var path = require('path'); 24 | var nopt = require('nopt'); 25 | 26 | // Support basic help commands 27 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) { 28 | console.log('Usage: ' + path.relative(process.cwd(), process.argv[1])); 29 | console.log('Cleans the project directory.'); 30 | process.exit(0); 31 | } 32 | 33 | // Do some basic argument parsing 34 | var opts = nopt({ 35 | 'verbose' : Boolean, 36 | 'silent' : Boolean 37 | }, { 'd' : '--verbose' }); 38 | 39 | // Make buildOptions compatible with PlatformApi clean method spec 40 | opts.argv = opts.argv.original; 41 | 42 | // Skip cleaning prepared files when not invoking via cordova CLI. 43 | opts.noPrepare = true; 44 | 45 | require('./loggingHelper').adjustLoggerLevel(opts); 46 | 47 | new Api().clean(opts) 48 | .catch(function(err) { 49 | console.error(err.stack); 50 | process.exit(2); 51 | }); 52 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/clean.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0clean" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/AndroidStudio.js: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a simple routine that checks if project is an Android Studio Project 3 | * 4 | * @param {String} root Root folder of the project 5 | */ 6 | 7 | /* jshint esnext: false */ 8 | 9 | var path = require('path'); 10 | var fs = require('fs'); 11 | var CordovaError = require('cordova-common').CordovaError; 12 | 13 | module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) { 14 | var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res']; 15 | var androidStudioFiles = ['app', 'app/src/main']; 16 | 17 | // assume it is an AS project and not an Eclipse project 18 | var isEclipse = false; 19 | var isAS = true; 20 | 21 | if (!fs.existsSync(root)) { 22 | throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root); 23 | } 24 | 25 | // if any of the following exists, then we are not an ASProj 26 | eclipseFiles.forEach(function (file) { 27 | if (fs.existsSync(path.join(root, file))) { 28 | isEclipse = true; 29 | } 30 | }); 31 | 32 | // if it is NOT an eclipse project, check that all required files exist 33 | if (!isEclipse) { 34 | androidStudioFiles.forEach(function (file) { 35 | if (!fs.existsSync(path.join(root, file))) { 36 | console.log('missing file :: ' + file); 37 | isAS = false; 38 | } 39 | }); 40 | } 41 | return (!isEclipse && isAS); 42 | }; 43 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/builders/builders.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | var CordovaError = require('cordova-common').CordovaError; 21 | 22 | var knownBuilders = { 23 | gradle: 'GradleBuilder', 24 | studio: 'StudioBuilder', 25 | none: 'GenericBuilder' 26 | }; 27 | 28 | /** 29 | * Helper method that instantiates and returns a builder for specified build 30 | * type. 31 | * 32 | * @param {String} builderType Builder name to construct and return. Must 33 | * be one of 'ant', 'gradle' or 'none' 34 | * 35 | * @return {Builder} A builder instance for specified build type. 36 | */ 37 | module.exports.getBuilder = function (builderType, projectRoot) { 38 | if (!knownBuilders[builderType]) { throw new CordovaError('Builder ' + builderType + ' is not supported.'); } 39 | 40 | try { 41 | var Builder = require('./' + knownBuilders[builderType]); 42 | return new Builder(projectRoot); 43 | } catch (err) { 44 | throw new CordovaError('Failed to instantiate ' + knownBuilders[builderType] + ' builder: ' + err); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/getASPath.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | for /f "tokens=2*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Android Studio" /v Path') do set "ASPath=%%~b" 3 | ECHO %ASPath% -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/install-device: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var device = require('./device'), 23 | args = process.argv; 24 | 25 | if(args.length > 2) { 26 | var install_target; 27 | if (args[2].substring(0, 9) == '--target=') { 28 | install_target = args[2].substring(9, args[2].length); 29 | device.install(install_target).done(null, function(err) { 30 | console.error('ERROR: ' + err); 31 | process.exit(2); 32 | }); 33 | } else { 34 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); 35 | process.exit(2); 36 | } 37 | } else { 38 | device.install().done(null, function(err) { 39 | console.error('ERROR: ' + err); 40 | process.exit(2); 41 | }); 42 | } 43 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/install-device.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0install-device" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'install-device' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/install-emulator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var emulator = require('./emulator'), 23 | args = process.argv; 24 | 25 | var install_target; 26 | if(args.length > 2) { 27 | if (args[2].substring(0, 9) == '--target=') { 28 | install_target = args[2].substring(9, args[2].length); 29 | } else { 30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); 31 | process.exit(2); 32 | } 33 | } 34 | 35 | emulator.install(install_target).done(null, function(err) { 36 | console.error('ERROR: ' + err); 37 | process.exit(2); 38 | }); 39 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/install-emulator.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0install-emulator" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'install-emulator' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-devices: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var devices = require('./device'); 23 | 24 | // Usage support for when args are given 25 | require('./check_reqs').check_android().then(function() { 26 | devices.list().done(function(device_list) { 27 | device_list && device_list.forEach(function(dev) { 28 | console.log(dev); 29 | }); 30 | }, function(err) { 31 | console.error('ERROR: ' + err); 32 | process.exit(2); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-devices.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0list-devices" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'list-devices' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-emulator-images: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var emulators = require('./emulator'); 23 | 24 | // Usage support for when args are given 25 | require('./check_reqs').check_android().then(function() { 26 | emulators.list_images().done(function(emulator_list) { 27 | emulator_list && emulator_list.forEach(function(emu) { 28 | console.log(emu.name); 29 | }); 30 | }, function(err) { 31 | console.error('ERROR: ' + err); 32 | process.exit(2); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-emulator-images.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0list-emulator-images" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'list-emulator-images' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) 27 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-started-emulators: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var emulators = require('./emulator'); 23 | 24 | // Usage support for when args are given 25 | require('./check_reqs').check_android().then(function() { 26 | emulators.list_started().done(function(emulator_list) { 27 | emulator_list && emulator_list.forEach(function(emu) { 28 | console.log(emu); 29 | }); 30 | }, function(err) { 31 | console.error('ERROR: ' + err); 32 | process.exit(2); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/list-started-emulators.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0list-started-emulators" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'list-started-emulators' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/log.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var path = require('path'); 23 | var os = require('os'); 24 | var Q = require('q'); 25 | var child_process = require('child_process'); 26 | var ROOT = path.join(__dirname, '..', '..'); 27 | 28 | /* 29 | * Starts running logcat in the shell. 30 | * Returns a promise. 31 | */ 32 | module.exports.run = function () { 33 | var d = Q.defer(); 34 | var adb = child_process.spawn('adb', ['logcat'], {cwd: os.tmpdir()}); 35 | 36 | adb.stdout.on('data', function (data) { 37 | var lines = data ? data.toString().split('\n') : []; 38 | var out = lines.filter(function (x) { return x.indexOf('nativeGetEnabledTags') < 0; }); 39 | console.log(out.join('\n')); 40 | }); 41 | 42 | adb.stderr.on('data', console.error); 43 | adb.on('close', function (code) { 44 | if (code > 0) { 45 | d.reject('Failed to run logcat command.'); 46 | } else d.resolve(); 47 | }); 48 | 49 | return d.promise; 50 | }; 51 | 52 | module.exports.help = function () { 53 | console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'cordova', 'log'))); 54 | console.log('Gives the logcat output on the command line.'); 55 | process.exit(0); 56 | }; 57 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/plugin-build.gradle: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one 2 | or more contributor license agreements. See the NOTICE file 3 | distributed with this work for additional information 4 | regarding copyright ownership. The ASF licenses this file 5 | to you under the Apache License, Version 2.0 (the 6 | "License"); you may not use this file except in compliance 7 | with the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, 12 | software distributed under the License is distributed on an 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | KIND, either express or implied. See the License for the 15 | specific language governing permissions and limitations 16 | under the License. 17 | */ 18 | 19 | // GENERATED FILE! DO NOT EDIT! 20 | 21 | buildscript { 22 | repositories { 23 | jcenter() 24 | maven { 25 | url "https://maven.google.com" 26 | } 27 | } 28 | 29 | // Switch the Android Gradle plugin version requirement depending on the 30 | // installed version of Gradle. This dependency is documented at 31 | // http://tools.android.com/tech-docs/new-build-system/version-compatibility 32 | // and https://issues.apache.org/jira/browse/CB-8143 33 | dependencies { 34 | classpath 'com.android.tools.build:gradle:1.0.0+' 35 | } 36 | } 37 | 38 | apply plugin: 'com.android.library' 39 | 40 | dependencies { 41 | compile fileTree(dir: 'libs', include: '*.jar') 42 | debugCompile project(path: ":CordovaLib", configuration: "debug") 43 | releaseCompile project(path: ":CordovaLib", configuration: "release") 44 | } 45 | 46 | android { 47 | compileSdkVersion cdvCompileSdkVersion 48 | buildToolsVersion cdvBuildToolsVersion 49 | publishNonDefault true 50 | 51 | compileOptions { 52 | sourceCompatibility JavaVersion.VERSION_1_6 53 | targetCompatibility JavaVersion.VERSION_1_6 54 | } 55 | 56 | sourceSets { 57 | main { 58 | manifest.srcFile 'AndroidManifest.xml' 59 | java.srcDirs = ['src'] 60 | resources.srcDirs = ['src'] 61 | aidl.srcDirs = ['src'] 62 | renderscript.srcDirs = ['src'] 63 | res.srcDirs = ['res'] 64 | assets.srcDirs = ['assets'] 65 | jniLibs.srcDirs = ['libs'] 66 | } 67 | } 68 | } 69 | 70 | if (file('build-extras.gradle').exists()) { 71 | apply from: 'build-extras.gradle' 72 | } 73 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/retry.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | /* jshint node: true */ 23 | 24 | 'use strict'; 25 | 26 | var events = require('cordova-common').events; 27 | 28 | /* 29 | * Retry a promise-returning function a number of times, propagating its 30 | * results on success or throwing its error on a failed final attempt. 31 | * 32 | * @arg {Number} attemts_left - The number of times to retry the passed call. 33 | * @arg {Function} promiseFunction - A function that returns a promise. 34 | * @arg {...} - Arguments to pass to promiseFunction. 35 | * 36 | * @returns {Promise} 37 | */ 38 | module.exports.retryPromise = function (attemts_left, promiseFunction) { 39 | 40 | // NOTE: 41 | // get all trailing arguments, by skipping the first two (attemts_left and 42 | // promiseFunction) because they shouldn't get passed to promiseFunction 43 | var promiseFunctionArguments = Array.prototype.slice.call(arguments, 2); 44 | 45 | return promiseFunction.apply(undefined, promiseFunctionArguments).then( 46 | 47 | // on success pass results through 48 | function onFulfilled (value) { 49 | return value; 50 | }, 51 | 52 | // on rejection either retry, or throw the error 53 | function onRejected (error) { 54 | 55 | attemts_left -= 1; 56 | 57 | if (attemts_left < 1) { 58 | throw error; 59 | } 60 | 61 | events.emit('verbose', 'A retried call failed. Retrying ' + attemts_left + ' more time(s).'); 62 | 63 | // retry call self again with the same arguments, except attemts_left is now lower 64 | var fullArguments = [attemts_left, promiseFunction].concat(promiseFunctionArguments); 65 | return module.exports.retryPromise.apply(undefined, fullArguments); 66 | } 67 | ); 68 | }; 69 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/start-emulator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var emulator = require('./emulator'), 23 | args = process.argv; 24 | 25 | var install_target; 26 | if(args.length > 2) { 27 | if (args[2].substring(0, 9) == '--target=') { 28 | install_target = args[2].substring(9, args[2].length); 29 | } else { 30 | console.error('ERROR : argument \'' + args[2] + '\' not recognized.'); 31 | process.exit(2); 32 | } 33 | } 34 | 35 | emulator.start(install_target).done(null, function(err) { 36 | console.error('ERROR: ' + err); 37 | process.exit(2); 38 | }); 39 | 40 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/lib/start-emulator.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0start-emulator" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'start-emulator' script in 'cordova\lib' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/log: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var log = require('./lib/log'), 23 | reqs = require('./lib/check_reqs'), 24 | args = process.argv; 25 | 26 | // Usage support for when args are given 27 | if(args.length > 2) { 28 | log.help(); 29 | } else { 30 | reqs.run().done(function() { 31 | return log.run(); 32 | }, function(err) { 33 | console.error('ERROR: ' + err); 34 | process.exit(2); 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/log.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0log" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'log' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/loggingHelper.js: -------------------------------------------------------------------------------- 1 | var CordovaLogger = require('cordova-common').CordovaLogger; 2 | 3 | module.exports = { 4 | adjustLoggerLevel: function (opts) { 5 | if (opts instanceof Array) { 6 | opts.silent = opts.indexOf('--silent') !== -1; 7 | opts.verbose = opts.indexOf('--verbose') !== -1; 8 | } 9 | 10 | if (opts.silent) { 11 | CordovaLogger.get().setLevel('error'); 12 | } 13 | 14 | if (opts.verbose) { 15 | CordovaLogger.get().setLevel('verbose'); 16 | } 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | var Api = require('./Api'); 23 | var nopt = require('nopt'); 24 | var path = require('path'); 25 | 26 | // Support basic help commands 27 | if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) 28 | require('./lib/run').help(); 29 | 30 | // Do some basic argument parsing 31 | var runOpts = nopt({ 32 | 'verbose' : Boolean, 33 | 'silent' : Boolean, 34 | 'debug' : Boolean, 35 | 'release' : Boolean, 36 | 'nobuild': Boolean, 37 | 'buildConfig' : path, 38 | 'archs' : String, 39 | 'device' : Boolean, 40 | 'emulator': Boolean, 41 | 'target' : String 42 | }, { 'd' : '--verbose' }); 43 | 44 | // Make runOptions compatible with PlatformApi run method spec 45 | runOpts.argv = runOpts.argv.remain; 46 | 47 | require('./loggingHelper').adjustLoggerLevel(runOpts); 48 | 49 | new Api().run(runOpts) 50 | .catch(function(err) { 51 | console.error(err, err.stack); 52 | process.exit(2); 53 | }); 54 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/run.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0run" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | Licensed to the Apache Software Foundation (ASF) under one 5 | or more contributor license agreements. See the NOTICE file 6 | distributed with this work for additional information 7 | regarding copyright ownership. The ASF licenses this file 8 | to you under the Apache License, Version 2.0 (the 9 | "License"); you may not use this file except in compliance 10 | with the License. You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, 15 | software distributed under the License is distributed on an 16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | KIND, either express or implied. See the License for the 18 | specific language governing permissions and limitations 19 | under the License. 20 | */ 21 | 22 | // Coho updates this line: 23 | var VERSION = "7.0.0"; 24 | 25 | module.exports.version = VERSION; 26 | 27 | if (!module.parent) { 28 | console.log(VERSION); 29 | } 30 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/cordova/version.bat: -------------------------------------------------------------------------------- 1 | :: Licensed to the Apache Software Foundation (ASF) under one 2 | :: or more contributor license agreements. See the NOTICE file 3 | :: distributed with this work for additional information 4 | :: regarding copyright ownership. The ASF licenses this file 5 | :: to you under the Apache License, Version 2.0 (the 6 | :: "License"); you may not use this file except in compliance 7 | :: with the License. You may obtain a copy of the License at 8 | :: 9 | :: http://www.apache.org/licenses/LICENSE-2.0 10 | :: 11 | :: Unless required by applicable law or agreed to in writing, 12 | :: software distributed under the License is distributed on an 13 | :: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | :: KIND, either express or implied. See the License for the 15 | :: specific language governing permissions and limitations 16 | :: under the License. 17 | 18 | @ECHO OFF 19 | SET script_path="%~dp0version" 20 | IF EXIST %script_path% ( 21 | node %script_path% %* 22 | ) ELSE ( 23 | ECHO. 24 | ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2 25 | EXIT /B 1 26 | ) 27 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/platform_www/cordova-js-src/android/nativeapiprovider.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. 22 | */ 23 | 24 | var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); 25 | var currentApi = nativeApi; 26 | 27 | module.exports = { 28 | get: function() { return currentApi; }, 29 | setPreferPrompt: function(value) { 30 | currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; 31 | }, 32 | // Used only by tests. 33 | set: function(value) { 34 | currentApi = value; 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/platform_www/cordova-js-src/android/promptbasednativeapi.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. 22 | * This is used pre-JellyBean, where addJavascriptInterface() is disabled. 23 | */ 24 | 25 | module.exports = { 26 | exec: function(bridgeSecret, service, action, callbackId, argsJson) { 27 | return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); 28 | }, 29 | setNativeToJsBridgeMode: function(bridgeSecret, value) { 30 | prompt(value, 'gap_bridge_mode:' + bridgeSecret); 31 | }, 32 | retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { 33 | return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/platform_www/cordova_plugins.js: -------------------------------------------------------------------------------- 1 | cordova.define('cordova/plugin_list', function(require, exports, module) { 2 | module.exports = []; 3 | module.exports.metadata = 4 | // TOP OF METADATA 5 | { 6 | "cordova-plugin-whitelist": "1.3.3" 7 | }; 8 | // BOTTOM OF METADATA 9 | }); -------------------------------------------------------------------------------- /cordova-shell/platforms/android/project.properties: -------------------------------------------------------------------------------- 1 | # This file was originally created by the Android Tools, but is now 2 | # used by cordova-android to manage the state of the various third party 3 | # libraries used in your application 4 | 5 | # This is the Library Module that contains the Cordova Library, this is not 6 | # required when using an AAR 7 | 8 | # This is the application project. This is only required for Android Studio Gradle projects 9 | 10 | # Project target. 11 | target=android-26 12 | android.library.reference.1=CordovaLib 13 | android.library.reference.2=app 14 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // GENERATED FILE - DO NOT EDIT 2 | include ":" 3 | include ":CordovaLib" 4 | include ":app" 5 | -------------------------------------------------------------------------------- /cordova-shell/platforms/android/wrapper.gradle: -------------------------------------------------------------------------------- 1 | //This file is intentionally just a comment 2 | -------------------------------------------------------------------------------- /cordova-shell/plugins/android.json: -------------------------------------------------------------------------------- 1 | { 2 | "prepare_queue": { 3 | "installed": [], 4 | "uninstalled": [] 5 | }, 6 | "config_munge": { 7 | "files": {} 8 | }, 9 | "installed_plugins": { 10 | "cordova-plugin-whitelist": { 11 | "PACKAGE_NAME": "io.cordova.hellocordova" 12 | } 13 | }, 14 | "dependent_plugins": {} 15 | } -------------------------------------------------------------------------------- /cordova-shell/plugins/cordova-plugin-whitelist/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | # Contributing to Apache Cordova 23 | 24 | Anyone can contribute to Cordova. And we need your contributions. 25 | 26 | There are multiple ways to contribute: report bugs, improve the docs, and 27 | contribute code. 28 | 29 | For instructions on this, start with the 30 | [contribution overview](http://cordova.apache.org/contribute/). 31 | 32 | The details are explained there, but the important items are: 33 | - Sign and submit an Apache ICLA (Contributor License Agreement). 34 | - Have a Jira issue open that corresponds to your contribution. 35 | - Run the tests so your patch doesn't break existing functionality. 36 | 37 | We look forward to your contributions! 38 | -------------------------------------------------------------------------------- /cordova-shell/plugins/cordova-plugin-whitelist/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Cordova 2 | Copyright 2012 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /cordova-shell/plugins/cordova-plugin-whitelist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "cordova-plugin-whitelist@1", 3 | "_id": "cordova-plugin-whitelist@1.3.3", 4 | "_inBundle": false, 5 | "_integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q=", 6 | "_location": "/cordova-plugin-whitelist", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "cordova-plugin-whitelist@1", 12 | "name": "cordova-plugin-whitelist", 13 | "escapedName": "cordova-plugin-whitelist", 14 | "rawSpec": "1", 15 | "saveSpec": null, 16 | "fetchSpec": "1" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz", 23 | "_shasum": "b5e85ecdbbfe5aeded40a1bf4ee2372e67d96fb4", 24 | "_spec": "cordova-plugin-whitelist@1", 25 | "_where": "C:\\Users\\loref\\Projects\\fluid-outliner\\cordova-shell", 26 | "author": { 27 | "name": "Apache Software Foundation" 28 | }, 29 | "bugs": { 30 | "url": "https://issues.apache.org/jira/browse/CB" 31 | }, 32 | "bundleDependencies": false, 33 | "cordova": { 34 | "platforms": [ 35 | "android" 36 | ] 37 | }, 38 | "deprecated": false, 39 | "description": "Cordova Whitelist Plugin", 40 | "engines": { 41 | "cordovaDependencies": { 42 | "0.0.0": { 43 | "cordova-android": ">=4.0.0" 44 | }, 45 | "2.0.0": { 46 | "cordova": ">100" 47 | } 48 | } 49 | }, 50 | "homepage": "https://github.com/apache/cordova-plugin-whitelist#readme", 51 | "keywords": [ 52 | "cordova", 53 | "whitelist", 54 | "ecosystem:cordova", 55 | "cordova-android" 56 | ], 57 | "license": "Apache-2.0", 58 | "name": "cordova-plugin-whitelist", 59 | "repository": { 60 | "type": "git", 61 | "url": "git+https://github.com/apache/cordova-plugin-whitelist.git" 62 | }, 63 | "version": "1.3.3" 64 | } 65 | -------------------------------------------------------------------------------- /cordova-shell/plugins/cordova-plugin-whitelist/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 24 | Whitelist 25 | Cordova Network Whitelist Plugin 26 | Apache 2.0 27 | cordova,whitelist,policy 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /cordova-shell/plugins/fetch.json: -------------------------------------------------------------------------------- 1 | { 2 | "cordova-plugin-whitelist": { 3 | "source": { 4 | "type": "registry", 5 | "id": "cordova-plugin-whitelist@1" 6 | }, 7 | "is_top_level": true, 8 | "variables": {} 9 | } 10 | } -------------------------------------------------------------------------------- /cordova-shell/res/README.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | Note that these image resources are not copied into a project when a project 23 | is created with the CLI. Although there are default image resources in a 24 | newly-created project, those come from the platform-specific project template, 25 | which can generally be found in the platform's `template` directory. Until 26 | icon and splashscreen support is added to the CLI, these image resources 27 | aren't used directly. 28 | 29 | See https://issues.apache.org/jira/browse/CB-5145 30 | -------------------------------------------------------------------------------- /cordova-shell/res/icon/android/icon-36-ldpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/android/icon-36-ldpi.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/android/icon-48-mdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/android/icon-48-mdpi.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/android/icon-72-hdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/android/icon-72-hdpi.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/android/icon-96-xhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/android/icon-96-xhdpi.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/bada-wac/icon-48-type5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/bada-wac/icon-48-type5.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/bada-wac/icon-50-type3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/bada-wac/icon-50-type3.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/bada-wac/icon-80-type4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/bada-wac/icon-80-type4.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/bada/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/bada/icon-128.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/blackberry/icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/blackberry/icon-80.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/blackberry10/icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/blackberry10/icon-80.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/ios/icon-57-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/ios/icon-57-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/ios/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/ios/icon-57.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/ios/icon-72-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/ios/icon-72-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/ios/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/ios/icon-72.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/tizen/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/tizen/icon-128.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/webos/icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/webos/icon-64.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/windows-phone/icon-173-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/windows-phone/icon-173-tile.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/windows-phone/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/windows-phone/icon-48.png -------------------------------------------------------------------------------- /cordova-shell/res/icon/windows-phone/icon-62-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/icon/windows-phone/icon-62-tile.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-hdpi-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-hdpi-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-hdpi-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-hdpi-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-ldpi-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-ldpi-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-ldpi-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-ldpi-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-mdpi-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-mdpi-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-mdpi-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-mdpi-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-xhdpi-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-xhdpi-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/android/screen-xhdpi-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/android/screen-xhdpi-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/bada-wac/screen-type3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/bada-wac/screen-type3.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/bada-wac/screen-type4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/bada-wac/screen-type4.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/bada-wac/screen-type5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/bada-wac/screen-type5.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/bada/screen-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/bada/screen-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/blackberry/screen-225.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/blackberry/screen-225.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/blackberry10/splash-1280x768.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/blackberry10/splash-1280x768.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/blackberry10/splash-720x720.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/blackberry10/splash-720x720.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/blackberry10/splash-768x1280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/blackberry10/splash-768x1280.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-ipad-landscape-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-ipad-landscape-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-ipad-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-ipad-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-ipad-portrait-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-ipad-portrait-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-ipad-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-ipad-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-iphone-landscape-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-iphone-landscape-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-iphone-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-iphone-landscape.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-iphone-portrait-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-iphone-portrait-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-iphone-portrait-568h-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-iphone-portrait-568h-2x.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/ios/screen-iphone-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/ios/screen-iphone-portrait.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/tizen/README.md: -------------------------------------------------------------------------------- 1 | 21 | 22 | # Tizen Splash Screen 23 | 24 | Splash screens are unsupported on the Tizen platform. 25 | -------------------------------------------------------------------------------- /cordova-shell/res/screen/webos/screen-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/webos/screen-64.png -------------------------------------------------------------------------------- /cordova-shell/res/screen/windows-phone/screen-portrait.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluid-notion/fluid-outliner/ab2e683445c2fa9497b7b93edd7c0a87513092f0/cordova-shell/res/screen/windows-phone/screen-portrait.jpg -------------------------------------------------------------------------------- /cordova-shell/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | 16 | 17 | Fluid Outliner 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /cordova-shell/src/index.tsx: -------------------------------------------------------------------------------- 1 | import _debug from "debug" 2 | 3 | import React from "react" 4 | import { render } from "react-dom" 5 | import { App } from "../../core/components/App" 6 | import { installOfflinePlugin } from "../../core/utils/offline-plugin-runtime" 7 | 8 | const debug = _debug("fluid-outliner:index") 9 | 10 | debug("Installing Service Workers") 11 | installOfflinePlugin() 12 | 13 | const handleDeviceReady = () => { 14 | debug("Bootstrapping React root") 15 | render(, document.getElementById("root")) 16 | } 17 | 18 | document.addEventListener('deviceready', handleDeviceReady, false); 19 | -------------------------------------------------------------------------------- /cordova-shell/webpack.config.ts: -------------------------------------------------------------------------------- 1 | import path from "path" 2 | 3 | import pwaConfig from "../pwa-shell/webpack.config" 4 | 5 | export default { 6 | ...pwaConfig, 7 | entry: { 8 | main: "./src/index.tsx" 9 | }, 10 | output: { 11 | path: path.join(__dirname, "www"), 12 | filename: "[name].[hash].js" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/@types/fuzzy-search.ts: -------------------------------------------------------------------------------- 1 | declare module "fuzzysearch" { 2 | const fuzzysearch: (needle: string, haystack: string) => boolean 3 | export = fuzzysearch 4 | } 5 | -------------------------------------------------------------------------------- /core/@types/react-octicon.tsx: -------------------------------------------------------------------------------- 1 | declare module "react-octicon" { 2 | const Octicon: React.ComponentType< 3 | { 4 | name: string 5 | spin?: boolean 6 | mega?: boolean 7 | } & React.HTMLAttributes 8 | > 9 | export = Octicon 10 | } 11 | -------------------------------------------------------------------------------- /core/components/App.tsx: -------------------------------------------------------------------------------- 1 | import { CssBaseline, MuiThemeProvider } from "@material-ui/core" 2 | 3 | import { Provider } from "mobx-react" 4 | import React from "react" 5 | 6 | import { Store } from "../models/Store" 7 | import { Body } from "./Body" 8 | import { theme } from "./styles/theme" 9 | import { ModalContainer } from "./ModalContainer" 10 | 11 | const store = Store.create() 12 | 13 | export class App extends React.Component { 14 | public shouldComponentUpdate() { 15 | return false 16 | } 17 | 18 | public render() { 19 | return ( 20 | <> 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/components/AppFooter.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { Divider, Typography, Button } from "@material-ui/core" 3 | import { IModalConsumerProps, injectModal } from "./ModalContainer" 4 | import { Link } from "./Link" 5 | 6 | export const AppFooter: React.StatelessComponent< 7 | Partial 8 | > = injectModal(({ modal }: Partial) => ( 9 |
16 | 17 | 18 | Fluid Outliner cares about your privacy.{" "} 19 | modal!.activate("PrivacyDialog", true)}> 20 | Know More 21 | 22 | 23 | 24 | 25 | {[ 26 | [ 27 | "Source Code", 28 | "https://github.com/fluid-notion/fluid-outliner", 29 | ], 30 | [ 31 | "Roadmap", 32 | "https://github.com/fluid-notion/fluid-outliner/projects/1", 33 | ], 34 | ["@lorefnon", "https://twitter.com/lorefnon"], 35 | ].map(([label, href]) => ( 36 | 39 | ))} 40 | 41 |
42 | )) 43 | -------------------------------------------------------------------------------- /core/components/BodyErrorWrapper.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { observable } from "mobx" 3 | import { observer } from "mobx-react" 4 | import { Typography, Button } from "@material-ui/core" 5 | import Cached from "@material-ui/icons/Cached" 6 | import { Link } from "./Link" 7 | import { autobind } from "core-decorators" 8 | import { clearLocal } from "../utils/persistence" 9 | 10 | @observer 11 | export class BodyErrorWrapper extends React.Component { 12 | @observable private error?: Error 13 | 14 | public componentDidCatch(error: Error) { 15 | this.error = error 16 | } 17 | 18 | public render() { 19 | if (this.error) { 20 | return ( 21 |
22 | 28 | Something went wrong! 29 | 30 | 31 | Fluid Outliner encountered an error which it could not 32 | recover from. 33 |
34 | Please report this in our{" "} 35 | 36 | issue tracker 37 | . 38 |
39 | 42 |
43 | ) 44 | } 45 | return this.props.children 46 | } 47 | 48 | @autobind 49 | private reset() { 50 | clearLocal() 51 | location.reload() 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /core/components/BookmarkList.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Octicon from "react-octicon" 3 | import { IOutlineVisitState } from "../models/OutlineVisitState" 4 | import { DrawerSection } from "./DrawerSection" 5 | import { DrawerActionItem } from "./DrawerActionItem" 6 | 7 | interface IBookmarkListProps { 8 | visitState: IOutlineVisitState 9 | scrollToNode: (id: string) => void 10 | } 11 | 12 | export class BookmarkList extends React.Component { 13 | public render() { 14 | const bookmarks = this.props.visitState.fullBookmarkList 15 | return ( 16 | 0}> 17 | {bookmarks.map(level => ( 18 | 21 | } 22 | label={level.node.content} 23 | onClick={() => this.props.scrollToNode(level.node.id)} 24 | /> 25 | ))} 26 | 27 | ) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/components/CloseButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Octicon from "react-octicon" 3 | 4 | interface ICloseButtonProps { 5 | onClick: () => void 6 | name?: string 7 | } 8 | 9 | export const CloseButton = ({ onClick, name = "x" }: ICloseButtonProps) => ( 10 | 22 | ) 23 | -------------------------------------------------------------------------------- /core/components/DrawerActionItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { Typography, ButtonBase } from "@material-ui/core" 3 | import { ButtonBaseProps } from "@material-ui/core/ButtonBase" 4 | 5 | interface IDrawerActionItemProps extends ButtonBaseProps { 6 | icon?: React.ReactElement 7 | label: React.ReactChild 8 | } 9 | 10 | export const DrawerActionItem = ({ 11 | icon, 12 | label, 13 | ...props 14 | }: IDrawerActionItemProps) => ( 15 | 24 |
33 | {icon && 34 | React.cloneElement(icon, { 35 | style: { 36 | fontSize: "1.5rem", 37 | position: "relative", 38 | top: "2px", 39 | marginRight: "5px", 40 | ...icon.props.style, 41 | }, 42 | })} 43 | 48 | {label} 49 | 50 |
51 |
52 | ) 53 | -------------------------------------------------------------------------------- /core/components/DrawerSection.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { Typography } from "@material-ui/core" 3 | 4 | interface IDrawerSectionProps { 5 | title?: React.ReactChild 6 | show?: boolean 7 | style?: object 8 | } 9 | 10 | export const DrawerSection: React.StatelessComponent = ({ 11 | title, 12 | show, 13 | style, 14 | children, 15 | }) => ( 16 | <> 17 | {show !== false && ( 18 |
27 | {title && ( 28 | 32 | {title} 33 | 34 | )} 35 |
{children}
36 |
37 | )} 38 | 39 | ) 40 | -------------------------------------------------------------------------------- /core/components/IconPair.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | interface IIconPairProps { 4 | primary: any // React.ComponentType 5 | secondary: any // React.ComponentType 6 | } 7 | 8 | export const IconPair = ({ 9 | primary: Primary, 10 | secondary: Secondary, 11 | }: IIconPairProps) => ( 12 |
13 | 19 | 28 |
29 | ) 30 | -------------------------------------------------------------------------------- /core/components/KeyBindingsRefList.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { 3 | Typography, 4 | Table, 5 | TableBody, 6 | TableRow, 7 | TableCell, 8 | withStyles, 9 | StyledComponentProps, 10 | } from "@material-ui/core" 11 | import { table } from "./styles/drawer" 12 | import { DrawerSection } from "./DrawerSection" 13 | 14 | const styles = { table } 15 | 16 | export const KeyBindingsRefList = withStyles(styles)( 17 | ({ classes }: StyledComponentProps) => ( 18 | 19 | 20 | 21 | 22 | Save To File 23 | Ctrl+S 24 | 25 | 26 | Find 27 | Ctrl+F 28 | 29 | 30 | 31 | 32 | For Selected Node: 33 | 34 | 35 | 36 | 37 | Shift Up 38 | Shift+Up 39 | 40 | 41 | Shift Down 42 | Shift+Down 43 | 44 | 45 | Navigate 46 | Up/Down 47 | 48 | 49 | Indent Further 50 | Tab 51 | 52 | 53 | Indent Back 54 | Shift+Tab 55 | 56 | 57 | Enable Edit 58 | Enter 59 | 60 | 61 | Disable Edit 62 | Esc 63 | 64 | 65 | Add new note below 66 | Shift+Enter 67 | 68 | 69 |
70 |
71 | ) 72 | ) 73 | -------------------------------------------------------------------------------- /core/components/Link.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | type ILinkProps = React.DetailedHTMLProps< 4 | React.AnchorHTMLAttributes & { 5 | nodeType?: string | React.ReactType> 6 | }, 7 | HTMLAnchorElement 8 | > 9 | 10 | export const Link = (props: ILinkProps) => { 11 | const Presenter = props.nodeType || "a" 12 | return ( 13 | 25 | ) 26 | } 27 | -------------------------------------------------------------------------------- /core/components/Loader.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Octicon from "react-octicon" 3 | import { Typography } from "@material-ui/core" 4 | 5 | export const Loader = () => ( 6 |
16 | 17 | 24 | 32 | 33 | Loading ... 34 | 35 |
36 | ) 37 | -------------------------------------------------------------------------------- /core/components/ModalContainer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { autobind, decorate } from "core-decorators" 3 | import { observable } from "mobx" 4 | import memoize from "lodash/memoize" 5 | import { observer, Provider } from "mobx-react" 6 | import { IModalKey, IModalFacade, ModalRegistry } from "../utils/ModalRegistry" 7 | 8 | @observer 9 | export class ModalContainer extends React.Component { 10 | @observable private activeModal: IModalKey | null = null 11 | private activeModalStack: IModalKey[] = [] 12 | 13 | public render() { 14 | return ( 15 | 16 | <> 17 | {this.renderActiveModal()} 18 | {this.props.children} 19 | 20 | 21 | ) 22 | } 23 | @decorate(memoize) 24 | private getModalFacade(): IModalFacade { 25 | return { 26 | activeModal: this.activeModal, 27 | activate: this.activateModal, 28 | dismiss: this.dismissModal, 29 | } 30 | } 31 | @autobind 32 | private activateModal(activeModal: IModalKey, retainPrev = false) { 33 | if (retainPrev && this.activeModal) { 34 | this.activeModalStack.push(this.activeModal) 35 | } else { 36 | this.activeModalStack = [] 37 | } 38 | this.activeModal = activeModal 39 | } 40 | private renderActiveModal() { 41 | if (!this.activeModal) { 42 | return null 43 | } 44 | const Modal = ModalRegistry[this.activeModal] 45 | return 46 | } 47 | @autobind 48 | private dismissModal() { 49 | const prevModal = this.activeModalStack.pop() 50 | this.activeModal = prevModal || null 51 | } 52 | } 53 | 54 | export * from "../utils/ModalRegistry" 55 | -------------------------------------------------------------------------------- /core/components/NodeFoldControls.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import Octicon from "react-octicon" 3 | import { Tooltip } from "@material-ui/core" 4 | 5 | interface INodeFoldControlsProps { 6 | isCollapsed: boolean 7 | classes: any 8 | toggleCollapse: () => any 9 | } 10 | 11 | export const NodeFoldControls = (props: INodeFoldControlsProps) => ( 12 | 15 | 24 | 25 | ) 26 | -------------------------------------------------------------------------------- /core/components/NodePlaceholder.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { INodeEditorProps } from "./NodeEditor" 3 | import { Paper } from "@material-ui/core" 4 | 5 | export const NodePlaceholder = ({ node, level }: INodeEditorProps) => ( 6 |
11 | 12 |
17 | 18 |
19 | ) 20 | -------------------------------------------------------------------------------- /core/components/NodeZoomControls.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { Tooltip } from "@material-ui/core" 3 | import ReplyAllIcon from "@material-ui/icons/ReplyAll" 4 | import CenterFocusStrongIcon from "@material-ui/icons/CenterFocusStrong" 5 | import { INode } from "../models/Node" 6 | 7 | interface INodeZoomControlsProps { 8 | node: INode 9 | isRoot: boolean 10 | zoomIn: () => void 11 | zoomOut: () => void 12 | classes: any 13 | } 14 | 15 | export const NodeZoomControls = (props: INodeZoomControlsProps) => 16 | props.isRoot ? ( 17 | 18 | 22 | 23 | ) : ( 24 | 25 | 29 | 30 | ) 31 | -------------------------------------------------------------------------------- /core/components/NoteOverview.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { INote } from "../models/Note" 3 | import Truncate from "react-truncate" 4 | import strip from "striptags" 5 | 6 | interface INoteOverviewProps { 7 | note: INote 8 | } 9 | 10 | export class NoteOverview extends React.Component { 11 | public render() { 12 | return ( 13 | 14 | {strip(this.props.note.content || "")} 15 | 16 | ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /core/components/NotesOverview.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { INote } from "../models/Note" 3 | import { DrawerSection } from "./DrawerSection" 4 | import { NoteOverview } from "./NoteOverview" 5 | import strip from "striptags" 6 | 7 | interface INotesOverviewProps { 8 | notes: INote[] 9 | style?: object 10 | } 11 | 12 | export class NotesOverview extends React.Component { 13 | public render() { 14 | const notes = this.props.notes.filter( 15 | n => strip(n.content || "").trim().length > 0 16 | ) 17 | if (notes.length === 0) return null 18 | return ( 19 | 0} 22 | style={this.props.style} 23 | > 24 |
    25 | {notes.map(n => ( 26 |
  • 27 | 28 |
  • 29 | ))} 30 |
31 |
32 | ) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/components/OutlineActionToolbar.tsx: -------------------------------------------------------------------------------- 1 | import UndoIcon from "@material-ui/icons/Undo" 2 | import RedoIcon from "@material-ui/icons/Redo" 3 | import DeleteIcon from "@material-ui/icons/Delete" 4 | import React from "react" 5 | import { IOutline } from "../models/Outline" 6 | import { SecondaryActionLink } from "./SecondaryActionLink" 7 | import { IModalConsumerProps, injectModal } from "./ModalContainer" 8 | 9 | export interface IOutlineActionToolbarProps 10 | extends Partial { 11 | style: any 12 | outline: IOutline 13 | } 14 | 15 | export const OutlineActionToolbar: React.ComponentType = injectModal( 16 | (props: IOutlineActionToolbarProps) => ( 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | props.modal!.activate("OutlineDeletionDialog")} 26 | > 27 | 28 | 29 |
30 | ) 31 | ) 32 | -------------------------------------------------------------------------------- /core/components/OutlineDeletionDialog.tsx: -------------------------------------------------------------------------------- 1 | import WarningIcon from "@material-ui/icons/Warning" 2 | import { 3 | Dialog, 4 | DialogContent, 5 | DialogActions, 6 | Button, 7 | DialogContentText, 8 | } from "@material-ui/core" 9 | import React from "react" 10 | import { clearLocal } from "../utils/persistence" 11 | import { IModalConsumerProps } from "../utils/ModalRegistry" 12 | 13 | export const OutlineDeletionDialog = ({ modal }: IModalConsumerProps) => ( 14 | 15 | 16 | 19 | 20 | Are you sure you want to clear this outline ? 21 |
22 | This action can not be undone ! 23 |
24 |
25 | 26 | 35 | 38 | 39 |
40 | ) 41 | -------------------------------------------------------------------------------- /core/components/OutlineTitleEditor.tsx: -------------------------------------------------------------------------------- 1 | import { Typography, StyledComponentProps } from "@material-ui/core" 2 | import Input from "@material-ui/core/Input/Input" 3 | import { autobind } from "core-decorators" 4 | import keycode from "keycode" 5 | import { observable } from "mobx" 6 | import { observer } from "mobx-react" 7 | import React from "react" 8 | import Octicon from "react-octicon" 9 | import { IOutline } from "../models/Outline" 10 | import { withStyles } from "../utils/type-overrides" 11 | 12 | const styles = { 13 | input: { 14 | fontSize: "1.5rem", 15 | }, 16 | inputWrapper: { 17 | margin: "10px 40px", 18 | }, 19 | editControl: { 20 | display: "none", 21 | cursor: "pointer", 22 | color: "gray", 23 | marginLeft: "10px", 24 | // Required because: https://github.com/Microsoft/TypeScript/issues/11465#issuecomment-252453037 25 | position: "relative" as "relative", 26 | bottom: "3px", 27 | }, 28 | title: { 29 | padding: "10px 40px", 30 | "&:hover $editControl": { 31 | display: "inline-block", 32 | }, 33 | }, 34 | } 35 | 36 | type I = { outline: IOutline } & StyledComponentProps 37 | 38 | @withStyles(styles) 39 | @observer 40 | export class OutlineTitleEditor extends React.Component { 41 | @observable private isEditing = false 42 | public render() { 43 | const { classes } = this.props 44 | if (this.isEditing) { 45 | return ( 46 | 55 | ) 56 | } 57 | return ( 58 | 63 | {this.props.outline.title} 64 | 69 | 70 | ) 71 | } 72 | @autobind 73 | private toggleEditing() { 74 | this.isEditing = !this.isEditing 75 | } 76 | 77 | @autobind 78 | private handleTitleChange(event: React.ChangeEvent) { 79 | this.props.outline.setTitle(event.target.value) 80 | } 81 | @autobind 82 | private handleTitleKeyDown(event: React.KeyboardEvent) { 83 | if (keycode(event.nativeEvent) === "enter") { 84 | this.isEditing = false 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /core/components/PrimaryDrawerMenu.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { inject, observer } from "mobx-react" 3 | import { IStoreConsumerProps } from "../models/IProviderProps" 4 | import { ZoomStack } from "./ZoomStack" 5 | import { IOutlineVisitState } from "../models/OutlineVisitState" 6 | import { BookmarkList } from "./BookmarkList" 7 | 8 | interface IPrimaryDrawerMenuProps { 9 | visitState?: IOutlineVisitState 10 | scrollToNode: (id: string) => void 11 | } 12 | 13 | @inject(({ store }: IStoreConsumerProps) => ({ 14 | visitState: store.visitState, 15 | })) 16 | @observer 17 | export class PrimaryDrawerMenu extends React.Component< 18 | IPrimaryDrawerMenuProps 19 | > { 20 | public render() { 21 | const { visitState } = this.props 22 | return ( 23 | <> 24 | {visitState && ( 25 | <> 26 | 27 | 31 | 32 | )} 33 | 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/components/PrivacyDialog.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Dialog, 3 | DialogTitle, 4 | Divider, 5 | DialogContent, 6 | Typography, 7 | } from "@material-ui/core" 8 | import React from "react" 9 | import { CloseButton } from "./CloseButton" 10 | import { IModalConsumerProps } from "../utils/ModalRegistry" 11 | 12 | export const PrivacyDialog: React.StatelessComponent< 13 | Partial 14 | > = ({ modal }: Partial) => ( 15 | 16 | 17 | Fluid Outliner cares about your Privacy 18 | 19 | 20 | 21 | Your outlines reside in your computer. All operations that you 22 | perform are managed within your browser and none of your 23 | information is saved in our servers or shared with any third 24 | party services. 25 | 26 | 27 | 28 | 29 | 30 | Show your support by starring the project on Github, and telling 31 | your friends and loved ones about Fluid Outliner. 32 | 33 | 34 | 35 | ) 36 | -------------------------------------------------------------------------------- /core/components/ResourceRefList.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { DrawerSection } from "./DrawerSection" 3 | import { 4 | Typography, 5 | List, 6 | ListItem, 7 | StyledComponentProps, 8 | } from "@material-ui/core" 9 | import Octicon from "react-octicon" 10 | import { Link } from "./Link" 11 | import { icon } from "./styles/drawer" 12 | import { withStyles } from "../utils/type-overrides" 13 | 14 | const styles = { 15 | icon, 16 | } 17 | 18 | @withStyles(styles) 19 | export class ResourceRefList extends React.Component< 20 | StyledComponentProps 21 | > { 22 | public render() { 23 | const classes = this.props.classes! 24 | return ( 25 | 26 | 27 | This project wouldn't exist without these amazing open 28 | source projects: 29 | 30 | 31 | 32 | 33 | 34 | Mobx &{" "} 35 | 36 | MST 37 | 38 | 39 | 40 | 41 | 42 | 43 | React 44 | 45 | 46 | 47 | 48 | 49 | Webpack 50 |
51 | (& the{" "} 52 | 53 | ecosystem 54 | {" "} 55 | around it) 56 |
57 |
58 | 59 | 60 | 61 | 62 | And Many More ... 63 | 64 | 65 | 66 |
67 |
68 | ) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /core/components/RichTextEditor.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { autobind } from "core-decorators" 3 | import { INote } from "../models/Note" 4 | import { observer } from "mobx-react" 5 | import { asyncComponent } from "react-async-component" 6 | 7 | import { computed } from "mobx" 8 | import Paper from "@material-ui/core/Paper/Paper" 9 | import { injectStore } from "../models/Store" 10 | import { IStoreConsumerProps } from "../models/IProviderProps" 11 | import { Editable } from "../utils/Editable" 12 | import { CloseButton } from "./CloseButton" 13 | 14 | const ReactQuill = asyncComponent({ 15 | resolve: async () => { 16 | // @ts-ignore 17 | await import("react-quill/dist/quill.snow.css") 18 | return (await import("react-quill")).default 19 | }, 20 | }) 21 | 22 | export interface IRichTextEditorProps extends Partial { 23 | note: INote 24 | } 25 | 26 | @injectStore 27 | @observer 28 | export class RichTextEditor extends React.Component { 29 | private editable: Editable 30 | 31 | constructor(props: IRichTextEditorProps) { 32 | super(props) 33 | this.editable = new Editable(this) 34 | } 35 | 36 | @computed 37 | get item() { 38 | return this.props.note 39 | } 40 | 41 | @computed 42 | get htmlContent() { 43 | return this.item.content 44 | } 45 | 46 | public render() { 47 | if (!this.editable.isEditing) { 48 | return ( 49 | 57 |
61 | 62 | ) 63 | } 64 | return ( 65 |
69 | this.editable.disableEditing()} 72 | /> 73 | 77 |
78 | ) 79 | } 80 | 81 | @autobind 82 | private handleChange(content: string) { 83 | this.props.note.setContent(content) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /core/components/SecondaryActionLink.tsx: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { withStyles, Button } from "@material-ui/core" 3 | import { palette } from "./styles/theme" 4 | 5 | const S = withStyles({ 6 | link: { 7 | color: "slategray", 8 | fontSize: "1.6rem", 9 | fontWeight: 100, 10 | cursor: "pointer", 11 | padding: "0 5px", 12 | minWidth: 0, 13 | "&:hover": { 14 | color: palette.primary.main, 15 | }, 16 | }, 17 | }) 18 | 19 | export const SecondaryActionLink = S( 20 | ({ className, classes, ...restProps }: any) => ( 21 |