Skip to content

Commit 09e4861

Browse files
committed
fix: added examples to github
1 parent 5868fd2 commit 09e4861

File tree

227 files changed

+119817
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+119817
-0
lines changed

examples/ionic1/.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "www/lib"
3+
}

examples/ionic1/.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

examples/ionic1/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.sourcemaps/
17+
.sass-cache/
18+
.tmp/
19+
.versions/
20+
coverage/
21+
dist/
22+
node_modules/
23+
tmp/
24+
temp/
25+
platforms/
26+
plugins/
27+
plugins/android.json
28+
plugins/ios.json
29+
$RECYCLE.BIN/
30+
31+
.DS_Store
32+
Thumbs.db
33+
UserInterfaceState.xcuserstate

examples/ionic1/bower.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "HelloIonic",
3+
"private": "true",
4+
"devDependencies": {
5+
"ionic": "ionic-team/ionic-bower#1.3.4"
6+
}
7+
}

examples/ionic1/build.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"ios": {
3+
"debug": {
4+
"developmentTeam": "PW4Q8885U7"
5+
},
6+
"release": {
7+
"developmentTeam": "PW4Q8885U7"
8+
}
9+
}
10+
}

examples/ionic1/config.xml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="com.eneff.branch.ionic1" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<branch-config>
4+
<branch-key value="key_live_jnBhaHwt5K8xtn4g4hblHoleqsocI6C2" />
5+
<uri-scheme value="branchionic1" />
6+
<link-domain value="cluv.app.link" />
7+
<ios-team-release value="PW4Q8885U7" />
8+
</branch-config>
9+
<name>Ionic1</name>
10+
<description>Ionic1</description>
11+
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
12+
<content src="index.html" />
13+
<access origin="*" />
14+
<allow-intent href="http://*/*" />
15+
<allow-intent href="https://*/*" />
16+
<allow-intent href="tel:*" />
17+
<allow-intent href="sms:*" />
18+
<allow-intent href="mailto:*" />
19+
<allow-intent href="geo:*" />
20+
<preference name="ScrollEnabled" value="false" />
21+
<preference name="android-minSdkVersion" value="19" />
22+
<preference name="BackupWebStorage" value="none" />
23+
<preference name="SplashMaintainAspectRatio" value="true" />
24+
<preference name="FadeSplashScreenDuration" value="300" />
25+
<preference name="SplashShowOnlyFirstTime" value="false" />
26+
<preference name="SplashScreen" value="screen" />
27+
<preference name="SplashScreenDelay" value="3000" />
28+
<platform name="android">
29+
<allow-intent href="market:*" />
30+
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
31+
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
32+
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
33+
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
34+
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
35+
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
36+
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
37+
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
38+
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
39+
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
40+
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
41+
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
42+
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
43+
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
44+
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
45+
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
46+
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
47+
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
48+
</platform>
49+
<platform name="ios">
50+
<allow-intent href="itms:*" />
51+
<allow-intent href="itms-apps:*" />
52+
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
53+
<icon height="114" src="resources/ios/icon/[email protected]" width="114" />
54+
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
55+
<icon height="80" src="resources/ios/icon/[email protected]" width="80" />
56+
<icon height="120" src="resources/ios/icon/[email protected]" width="120" />
57+
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
58+
<icon height="100" src="resources/ios/icon/[email protected]" width="100" />
59+
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
60+
<icon height="120" src="resources/ios/icon/[email protected]" width="120" />
61+
<icon height="180" src="resources/ios/icon/[email protected]" width="180" />
62+
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
63+
<icon height="144" src="resources/ios/icon/[email protected]" width="144" />
64+
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
65+
<icon height="152" src="resources/ios/icon/[email protected]" width="152" />
66+
<icon height="167" src="resources/ios/icon/[email protected]" width="167" />
67+
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
68+
<icon height="58" src="resources/ios/icon/[email protected]" width="58" />
69+
<icon height="87" src="resources/ios/icon/[email protected]" width="87" />
70+
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
71+
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
72+
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
73+
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
74+
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
75+
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
76+
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
77+
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
78+
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
79+
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
80+
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
81+
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
82+
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
83+
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
84+
</platform>
85+
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
86+
<plugin name="cordova-plugin-device" spec="~2.0.2" />
87+
<plugin name="cordova-plugin-splashscreen" spec="~5.0.2" />
88+
<plugin name="cordova-plugin-ionic-webview" spec="~1.1.19" />
89+
<plugin name="cordova-plugin-ionic-keyboard" spec="~2.0.5" />
90+
<engine name="ios" spec="~4.5.4" />
91+
<engine name="android" spec="~7.0.0" />
92+
</widget>

examples/ionic1/gulpfile.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var gulp = require('gulp');
2+
var sass = require('gulp-sass');
3+
var cleanCss = require('gulp-clean-css');
4+
var rename = require('gulp-rename');
5+
6+
var paths = {
7+
sass: ['./scss/**/*.scss']
8+
};
9+
10+
gulp.task('default', ['sass']);
11+
12+
gulp.task('sass', function(done) {
13+
gulp.src('./scss/ionic.app.scss')
14+
.pipe(sass())
15+
.on('error', sass.logError)
16+
.pipe(gulp.dest('./www/css/'))
17+
.pipe(cleanCss({
18+
keepSpecialComments: 0
19+
}))
20+
.pipe(rename({ extname: '.min.css' }))
21+
.pipe(gulp.dest('./www/css/'))
22+
.on('end', done);
23+
});
24+
25+
gulp.task('watch', ['sass'], function() {
26+
gulp.watch(paths.sass, ['sass']);
27+
});

examples/ionic1/hooks/README.md

Lines changed: 1 addition & 0 deletions
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env node
2+
3+
// Add Platform Class
4+
// v1.0
5+
// Automatically adds the platform class to the body tag
6+
// after the `prepare` command. By placing the platform CSS classes
7+
// directly in the HTML built for the platform, it speeds up
8+
// rendering the correct layout/style for the specific platform
9+
// instead of waiting for the JS to figure out the correct classes.
10+
11+
var fs = require('fs');
12+
var path = require('path');
13+
14+
var rootdir = process.argv[2];
15+
16+
function addPlatformBodyTag(indexPath, platform) {
17+
// add the platform class to the body tag
18+
try {
19+
var platformClass = 'platform-' + platform;
20+
var cordovaClass = 'platform-cordova platform-webview';
21+
22+
var html = fs.readFileSync(indexPath, 'utf8');
23+
24+
var bodyTag = findBodyTag(html);
25+
if(!bodyTag) return; // no opening body tag, something's wrong
26+
27+
if(bodyTag.indexOf(platformClass) > -1) return; // already added
28+
29+
var newBodyTag = bodyTag;
30+
31+
var classAttr = findClassAttr(bodyTag);
32+
if(classAttr) {
33+
// body tag has existing class attribute, add the classname
34+
var endingQuote = classAttr.substring(classAttr.length-1);
35+
var newClassAttr = classAttr.substring(0, classAttr.length-1);
36+
newClassAttr += ' ' + platformClass + ' ' + cordovaClass + endingQuote;
37+
newBodyTag = bodyTag.replace(classAttr, newClassAttr);
38+
39+
} else {
40+
// add class attribute to the body tag
41+
newBodyTag = bodyTag.replace('>', ' class="' + platformClass + ' ' + cordovaClass + '">');
42+
}
43+
44+
html = html.replace(bodyTag, newBodyTag);
45+
46+
fs.writeFileSync(indexPath, html, 'utf8');
47+
48+
process.stdout.write('add to body class: ' + platformClass + '\n');
49+
} catch(e) {
50+
process.stdout.write(e);
51+
}
52+
}
53+
54+
function findBodyTag(html) {
55+
// get the body tag
56+
try{
57+
return html.match(/<body(?=[\s>])(.*?)>/gi)[0];
58+
}catch(e){}
59+
}
60+
61+
function findClassAttr(bodyTag) {
62+
// get the body tag's class attribute
63+
try{
64+
return bodyTag.match(/ class=["|'](.*?)["|']/gi)[0];
65+
}catch(e){}
66+
}
67+
68+
if (rootdir) {
69+
70+
// go through each of the platform directories that have been prepared
71+
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []);
72+
73+
for(var x=0; x<platforms.length; x++) {
74+
// open up the index.html file at the www root
75+
try {
76+
var platform = platforms[x].trim().toLowerCase();
77+
var indexPath;
78+
79+
if(platform == 'android') {
80+
indexPath = path.join('platforms', platform, 'assets', 'www', 'index.html');
81+
} else {
82+
indexPath = path.join('platforms', platform, 'www', 'index.html');
83+
}
84+
85+
if(fs.existsSync(indexPath)) {
86+
addPlatformBodyTag(indexPath, platform);
87+
}
88+
89+
} catch(e) {
90+
process.stdout.write(e);
91+
}
92+
}
93+
94+
}

examples/ionic1/ionic.config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "ionic1",
3+
"app_id": "",
4+
"type": "ionic1",
5+
"integrations": {
6+
"gulp": {},
7+
"cordova": {}
8+
},
9+
"watchPatterns": [
10+
"scss/**/*",
11+
"www/**/*",
12+
"!www/lib/**/*",
13+
"!www/**/*.map"
14+
]
15+
}

0 commit comments

Comments
 (0)