├── .gitignore ├── README.md ├── bucket.json ├── native ├── .buckconfig ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── App.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── Andale Mono.ttf │ │ │ │ ├── Arial Black.ttf │ │ │ │ ├── Arial.ttf │ │ │ │ ├── Comic Sans MS.ttf │ │ │ │ ├── Courier New.ttf │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Georgia.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Microsoft Sans Serif.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── Roboto.ttf │ │ │ │ ├── Roboto_medium.ttf │ │ │ │ ├── SF-UI-Text-Regular.otf │ │ │ │ ├── Skia.ttf │ │ │ │ ├── Times New Roman.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── crossplatformblog │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── components │ ├── BlogList.js │ ├── BlogPost.js │ └── LandingPage.js ├── config.js ├── index.android.js ├── index.ios.js ├── ios │ ├── CrossPlatformBlog.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── CrossPlatformBlog.xcscheme │ ├── CrossPlatformBlog │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── CrossPlatformBlogTests │ │ ├── CrossPlatformBlogTests.m │ │ └── Info.plist └── package.json └── web ├── .babelrc ├── .gitignore ├── LICENSE.txt ├── app-server.js ├── app.js ├── config ├── development.js ├── index.js └── production.js ├── package.json ├── public ├── css │ ├── combined.css │ ├── combined.min.css │ ├── css-helpers.min.css │ ├── font-awesome.min.css │ └── main.css ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── fontawesome-webfont.woff2 │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── js │ ├── 0-jquery.min.js │ ├── 1-jquery.mask.js │ ├── 2-bootstrap.min.js │ ├── 3-main.js │ ├── combined.js │ └── combined.min.js └── less │ ├── bootstrap │ ├── .csscomb.json │ ├── .csslintrc │ ├── alerts.less │ ├── badges.less │ ├── bootstrap.less │ ├── breadcrumbs.less │ ├── button-groups.less │ ├── buttons.less │ ├── carousel.less │ ├── close.less │ ├── code.less │ ├── component-animations.less │ ├── dropdowns.less │ ├── forms.less │ ├── glyphicons.less │ ├── grid.less │ ├── input-groups.less │ ├── jumbotron.less │ ├── labels.less │ ├── list-group.less │ ├── media.less │ ├── mixins.less │ ├── mixins │ │ ├── alerts.less │ │ ├── background-variant.less │ │ ├── border-radius.less │ │ ├── buttons.less │ │ ├── center-block.less │ │ ├── clearfix.less │ │ ├── forms.less │ │ ├── gradients.less │ │ ├── grid-framework.less │ │ ├── grid.less │ │ ├── hide-text.less │ │ ├── image.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── nav-divider.less │ │ ├── nav-vertical-align.less │ │ ├── opacity.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── progress-bar.less │ │ ├── reset-filter.less │ │ ├── reset-text.less │ │ ├── resize.less │ │ ├── responsive-visibility.less │ │ ├── size.less │ │ ├── tab-focus.less │ │ ├── table-row.less │ │ ├── text-emphasis.less │ │ ├── text-overflow.less │ │ └── vendor-prefixes.less │ ├── modals.less │ ├── navbar.less │ ├── navs.less │ ├── normalize.less │ ├── pager.less │ ├── pagination.less │ ├── panels.less │ ├── popovers.less │ ├── print.less │ ├── progress-bars.less │ ├── responsive-embed.less │ ├── responsive-utilities.less │ ├── scaffolding.less │ ├── tables.less │ ├── theme.less │ ├── thumbnails.less │ ├── tooltip.less │ ├── type.less │ ├── utilities.less │ ├── variables.less │ └── wells.less │ ├── components │ ├── footer.less │ ├── global.less │ └── nav.less │ └── main.less ├── routes ├── 404.js ├── blog.js └── index.js └── views ├── 404.html ├── blog-single.html ├── blog.html └── partials ├── footer.html └── header.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross-Platform Blog 2 | ![alt tag](https://cosmicjs.com/uploads/21e23d30-8076-11e6-a994-973764f7d6d1-cross-platform-blog.jpg) 3 | This repo is an example of how to build cross-platform apps with content powered by [Cosmic JS](https://cosmicjs.com). The iOS and Android apps in this repo are built using React Native and the web app runs on a light Node.js web server, all with content served from the [Cosmic JS CMS API](https://cosmicjs.com). Create your content once, deliver everywhere. 4 | ###Features 5 | 1. Native iOS and Android apps share the same React Native codebase. Learn once, write anywhereTM. 6 | 2. Web is fully responsive down to mobile w/ [Bootstrap](http://getbootstrap.com) frontend.
7 | 3. Images are easily manipulated for different device / browser requirements via the Cosmic JS provided [Imgix](https://www.imgix.com/) integration. 8 | 9 | Sign up for [Cosmic JS](https://cosmicjs.com) to install the app, add / edit content and deploy the web app. 10 | 11 | ** Before trying to run any of the examples, make sure you are connecting to the example bucket `cross-platform-blog` or have imported the bucket.json in the root of this repo to your own bucket in Cosmic JS. 12 | ## Web 13 | [View the web demo here](https://cosmicjs.com/apps/cross-platform-blog/demo) 14 | ###Get started with web 15 | ``` 16 | git clone https://github.com/cosmicjs/cross-platform-blog 17 | cd cross-platform-blog/web 18 | npm install 19 | ``` 20 | ### Run web in development 21 | ``` 22 | npm run development 23 | ``` 24 | Go to [http://localhost:5000](http://localhost:5000). 25 | ### Run web in production 26 | ``` 27 | COSMIC_BUCKET=your-bucket-slug npm start 28 | ``` 29 | Go to [http://localhost:3000](http://localhost:3000). 30 | ## Native 31 | If you are new to React Native, make sure you check out the [React Native docs](https://facebook.github.io/react-native/) to make sure you have everything set up properly. 32 | ### Get started with native 33 | ``` 34 | cd cross-platform-blog/native 35 | npm install 36 | ``` 37 | ### Config 38 | Edit native/config.js to point to your bucket slug on Cosmic JS. 39 | ``` 40 | export default { 41 | COSMIC_BUCKET: 'your-bucket-slug' 42 | } 43 | ``` 44 | ### Run iOS 45 | Run the iOS command inside the native folder: 46 | ``` 47 | react-native run-ios 48 | ``` 49 | ### Run Android 50 | Run the Android command inside the native folder: 51 | ``` 52 | react-native run-android 53 | ``` 54 | ## Questions 55 | For any questions, feel free to reach out to us on the [Cosmic JS website](https://cosmicjs.com/) through the Intercom chat bubble on the bottom right side of the page. Or join the [Cosmic JS Community on Slack](https://cosmicjs.com/community). 56 | -------------------------------------------------------------------------------- /native/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /native/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | # Ignore the website subdir 13 | /website/.* 14 | 15 | # Ignore BUCK generated dirs 16 | /\.buckd/ 17 | 18 | # Ignore unexpected extra @providesModule 19 | .*/node_modules/commoner/test/source/widget/share.js 20 | 21 | # Ignore duplicate module providers 22 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root 23 | .*/Libraries/react-native/React.js 24 | .*/Libraries/react-native/ReactNative.js 25 | .*/node_modules/jest-runtime/build/__tests__/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | node_modules/react-native/flow 32 | flow/ 33 | 34 | [options] 35 | module.system=haste 36 | 37 | esproposal.class_static_fields=enable 38 | esproposal.class_instance_fields=enable 39 | 40 | experimental.strict_type_args=true 41 | 42 | munge_underscores=true 43 | 44 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 45 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 46 | 47 | suppress_type=$FlowIssue 48 | suppress_type=$FlowFixMe 49 | suppress_type=$FixMe 50 | 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 52 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 53 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 54 | 55 | unsafe.enable_getters_and_setters=true 56 | 57 | [version] 58 | ^0.30.0 59 | -------------------------------------------------------------------------------- /native/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | -------------------------------------------------------------------------------- /native/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /native/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Text, View, Navigator } from 'react-native' 3 | import { Container, Header, Title, Content, Spinner } from 'native-base'; 4 | import _ from 'lodash' 5 | import LandingPage from './components/LandingPage' 6 | import BlogList from './components/BlogList' 7 | import BlogPost from './components/BlogPost' 8 | import config from './config' 9 | export default class App extends Component { 10 | constructor(props) { 11 | super(props) 12 | this.state = { 13 | loading: true, 14 | objects: [] 15 | } 16 | this.getObjects() 17 | } 18 | getObjects() { 19 | fetch('https://api.cosmicjs.com/v1/' + config.COSMIC_BUCKET + '/objects') 20 | .then(response => response.json()) 21 | .then(responseJson => { 22 | this.setState({ 23 | objects: responseJson.objects, 24 | loading: false 25 | }) 26 | }) 27 | .catch(error => { 28 | console.error(error) 29 | }) 30 | } 31 | handlePress(navigator, post) { 32 | this.setState({ objects: this.state.objects, post }) 33 | navigator.push({ 34 | name: 'BlogPost', 35 | }) 36 | } 37 | handlePressViewBlog(navigator, post) { 38 | navigator.push({ 39 | name: 'BlogList', 40 | }) 41 | } 42 | goBack(navigator) { 43 | navigator.pop() 44 | } 45 | renderScene(route, navigator) { 46 | const objects = this.state.objects 47 | const posts = objects.filter(object => { 48 | if (object.type_slug === 'posts') 49 | return object 50 | }) 51 | const landing_page = _.find(objects, { slug: 'landing-page' }) 52 | if(route.name === 'LandingPage') { 53 | return 54 | } 55 | if(route.name === 'BlogList') { 56 | return 57 | } 58 | if(route.name === 'BlogPost') { 59 | return 60 | } 61 | } 62 | render() { 63 | let posts 64 | if (this.state.loading) { 65 | return ( 66 | 67 |
68 | Cross-Platform Blog 69 |
70 | 71 | 72 | 73 |
74 | ) 75 | } 76 | return ( 77 | this.renderScene(route, navigator) } 80 | /> 81 | ); 82 | } 83 | } -------------------------------------------------------------------------------- /native/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.crossplatformblog', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.crossplatformblog', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /native/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.crossplatformblog" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile project(':react-native-vector-icons') 130 | compile fileTree(dir: "libs", include: ["*.jar"]) 131 | compile "com.android.support:appcompat-v7:23.0.1" 132 | compile "com.facebook.react:react-native:+" // From node_modules 133 | } 134 | 135 | // Run this once to be able to run the application with BUCK 136 | // puts all compile dependencies into folder libs for BUCK to use 137 | task copyDownloadableDepsToLibs(type: Copy) { 138 | from configurations.compile 139 | into 'libs' 140 | } 141 | -------------------------------------------------------------------------------- /native/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /native/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Andale Mono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Andale Mono.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Arial Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Arial Black.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Arial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Arial.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Comic Sans MS.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Comic Sans MS.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Courier New.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Courier New.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Georgia.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Georgia.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Microsoft Sans Serif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Microsoft Sans Serif.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Roboto.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Roboto_medium.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/SF-UI-Text-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/SF-UI-Text-Regular.otf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Skia.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Skia.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Times New Roman.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Times New Roman.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /native/android/app/src/main/java/com/crossplatformblog/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.crossplatformblog; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.oblador.vectoricons.VectorIconsPackage; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. 10 | * This is used to schedule rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "CrossPlatformBlog"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /native/android/app/src/main/java/com/crossplatformblog/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.crossplatformblog; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | protected boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage() 27 | ); 28 | } 29 | }; 30 | 31 | @Override 32 | public ReactNativeHost getReactNativeHost() { 33 | return mReactNativeHost; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /native/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CrossPlatformBlog 4 | 5 | -------------------------------------------------------------------------------- /native/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /native/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /native/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /native/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/native/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /native/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /native/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /native/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /native/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /native/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /native/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'CrossPlatformBlog' 2 | 3 | include ':app' 4 | include ':react-native-vector-icons' 5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 6 | -------------------------------------------------------------------------------- /native/components/BlogList.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Text, TouchableHighlight } from 'react-native' 3 | import { Container, Header, Title, Content, List, ListItem, Thumbnail } from 'native-base'; 4 | import _ from 'lodash' 5 | export default class BlogPost extends Component { 6 | render() { 7 | const posts = this.props.posts 8 | const objects = this.props.objects 9 | const blog_list_page = _.find(objects, { slug: 'blog' }) 10 | const blog_title = _.find(blog_list_page.metafields, { key: 'blog_title' }).value 11 | return ( 12 | 13 |
14 | { blog_title } 15 |
16 | 17 | 18 | { 19 | posts.map(post => { 20 | return ( 21 | 22 | 23 | 24 | { post.title } 25 | 26 | 27 | ) 28 | }) 29 | } 30 | 31 | 32 |
33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /native/components/BlogPost.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Text, ScrollView, View, Image } from 'react-native' 3 | import { Container, Header, Title, Content, Button, Icon, Thumbnail } from 'native-base'; 4 | import HTMLView from 'react-native-htmlview' 5 | import _ from 'lodash' 6 | export default class BlogPost extends Component { 7 | render() { 8 | const post = this.props.post 9 | return ( 10 | 11 |
12 | 15 | { post.title } 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | by { _.find(post.metafields, { key: 'author' }).object.title } 26 | 27 | 28 | 29 | 30 | 31 |
32 | ) 33 | } 34 | } -------------------------------------------------------------------------------- /native/components/LandingPage.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { Text, Image, StyleSheet } from 'react-native' 3 | import { Container, View, Button } from 'native-base'; 4 | import _ from 'lodash' 5 | export default class LandingPage extends Component { 6 | render() { 7 | const landing_page = this.props.landing_page 8 | return ( 9 | 10 | 11 | 12 | { _.find(landing_page.metafields, { key: 'headline'}).value } 13 | 14 | 15 | 16 | 17 | ) 18 | } 19 | } 20 | 21 | const styles = StyleSheet.create({ 22 | content:{ 23 | flex:1, 24 | alignItems:'center', 25 | justifyContent:'center' 26 | }, 27 | headline: { 28 | width: 300, 29 | color: '#fff', 30 | fontSize: 30, 31 | fontWeight: 'bold', 32 | textShadowOffset: { width: 1, height: 1}, 33 | textShadowRadius: 1, 34 | textShadowColor: '#000', 35 | textAlign: 'center' 36 | }, 37 | button: { 38 | height: 50, 39 | marginTop: 20, 40 | marginLeft: 50, 41 | marginRight: 50 42 | } 43 | }) -------------------------------------------------------------------------------- /native/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | COSMIC_BUCKET: 'cross-platform-blog' 3 | } -------------------------------------------------------------------------------- /native/index.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { AppRegistry } from 'react-native' 3 | import App from './App' 4 | AppRegistry.registerComponent('CrossPlatformBlog', () => App) -------------------------------------------------------------------------------- /native/index.ios.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { AppRegistry } from 'react-native' 3 | import App from './App' 4 | AppRegistry.registerComponent('CrossPlatformBlog', () => App) -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog.xcodeproj/xcshareddata/xcschemes/CrossPlatformBlog.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"CrossPlatformBlog" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | NSExceptionDomains 44 | 45 | localhost 46 | 47 | NSTemporaryExceptionAllowsInsecureHTTPLoads 48 | 49 | 50 | 51 | 52 | UIAppFonts 53 | 54 | Andale Mono.ttf 55 | Arial.ttf 56 | Comic Sans MS.ttf 57 | Courier New.ttf 58 | Georgia.ttf 59 | Microsoft Sans Serif.ttf 60 | Roboto_medium.ttf 61 | Roboto.ttf 62 | SF-UI-Text-Regular.otf 63 | Skia.ttf 64 | Times New Roman.ttf 65 | Entypo.ttf 66 | EvilIcons.ttf 67 | FontAwesome.ttf 68 | Foundation.ttf 69 | Ionicons.ttf 70 | MaterialIcons.ttf 71 | Octicons.ttf 72 | Zocial.ttf 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlog/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlogTests/CrossPlatformBlogTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface CrossPlatformBlogTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation CrossPlatformBlogTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /native/ios/CrossPlatformBlogTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /native/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CrossPlatformBlog", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start" 7 | }, 8 | "dependencies": { 9 | "cosmicjs": "^2.1.2", 10 | "lodash": "^4.16.1", 11 | "native-base": "^0.5.8", 12 | "react": "15.3.1", 13 | "react-native": "^0.33.0", 14 | "react-native-htmlview": "^0.5.0", 15 | "react-native-vector-icons": "^2.1.0", 16 | "shorti": "^1.1.6" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /web/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015" 4 | ] 5 | } -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /web/app-server.js: -------------------------------------------------------------------------------- 1 | // app-server.js 2 | import express from 'express' 3 | import hogan from 'hogan-express' 4 | import http_module from 'http' 5 | import bodyParser from 'body-parser' 6 | import compression from 'compression' 7 | import config from './config' 8 | const app = express() 9 | app.use(bodyParser.json()) 10 | app.use(compression()) 11 | app.engine('html', hogan) 12 | app.set('views', __dirname + '/views') 13 | app.set('port', process.env.PORT || 3000) 14 | app.use(express.static(__dirname + '/public')) 15 | app.use((req, res, next) => { 16 | if (req.url === '/favicon.ico') 17 | return res.end() 18 | // Set global variables 19 | res.locals.year = new Date().getFullYear() 20 | // Set dev 21 | if (process.env.NODE_ENV === 'development') 22 | res.locals.is_dev = true 23 | next() 24 | }) 25 | const partials = { 26 | header: 'partials/header', 27 | footer: 'partials/footer' 28 | } 29 | require('./routes')(app, config, partials) 30 | const http = http_module.Server(app) 31 | http.listen(app.get('port'), () => { 32 | console.info('==> 🌎 Go to http://localhost:%s', app.get('port')); 33 | }) -------------------------------------------------------------------------------- /web/app.js: -------------------------------------------------------------------------------- 1 | // app.js 2 | require('babel-core/register') 3 | require('./app-server.js') -------------------------------------------------------------------------------- /web/config/development.js: -------------------------------------------------------------------------------- 1 | // config.js 2 | export default { 3 | cosmicjs: { 4 | bucket: { 5 | slug: process.env.COSMIC_BUCKET || 'cross-platform-blog', 6 | read_key: process.env.COSMIC_READ_KEY, 7 | write_key: process.env.COSMIC_WRITE_KEY 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /web/config/index.js: -------------------------------------------------------------------------------- 1 | // config 2 | const config = require('./' + process.env.NODE_ENV) 3 | module.exports = config -------------------------------------------------------------------------------- /web/config/production.js: -------------------------------------------------------------------------------- 1 | // config.js 2 | export default { 3 | cosmicjs: { 4 | bucket: { 5 | slug: process.env.COSMIC_BUCKET, 6 | read_key: process.env.COSMIC_READ_KEY, 7 | write_key: process.env.COSMIC_WRITE_KEY 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cross-platform-blog", 3 | "version": "1.0.0", 4 | "description": "Cross-Platform Blog", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "npm run concat-js; npm run uglifyjs; npm run less; npm run concat-css; npm run minify-css; NODE_ENV=production node app.js", 8 | "development": "NODE_ENV=development PORT=5000 NODE_ENV=development nodemon app.js -e js,html", 9 | "concat-js": "rm -f public/js/combined.js; rm -f public/js/combined.min.js; concat-cli -f public/js/* -o public/js/combined.js", 10 | "uglifyjs": "touch public/js/combined.min.js; uglifyjs public/js/combined.js -o public/js/combined.min.js", 11 | "less": "lessc public/less/main.less public/css/main.css", 12 | "concat-css": "concat-cli -f public/css/font-awesome.min.css public/css/css-helpers.min.css public/css/main.css -o public/css/combined.css", 13 | "minify-css": "touch public/css/combined.min.css; cleancss -o public/css/combined.min.css public/css/combined.css" 14 | }, 15 | "author": "", 16 | "license": "ISC", 17 | "dependencies": { 18 | "async": "^2.0.0", 19 | "babel": "^6.5.2", 20 | "babel-core": "^6.5.2", 21 | "babel-preset-es2015": "^6.5.0", 22 | "body-parser": "^1.15.2", 23 | "clean-css": "^3.4.19", 24 | "compression": "^1.6.1", 25 | "concat-cli": "^4.0.0", 26 | "cosmicjs": "^2.1.2", 27 | "express": "^4.13.4", 28 | "hogan-express": "^0.5.2", 29 | "install": "^0.4.4", 30 | "less": "^2.7.1", 31 | "lodash": "^4.13.1", 32 | "nodemailer": "^2.5.0", 33 | "npm": "^3.7.2", 34 | "uglify-js": "^2.7.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /web/public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /web/public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /web/public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /web/public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /web/public/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /web/public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web/public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web/public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web/public/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cosmicjs/cross-platform-blog/fa0c5e533498b900d3adc8fed5149047f85e37f6/web/public/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /web/public/js/3-main.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $('.phone-mask').mask('000-000-0000'); 3 | $(window).on('load', function() { 4 | stickyFooter(); 5 | }); 6 | $(window).on('resize', function() { 7 | stickyFooter(); 8 | }); 9 | $('#contact_form').on('submit', function() { 10 | var data = $(this).serializeFormJSON(); 11 | // Do some validation 12 | $('.form-group').removeClass('has-error'); 13 | if (!data.full_name) { 14 | $('.form-group--name').addClass('has-error'); 15 | return false; 16 | } 17 | if (!data.email || !isValidEmail(data.email)) { 18 | $('.form-group--email').addClass('has-error'); 19 | return false; 20 | } 21 | if (!data.message) { 22 | $('.form-group--message').addClass('has-error'); 23 | return false; 24 | } 25 | $('.error-message').addClass('hidden'); 26 | $('.success-message').addClass('hidden'); 27 | $('.submit-btn').addClass('disabled'); 28 | $('.submit-btn').text('Submitting...'); 29 | $.ajax({ 30 | url: '/contact', 31 | method: 'post', 32 | contentType: 'application/json', 33 | data: JSON.stringify(data) 34 | }).success(function(){ 35 | $('.submit-btn').removeClass('disabled'); 36 | $('.submit-btn').text('Submit'); 37 | $('.success-message').removeClass('hidden'); 38 | }).error(function(response){ 39 | $('.error-message').removeClass('hidden'); 40 | $('.error-message').text(response.responseJSON.message); 41 | $('.submit-btn').removeClass('disabled'); 42 | $('.submit-btn').text('Submit'); 43 | }); 44 | return false; 45 | }); 46 | $('.make-friendly-date').each(function() { 47 | var timestamp = $(this).data('timestamp'); 48 | var friendly_date = friendlyDate(new Date(timestamp)); 49 | $(this).html(friendly_date.day + ', ' + friendly_date.month + ' ' + friendly_date.date + ' ' + friendly_date.year); 50 | }); 51 | }); 52 | // Functions 53 | function stickyFooter(){ 54 | var windowHeight = $(window).height(); 55 | if(windowHeight > $('#footer').height() + $('#header').height() + $('#main').height()){ 56 | $('#footer').addClass('sticky'); 57 | } else { 58 | $('#footer').removeClass('sticky'); 59 | } 60 | $('#footer').removeClass('invisible'); 61 | } 62 | (function ($) { 63 | $.fn.serializeFormJSON = function () { 64 | var o = {}; 65 | var a = this.serializeArray(); 66 | $.each(a, function () { 67 | if (o[this.name]) { 68 | if (!o[this.name].push) { 69 | o[this.name] = [o[this.name]]; 70 | } 71 | o[this.name].push(this.value || ''); 72 | } else { 73 | o[this.name] = this.value || ''; 74 | } 75 | }); 76 | return o; 77 | }; 78 | })(jQuery); 79 | function isValidEmail(email) { 80 | var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 81 | return re.test(email); 82 | } 83 | function friendlyDate(a) { 84 | var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; 85 | var days = ['Sun','Mon','Tues','Wed','Thurs','Fri','Sat']; 86 | var year = a.getFullYear(); 87 | var month = months[a.getMonth()]; 88 | var day = days[a.getDay()]; 89 | var date = a.getDate(); 90 | var hour = a.getHours(); 91 | var min = a.getMinutes(); 92 | var sec = a.getSeconds(); 93 | var time = { 94 | day: day, 95 | date: date, 96 | month: month, 97 | year: year, 98 | hour: hour, 99 | min: min, 100 | sec: sec 101 | } 102 | return time; 103 | } -------------------------------------------------------------------------------- /web/public/less/bootstrap/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: middle; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.6 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // Core variables and mixins 8 | @import "variables.less"; 9 | @import "mixins.less"; 10 | 11 | // Reset and dependencies 12 | @import "normalize.less"; 13 | @import "print.less"; 14 | @import "glyphicons.less"; 15 | 16 | // Core CSS 17 | @import "scaffolding.less"; 18 | @import "type.less"; 19 | @import "code.less"; 20 | @import "grid.less"; 21 | @import "tables.less"; 22 | @import "forms.less"; 23 | @import "buttons.less"; 24 | 25 | // Components 26 | @import "component-animations.less"; 27 | @import "dropdowns.less"; 28 | @import "button-groups.less"; 29 | @import "input-groups.less"; 30 | @import "navs.less"; 31 | @import "navbar.less"; 32 | @import "breadcrumbs.less"; 33 | @import "pagination.less"; 34 | @import "pager.less"; 35 | @import "labels.less"; 36 | @import "badges.less"; 37 | @import "jumbotron.less"; 38 | @import "thumbnails.less"; 39 | @import "alerts.less"; 40 | @import "progress-bars.less"; 41 | @import "media.less"; 42 | @import "list-group.less"; 43 | @import "panels.less"; 44 | @import "responsive-embed.less"; 45 | @import "wells.less"; 46 | @import "close.less"; 47 | 48 | // Components w/ JavaScript 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | @import "carousel.less"; 53 | 54 | // Utility classes 55 | @import "utilities.less"; 56 | @import "responsive-utilities.less"; 57 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/button-groups.less: -------------------------------------------------------------------------------- 1 | // 2 | // Button groups 3 | // -------------------------------------------------- 4 | 5 | // Make the div behave like a button 6 | .btn-group, 7 | .btn-group-vertical { 8 | position: relative; 9 | display: inline-block; 10 | vertical-align: middle; // match .btn alignment given font-size hack above 11 | > .btn { 12 | position: relative; 13 | float: left; 14 | // Bring the "active" button to the front 15 | &:hover, 16 | &:focus, 17 | &:active, 18 | &.active { 19 | z-index: 2; 20 | } 21 | } 22 | } 23 | 24 | // Prevent double borders when buttons are next to each other 25 | .btn-group { 26 | .btn + .btn, 27 | .btn + .btn-group, 28 | .btn-group + .btn, 29 | .btn-group + .btn-group { 30 | margin-left: -1px; 31 | } 32 | } 33 | 34 | // Optional: Group multiple button groups together for a toolbar 35 | .btn-toolbar { 36 | margin-left: -5px; // Offset the first child's margin 37 | &:extend(.clearfix all); 38 | 39 | .btn, 40 | .btn-group, 41 | .input-group { 42 | float: left; 43 | } 44 | > .btn, 45 | > .btn-group, 46 | > .input-group { 47 | margin-left: 5px; 48 | } 49 | } 50 | 51 | .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { 52 | border-radius: 0; 53 | } 54 | 55 | // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match 56 | .btn-group > .btn:first-child { 57 | margin-left: 0; 58 | &:not(:last-child):not(.dropdown-toggle) { 59 | .border-right-radius(0); 60 | } 61 | } 62 | // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it 63 | .btn-group > .btn:last-child:not(:first-child), 64 | .btn-group > .dropdown-toggle:not(:first-child) { 65 | .border-left-radius(0); 66 | } 67 | 68 | // Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group) 69 | .btn-group > .btn-group { 70 | float: left; 71 | } 72 | .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { 73 | border-radius: 0; 74 | } 75 | .btn-group > .btn-group:first-child:not(:last-child) { 76 | > .btn:last-child, 77 | > .dropdown-toggle { 78 | .border-right-radius(0); 79 | } 80 | } 81 | .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { 82 | .border-left-radius(0); 83 | } 84 | 85 | // On active and open, don't show outline 86 | .btn-group .dropdown-toggle:active, 87 | .btn-group.open .dropdown-toggle { 88 | outline: 0; 89 | } 90 | 91 | 92 | // Sizing 93 | // 94 | // Remix the default button sizing classes into new ones for easier manipulation. 95 | 96 | .btn-group-xs > .btn { &:extend(.btn-xs); } 97 | .btn-group-sm > .btn { &:extend(.btn-sm); } 98 | .btn-group-lg > .btn { &:extend(.btn-lg); } 99 | 100 | 101 | // Split button dropdowns 102 | // ---------------------- 103 | 104 | // Give the line between buttons some depth 105 | .btn-group > .btn + .dropdown-toggle { 106 | padding-left: 8px; 107 | padding-right: 8px; 108 | } 109 | .btn-group > .btn-lg + .dropdown-toggle { 110 | padding-left: 12px; 111 | padding-right: 12px; 112 | } 113 | 114 | // The clickable button for toggling the menu 115 | // Remove the gradient and set the same inset shadow as the :active state 116 | .btn-group.open .dropdown-toggle { 117 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); 118 | 119 | // Show no shadow for `.btn-link` since it has no other button styles. 120 | &.btn-link { 121 | .box-shadow(none); 122 | } 123 | } 124 | 125 | 126 | // Reposition the caret 127 | .btn .caret { 128 | margin-left: 0; 129 | } 130 | // Carets in other button sizes 131 | .btn-lg .caret { 132 | border-width: @caret-width-large @caret-width-large 0; 133 | border-bottom-width: 0; 134 | } 135 | // Upside down carets for .dropup 136 | .dropup .btn-lg .caret { 137 | border-width: 0 @caret-width-large @caret-width-large; 138 | } 139 | 140 | 141 | // Vertical button groups 142 | // ---------------------- 143 | 144 | .btn-group-vertical { 145 | > .btn, 146 | > .btn-group, 147 | > .btn-group > .btn { 148 | display: block; 149 | float: none; 150 | width: 100%; 151 | max-width: 100%; 152 | } 153 | 154 | // Clear floats so dropdown menus can be properly placed 155 | > .btn-group { 156 | &:extend(.clearfix all); 157 | > .btn { 158 | float: none; 159 | } 160 | } 161 | 162 | > .btn + .btn, 163 | > .btn + .btn-group, 164 | > .btn-group + .btn, 165 | > .btn-group + .btn-group { 166 | margin-top: -1px; 167 | margin-left: 0; 168 | } 169 | } 170 | 171 | .btn-group-vertical > .btn { 172 | &:not(:first-child):not(:last-child) { 173 | border-radius: 0; 174 | } 175 | &:first-child:not(:last-child) { 176 | .border-top-radius(@btn-border-radius-base); 177 | .border-bottom-radius(0); 178 | } 179 | &:last-child:not(:first-child) { 180 | .border-top-radius(0); 181 | .border-bottom-radius(@btn-border-radius-base); 182 | } 183 | } 184 | .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { 185 | border-radius: 0; 186 | } 187 | .btn-group-vertical > .btn-group:first-child:not(:last-child) { 188 | > .btn:last-child, 189 | > .dropdown-toggle { 190 | .border-bottom-radius(0); 191 | } 192 | } 193 | .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { 194 | .border-top-radius(0); 195 | } 196 | 197 | 198 | // Justified button groups 199 | // ---------------------- 200 | 201 | .btn-group-justified { 202 | display: table; 203 | width: 100%; 204 | table-layout: fixed; 205 | border-collapse: separate; 206 | > .btn, 207 | > .btn-group { 208 | float: none; 209 | display: table-cell; 210 | width: 1%; 211 | } 212 | > .btn-group .btn { 213 | width: 100%; 214 | } 215 | 216 | > .btn-group .dropdown-menu { 217 | left: auto; 218 | } 219 | } 220 | 221 | 222 | // Checkbox and radio options 223 | // 224 | // In order to support the browser's form validation feedback, powered by the 225 | // `required` attribute, we have to "hide" the inputs via `clip`. We cannot use 226 | // `display: none;` or `visibility: hidden;` as that also hides the popover. 227 | // Simply visually hiding the inputs via `opacity` would leave them clickable in 228 | // certain cases which is prevented by using `clip` and `pointer-events`. 229 | // This way, we ensure a DOM element is visible to position the popover from. 230 | // 231 | // See https://github.com/twbs/bootstrap/pull/12794 and 232 | // https://github.com/twbs/bootstrap/pull/14559 for more information. 233 | 234 | [data-toggle="buttons"] { 235 | > .btn, 236 | > .btn-group > .btn { 237 | input[type="radio"], 238 | input[type="checkbox"] { 239 | position: absolute; 240 | clip: rect(0,0,0,0); 241 | pointer-events: none; 242 | } 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/buttons.less: -------------------------------------------------------------------------------- 1 | // 2 | // Buttons 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // -------------------------------------------------- 8 | 9 | .btn { 10 | display: inline-block; 11 | margin-bottom: 0; // For input.btn 12 | font-weight: @btn-font-weight; 13 | text-align: center; 14 | vertical-align: middle; 15 | touch-action: manipulation; 16 | cursor: pointer; 17 | background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 18 | border: 1px solid transparent; 19 | white-space: nowrap; 20 | .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base); 21 | .user-select(none); 22 | 23 | &, 24 | &:active, 25 | &.active { 26 | &:focus, 27 | &.focus { 28 | .tab-focus(); 29 | } 30 | } 31 | 32 | &:hover, 33 | &:focus, 34 | &.focus { 35 | color: @btn-default-color; 36 | text-decoration: none; 37 | } 38 | 39 | &:active, 40 | &.active { 41 | outline: 0; 42 | background-image: none; 43 | .box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); 44 | } 45 | 46 | &.disabled, 47 | &[disabled], 48 | fieldset[disabled] & { 49 | cursor: @cursor-disabled; 50 | .opacity(.65); 51 | .box-shadow(none); 52 | } 53 | 54 | a& { 55 | &.disabled, 56 | fieldset[disabled] & { 57 | pointer-events: none; // Future-proof disabling of clicks on `` elements 58 | } 59 | } 60 | } 61 | 62 | 63 | // Alternate buttons 64 | // -------------------------------------------------- 65 | 66 | .btn-default { 67 | .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border); 68 | } 69 | .btn-primary { 70 | .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border); 71 | } 72 | // Success appears as green 73 | .btn-success { 74 | .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border); 75 | } 76 | // Info appears as blue-green 77 | .btn-info { 78 | .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border); 79 | } 80 | // Warning appears as orange 81 | .btn-warning { 82 | .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border); 83 | } 84 | // Danger and error appear as red 85 | .btn-danger { 86 | .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border); 87 | } 88 | 89 | 90 | // Link buttons 91 | // ------------------------- 92 | 93 | // Make a button look and behave like a link 94 | .btn-link { 95 | color: @link-color; 96 | font-weight: normal; 97 | border-radius: 0; 98 | 99 | &, 100 | &:active, 101 | &.active, 102 | &[disabled], 103 | fieldset[disabled] & { 104 | background-color: transparent; 105 | .box-shadow(none); 106 | } 107 | &, 108 | &:hover, 109 | &:focus, 110 | &:active { 111 | border-color: transparent; 112 | } 113 | &:hover, 114 | &:focus { 115 | color: @link-hover-color; 116 | text-decoration: @link-hover-decoration; 117 | background-color: transparent; 118 | } 119 | &[disabled], 120 | fieldset[disabled] & { 121 | &:hover, 122 | &:focus { 123 | color: @btn-link-disabled-color; 124 | text-decoration: none; 125 | } 126 | } 127 | } 128 | 129 | 130 | // Button Sizes 131 | // -------------------------------------------------- 132 | 133 | .btn-lg { 134 | // line-height: ensure even-numbered height of button next to large input 135 | .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large); 136 | } 137 | .btn-sm { 138 | // line-height: ensure proper height of button next to small input 139 | .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); 140 | } 141 | .btn-xs { 142 | .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); 143 | } 144 | 145 | 146 | // Block button 147 | // -------------------------------------------------- 148 | 149 | .btn-block { 150 | display: block; 151 | width: 100%; 152 | } 153 | 154 | // Vertically space out multiple block buttons 155 | .btn-block + .btn-block { 156 | margin-top: 5px; 157 | } 158 | 159 | // Specificity overrides 160 | input[type="submit"], 161 | input[type="reset"], 162 | input[type="button"] { 163 | &.btn-block { 164 | width: 100%; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/carousel.less: -------------------------------------------------------------------------------- 1 | // 2 | // Carousel 3 | // -------------------------------------------------- 4 | 5 | 6 | // Wrapper for the slide container and indicators 7 | .carousel { 8 | position: relative; 9 | } 10 | 11 | .carousel-inner { 12 | position: relative; 13 | overflow: hidden; 14 | width: 100%; 15 | 16 | > .item { 17 | display: none; 18 | position: relative; 19 | .transition(.6s ease-in-out left); 20 | 21 | // Account for jankitude on images 22 | > img, 23 | > a > img { 24 | &:extend(.img-responsive); 25 | line-height: 1; 26 | } 27 | 28 | // WebKit CSS3 transforms for supported devices 29 | @media all and (transform-3d), (-webkit-transform-3d) { 30 | .transition-transform(~'0.6s ease-in-out'); 31 | .backface-visibility(~'hidden'); 32 | .perspective(1000px); 33 | 34 | &.next, 35 | &.active.right { 36 | .translate3d(100%, 0, 0); 37 | left: 0; 38 | } 39 | &.prev, 40 | &.active.left { 41 | .translate3d(-100%, 0, 0); 42 | left: 0; 43 | } 44 | &.next.left, 45 | &.prev.right, 46 | &.active { 47 | .translate3d(0, 0, 0); 48 | left: 0; 49 | } 50 | } 51 | } 52 | 53 | > .active, 54 | > .next, 55 | > .prev { 56 | display: block; 57 | } 58 | 59 | > .active { 60 | left: 0; 61 | } 62 | 63 | > .next, 64 | > .prev { 65 | position: absolute; 66 | top: 0; 67 | width: 100%; 68 | } 69 | 70 | > .next { 71 | left: 100%; 72 | } 73 | > .prev { 74 | left: -100%; 75 | } 76 | > .next.left, 77 | > .prev.right { 78 | left: 0; 79 | } 80 | 81 | > .active.left { 82 | left: -100%; 83 | } 84 | > .active.right { 85 | left: 100%; 86 | } 87 | 88 | } 89 | 90 | // Left/right controls for nav 91 | // --------------------------- 92 | 93 | .carousel-control { 94 | position: absolute; 95 | top: 0; 96 | left: 0; 97 | bottom: 0; 98 | width: @carousel-control-width; 99 | .opacity(@carousel-control-opacity); 100 | font-size: @carousel-control-font-size; 101 | color: @carousel-control-color; 102 | text-align: center; 103 | text-shadow: @carousel-text-shadow; 104 | background-color: rgba(0, 0, 0, 0); // Fix IE9 click-thru bug 105 | // We can't have this transition here because WebKit cancels the carousel 106 | // animation if you trip this while in the middle of another animation. 107 | 108 | // Set gradients for backgrounds 109 | &.left { 110 | #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001)); 111 | } 112 | &.right { 113 | left: auto; 114 | right: 0; 115 | #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5)); 116 | } 117 | 118 | // Hover/focus state 119 | &:hover, 120 | &:focus { 121 | outline: 0; 122 | color: @carousel-control-color; 123 | text-decoration: none; 124 | .opacity(.9); 125 | } 126 | 127 | // Toggles 128 | .icon-prev, 129 | .icon-next, 130 | .glyphicon-chevron-left, 131 | .glyphicon-chevron-right { 132 | position: absolute; 133 | top: 50%; 134 | margin-top: -10px; 135 | z-index: 5; 136 | display: inline-block; 137 | } 138 | .icon-prev, 139 | .glyphicon-chevron-left { 140 | left: 50%; 141 | margin-left: -10px; 142 | } 143 | .icon-next, 144 | .glyphicon-chevron-right { 145 | right: 50%; 146 | margin-right: -10px; 147 | } 148 | .icon-prev, 149 | .icon-next { 150 | width: 20px; 151 | height: 20px; 152 | line-height: 1; 153 | font-family: serif; 154 | } 155 | 156 | 157 | .icon-prev { 158 | &:before { 159 | content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039) 160 | } 161 | } 162 | .icon-next { 163 | &:before { 164 | content: '\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A) 165 | } 166 | } 167 | } 168 | 169 | // Optional indicator pips 170 | // 171 | // Add an unordered list with the following class and add a list item for each 172 | // slide your carousel holds. 173 | 174 | .carousel-indicators { 175 | position: absolute; 176 | bottom: 10px; 177 | left: 50%; 178 | z-index: 15; 179 | width: 60%; 180 | margin-left: -30%; 181 | padding-left: 0; 182 | list-style: none; 183 | text-align: center; 184 | 185 | li { 186 | display: inline-block; 187 | width: 10px; 188 | height: 10px; 189 | margin: 1px; 190 | text-indent: -999px; 191 | border: 1px solid @carousel-indicator-border-color; 192 | border-radius: 10px; 193 | cursor: pointer; 194 | 195 | // IE8-9 hack for event handling 196 | // 197 | // Internet Explorer 8-9 does not support clicks on elements without a set 198 | // `background-color`. We cannot use `filter` since that's not viewed as a 199 | // background color by the browser. Thus, a hack is needed. 200 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer 201 | // 202 | // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we 203 | // set alpha transparency for the best results possible. 204 | background-color: #000 \9; // IE8 205 | background-color: rgba(0,0,0,0); // IE9 206 | } 207 | .active { 208 | margin: 0; 209 | width: 12px; 210 | height: 12px; 211 | background-color: @carousel-indicator-active-bg; 212 | } 213 | } 214 | 215 | // Optional captions 216 | // ----------------------------- 217 | // Hidden by default for smaller viewports 218 | .carousel-caption { 219 | position: absolute; 220 | left: 15%; 221 | right: 15%; 222 | bottom: 20px; 223 | z-index: 10; 224 | padding-top: 20px; 225 | padding-bottom: 20px; 226 | color: @carousel-caption-color; 227 | text-align: center; 228 | text-shadow: @carousel-text-shadow; 229 | & .btn { 230 | text-shadow: none; // No shadow for button elements in carousel-caption 231 | } 232 | } 233 | 234 | 235 | // Scale up controls for tablets and up 236 | @media screen and (min-width: @screen-sm-min) { 237 | 238 | // Scale up the controls a smidge 239 | .carousel-control { 240 | .glyphicon-chevron-left, 241 | .glyphicon-chevron-right, 242 | .icon-prev, 243 | .icon-next { 244 | width: (@carousel-control-font-size * 1.5); 245 | height: (@carousel-control-font-size * 1.5); 246 | margin-top: (@carousel-control-font-size / -2); 247 | font-size: (@carousel-control-font-size * 1.5); 248 | } 249 | .glyphicon-chevron-left, 250 | .icon-prev { 251 | margin-left: (@carousel-control-font-size / -2); 252 | } 253 | .glyphicon-chevron-right, 254 | .icon-next { 255 | margin-right: (@carousel-control-font-size / -2); 256 | } 257 | } 258 | 259 | // Show and left align the captions 260 | .carousel-caption { 261 | left: 20%; 262 | right: 20%; 263 | padding-bottom: 30px; 264 | } 265 | 266 | // Move up the indicators 267 | .carousel-indicators { 268 | bottom: 20px; 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/dropdowns.less: -------------------------------------------------------------------------------- 1 | // 2 | // Dropdown menus 3 | // -------------------------------------------------- 4 | 5 | 6 | // Dropdown arrow/caret 7 | .caret { 8 | display: inline-block; 9 | width: 0; 10 | height: 0; 11 | margin-left: 2px; 12 | vertical-align: middle; 13 | border-top: @caret-width-base dashed; 14 | border-top: @caret-width-base solid ~"\9"; // IE8 15 | border-right: @caret-width-base solid transparent; 16 | border-left: @caret-width-base solid transparent; 17 | } 18 | 19 | // The dropdown wrapper (div) 20 | .dropup, 21 | .dropdown { 22 | position: relative; 23 | } 24 | 25 | // Prevent the focus on the dropdown toggle when closing dropdowns 26 | .dropdown-toggle:focus { 27 | outline: 0; 28 | } 29 | 30 | // The dropdown menu (ul) 31 | .dropdown-menu { 32 | position: absolute; 33 | top: 100%; 34 | left: 0; 35 | z-index: @zindex-dropdown; 36 | display: none; // none by default, but block on "open" of the menu 37 | float: left; 38 | min-width: 160px; 39 | padding: 5px 0; 40 | margin: 2px 0 0; // override default ul 41 | list-style: none; 42 | font-size: @font-size-base; 43 | text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) 44 | background-color: @dropdown-bg; 45 | border: 1px solid @dropdown-fallback-border; // IE8 fallback 46 | border: 1px solid @dropdown-border; 47 | border-radius: @border-radius-base; 48 | .box-shadow(0 6px 12px rgba(0,0,0,.175)); 49 | background-clip: padding-box; 50 | 51 | // Aligns the dropdown menu to right 52 | // 53 | // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]` 54 | &.pull-right { 55 | right: 0; 56 | left: auto; 57 | } 58 | 59 | // Dividers (basically an hr) within the dropdown 60 | .divider { 61 | .nav-divider(@dropdown-divider-bg); 62 | } 63 | 64 | // Links within the dropdown menu 65 | > li > a { 66 | display: block; 67 | padding: 3px 20px; 68 | clear: both; 69 | font-weight: normal; 70 | line-height: @line-height-base; 71 | color: @dropdown-link-color; 72 | white-space: nowrap; // prevent links from randomly breaking onto new lines 73 | } 74 | } 75 | 76 | // Hover/Focus state 77 | .dropdown-menu > li > a { 78 | &:hover, 79 | &:focus { 80 | text-decoration: none; 81 | color: @dropdown-link-hover-color; 82 | background-color: @dropdown-link-hover-bg; 83 | } 84 | } 85 | 86 | // Active state 87 | .dropdown-menu > .active > a { 88 | &, 89 | &:hover, 90 | &:focus { 91 | color: @dropdown-link-active-color; 92 | text-decoration: none; 93 | outline: 0; 94 | background-color: @dropdown-link-active-bg; 95 | } 96 | } 97 | 98 | // Disabled state 99 | // 100 | // Gray out text and ensure the hover/focus state remains gray 101 | 102 | .dropdown-menu > .disabled > a { 103 | &, 104 | &:hover, 105 | &:focus { 106 | color: @dropdown-link-disabled-color; 107 | } 108 | 109 | // Nuke hover/focus effects 110 | &:hover, 111 | &:focus { 112 | text-decoration: none; 113 | background-color: transparent; 114 | background-image: none; // Remove CSS gradient 115 | .reset-filter(); 116 | cursor: @cursor-disabled; 117 | } 118 | } 119 | 120 | // Open state for the dropdown 121 | .open { 122 | // Show the menu 123 | > .dropdown-menu { 124 | display: block; 125 | } 126 | 127 | // Remove the outline when :focus is triggered 128 | > a { 129 | outline: 0; 130 | } 131 | } 132 | 133 | // Menu positioning 134 | // 135 | // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown 136 | // menu with the parent. 137 | .dropdown-menu-right { 138 | left: auto; // Reset the default from `.dropdown-menu` 139 | right: 0; 140 | } 141 | // With v3, we enabled auto-flipping if you have a dropdown within a right 142 | // aligned nav component. To enable the undoing of that, we provide an override 143 | // to restore the default dropdown menu alignment. 144 | // 145 | // This is only for left-aligning a dropdown menu within a `.navbar-right` or 146 | // `.pull-right` nav component. 147 | .dropdown-menu-left { 148 | left: 0; 149 | right: auto; 150 | } 151 | 152 | // Dropdown section headers 153 | .dropdown-header { 154 | display: block; 155 | padding: 3px 20px; 156 | font-size: @font-size-small; 157 | line-height: @line-height-base; 158 | color: @dropdown-header-color; 159 | white-space: nowrap; // as with > li > a 160 | } 161 | 162 | // Backdrop to catch body clicks on mobile, etc. 163 | .dropdown-backdrop { 164 | position: fixed; 165 | left: 0; 166 | right: 0; 167 | bottom: 0; 168 | top: 0; 169 | z-index: (@zindex-dropdown - 10); 170 | } 171 | 172 | // Right aligned dropdowns 173 | .pull-right > .dropdown-menu { 174 | right: 0; 175 | left: auto; 176 | } 177 | 178 | // Allow for dropdowns to go bottom up (aka, dropup-menu) 179 | // 180 | // Just add .dropup after the standard .dropdown class and you're set, bro. 181 | // TODO: abstract this so that the navbar fixed styles are not placed here? 182 | 183 | .dropup, 184 | .navbar-fixed-bottom .dropdown { 185 | // Reverse the caret 186 | .caret { 187 | border-top: 0; 188 | border-bottom: @caret-width-base dashed; 189 | border-bottom: @caret-width-base solid ~"\9"; // IE8 190 | content: ""; 191 | } 192 | // Different positioning for bottom up menu 193 | .dropdown-menu { 194 | top: auto; 195 | bottom: 100%; 196 | margin-bottom: 2px; 197 | } 198 | } 199 | 200 | 201 | // Component alignment 202 | // 203 | // Reiterate per navbar.less and the modified component alignment there. 204 | 205 | @media (min-width: @grid-float-breakpoint) { 206 | .navbar-right { 207 | .dropdown-menu { 208 | .dropdown-menu-right(); 209 | } 210 | // Necessary for overrides of the default right aligned menu. 211 | // Will remove come v4 in all likelihood. 212 | .dropdown-menu-left { 213 | .dropdown-menu-left(); 214 | } 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/input-groups.less: -------------------------------------------------------------------------------- 1 | // 2 | // Input groups 3 | // -------------------------------------------------- 4 | 5 | // Base styles 6 | // ------------------------- 7 | .input-group { 8 | position: relative; // For dropdowns 9 | display: table; 10 | border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table 11 | 12 | // Undo padding and float of grid classes 13 | &[class*="col-"] { 14 | float: none; 15 | padding-left: 0; 16 | padding-right: 0; 17 | } 18 | 19 | .form-control { 20 | // Ensure that the input is always above the *appended* addon button for 21 | // proper border colors. 22 | position: relative; 23 | z-index: 2; 24 | 25 | // IE9 fubars the placeholder attribute in text inputs and the arrows on 26 | // select elements in input groups. To fix it, we float the input. Details: 27 | // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855 28 | float: left; 29 | 30 | width: 100%; 31 | margin-bottom: 0; 32 | 33 | &:focus { 34 | z-index: 3; 35 | } 36 | } 37 | } 38 | 39 | // Sizing options 40 | // 41 | // Remix the default form control sizing classes into new ones for easier 42 | // manipulation. 43 | 44 | .input-group-lg > .form-control, 45 | .input-group-lg > .input-group-addon, 46 | .input-group-lg > .input-group-btn > .btn { 47 | .input-lg(); 48 | } 49 | .input-group-sm > .form-control, 50 | .input-group-sm > .input-group-addon, 51 | .input-group-sm > .input-group-btn > .btn { 52 | .input-sm(); 53 | } 54 | 55 | 56 | // Display as table-cell 57 | // ------------------------- 58 | .input-group-addon, 59 | .input-group-btn, 60 | .input-group .form-control { 61 | display: table-cell; 62 | 63 | &:not(:first-child):not(:last-child) { 64 | border-radius: 0; 65 | } 66 | } 67 | // Addon and addon wrapper for buttons 68 | .input-group-addon, 69 | .input-group-btn { 70 | width: 1%; 71 | white-space: nowrap; 72 | vertical-align: middle; // Match the inputs 73 | } 74 | 75 | // Text input groups 76 | // ------------------------- 77 | .input-group-addon { 78 | padding: @padding-base-vertical @padding-base-horizontal; 79 | font-size: @font-size-base; 80 | font-weight: normal; 81 | line-height: 1; 82 | color: @input-color; 83 | text-align: center; 84 | background-color: @input-group-addon-bg; 85 | border: 1px solid @input-group-addon-border-color; 86 | border-radius: @input-border-radius; 87 | 88 | // Sizing 89 | &.input-sm { 90 | padding: @padding-small-vertical @padding-small-horizontal; 91 | font-size: @font-size-small; 92 | border-radius: @input-border-radius-small; 93 | } 94 | &.input-lg { 95 | padding: @padding-large-vertical @padding-large-horizontal; 96 | font-size: @font-size-large; 97 | border-radius: @input-border-radius-large; 98 | } 99 | 100 | // Nuke default margins from checkboxes and radios to vertically center within. 101 | input[type="radio"], 102 | input[type="checkbox"] { 103 | margin-top: 0; 104 | } 105 | } 106 | 107 | // Reset rounded corners 108 | .input-group .form-control:first-child, 109 | .input-group-addon:first-child, 110 | .input-group-btn:first-child > .btn, 111 | .input-group-btn:first-child > .btn-group > .btn, 112 | .input-group-btn:first-child > .dropdown-toggle, 113 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), 114 | .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { 115 | .border-right-radius(0); 116 | } 117 | .input-group-addon:first-child { 118 | border-right: 0; 119 | } 120 | .input-group .form-control:last-child, 121 | .input-group-addon:last-child, 122 | .input-group-btn:last-child > .btn, 123 | .input-group-btn:last-child > .btn-group > .btn, 124 | .input-group-btn:last-child > .dropdown-toggle, 125 | .input-group-btn:first-child > .btn:not(:first-child), 126 | .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { 127 | .border-left-radius(0); 128 | } 129 | .input-group-addon:last-child { 130 | border-left: 0; 131 | } 132 | 133 | // Button input groups 134 | // ------------------------- 135 | .input-group-btn { 136 | position: relative; 137 | // Jankily prevent input button groups from wrapping with `white-space` and 138 | // `font-size` in combination with `inline-block` on buttons. 139 | font-size: 0; 140 | white-space: nowrap; 141 | 142 | // Negative margin for spacing, position for bringing hovered/focused/actived 143 | // element above the siblings. 144 | > .btn { 145 | position: relative; 146 | + .btn { 147 | margin-left: -1px; 148 | } 149 | // Bring the "active" button to the front 150 | &:hover, 151 | &:focus, 152 | &:active { 153 | z-index: 2; 154 | } 155 | } 156 | 157 | // Negative margin to only have a 1px border between the two 158 | &:first-child { 159 | > .btn, 160 | > .btn-group { 161 | margin-right: -1px; 162 | } 163 | } 164 | &:last-child { 165 | > .btn, 166 | > .btn-group { 167 | z-index: 2; 168 | margin-left: -1px; 169 | } 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding-top: @jumbotron-padding; 8 | padding-bottom: @jumbotron-padding; 9 | margin-bottom: @jumbotron-padding; 10 | color: @jumbotron-color; 11 | background-color: @jumbotron-bg; 12 | 13 | h1, 14 | .h1 { 15 | color: @jumbotron-heading-color; 16 | } 17 | 18 | p { 19 | margin-bottom: (@jumbotron-padding / 2); 20 | font-size: @jumbotron-font-size; 21 | font-weight: 200; 22 | } 23 | 24 | > hr { 25 | border-top-color: darken(@jumbotron-bg, 10%); 26 | } 27 | 28 | .container &, 29 | .container-fluid & { 30 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 31 | padding-left: (@grid-gutter-width / 2); 32 | padding-right: (@grid-gutter-width / 2); 33 | } 34 | 35 | .container { 36 | max-width: 100%; 37 | } 38 | 39 | @media screen and (min-width: @screen-sm-min) { 40 | padding-top: (@jumbotron-padding * 1.6); 41 | padding-bottom: (@jumbotron-padding * 1.6); 42 | 43 | .container &, 44 | .container-fluid & { 45 | padding-left: (@jumbotron-padding * 2); 46 | padding-right: (@jumbotron-padding * 2); 47 | } 48 | 49 | h1, 50 | .h1 { 51 | font-size: @jumbotron-heading-font-size; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // 8 | // Easily usable on
    ,
      , or
      . 9 | 10 | .list-group { 11 | // No need to set list-style: none; since .list-group-item is block level 12 | margin-bottom: 20px; 13 | padding-left: 0; // reset padding because ul and ol 14 | } 15 | 16 | 17 | // Individual list items 18 | // 19 | // Use on `li`s or `div`s within the `.list-group` parent. 20 | 21 | .list-group-item { 22 | position: relative; 23 | display: block; 24 | padding: 10px 15px; 25 | // Place the border on the list items and negative margin up for better styling 26 | margin-bottom: -1px; 27 | background-color: @list-group-bg; 28 | border: 1px solid @list-group-border; 29 | 30 | // Round the first and last items 31 | &:first-child { 32 | .border-top-radius(@list-group-border-radius); 33 | } 34 | &:last-child { 35 | margin-bottom: 0; 36 | .border-bottom-radius(@list-group-border-radius); 37 | } 38 | } 39 | 40 | 41 | // Interactive list items 42 | // 43 | // Use anchor or button elements instead of `li`s or `div`s to create interactive items. 44 | // Includes an extra `.active` modifier class for showing selected items. 45 | 46 | a.list-group-item, 47 | button.list-group-item { 48 | color: @list-group-link-color; 49 | 50 | .list-group-item-heading { 51 | color: @list-group-link-heading-color; 52 | } 53 | 54 | // Hover state 55 | &:hover, 56 | &:focus { 57 | text-decoration: none; 58 | color: @list-group-link-hover-color; 59 | background-color: @list-group-hover-bg; 60 | } 61 | } 62 | 63 | button.list-group-item { 64 | width: 100%; 65 | text-align: left; 66 | } 67 | 68 | .list-group-item { 69 | // Disabled state 70 | &.disabled, 71 | &.disabled:hover, 72 | &.disabled:focus { 73 | background-color: @list-group-disabled-bg; 74 | color: @list-group-disabled-color; 75 | cursor: @cursor-disabled; 76 | 77 | // Force color to inherit for custom content 78 | .list-group-item-heading { 79 | color: inherit; 80 | } 81 | .list-group-item-text { 82 | color: @list-group-disabled-text-color; 83 | } 84 | } 85 | 86 | // Active class on item itself, not parent 87 | &.active, 88 | &.active:hover, 89 | &.active:focus { 90 | z-index: 2; // Place active items above their siblings for proper border styling 91 | color: @list-group-active-color; 92 | background-color: @list-group-active-bg; 93 | border-color: @list-group-active-border; 94 | 95 | // Force color to inherit for custom content 96 | .list-group-item-heading, 97 | .list-group-item-heading > small, 98 | .list-group-item-heading > .small { 99 | color: inherit; 100 | } 101 | .list-group-item-text { 102 | color: @list-group-active-text-color; 103 | } 104 | } 105 | } 106 | 107 | 108 | // Contextual variants 109 | // 110 | // Add modifier classes to change text and background color on individual items. 111 | // Organizationally, this must come after the `:hover` states. 112 | 113 | .list-group-item-variant(success; @state-success-bg; @state-success-text); 114 | .list-group-item-variant(info; @state-info-bg; @state-info-text); 115 | .list-group-item-variant(warning; @state-warning-bg; @state-warning-text); 116 | .list-group-item-variant(danger; @state-danger-bg; @state-danger-text); 117 | 118 | 119 | // Custom content options 120 | // 121 | // Extra classes for creating well-formatted content within `.list-group-item`s. 122 | 123 | .list-group-item-heading { 124 | margin-top: 0; 125 | margin-bottom: 5px; 126 | } 127 | .list-group-item-text { 128 | margin-bottom: 0; 129 | line-height: 1.3; 130 | } 131 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &:hover, 46 | &:focus, 47 | &.focus { 48 | background-color: @background; 49 | border-color: @border; 50 | } 51 | } 52 | 53 | .badge { 54 | color: @background; 55 | background-color: @color; 56 | } 57 | } 58 | 59 | // Button sizes 60 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 61 | padding: @padding-vertical @padding-horizontal; 62 | font-size: @font-size; 63 | line-height: @line-height; 64 | border-radius: @border-radius; 65 | } 66 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web/public/less/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. `