es-num-new">
-# If your project uses WebView with JS, uncomment the following
9
-# and specify the fully qualified class name to the JavaScript interface
10
-# class:
11
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12
-#   public *;
13
-#}
14
-
15
-# Uncomment this to preserve the line number information for
16
-# debugging stack traces.
17
-#-keepattributes SourceFile,LineNumberTable
18
-
19
-# If you keep the line number information, uncomment this to
20
-# hide the original source file name.
21
-#-renamesourcefileattribute SourceFile

+ 0 - 26
android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
1
-package com.getcapacitor.myapp;
2
-
3
-import static org.junit.Assert.*;
4
-
5
-import android.content.Context;
6
-import androidx.test.ext.junit.runners.AndroidJUnit4;
7
-import androidx.test.platform.app.InstrumentationRegistry;
8
-import org.junit.Test;
9
-import org.junit.runner.RunWith;
10
-
11
-/**
12
- * Instrumented test, which will execute on an Android device.
13
- *
14
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
15
- */
16
-@RunWith(AndroidJUnit4.class)
17
-public class ExampleInstrumentedTest {
18
-
19
-    @Test
20
-    public void useAppContext() throws Exception {
21
-        // Context of the app under test.
22
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
23
-
24
-        assertEquals("com.getcapacitor.app", appContext.getPackageName());
25
-    }
26
-}

+ 0 - 41
android/app/src/main/AndroidManifest.xml

@@ -1,41 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
-    package="net.simplico.whitesports">
4
-
5
-    <application
6
-        android:allowBackup="true"
7
-        android:icon="@mipmap/ic_launcher"
8
-        android:label="@string/app_name"
9
-        android:roundIcon="@mipmap/ic_launcher_round"
10
-        android:supportsRtl="true"
11
-        android:theme="@style/AppTheme">
12
-
13
-        <activity
14
-            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
15
-            android:name="net.simplico.whitesports.MainActivity"
16
-            android:label="@string/title_activity_main"
17
-            android:theme="@style/AppTheme.NoActionBarLaunch"
18
-            android:launchMode="singleTask">
19
-
20
-            <intent-filter>
21
-                <action android:name="android.intent.action.MAIN" />
22
-                <category android:name="android.intent.category.LAUNCHER" />
23
-            </intent-filter>
24
-
25
-        </activity>
26
-
27
-        <provider
28
-            android:name="androidx.core.content.FileProvider"
29
-            android:authorities="${applicationId}.fileprovider"
30
-            android:exported="false"
31
-            android:grantUriPermissions="true">
32
-            <meta-data
33
-                android:name="android.support.FILE_PROVIDER_PATHS"
34
-                android:resource="@xml/file_paths"></meta-data>
35
-        </provider>
36
-    </application>
37
-
38
-    <!-- Permissions -->
39
-
40
-    <uses-permission android:name="android.permission.INTERNET" />
41
-</manifest>

+ 0 - 19
android/app/src/main/assets/capacitor.config.json

@@ -1,19 +0,0 @@
1
-{
2
-	"appId": "io.ionic.starter",
3
-	"appName": "Stark",
4
-	"webDir": "www",
5
-	"bundledWebRuntime": false,
6
-	"cordova": {
7
-		"preferences": {
8
-			"ScrollEnabled": "false",
9
-			"android-minSdkVersion": "28",
10
-			"android-targetSdkVersion": "28",
11
-			"BackupWebStorage": "none",
12
-			"SplashMaintainAspectRatio": "true",
13
-			"FadeSplashScreenDuration": "300",
14
-			"SplashShowOnlyFirstTime": "false",
15
-			"SplashScreen": "screen",
16
-			"SplashScreenDelay": "3000"
17
-		}
18
-	}
19
-}

+ 0 - 18
android/app/src/main/assets/capacitor.plugins.json

@@ -1,18 +0,0 @@
1
-[
2
-	{
3
-		"pkg": "@capacitor/app",
4
-		"classpath": "com.capacitorjs.plugins.app.AppPlugin"
5
-	},
6
-	{
7
-		"pkg": "@capacitor/haptics",
8
-		"classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
9
-	},
10
-	{
11
-		"pkg": "@capacitor/keyboard",
12
-		"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
13
-	},
14
-	{
15
-		"pkg": "@capacitor/status-bar",
16
-		"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
17
-	}
18
-]

+ 0 - 5
android/app/src/main/java/net/simplico/whitesports/MainActivity.java

@@ -1,5 +0,0 @@
1
-package net.simplico.whitesports;
2
-
3
-import com.getcapacitor.BridgeActivity;
4
-
5
-public class MainActivity extends BridgeActivity {}

BIN
android/app/src/main/res/drawable-land-hdpi/splash.png


BIN
android/app/src/main/res/drawable-land-mdpi/splash.png


BIN
android/app/src/main/res/drawable-land-xhdpi/splash.png


BIN
android/app/src/main/res/drawable-land-xxhdpi/splash.png


BIN
android/app/src/main/res/drawable-land-xxxhdpi/splash.png


BIN
android/app/src/main/res/drawable-port-hdpi/splash.png


BIN
android/app/src/main/res/drawable-port-mdpi/splash.png


BIN
android/app/src/main/res/drawable-port-xhdpi/splash.png


BIN
android/app/src/main/res/drawable-port-xxhdpi/splash.png


BIN
android/app/src/main/res/drawable-port-xxxhdpi/splash.png


File diff suppressed because it is too large
+ 0 - 34
android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml


+ 0 - 170
android/app/src/main/res/drawable/ic_launcher_background.xml

@@ -1,170 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:width="108dp"
4
-    android:height="108dp"
5
-    android:viewportHeight="108"
6
-    android:viewportWidth="108">
7
-    <path
8
-        android:fillColor="#26A69A"
9
-        android:pathData="M0,0h108v108h-108z" />
10
-    <path
11
-        android:fillColor="#00000000"
12
-        android:pathData="M9,0L9,108"
13
-        android:strokeColor="#33FFFFFF"
14
-        android:strokeWidth="0.8" />
15
-    <path
16
-        android:fillColor="#00000000"
17
-        android:pathData="M19,0L19,108"
18
-        android:strokeColor="#33FFFFFF"
19
-        android:strokeWidth="0.8" />
20
-    <path
21
-        android:fillColor="#00000000"
22
-        android:pathData="M29,0L29,108"
23
-        android:strokeColor="#33FFFFFF"
24
-        android:strokeWidth="0.8" />
25
-    <path
26
-        android:fillColor="#00000000"
27
-        android:pathData="M39,0L39,108"
28
-        android:strokeColor="#33FFFFFF"
29
-        android:strokeWidth="0.8" />
30
-    <path
31
-        android:fillColor="#00000000"
32
-        android:pathData="M49,0L49,108"
33
-        android:strokeColor="#33FFFFFF"
34
-        android:strokeWidth="0.8" />
35
-    <path
36
-        android:fillColor="#00000000"
37
-        android:pathData="M59,0L59,108"
38
-        android:strokeColor="#33FFFFFF"
39
-        android:strokeWidth="0.8" />
40
-    <path
41
-        android:fillColor="#00000000"
42
-        android:pathData="M69,0L69,108"
43
-        android:strokeColor="#33FFFFFF"
44
-        android:strokeWidth="0.8" />
45
-    <path
46
-        android:fillColor="#00000000"
47
-        android:pathData="M79,0L79,108"
48
-        android:strokeColor="#33FFFFFF"
49
-        android:strokeWidth="0.8" />
50
-    <path
51
-        android:fillColor="#00000000"
52
-        android:pathData="M89,0L89,108"
53
-        android:strokeColor="#33FFFFFF"
54
-        android:strokeWidth="0.8" />
55
-    <path
56
-        android:fillColor="#00000000"
57
-        android:pathData="M99,0L99,108"
58
-        android:strokeColor="#33FFFFFF"
59
-        android:strokeWidth="0.8" />
60
-    <path
61
-        android:fillColor="#00000000"
62
-        android:pathData="M0,9L108,9"
63
-        android:strokeColor="#33FFFFFF"
64
-        android:strokeWidth="0.8" />
65
-    <path
66
-        android:fillColor="#00000000"
67
-        android:pathData="M0,19L108,19"
68
-        android:strokeColor="#33FFFFFF"
69
-        android:strokeWidth="0.8" />
70
-    <path
71
-        android:fillColor="#00000000"
72
-        android:pathData="M0,29L108,29"
73
-        android:strokeColor="#33FFFFFF"
74
-        android:strokeWidth="0.8" />
75
-    <path
76
-        android:fillColor="#00000000"
77
-        android:pathData="M0,39L108,39"
78
-        android:strokeColor="#33FFFFFF"
79
-        android:strokeWidth="0.8" />
80
-    <path
81
-        android:fillColor="#00000000"
82
-        android:pathData="M0,49L108,49"
83
-        android:strokeColor="#33FFFFFF"
84
-        android:strokeWidth="0.8" />
85
-    <path
86
-        android:fillColor="#00000000"
87
-        android:pathData="M0,59L108,59"
88
-        android:strokeColor="#33FFFFFF"
89
-        android:strokeWidth="0.8" />
90
-    <path
91
-        android:fillColor="#00000000"
92
-        android:pathData="M0,69L108,69"
93
-        android:strokeColor="#33FFFFFF"
94
-        android:strokeWidth="0.8" />
95
-    <path
96
-        android:fillColor="#00000000"
97
-        android:pathData="M0,79L108,79"
98
-        android:strokeColor="#33FFFFFF"
99
-        android:strokeWidth="0.8" />
100
-    <path
101
-        android:fillColor="#00000000"
102
-        android:pathData="M0,89L108,89"
103
-        android:strokeColor="#33FFFFFF"
104
-        android:strokeWidth="0.8" />
105
-    <path
106
-        android:fillColor="#00000000"
107
-        android:pathData="M0,99L108,99"
108
-        android:strokeColor="#33FFFFFF"
109
-        android:strokeWidth="0.8" />
110
-    <path
111
-        android:fillColor="#00000000"
112
-        android:pathData="M19,29L89,29"
113
-        android:strokeColor="#33FFFFFF"
114
-        android:strokeWidth="0.8" />
115
-    <path
116
-        android:fillColor="#00000000"
117
-        android:pathData="M19,39L89,39"
118
-        android:strokeColor="#33FFFFFF"
119
-        android:strokeWidth="0.8" />
120
-    <path
121
-        android:fillColor="#00000000"
122
-        android:pathData="M19,49L89,49"
123
-        android:strokeColor="#33FFFFFF"
124
-        android:strokeWidth="0.8" />
125
-    <path
126
-        android:fillColor="#00000000"
127
-        android:pathData="M19,59L89,59"
128
-        android:strokeColor="#33FFFFFF"
129
-        android:strokeWidth="0.8" />
130
-    <path
131
-        android:fillColor="#00000000"
132
-        android:pathData="M19,69L89,69"
133
-        android:strokeColor="#33FFFFFF"
134
-        android:strokeWidth="0.8" />
135
-    <path
136
-        android:fillColor="#00000000"
137
-        android:pathData="M19,79L89,79"
138
-        android:strokeColor="#33FFFFFF"
139
-        android:strokeWidth="0.8" />
140
-    <path
141
-        android:fillColor="#00000000"
142
-        android:pathData="M29,19L29,89"
143
-        android:strokeColor="#33FFFFFF"
144
-        android:strokeWidth="0.8" />
145
-    <path
146
-        android:fillColor="#00000000"
147
-        android:pathData="M39,19L39,89"
148
-        android:strokeColor="#33FFFFFF"
149
-        android:strokeWidth="0.8" />
150
-    <path
151
-        android:fillColor="#00000000"
152
-        android:pathData="M49,19L49,89"
153
-        android:strokeColor="#33FFFFFF"
154
-        android:strokeWidth="0.8" />
155
-    <path
156
-        android:fillColor="#00000000"
157
-        android:pathData="M59,19L59,89"
158
-        android:strokeColor="#33FFFFFF"
159
-        android:strokeWidth="0.8" />
160
-    <path
161
-        android:fillColor="#00000000"
162
-        android:pathData="M69,19L69,89"
163
-        android:strokeColor="#33FFFFFF"
164
-        android:strokeWidth="0.8" />
165
-    <path
166
-        android:fillColor="#00000000"
167
-        android:pathData="M79,19L79,89"
168
-        android:strokeColor="#33FFFFFF"
169
-        android:strokeWidth="0.8" />
170
-</vector>

BIN
android/app/src/main/res/drawable/splash.png


+ 0 - 12
android/app/src/main/res/layout/activity_main.xml

@@ -1,12 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    xmlns:app="http://schemas.android.com/apk/res-auto"
4
-    xmlns:tools="http://schemas.android.com/tools"
5
-    android:layout_width="match_parent"
6
-    android:layout_height="match_parent"
7
-    tools:context=".MainActivity">
8
-
9
-    <WebView
10
-        android:layout_width="match_parent"
11
-        android:layout_height="match_parent" />
12
-</androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 0 - 5
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -1,5 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@color/ic_launcher_background"/>
4
-    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5
-</adaptive-icon>

+ 0 - 5
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -1,5 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@color/ic_launcher_background"/>
4
-    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5
-</adaptive-icon>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 0 - 4
android/app/src/main/res/values/ic_launcher_background.xml

@@ -1,4 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<resources>
3
-    <color name="ic_launcher_background">#FFFFFF</color>
4
-</resources>

+ 0 - 7
android/app/src/main/res/values/strings.xml

@@ -1,7 +0,0 @@
1
-<?xml version='1.0' encoding='utf-8'?>
2
-<resources>
3
-    <string name="app_name">whitesports</string>
4
-    <string name="title_activity_main">whitesports</string>
5
-    <string name="package_name">net.simplico.whitesports</string>
6
-    <string name="custom_url_scheme">net.simplico.whitesports</string>
7
-</resources>

+ 0 - 22
android/app/src/main/res/values/styles.xml

@@ -1,22 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<resources>
3
-
4
-    <!-- Base application theme. -->
5
-    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
6
-        <!-- Customize your theme here. -->
7
-        <item name="colorPrimary">@color/colorPrimary</item>
8
-        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
9
-        <item name="colorAccent">@color/colorAccent</item>
10
-    </style>
11
-
12
-    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
13
-        <item name="windowActionBar">false</item>
14
-        <item name="windowNoTitle">true</item>
15
-        <item name="android:background">@null</item>
16
-    </style>
17
-
18
-
19
-    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
20
-        <item name="android:background">@drawable/splash</item>
21
-    </style>
22
-</resources>

+ 0 - 46
android/app/src/main/res/xml/config.xml

@@ -1,46 +0,0 @@
1
-<?xml version='1.0' encoding='utf-8'?>
2
-<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3
-  <access origin="*" />
4
-  
5
-  <feature name="CordovaHttpPlugin">
6
-    <param name="android-package" value="com.synconset.cordovahttp.CordovaHttpPlugin"/>
7
-  </feature>
8
-
9
-  <feature name="File">
10
-    <param name="android-package" value="org.apache.cordova.file.FileUtils"/>
11
-    <param name="onload" value="true"/>
12
-  </feature>
13
-
14
-  <feature name="NativeStorage">
15
-    <param name="android-package" value="NativeStorage"/>
16
-  </feature>
17
-
18
-  <feature name="Device">
19
-    <param name="android-package" value="org.apache.cordova.device.Device"/>
20
-  </feature>
21
-
22
-  <feature name="InAppBrowser">
23
-    <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
24
-  </feature>
25
-
26
-  <feature name="UserAgent">
27
-    <param name="android-package" value="im.ltdev.cordova.UserAgent"/>
28
-    <param name="onload" value="true"/>
29
-  </feature>
30
-
31
-  <feature name="Whitelist">
32
-    <param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin"/>
33
-    <param name="onload" value="true"/>
34
-  </feature>
35
-
36
-  
37
-  <preference name="ScrollEnabled" value="false" />
38
-  <preference name="android-minSdkVersion" value="28" />
39
-  <preference name="android-targetSdkVersion" value="28" />
40
-  <preference name="BackupWebStorage" value="none" />
41
-  <preference name="SplashMaintainAspectRatio" value="true" />
42
-  <preference name="FadeSplashScreenDuration" value="300" />
43
-  <preference name="SplashShowOnlyFirstTime" value="false" />
44
-  <preference name="SplashScreen" value="screen" />
45
-  <preference name="SplashScreenDelay" value="3000" />
46
-</widget>

+ 0 - 5
android/app/src/main/res/xml/file_paths.xml

@@ -1,5 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<paths xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <external-path name="my_images" path="." />
4
-    <cache-path name="my_cache_images" path="." />
5
-</paths>

+ 0 - 18
android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java

@@ -1,18 +0,0 @@
1
-package com.getcapacitor.myapp;
2
-
3
-import static org.junit.Assert.*;
4
-
5
-import org.junit.Test;
6
-
7
-/**
8
- * Example local unit test, which will execute on the development machine (host).
9
- *
10
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11
- */
12
-public class ExampleUnitTest {
13
-
14
-    @Test
15
-    public void addition_isCorrect() throws Exception {
16
-        assertEquals(4, 2 + 2);
17
-    }
18
-}

+ 0 - 29
android/build.gradle

@@ -1,29 +0,0 @@
1
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
-
3
-buildscript {
4
-    
5
-    repositories {
6
-        google()
7
-        jcenter()
8
-    }
9
-    dependencies {
10
-        classpath 'com.android.tools.build:gradle:4.2.1'
11
-        classpath 'com.google.gms:google-services:4.3.5'
12
-
13
-        // NOTE: Do not place your application dependencies here; they belong
14
-        // in the individual module build.gradle files
15
-    }
16
-}
17
-
18
-apply from: "variables.gradle"
19
-
20
-allprojects {
21
-    repositories {
22
-        google()
23
-        jcenter()
24
-    }
25
-}
26
-
27
-task clean(type: Delete) {
28
-    delete rootProject.buildDir
29
-}

+ 0 - 15
android/capacitor.settings.gradle

@@ -1,15 +0,0 @@
1
-// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2
-include ':capacitor-android'
3
-project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
4
-
5
-include ':capacitor-app'
6
-project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
7
-
8
-include ':capacitor-haptics'
9
-project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
10
-
11
-include ':capacitor-keyboard'
12
-project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
13
-
14
-include ':capacitor-status-bar'
15
-project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

+ 0 - 24
android/gradle.properties

@@ -1,24 +0,0 @@
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
-org.gradle.jvmargs=-Xmx1536m
13
-
14
-# When configured, Gradle will run in incubating parallel mode.
15
-# This option should only be used with decoupled projects. More details, visit
16
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17
-# org.gradle.parallel=true
18
-
19
-# AndroidX package structure to make it clearer which packages are bundled with the
20
-# Android operating system, and which are packaged with your app's APK
21
-# https://developer.android.com/topic/libraries/support-library/androidx-rn
22
-android.useAndroidX=true
23
-# Automatically convert third-party libraries to use AndroidX
24
-android.enableJetifier=true

BIN
android/gradle/wrapper/gradle-wrapper.jar


+ 0 - 5
android/gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +0,0 @@
1
-distributionBase=GRADLE_USER_HOME
2
-distributionPath=wrapper/dists
3
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
4
-zipStoreBase=GRADLE_USER_HOME
5
-zipStorePath=wrapper/dists

+ 0 - 185
android/gradlew

@@ -1,185 +0,0 @@
1
-#!/usr/bin/env sh
2
-
3
-#
4
-# Copyright 2015 the original author or authors.
5
-#
6
-# Licensed under the Apache License, Version 2.0 (the "License");
7
-# you may not use this file except in compliance with the License.
8
-# You may obtain a copy of the License at
9
-#
10
-#      https://www.apache.org/licenses/LICENSE-2.0
11
-#
12
-# Unless required by applicable law or agreed to in writing, software
13
-# distributed under the License is distributed on an "AS IS" BASIS,
14
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
-# See the License for the specific language governing permissions and
16
-# limitations under the License.
17
-#
18
-
19
-##############################################################################
20
-##
21
-##  Gradle start up script for UN*X
22
-##
23
-##############################################################################
24
-
25
-# Attempt to set APP_HOME
26
-# Resolve links: $0 may be a link
27
-PRG="$0"
28
-# Need this for relative symlinks.
29
-while [ -h "$PRG" ] ; do
30
-    ls=`ls -ld "$PRG"`
31
-    link=`expr "$ls" : '.*-> \(.*\)$'`
32
-    if expr "$link" : '/.*' > /dev/null; then
33
-        PRG="$link"
34
-    else
35
-        PRG=`dirname "$PRG"`"/$link"
36
-    fi
37
-done
38
-SAVED="`pwd`"
39
-cd "`dirname \"$PRG\"`/" >/dev/null
40
-APP_HOME="`pwd -P`"
41
-cd "$SAVED" >/dev/null
42
-
43
-APP_NAME="Gradle"
44
-APP_BASE_NAME=`basename "$0"`
45
-
46
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48
-
49
-# Use the maximum available, or set MAX_FD != -1 to use that value.
50
-MAX_FD="maximum"
51
-
52
-warn () {
53
-    echo "$*"
54
-}
55
-
56
-die () {
57
-    echo
58
-    echo "$*"
59
-    echo
60
-    exit 1
61
-}
62
-
63
-# OS specific support (must be 'true' or 'false').
64
-cygwin=false
65
-msys=false
66
-darwin=false
67
-nonstop=false
68
-case "`uname`" in
69
-  CYGWIN* )
70
-    cygwin=true
71
-    ;;
72
-  Darwin* )
73
-    darwin=true
74
-    ;;
75
-  MINGW* )
76
-    msys=true
77
-    ;;
78
-  NONSTOP* )
79
-    nonstop=true
80
-    ;;
81
-esac
82
-
83
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84
-
85
-
86
-# Determine the Java command to use to start the JVM.
87
-if [ -n "$JAVA_HOME" ] ; then
88
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89
-        # IBM's JDK on AIX uses strange locations for the executables
90
-        JAVACMD="$JAVA_HOME/jre/sh/java"
91
-    else
92
-        JAVACMD="$JAVA_HOME/bin/java"
93
-    fi
94
-    if [ ! -x "$JAVACMD" ] ; then
95
-        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96
-
97
-Please set the JAVA_HOME variable in your environment to match the
98
-location of your Java installation."
99
-    fi
100
-else
101
-    JAVACMD="java"
102
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103
-
104
-Please set the JAVA_HOME variable in your environment to match the
105
-location of your Java installation."
106
-fi
107
-
108
-# Increase the maximum file descriptors if we can.
109
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110
-    MAX_FD_LIMIT=`ulimit -H -n`
111
-    if [ $? -eq 0 ] ; then
112
-        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113
-            MAX_FD="$MAX_FD_LIMIT"
114
-        fi
115
-        ulimit -n $MAX_FD
116
-        if [ $? -ne 0 ] ; then
117
-            warn "Could not set maximum file descriptor limit: $MAX_FD"
118
-        fi
119
-    else
120
-        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121
-    fi
122
-fi
123
-
124
-# For Darwin, add options to specify how the application appears in the dock
125
-if $darwin; then
126
-    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127
-fi
128
-
129
-# For Cygwin or MSYS, switch paths to Windows format before running java
130
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131
-    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132
-    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133
-
134
-    JAVACMD=`cygpath --unix "$JAVACMD"`
135
-
136
-    # We build the pattern for arguments to be converted via cygpath
137
-    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138
-    SEP=""
139
-    for dir in $ROOTDIRSRAW ; do
140
-        ROOTDIRS="$ROOTDIRS$SEP$dir"
141
-        SEP="|"
142
-    done
143
-    OURCYGPATTERN="(^($ROOTDIRS))"
144
-    # Add a user-defined pattern to the cygpath arguments
145
-    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146
-        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147
-    fi
148
-    # Now convert the arguments - kludge to limit ourselves to /bin/sh
149
-    i=0
150
-    for arg in "$@" ; do
151
-        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152
-        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
153
-
154
-        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
155
-            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156
-        else
157
-            eval `echo args$i`="\"$arg\""
158
-        fi
159
-        i=`expr $i + 1`
160
-    done
161
-    case $i in
162
-        0) set -- ;;
163
-        1) set -- "$args0" ;;
164
-        2) set -- "$args0" "$args1" ;;
165
-        3) set -- "$args0" "$args1" "$args2" ;;
166
-        4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167
-        5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168
-        6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169
-        7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170
-        8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171
-        9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172
-    esac
173
-fi
174
-
175
-# Escape application args
176
-save () {
177
-    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178
-    echo " "
179
-}
180
-APP_ARGS=`save "$@"`
181
-
182
-# Collect all arguments for the java command, following the shell quoting and substitution rules
183
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184
-
185
-exec "$JAVACMD" "$@"

+ 0 - 89
android/gradlew.bat

@@ -1,89 +0,0 @@
1
-@rem
2
-@rem Copyright 2015 the original author or authors.
3
-@rem
4
-@rem Licensed under the Apache License, Version 2.0 (the "License");
5
-@rem you may not use this file except in compliance with the License.
6
-@rem You may obtain a copy of the License at
7
-@rem
8
-@rem      https://www.apache.org/licenses/LICENSE-2.0
9
-@rem
10
-@rem Unless required by applicable law or agreed to in writing, software
11
-@rem distributed under the License is distributed on an "AS IS" BASIS,
12
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-@rem See the License for the specific language governing permissions and
14
-@rem limitations under the License.
15
-@rem
16
-
17
-@if "%DEBUG%" == "" @echo off
18
-@rem ##########################################################################
19
-@rem
20
-@rem  Gradle startup script for Windows
21
-@rem
22
-@rem ##########################################################################
23
-
24
-@rem Set local scope for the variables with windows NT shell
25
-if "%OS%"=="Windows_NT" setlocal
26
-
27
-set DIRNAME=%~dp0
28
-if "%DIRNAME%" == "" set DIRNAME=.
29
-set APP_BASE_NAME=%~n0
30
-set APP_HOME=%DIRNAME%
31
-
32
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34
-
35
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37
-
38
-@rem Find java.exe
39
-if defined JAVA_HOME goto findJavaFromJavaHome
40
-
41
-set JAVA_EXE=java.exe
42
-%JAVA_EXE% -version >NUL 2>&1
43
-if "%ERRORLEVEL%" == "0" goto execute
44
-
45
-echo.
46
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47
-echo.
48
-echo Please set the JAVA_HOME variable in your environment to match the
49
-echo location of your Java installation.
50
-
51
-goto fail
52
-
53
-:findJavaFromJavaHome
54
-set JAVA_HOME=%JAVA_HOME:"=%
55
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56
-
57
-if exist "%JAVA_EXE%" goto execute
58
-
59
-echo.
60
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61
-echo.
62
-echo Please set the JAVA_HOME variable in your environment to match the
63
-echo location of your Java installation.
64
-
65
-goto fail
66
-
67
-:execute
68
-@rem Setup the command line
69
-
70
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71
-
72
-
73
-@rem Execute Gradle
74
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75
-
76
-:end
77
-@rem End local scope for the variables with windows NT shell
78
-if "%ERRORLEVEL%"=="0" goto mainEnd
79
-
80
-:fail
81
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82
-rem the _cmd.exe /c_ return code!
83
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84
-exit /b 1
85
-
86
-:mainEnd
87
-if "%OS%"=="Windows_NT" endlocal
88
-
89
-:omega

+ 0 - 5
android/settings.gradle

@@ -1,5 +0,0 @@
1
-include ':app'
2
-include ':capacitor-cordova-android-plugins'
3
-project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
4
-
5
-apply from: 'capacitor.settings.gradle'

+ 0 - 14
android/variables.gradle

@@ -1,14 +0,0 @@
1
-ext {
2
-    minSdkVersion = 21
3
-    compileSdkVersion = 30
4
-    targetSdkVersion = 30
5
-    androidxActivityVersion = '1.2.0'
6
-    androidxAppCompatVersion = '1.2.0'
7
-    androidxCoordinatorLayoutVersion = '1.1.0'
8
-    androidxCoreVersion = '1.3.2'
9
-    androidxFragmentVersion = '1.3.0'
10
-    junitVersion = '4.13.1'
11
-    androidxJunitVersion = '1.1.2'
12
-    androidxEspressoCoreVersion = '3.3.0'
13
-    cordovaAndroidVersion = '7.0.0'
14
-}

+ 0 - 23
capacitor.config.ts

@@ -1,23 +0,0 @@
1
-import { CapacitorConfig } from '@capacitor/cli';
2
-
3
-const config: CapacitorConfig = {
4
-  appId: 'io.ionic.starter',
5
-  appName: 'Stark',
6
-  webDir: 'www',
7
-  bundledWebRuntime: false,
8
-  cordova: {
9
-    preferences: {
10
-      ScrollEnabled: 'false',
11
-      'android-minSdkVersion': '28',
12
-      'android-targetSdkVersion': '28',
13
-      BackupWebStorage: 'none',
14
-      SplashMaintainAspectRatio: 'true',
15
-      FadeSplashScreenDuration: '300',
16
-      SplashShowOnlyFirstTime: 'false',
17
-      SplashScreen: 'screen',
18
-      SplashScreenDelay: '3000'
19
-    }
20
-  }
21
-};
22
-
23
-export default config;

+ 5 - 7
config.xml

@@ -1,7 +1,7 @@
1 1
 <?xml version='1.0' encoding='utf-8'?>
2
-<widget id="net.simplico.whitesports" version="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2
+<widget id="net.simplico.whitesports" version="1.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3 3
     <name>White Sports</name>
4
-    <description>Burn More, Get More</description>
4
+    <description>Virtual Run Mobile App</description>
5 5
     <author email="patumos@gmail.com" href="http://www.simplico.net/">Suebpong Sittimalairut</author>
6 6
     <content src="index.html" />
7 7
     <access origin="*" />
@@ -13,14 +13,15 @@
13 13
     <allow-intent href="geo:*" />
14 14
     <allow-intent href="line://*/*" />
15 15
     <preference name="ScrollEnabled" value="false" />
16
-    <preference name="android-minSdkVersion" value="28" />
17
-    <preference name="android-targetSdkVersion" value="28" />
16
+    <preference name="android-minSdkVersion" value="30" />
17
+    <preference name="android-targetSdkVersion" value="30" />
18 18
     <preference name="BackupWebStorage" value="none" />
19 19
     <preference name="SplashMaintainAspectRatio" value="true" />
20 20
     <preference name="FadeSplashScreenDuration" value="300" />
21 21
     <preference name="SplashShowOnlyFirstTime" value="false" />
22 22
     <preference name="SplashScreen" value="screen" />
23 23
     <preference name="SplashScreenDelay" value="3000" />
24
+    <preference name="InAppBrowserOverrideUserAgent" value="Mozilla/5.0 Google" />
24 25
     <platform name="android">
25 26
         <allow-intent href="market:*" />
26 27
         <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
@@ -60,9 +61,6 @@
60 61
         <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
61 62
         <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
62 63
         <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
63
-        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
64
-        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
65
-        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
66 64
         <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
67 65
         <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
68 66
         <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />

+ 1 - 2
ionic.config.json

@@ -1,8 +1,7 @@
1 1
 {
2 2
   "name": "Stark",
3 3
   "integrations": {
4
-    "cordova": {},
5
-    "capacitor": {}
4
+    "cordova": {}
6 5
   },
7 6
   "type": "ionic-angular"
8 7
 }

BIN
my-release-key.keystore


File diff suppressed because it is too large
+ 108 - 1060
package-lock.json


+ 8 - 26
package.json

@@ -21,19 +21,12 @@
21 21
     "@angular/http": "5.2.10",
22 22
     "@angular/platform-browser": "5.2.10",
23 23
     "@angular/platform-browser-dynamic": "5.2.10",
24
-    "@capacitor/android": "^3.2.5",
25
-    "@capacitor/app": "1.0.3",
26
-    "@capacitor/core": "3.2.5",
27
-    "@capacitor/haptics": "1.1.0",
28
-    "@capacitor/ios": "^3.2.4",
29
-    "@capacitor/keyboard": "1.1.0",
30
-    "@capacitor/status-bar": "1.0.3",
31 24
     "@ionic-native/core": "4.7.0",
32 25
     "@ionic-native/device": "^4.7.0",
33 26
     "@ionic-native/health": "^4.7.0",
34
-    "@ionic-native/http": "^4.9.1",
27
+    "@ionic-native/http": "^4.20.0",
35 28
     "@ionic-native/in-app-browser": "^4.7.0",
36
-    "@ionic-native/native-storage": "^4.20.0",
29
+    "@ionic-native/native-storage": "^4.7.0",
37 30
     "@ionic-native/social-sharing": "^4.7.0",
38 31
     "@ionic-native/splash-screen": "4.7.0",
39 32
     "@ionic-native/status-bar": "4.7.0",
@@ -42,8 +35,8 @@
42 35
     "@swimlane/ngx-charts": "^8.1.0",
43 36
     "angular2-humanize": "^2.1.0",
44 37
     "cordova-plugin-advanced-http": "^1.11.1",
45
-    "cordova-plugin-file": "^6.0.2",
46
-    "cordova-plugin-nativestorage": "^2.3.2",
38
+    "cordova-plugin-file": "^6.0.1",
39
+    "cordova-plugin-ionic-webview": "^5.0.0",
47 40
     "es6-promise-plugin": "4.2.2",
48 41
     "ionic-angular": "3.9.2",
49 42
     "ionicons": "3.0.0",
@@ -56,38 +49,27 @@
56 49
     "zone.js": "0.8.26"
57 50
   },
58 51
   "devDependencies": {
59
-    "@capacitor/cli": "3.2.5",
60 52
     "@ionic/app-scripts": "^3.2.4",
61
-    "cordova-android": "^9.0.0",
62 53
     "cordova-ios": "^6.2.0",
63
-    "cordova-plugin-device": "^2.0.3",
64 54
     "cordova-plugin-inappbrowser": "^5.0.0",
65
-    "cordova-plugin-ionic-keyboard": "^2.0.5",
66
-    "cordova-plugin-splashscreen": "^5.0.4",
67
-    "cordova-plugin-useragent": "^1.0.6",
68
-    "cordova-plugin-whitelist": "^1.3.5",
69 55
     "typescript": "~2.6.2"
70 56
   },
71 57
   "description": "An Ionic project",
72 58
   "cordova": {
73 59
     "plugins": {
60
+      "cordova-plugin-ionic-webview": {},
74 61
       "cordova-plugin-advanced-http": {},
75
-      "cordova-plugin-x-socialsharing": {
76
-        "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
77
-        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
78
-      },
62
+      "cordova-plugin-x-socialsharing": {},
79 63
       "cordova-plugin-nativestorage": {},
80 64
       "cordova-plugin-ionic-keyboard": {},
81 65
       "cordova-plugin-splashscreen": {},
82 66
       "cordova-plugin-device": {},
83 67
       "cordova-plugin-whitelist": {},
84
-      "cordova-plugin-inappbrowser": {},
85
-      "im.ltdev.cordova.UserAgent": {},
86
-      "cordova-plugin-ionic-webview": {}
68
+      "cordova-plugin-inappbrowser": {}
87 69
     },
88 70
     "platforms": [
89 71
       "ios",
90 72
       "android"
91 73
     ]
92 74
   }
93
-}
75
+}

BIN
resources/icon-android.png


BIN
resources/ios/icon/icon-small.png


BIN
resources/ios/icon/icon-small@2x.png


BIN
resources/ios/icon/icon-small@3x.png


BIN
src/assets/imgs/run-event.jpg


+ 2 - 1
src/pages/detail/detail.html

@@ -49,7 +49,8 @@
49 49
         <div *ngIf="linkRec" text-center> 
50 50
             <a ion-button full [href]="linkRec" style="margin-bottom:20px; margin-top:20px">รับ Coupon</a>
51 51
         </div> -->
52
-        {{ product.cal_return }}
52
+        <!--
53
+            {{ product.cal_return }} -->
53 54
         <div *ngIf="product.cal_return > 0">
54 55
         <button ion-button full color="danger" (click)="cutPoint()" icon-start><ion-icon name="md-pricetag"></ion-icon> 
55 56
             แลกคูปอง / Redeem Coupon

+ 31 - 2
src/pages/event/event.html

@@ -7,16 +7,45 @@
7 7
 <ion-header>
8 8
 
9 9
   <ion-navbar color="primary">
10
-    <ion-title>Burn More Get More</ion-title>
10
+    <ion-title><img src="assets/imgs/ss-small.png" class='top-logo'>
11
+    </ion-title>
11 12
   </ion-navbar>
12 13
 </ion-header>
13 14
 
14 15
 
15 16
 <ion-content>
17
+    <ion-card *ngFor="let p of eventPosts">
18
+
19
+
20
+    <img [src]="p.jetpack_featured_media_url"/>
21
+
22
+  <ion-card-content>
23
+      <h2>{{ p.title.rendered }}</h2>
24
+  </ion-card-content>
25
+
26
+  <ion-row>
27
+    <ion-col>
28
+      <button ion-button icon-start color='dark' block (click)="openLink(p.guid.rendered)">
29
+        <ion-icon name="thumbs-up"></ion-icon>
30
+        Read
31
+      </button>
32
+    </ion-col>
33
+    <ion-col>
34
+      <button ion-button icon-start color='success' block>
35
+        <ion-icon name="text"></ion-icon>
36
+        <div>Join</div>
37
+      </button>
38
+    </ion-col>
39
+  </ion-row>
40
+
41
+</ion-card>
16 42
  <ion-refresher (ionRefresh)="refreshEvent($event)">
17 43
     <ion-refresher-content></ion-refresher-content>
18 44
   </ion-refresher>
19
-<event-chart></event-chart>
45
+  <!-- 
46
+  <event-chart></event-chart> -->
47
+  <!--
48
+  <img src="assets/imgs/run-event.jpg" width="100%"  /> -->
20 49
 <div>
21 50
     <ion-list-header *ngIf="allRunners" text-center>
22 51
         Total users: {{ format(allRunners.tuser + '') }} / activities: {{ format(allRunners.tact +'') }}

+ 11 - 0
src/pages/event/event.ts

@@ -44,6 +44,8 @@ export class EventPage {
44 44
     colorScheme = {
45 45
         domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
46 46
     };
47
+    eventPosts: Array<any>;
48
+
47 49
     constructor(public navCtrl: NavController, public navParams: NavParams,
48 50
         private hp: HealthProvider,
49 51
         private ns: NativeStorage,
@@ -81,6 +83,15 @@ export class EventPage {
81 83
             .then( data => { 
82 84
                 this.po = data
83 85
             }, error => this.po = null);
86
+
87
+
88
+        this.hp.getWPPostCat(46, 1)
89
+            .then( data => {
90
+                this.eventPosts = JSON.parse(data.data);
91
+            }, error => {
92
+                console.log("errors");
93
+                console.log(""+error);
94
+            });
84 95
     }
85 96
 
86 97
     ionViewDidLoad() {

+ 2 - 2
src/pages/home/home.html

@@ -56,7 +56,7 @@
56 56
 -->
57 57
   </ion-card> 
58 58
   
59
-<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
59
+<ion-infinite-scroll (ionInfinite)="doInfinite2($event)">
60 60
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
61
-</ion-infinite-scroll> 
61
+</ion-infinite-scroll>  
62 62
 </ion-content>

+ 25 - 5
src/pages/home/home.ts

@@ -30,14 +30,18 @@ export class HomePage {
30 30
     }
31 31
     ionViewWillEnter() {
32 32
         console.log("view will enter");
33
-        this.healthProvider.getWPPostCat(30)
34
-            .subscribe( data => {
35
-                console.log(data);
36
-                this.wpPosts = data;
37
-            } );
38 33
     }
39 34
 
40 35
     ionViewDidEnter() {
36
+        this.healthProvider.getWPPostCat(30, this.postPage++)
37
+            .then( data => {
38
+                console.log(data);
39
+                this.wpPosts = JSON.parse(data.data);
40
+                console.log(this.wpPosts);
41
+            }, error => {
42
+                console.log("errors");
43
+                console.log(""+error);
44
+            });
41 45
         /*
42 46
         this.healthProvider.getProducts()
43 47
             .subscribe(data => { 
@@ -62,6 +66,22 @@ export class HomePage {
62 66
          this.ab.create(link, '_blank');
63 67
     }
64 68
 	
69
+	doInfinite2(infiniteScroll) {
70
+		console.log('Begin async operation');
71
+
72
+        this.healthProvider.getWPPostCat(30, this.postPage++)
73
+            .then( data => {
74
+                console.log(data);
75
+                let d = JSON.parse(data.data);
76
+				this.wpPosts = this.wpPosts.concat(d);
77
+				console.log('Async operation has ended');
78
+				infiniteScroll.complete();
79
+            }, error => {
80
+                infiniteScroll.enable(false);
81
+                this.haveMore = false;
82
+                return;	
83
+            });
84
+	}
65 85
 	doInfinite(infiniteScroll) {
66 86
 		console.log('Begin async operation');
67 87
 

+ 37 - 0
src/pages/login/login.html

@@ -69,6 +69,43 @@
69 69
                                     {{ profileObject.city }} {{ profileObject.state }} {{ profileObject.country }}<br>
70 70
                                     {{ profileObject.description }}
71 71
                                     </p>
72
+                                    <form #f="ngForm" (ngSubmit)="profileSave(f)">
73
+                                    <ion-input placeholder="Enter Your Firstname and Lastname" [(ngModel)]="profile.fullName"  required=true name="fullName" #fullName="ngModel"></ion-input>
74
+
75
+                                    <ion-label color="danger" *ngIf="fullName.invalid && (fullName.dirty || fullName.touched)">
76
+                                        <div *ngIf="fullName.errors.required">
77
+                                            Name is required.
78
+                                        </div>
79
+                                    </ion-label>
80
+                                    <ion-input placeholder="Enter Email" [(ngModel)]="profile.email" type='email' required name='email' #email="ngModel"></ion-input>
81
+
82
+                                    <ion-label color="danger" *ngIf="email.invalid && (email.dirty || email.touched)">
83
+                                        <div *ngIf="email.errors.required">
84
+                                            Email is required.
85
+                                        </div>
86
+                                    </ion-label>
87
+                                    <ion-input placeholder="Enter Tel." [(ngModel)]="profile.tel" required name='tel' #tel="ngModel"></ion-input>
88
+
89
+                                    <ion-label color="danger" *ngIf="tel.invalid && (tel.dirty || tel.touched)">
90
+                                        <div *ngIf="tel.errors.required">
91
+                                            Tel. is required.
92
+                                        </div>
93
+                                    </ion-label>
94
+                                     <ion-textarea placeholder="Enter Your Address" [(ngModel)]="profile.address" required name='address' #address="ngModel"></ion-textarea>
95
+
96
+                                    <ion-label color="danger" *ngIf="address.invalid && (address.dirty || address.touched)">
97
+                                        <div *ngIf="address.errors.required">
98
+                                            Address is required.
99
+                                        </div>
100
+                                    </ion-label>
101
+                                        <button ion-button  color="primary" name='updateProfile' type='submit' block>
102
+                                            <ion-icon name='save'></ion-icon>
103
+                                            Update Profile
104
+                                        </button>
105
+                                        <!--
106
+                                        {{ f.value | json }}
107
+                                        {{ f.valid | json }} -->
108
+                                    </form>
72 109
                                     <!--
73 110
                                     <dl>
74 111
                                         <dt>Email</dt><dd>{{ profileObject.email }}</dd>

+ 51 - 0
src/pages/login/login.ts

@@ -8,6 +8,8 @@ import { HealthProvider } from '../../providers/health/health';
8 8
 import { CouponViewPage } from '../coupon-view/coupon-view';
9 9
 import { HTTP  } from '@ionic-native/http';
10 10
 import { UserAgent } from '@ionic-native/user-agent';
11
+import {NgForm} from '@angular/forms';
12
+
11 13
 
12 14
 
13 15
 /**
@@ -17,7 +19,15 @@ import { UserAgent } from '@ionic-native/user-agent';
17 19
  * Ionic pages and navigation.
18 20
  */
19 21
 
22
+
23
+class Profile {
24
+    fullName: string;
25
+    email: string;
26
+    tel: string;
27
+    address: string;
28
+}
20 29
 //@IonicPage()
30
+
21 31
 @Component({
22 32
     selector: 'page-login',
23 33
     templateUrl: 'login.html',
@@ -35,6 +45,7 @@ export class LoginPage {
35 45
     imageURL: string;
36 46
     haveSelectAct =  false;
37 47
     haveSelectHistory =  false;
48
+    profile = new Profile();
38 49
 
39 50
     @ViewChild(Content) content: Content;
40 51
 
@@ -65,9 +76,22 @@ export class LoginPage {
65 76
                     this.hp.getMyDetail(this.token)
66 77
                         .subscribe(
67 78
                             acts => { 
79
+                        
80
+                                console.dir(acts.output.athId);
68 81
                                 console.dir(acts.output.firstname, acts.output.lastname);
69 82
                                 this.nativeStorage.setItem('profileObject', acts.output);
70 83
                                 this.profileObject = acts.output;
84
+                                this.hp.getWSProfile(this.profileObject.athId,this.token)
85
+                                    .subscribe( wsdata => {
86
+                                        console.log(JSON.stringify(wsdata));
87
+                                        this.profile.fullName = wsdata['output']['fullName'];
88
+                                        this.profile.tel = wsdata['output']['tel'];
89
+                                        this.profile.email = wsdata['output']['email'];
90
+                                        this.profile.address = wsdata['output']['address'];
91
+                                        console.log(JSON.stringify(this.profile));
92
+                                    }, error => {
93
+                                        console.log("error "+error);
94
+                                    } );
71 95
                                 this.isLogin = true;
72 96
 
73 97
                             },
@@ -142,6 +166,33 @@ export class LoginPage {
142 166
             console.log("seg ", this.seg);
143 167
         }   
144 168
     }
169
+    saveProfile() {
170
+        console.log(JSON.stringify(this.profile));
171
+    }
172
+
173
+    profileSave(f: NgForm) {
174
+        if(f.valid) {
175
+            console.log(JSON.stringify(f.value));
176
+            let profile = {
177
+                athId: this.profileObject.athId,
178
+                fullName: f.value.fullName,
179
+                email: f.value.email,
180
+                tel: f.value.tel,
181
+                address: f.value.address,
182
+                token: this.token,
183
+            };
184
+            this.hp.saveWSProfile(profile)
185
+                .subscribe(
186
+                    data => {
187
+                        console.log(data);
188
+                        alert("Your profile was updated")
189
+                    },
190
+                    error => {
191
+                        console.log(error);
192
+                    }
193
+                );
194
+        } // false
195
+    }
145 196
     getMyActivities(fromRefresher = false) {
146 197
         if( this.haveSelectAct == true )
147 198
             return;

+ 18 - 0
src/pages/register/register.html

@@ -0,0 +1,18 @@
1
+<!--
2
+  Generated template for the RegisterPage page.
3
+
4
+  See http://ionicframework.com/docs/components/#navigation for more info on
5
+  Ionic pages and navigation.
6
+-->
7
+<ion-header>
8
+
9
+  <ion-navbar>
10
+    <ion-title>register</ion-title>
11
+  </ion-navbar>
12
+
13
+</ion-header>
14
+
15
+
16
+<ion-content padding>
17
+
18
+</ion-content>

+ 13 - 0
src/pages/register/register.module.ts

@@ -0,0 +1,13 @@
1
+import { NgModule } from '@angular/core';
2
+import { IonicPageModule } from 'ionic-angular';
3
+import { RegisterPage } from './register';
4
+
5
+@NgModule({
6
+  declarations: [
7
+    RegisterPage,
8
+  ],
9
+  imports: [
10
+    IonicPageModule.forChild(RegisterPage),
11
+  ],
12
+})
13
+export class RegisterPageModule {}

+ 3 - 0
src/pages/register/register.scss

@@ -0,0 +1,3 @@
1
+page-register {
2
+
3
+}

+ 25 - 0
src/pages/register/register.ts

@@ -0,0 +1,25 @@
1
+import { Component } from '@angular/core';
2
+import { IonicPage, NavController, NavParams } from 'ionic-angular';
3
+
4
+/**
5
+ * Generated class for the RegisterPage page.
6
+ *
7
+ * See https://ionicframework.com/docs/components/#navigation for more info on
8
+ * Ionic pages and navigation.
9
+ */
10
+
11
+@IonicPage()
12
+@Component({
13
+  selector: 'page-register',
14
+  templateUrl: 'register.html',
15
+})
16
+export class RegisterPage {
17
+
18
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
19
+  }
20
+
21
+  ionViewDidLoad() {
22
+    console.log('ionViewDidLoad RegisterPage');
23
+  }
24
+
25
+}

+ 12 - 4
src/providers/health/health.ts

@@ -3,6 +3,8 @@ import { Injectable } from '@angular/core';
3 3
 import { Observable } from 'rxjs';
4 4
 import { HttpHeaders } from '@angular/common/http';
5 5
 import { Device } from '@ionic-native/device';
6
+import { HTTP, HTTPResponse } from '@ionic-native/http';
7
+
6 8
 
7 9
 /*
8 10
   Generated class for the HealthProvider provider.
@@ -31,7 +33,7 @@ export class HealthProvider {
31 33
             'Authorization': 'JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicHVibGljIiwicm9sZXMiOlsicHVibGljIl0sImV4cCI6MTczNDE2NTcxMCwiaWF0IjoxNDc0OTY1NzEwLCJuYmYiOjE0NzQ5NjU3MTAsImlkZW50aXR5IjoiNTdlOWVmMjZjMjU0ZmQ4N2Q3ZmQ4MzM2In0.-9fcm5s8qYbdqBDUX7cZJ5J3AX91fe6VrCLs_S-_eBU'
32 34
         })
33 35
     };
34
-    constructor(public http: HttpClient, private dev: Device) {
36
+    constructor(public http: HttpClient, private nhttp: HTTP, private dev: Device) {
35 37
         console.log('Hello HealthProvider Provider');
36 38
         console.log("construct device = ", this.dev.model, this.dev.serial, this.dev.isVirtual);
37 39
     }
@@ -88,9 +90,9 @@ export class HealthProvider {
88 90
         //coment
89 91
         return this.http.post(COREAPI, {action: "LIST", collection: "coredata_post", query: {active: true}, page: page});
90 92
     }
91
-    getWPPostCat(cat_no): Observable<any> {
92
-        
93
-        return this.http.get(WP + "posts?categories="+cat_no);
93
+    getWPPostCat(cat_no, page): Promise<HTTPResponse> {
94
+        console.log(WP + "posts?categories="+cat_no+"&page="+page); 
95
+        return this.nhttp.get(WP + "posts?categories="+cat_no+"&page="+page, {}, {});
94 96
     }
95 97
     recentActs(): Observable<any> {
96 98
         //coment
@@ -107,6 +109,12 @@ export class HealthProvider {
107 109
         console.log("get ath ", athId);
108 110
         return this.http.post(COREAPI, {action: "GETRUNNER", athId: athId});
109 111
     }
112
+    saveWSProfile(profile) {
113
+        return this.http.post(SV_API, {action: "UPDATE_PROFILE", athId: profile['athId'],  fullName: profile['fullName'], email: profile['email'], tel: profile['tel'], address: profile['address'], token: profile['token']});
114
+    }
115
+    getWSProfile(athId, token) {
116
+        return this.http.post(SV_API, {action: "GET_WS_PROFILE", athId: athId,   token: token });
117
+    }
110 118
     /*
111 119
   listNews(token, act): Observable<any> {
112 120
     return this.http.post("http://mcotn-api.simplico.net/api/v2.0/posts", {  action: "LIST", model: {} }, this.httpOptions);

tum/whitesports - Gogs: Simplico Git Service

Aucune description

acf.php 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <?php
  2. /*
  3. Plugin Name: Advanced Custom Fields
  4. Plugin URI: https://www.advancedcustomfields.com
  5. Description: Customize WordPress with powerful, professional and intuitive fields.
  6. Version: 5.11.3
  7. Author: Delicious Brains
  8. Author URI: https://www.advancedcustomfields.com
  9. Text Domain: acf
  10. Domain Path: /lang
  11. */
  12. if ( ! defined( 'ABSPATH' ) ) {
  13. exit; // Exit if accessed directly
  14. }
  15. if ( ! class_exists( 'ACF' ) ) :
  16. class ACF {
  17. /** @var string The plugin version number. */
  18. var $version = '5.11.3';
  19. /** @var array The plugin settings array. */
  20. var $settings = array();
  21. /** @var array The plugin data array. */
  22. var $data = array();
  23. /** @var array Storage for class instances. */
  24. var $instances = array();
  25. /**
  26. * __construct
  27. *
  28. * A dummy constructor to ensure ACF is only setup once.
  29. *
  30. * @date 23/06/12
  31. * @since 5.0.0
  32. *
  33. * @param void
  34. * @return void
  35. */
  36. function __construct() {
  37. // Do nothing.
  38. }
  39. /**
  40. * initialize
  41. *
  42. * Sets up the ACF plugin.
  43. *
  44. * @date 28/09/13
  45. * @since 5.0.0
  46. *
  47. * @param void
  48. * @return void
  49. */
  50. function initialize() {
  51. // Define constants.
  52. $this->define( 'ACF', true );
  53. $this->define( 'ACF_PATH', plugin_dir_path( __FILE__ ) );
  54. $this->define( 'ACF_BASENAME', plugin_basename( __FILE__ ) );
  55. $this->define( 'ACF_VERSION', $this->version );
  56. $this->define( 'ACF_MAJOR_VERSION', 5 );
  57. // Define settings.
  58. $this->settings = array(
  59. 'name' => __( 'Advanced Custom Fields', 'acf' ),
  60. 'slug' => dirname( ACF_BASENAME ),
  61. 'version' => ACF_VERSION,
  62. 'basename' => ACF_BASENAME,
  63. 'path' => ACF_PATH,
  64. 'file' => __FILE__,
  65. 'url' => plugin_dir_url( __FILE__ ),
  66. 'show_admin' => true,
  67. 'show_updates' => true,
  68. 'stripslashes' => false,
  69. 'local' => true,
  70. 'json' => true,
  71. 'save_json' => '',
  72. 'load_json' => array(),
  73. 'default_language' => '',
  74. 'current_language' => '',
  75. 'capability' => 'manage_options',
  76. 'uploader' => 'wp',
  77. 'autoload' => false,
  78. 'l10n' => true,
  79. 'l10n_textdomain' => '',
  80. 'google_api_key' => '',
  81. 'google_api_client' => '',
  82. 'enqueue_google_maps' => true,
  83. 'enqueue_select2' => true,
  84. 'enqueue_datepicker' => true,
  85. 'enqueue_datetimepicker' => true,
  86. 'select2_version' => 4,
  87. 'row_index_offset' => 1,
  88. 'remove_wp_meta_box' => true,
  89. 'rest_api_enabled' => true,
  90. 'rest_api_format' => 'light',
  91. 'rest_api_embed_links' => true,
  92. );
  93. // Include utility functions.
  94. include_once ACF_PATH . 'includes/acf-utility-functions.php';
  95. // Include previous API functions.
  96. acf_include( 'includes/api/api-helpers.php' );
  97. acf_include( 'includes/api/api-template.php' );
  98. acf_include( 'includes/api/api-term.php' );
  99. // Include classes.
  100. acf_include( 'includes/class-acf-data.php' );
  101. acf_include( 'includes/fields/class-acf-field.php' );
  102. acf_include( 'includes/locations/abstract-acf-legacy-location.php' );
  103. acf_include( 'includes/locations/abstract-acf-location.php' );
  104. // Include functions.
  105. acf_include( 'includes/acf-helper-functions.php' );
  106. acf_include( 'includes/acf-hook-functions.php' );
  107. acf_include( 'includes/acf-field-functions.php' );
  108. acf_include( 'includes/acf-field-group-functions.php' );
  109. acf_include( 'includes/acf-form-functions.php' );
  110. acf_include( 'includes/acf-meta-functions.php' );
  111. acf_include( 'includes/acf-post-functions.php' );
  112. acf_include( 'includes/acf-user-functions.php' );
  113. acf_include( 'includes/acf-value-functions.php' );
  114. acf_include( 'includes/acf-input-functions.php' );
  115. acf_include( 'includes/acf-wp-functions.php' );
  116. // Include core.
  117. acf_include( 'includes/fields.php' );
  118. acf_include( 'includes/locations.php' );
  119. acf_include( 'includes/assets.php' );
  120. acf_include( 'includes/compatibility.php' );
  121. acf_include( 'includes/deprecated.php' );
  122. acf_include( 'includes/l10n.php' );
  123. acf_include( 'includes/local-fields.php' );
  124. acf_include( 'includes/local-meta.php' );
  125. acf_include( 'includes/local-json.php' );
  126. acf_include( 'includes/loop.php' );
  127. acf_include( 'includes/media.php' );
  128. acf_include( 'includes/revisions.php' );
  129. acf_include( 'includes/updates.php' );
  130. acf_include( 'includes/upgrades.php' );
  131. acf_include( 'includes/validation.php' );
  132. acf_include( 'includes/rest-api.php' );
  133. // Include ajax.
  134. acf_include( 'includes/ajax/class-acf-ajax.php' );
  135. acf_include( 'includes/ajax/class-acf-ajax-check-screen.php' );
  136. acf_include( 'includes/ajax/class-acf-ajax-user-setting.php' );
  137. acf_include( 'includes/ajax/class-acf-ajax-upgrade.php' );
  138. acf_include( 'includes/ajax/class-acf-ajax-query.php' );
  139. acf_include( 'includes/ajax/class-acf-ajax-query-users.php' );
  140. acf_include( 'includes/ajax/class-acf-ajax-local-json-diff.php' );
  141. // Include forms.
  142. acf_include( 'includes/forms/form-attachment.php' );
  143. acf_include( 'includes/forms/form-comment.php' );
  144. acf_include( 'includes/forms/form-customizer.php' );
  145. acf_include( 'includes/forms/form-front.php' );
  146. acf_include( 'includes/forms/form-nav-menu.php' );
  147. acf_include( 'includes/forms/form-post.php' );
  148. acf_include( 'includes/forms/form-gutenberg.php' );
  149. acf_include( 'includes/forms/form-taxonomy.php' );
  150. acf_include( 'includes/forms/form-user.php' );
  151. acf_include( 'includes/forms/form-widget.php' );
  152. // Include admin.
  153. if ( is_admin() ) {
  154. acf_include( 'includes/admin/admin.php' );
  155. acf_include( 'includes/admin/admin-field-group.php' );
  156. acf_include( 'includes/admin/admin-field-groups.php' );
  157. acf_include( 'includes/admin/admin-notices.php' );
  158. acf_include( 'includes/admin/admin-tools.php' );
  159. acf_include( 'includes/admin/admin-upgrade.php' );
  160. }
  161. // Include legacy.
  162. acf_include( 'includes/legacy/legacy-locations.php' );
  163. // Include PRO.
  164. acf_include( 'pro/acf-pro.php' );
  165. // Include tests.
  166. if ( defined( 'ACF_DEV' ) && ACF_DEV ) {
  167. acf_include( 'tests/tests.php' );
  168. }
  169. // Add actions.
  170. add_action( 'init', array( $this, 'init' ), 5 );
  171. add_action( 'init', array( $this, 'register_post_types' ), 5 );
  172. add_action( 'init', array( $this, 'register_post_status' ), 5 );
  173. // Add filters.
  174. add_filter( 'posts_where', array( $this, 'posts_where' ), 10, 2 );
  175. }
  176. /**
  177. * init
  178. *
  179. * Completes the setup process on "init" of earlier.
  180. *
  181. * @date 28/09/13
  182. * @since 5.0.0
  183. *
  184. * @param void
  185. * @return void
  186. */
  187. function init() {
  188. // Bail early if called directly from functions.php or plugin file.
  189. if ( ! did_action( 'plugins_loaded' ) ) {
  190. return;
  191. }
  192. // This function may be called directly from template functions. Bail early if already did this.
  193. if ( acf_did( 'init' ) ) {
  194. return;
  195. }
  196. // Update url setting. Allows other plugins to modify the URL (force SSL).
  197. acf_update_setting( 'url', plugin_dir_url( __FILE__ ) );
  198. // Load textdomain file.
  199. acf_load_textdomain();
  200. // Include 3rd party compatiblity.
  201. acf_include( 'includes/third-party.php' );
  202. // Include wpml support.
  203. if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
  204. acf_include( 'includes/wpml.php' );
  205. }
  206. // Include fields.
  207. acf_include( 'includes/fields/class-acf-field-text.php' );
  208. acf_include( 'includes/fields/class-acf-field-textarea.php' );
  209. acf_include( 'includes/fields/class-acf-field-number.php' );
  210. acf_include( 'includes/fields/class-acf-field-range.php' );
  211. acf_include( 'includes/fields/class-acf-field-email.php' );
  212. acf_include( 'includes/fields/class-acf-field-url.php' );
  213. acf_include( 'includes/fields/class-acf-field-password.php' );
  214. acf_include( 'includes/fields/class-acf-field-image.php' );
  215. acf_include( 'includes/fields/class-acf-field-file.php' );
  216. acf_include( 'includes/fields/class-acf-field-wysiwyg.php' );
  217. acf_include( 'includes/fields/class-acf-field-oembed.php' );
  218. acf_include( 'includes/fields/class-acf-field-select.php' );
  219. acf_include( 'includes/fields/class-acf-field-checkbox.php' );
  220. acf_include( 'includes/fields/class-acf-field-radio.php' );
  221. acf_include( 'includes/fields/class-acf-field-button-group.php' );
  222. acf_include( 'includes/fields/class-acf-field-true_false.php' );
  223. acf_include( 'includes/fields/class-acf-field-link.php' );
  224. acf_include( 'includes/fields/class-acf-field-post_object.php' );
  225. acf_include( 'includes/fields/class-acf-field-page_link.php' );
  226. acf_include( 'includes/fields/class-acf-field-relationship.php' );
  227. acf_include( 'includes/fields/class-acf-field-taxonomy.php' );
  228. acf_include( 'includes/fields/class-acf-field-user.php' );
  229. acf_include( 'includes/fields/class-acf-field-google-map.php' );
  230. acf_include( 'includes/fields/class-acf-field-date_picker.php' );
  231. acf_include( 'includes/fields/class-acf-field-date_time_picker.php' );
  232. acf_include( 'includes/fields/class-acf-field-time_picker.php' );
  233. acf_include( 'includes/fields/class-acf-field-color_picker.php' );
  234. acf_include( 'includes/fields/class-acf-field-message.php' );
  235. acf_include( 'includes/fields/class-acf-field-accordion.php' );
  236. acf_include( 'includes/fields/class-acf-field-tab.php' );
  237. acf_include( 'includes/fields/class-acf-field-group.php' );
  238. /**
  239. * Fires after field types have been included.
  240. *
  241. * @date 28/09/13
  242. * @since 5.0.0
  243. *
  244. * @param int $major_version The major version of ACF.
  245. */
  246. do_action( 'acf/include_field_types', ACF_MAJOR_VERSION );
  247. // Include locations.
  248. acf_include( 'includes/locations/class-acf-location-post-type.php' );
  249. acf_include( 'includes/locations/class-acf-location-post-template.php' );
  250. acf_include( 'includes/locations/class-acf-location-post-status.php' );
  251. acf_include( 'includes/locations/class-acf-location-post-format.php' );
  252. acf_include( 'includes/locations/class-acf-location-post-category.php' );
  253. acf_include( 'includes/locations/class-acf-location-post-taxonomy.php' );
  254. acf_include( 'includes/locations/class-acf-location-post.php' );
  255. acf_include( 'includes/locations/class-acf-location-page-template.php' );
  256. acf_include( 'includes/locations/class-acf-location-page-type.php' );
  257. acf_include( 'includes/locations/class-acf-location-page-parent.php' );
  258. acf_include( 'includes/locations/class-acf-location-page.php' );
  259. acf_include( 'includes/locations/class-acf-location-current-user.php' );
  260. acf_include( 'includes/locations/class-acf-location-current-user-role.php' );
  261. acf_include( 'includes/locations/class-acf-location-user-form.php' );
  262. acf_include( 'includes/locations/class-acf-location-user-role.php' );
  263. acf_include( 'includes/locations/class-acf-location-taxonomy.php' );
  264. acf_include( 'includes/locations/class-acf-location-attachment.php' );
  265. acf_include( 'includes/locations/class-acf-location-comment.php' );
  266. acf_include( 'includes/locations/class-acf-location-widget.php' );
  267. acf_include( 'includes/locations/class-acf-location-nav-menu.php' );
  268. acf_include( 'includes/locations/class-acf-location-nav-menu-item.php' );
  269. /**
  270. * Fires after location types have been included.
  271. *
  272. * @date 28/09/13
  273. * @since 5.0.0
  274. *
  275. * @param int $major_version The major version of ACF.
  276. */
  277. do_action( 'acf/include_location_rules', ACF_MAJOR_VERSION );
  278. /**
  279. * Fires during initialization. Used to add local fields.
  280. *
  281. * @date 28/09/13
  282. * @since 5.0.0
  283. *
  284. * @param int $major_version The major version of ACF.
  285. */
  286. do_action( 'acf/include_fields', ACF_MAJOR_VERSION );
  287. /**
  288. * Fires after ACF is completely "initialized".
  289. *
  290. * @date 28/09/13
  291. * @since 5.0.0
  292. *
  293. * @param int $major_version The major version of ACF.
  294. */
  295. do_action( 'acf/init', ACF_MAJOR_VERSION );
  296. }
  297. /**
  298. * register_post_types
  299. *
  300. * Registers the ACF post types.
  301. *
  302. * @date 22/10/2015
  303. * @since 5.3.2
  304. *
  305. * @param void
  306. * @return void
  307. */
  308. function register_post_types() {
  309. // Vars.
  310. $cap = acf_get_setting( 'capability' );
  311. // Register the Field Group post type.
  312. register_post_type(
  313. 'acf-field-group',
  314. array(
  315. 'labels' => array(
  316. 'name' => __( 'Field Groups', 'acf' ),
  317. 'singular_name' => __( 'Field Group', 'acf' ),
  318. 'add_new' => __( 'Add New', 'acf' ),
  319. 'add_new_item' => __( 'Add New Field Group', 'acf' ),
  320. 'edit_item' => __( 'Edit Field Group', 'acf' ),
  321. 'new_item' => __( 'New Field Group', 'acf' ),
  322. 'view_item' => __( 'View Field Group', 'acf' ),
  323. 'search_items' => __( 'Search Field Groups', 'acf' ),
  324. 'not_found' => __( 'No Field Groups found', 'acf' ),
  325. 'not_found_in_trash' => __( 'No Field Groups found in Trash', 'acf' ),
  326. ),
  327. 'public' => false,
  328. 'hierarchical' => true,
  329. 'show_ui' => true,
  330. 'show_in_menu' => false,
  331. '_builtin' => false,
  332. 'capability_type' => 'post',
  333. 'capabilities' => array(
  334. 'edit_post' => $cap,
  335. 'delete_post' => $cap,
  336. 'edit_posts' => $cap,
  337. 'delete_posts' => $cap,
  338. ),
  339. 'supports' => array( 'title' ),
  340. 'rewrite' => false,
  341. 'query_var' => false,
  342. )
  343. );
  344. // Register the Field post type.
  345. register_post_type(
  346. 'acf-field',
  347. array(
  348. 'labels' => array(
  349. 'name' => __( 'Fields', 'acf' ),
  350. 'singular_name' => __( 'Field', 'acf' ),
  351. 'add_new' => __( 'Add New', 'acf' ),
  352. 'add_new_item' => __( 'Add New Field', 'acf' ),
  353. 'edit_item' => __( 'Edit Field', 'acf' ),
  354. 'new_item' => __( 'New Field', 'acf' ),
  355. 'view_item' => __( 'View Field', 'acf' ),
  356. 'search_items' => __( 'Search Fields', 'acf' ),
  357. 'not_found' => __( 'No Fields found', 'acf' ),
  358. 'not_found_in_trash' => __( 'No Fields found in Trash', 'acf' ),
  359. ),
  360. 'public' => false,
  361. 'hierarchical' => true,
  362. 'show_ui' => false,
  363. 'show_in_menu' => false,
  364. '_builtin' => false,
  365. 'capability_type' => 'post',
  366. 'capabilities' => array(
  367. 'edit_post' => $cap,
  368. 'delete_post' => $cap,
  369. 'edit_posts' => $cap,
  370. 'delete_posts' => $cap,
  371. ),
  372. 'supports' => array( 'title' ),
  373. 'rewrite' => false,
  374. 'query_var' => false,
  375. )
  376. );
  377. }
  378. /**
  379. * register_post_status
  380. *
  381. * Registers the ACF post statuses.
  382. *
  383. * @date 22/10/2015
  384. * @since 5.3.2
  385. *
  386. * @param void
  387. * @return void
  388. */
  389. function register_post_status() {
  390. // Register the Disabled post status.
  391. register_post_status(
  392. 'acf-disabled',
  393. array(
  394. 'label' => _x( 'Disabled', 'post status', 'acf' ),
  395. 'public' => true,
  396. 'exclude_from_search' => false,
  397. 'show_in_admin_all_list' => true,
  398. 'show_in_admin_status_list' => true,
  399. 'label_count' => _n_noop( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', 'acf' ),
  400. )
  401. );
  402. }
  403. /**
  404. * posts_where
  405. *
  406. * Filters the $where clause allowing for custom WP_Query args.
  407. *
  408. * @date 31/8/19
  409. * @since 5.8.1
  410. *
  411. * @param string $where The WHERE clause.
  412. * @return WP_Query $wp_query The query object.
  413. */
  414. function posts_where( $where, $wp_query ) {
  415. global $wpdb;
  416. // Add custom "acf_field_key" arg.
  417. if ( $field_key = $wp_query->get( 'acf_field_key' ) ) {
  418. $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_name = %s", $field_key );
  419. }
  420. // Add custom "acf_field_name" arg.
  421. if ( $field_name = $wp_query->get( 'acf_field_name' ) ) {
  422. $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_excerpt = %s", $field_name );
  423. }
  424. // Add custom "acf_group_key" arg.
  425. if ( $group_key = $wp_query->get( 'acf_group_key' ) ) {
  426. $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_name = %s", $group_key );
  427. }
  428. // Return.
  429. return $where;
  430. }
  431. /**
  432. * define
  433. *
  434. * Defines a constant if doesnt already exist.
  435. *
  436. * @date 3/5/17
  437. * @since 5.5.13
  438. *
  439. * @param string $name The constant name.
  440. * @param mixed $value The constant value.
  441. * @return void
  442. */
  443. function define( $name, $value = true ) {
  444. if ( ! defined( $name ) ) {
  445. define( $name, $value );
  446. }
  447. }
  448. /**
  449. * has_setting
  450. *
  451. * Returns true if a setting exists for this name.
  452. *
  453. * @date 2/2/18
  454. * @since 5.6.5
  455. *
  456. * @param string $name The setting name.
  457. * @return boolean
  458. */
  459. function has_setting( $name ) {
  460. return isset( $this->settings[ $name ] );
  461. }
  462. /**
  463. * get_setting
  464. *
  465. * Returns a setting or null if doesn't exist.
  466. *
  467. * @date 28/09/13
  468. * @since 5.0.0
  469. *
  470. * @param string $name The setting name.
  471. * @return mixed
  472. */
  473. function get_setting( $name ) {
  474. return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
  475. }
  476. /**
  477. * update_setting
  478. *
  479. * Updates a setting for the given name and value.
  480. *
  481. * @date 28/09/13
  482. * @since 5.0.0
  483. *
  484. * @param string $name The setting name.
  485. * @param mixed $value The setting value.
  486. * @return true
  487. */
  488. function update_setting( $name, $value ) {
  489. $this->settings[ $name ] = $value;
  490. return true;
  491. }
  492. /**
  493. * get_data
  494. *
  495. * Returns data or null if doesn't exist.
  496. *
  497. * @date 28/09/13
  498. * @since 5.0.0
  499. *
  500. * @param string $name The data name.
  501. * @return mixed
  502. */
  503. function get_data( $name ) {
  504. return isset( $this->data[ $name ] ) ? $this->data[ $name ] : null;
  505. }
  506. /**
  507. * set_data
  508. *
  509. * Sets data for the given name and value.
  510. *
  511. * @date 28/09/13
  512. * @since 5.0.0
  513. *
  514. * @param string $name The data name.
  515. * @param mixed $value The data value.
  516. * @return void
  517. */
  518. function set_data( $name, $value ) {
  519. $this->data[ $name ] = $value;
  520. }
  521. /**
  522. * get_instance
  523. *
  524. * Returns an instance or null if doesn't exist.
  525. *
  526. * @date 13/2/18
  527. * @since 5.6.9
  528. *
  529. * @param string $class The instance class name.
  530. * @return object
  531. */
  532. function get_instance( $class ) {
  533. $name = strtolower( $class );
  534. return isset( $this->instances[ $name ] ) ? $this->instances[ $name ] : null;
  535. }
  536. /**
  537. * new_instance
  538. *
  539. * Creates and stores an instance of the given class.
  540. *
  541. * @date 13/2/18
  542. * @since 5.6.9
  543. *
  544. * @param string $class The instance class name.
  545. * @return object
  546. */
  547. function new_instance( $class ) {
  548. $instance = new $class();
  549. $name = strtolower( $class );
  550. $this->instances[ $name ] = $instance;
  551. return $instance;
  552. }
  553. /**
  554. * Magic __isset method for backwards compatibility.
  555. *
  556. * @date 24/4/20
  557. * @since 5.9.0
  558. *
  559. * @param string $key Key name.
  560. * @return bool
  561. */
  562. public function __isset( $key ) {
  563. return in_array( $key, array( 'locations', 'json' ) );
  564. }
  565. /**
  566. * Magic __get method for backwards compatibility.
  567. *
  568. * @date 24/4/20
  569. * @since 5.9.0
  570. *
  571. * @param string $key Key name.
  572. * @return mixed
  573. */
  574. public function __get( $key ) {
  575. switch ( $key ) {
  576. case 'locations':
  577. return acf_get_instance( 'ACF_Legacy_Locations' );
  578. case 'json':
  579. return acf_get_instance( 'ACF_Local_JSON' );
  580. }
  581. return null;
  582. }
  583. }
  584. /*
  585. * acf
  586. *
  587. * The main function responsible for returning the one true acf Instance to functions everywhere.
  588. * Use this function like you would a global variable, except without needing to declare the global.
  589. *
  590. * Example: <?php $acf = acf(); ?>
  591. *
  592. * @date 4/09/13
  593. * @since 4.3.0
  594. *
  595. * @param void
  596. * @return ACF
  597. */
  598. function acf() {
  599. global $acf;
  600. // Instantiate only once.
  601. if ( ! isset( $acf ) ) {
  602. $acf = new ACF();
  603. $acf->initialize();
  604. }
  605. return $acf;
  606. }
  607. // Instantiate.
  608. acf();
  609. endif; // class_exists check