Skip to content

Commit bc476b2

Browse files
committed
Merge branch 'development' - Version 1.6.0
2 parents fa3b772 + 1464100 commit bc476b2

38 files changed

+582
-153
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.6.0 (2020-10-27)
2+
3+
### Fixes
4+
- End of PhoneGap Build: allow to build apps with raw Cordova tools or VoltBuilder online service ([@mleroi](https://github.com/mleroi))
5+
16
## 1.5.6 (2020-05-05)
27

38
### Fixes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ WP-AppKit adds a menu to the WordPress admin.
3333
* Use Chrome to simulate your app in the browser
3434
* Set your secure key to support WordPress authentication in your app
3535
* Set the custom URL scheme for deeplinks
36-
* Export the app's sources ready to be compiled with [PhoneGap Build](https://build.phonegap.com/)
36+
* Export app's sources ready to be compiled with raw Cordova tools or VoltBuilder online service
3737

3838
![WP-AppKit Edit Application Panel](https://cloud.githubusercontent.com/assets/6179747/16171841/36a01202-357a-11e6-888e-e38f046fdf39.jpg)
3939

@@ -51,7 +51,7 @@ Developing app themes are at the heart of the WP-AppKit project. If you're ready
5151
![Edit WP-AppKit Theme in Bracket](https://cloud.githubusercontent.com/assets/6179747/16171843/3d4ea686-357a-11e6-91de-2f2ea82a513b.jpg)
5252

5353
## Who's Behind This Project?
54-
This project is done the [Uncategorized Creations](http://uncategorized-creations.com/) team. UncatCrea is a group of web professionals working with WordPress and Cordova/PhoneGap. facing the challenges to build content based mobile apps connected to WordPress, we've decided to create WP-AppKit.
54+
This project is done the [Uncategorized Creations](http://uncategorized-creations.com/) team. UncatCrea is a group of web professionals working with WordPress and Cordova. facing the challenges to build content based mobile apps connected to WordPress, we've decided to create WP-AppKit.
5555

5656
### Meet the team
5757
* Mathieu Le Roi: _Quiet and mystic_ developer

wp-appkit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: WP-AppKit
44
Plugin URI: https://github.com/uncatcrea/wp-appkit
55
Description: Build mobile apps and PWA based on your WordPress content.
6-
Version: 1.5.6
6+
Version: 1.6.0
77
Author: Uncategorized Creations
88
Author URI: http://getwpappkit.com
99
Text Domain: wp-appkit
Loading
Loading

wp-appkit/lib/addons/addon.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WpakAddon {
1717
protected $app_dynamic_data_callback = null;
1818
protected $app_dynamic_data = null;
1919

20-
public function __construct( $name, $slug = '', $platforms = ['ios','android'] ) {
20+
public function __construct( $name, $slug = '', $platforms = ['ios','android','android-cordova','android-voltbuilder'] ) {
2121
$this->name = $name;
2222
$this->slug = sanitize_title_with_dashes( remove_accents( empty($slug) ? $name : $slug ) );
2323
$this->platforms = is_array( $platforms ) ? $platforms : [];
@@ -36,18 +36,18 @@ public function set_location( $addon_file ) {
3636
}
3737

3838
public function add_js( $js_file, $type = 'module', $position = '', $platforms = [] ) {
39-
39+
4040
$file_type = pathinfo( $js_file, PATHINFO_EXTENSION );
4141
if( $file_type !== 'js' ){
4242
return;
4343
}
44-
44+
4545
$full_js_file = '';
46-
46+
4747
if( $type == 'theme' && $position === '' ){
4848
$position = 'after';
4949
}
50-
50+
5151
if( $type == 'init' ){
5252
$position = 'before'; //for now, only init+before is handled
5353
}
@@ -62,11 +62,11 @@ public function add_js( $js_file, $type = 'module', $position = '', $platforms =
6262

6363
if ( file_exists( $full_js_file ) ) {
6464
if ( !in_array( $js_file, $this->js_files ) ) {
65-
$this->js_files[] = array(
66-
'file' => $js_file,
67-
'type' => $type,
65+
$this->js_files[] = array(
66+
'file' => $js_file,
67+
'type' => $type,
6868
'position' => $position,
69-
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : ['android', 'ios', 'pwa']
69+
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : $this->platforms
7070
);
7171
}
7272
}
@@ -78,7 +78,7 @@ public function add_css( $css_file, $position = 'after', $platforms = [] ) {
7878
if( $file_type !== 'css' ){
7979
return;
8080
}
81-
81+
8282
$full_css_file = '';
8383

8484
if ( strpos( $css_file, $this->directory ) !== false ) {
@@ -91,23 +91,23 @@ public function add_css( $css_file, $position = 'after', $platforms = [] ) {
9191

9292
if ( file_exists( $full_css_file ) ) {
9393
if ( !in_array( $css_file, $this->css_files ) ) {
94-
$this->css_files[] = array(
95-
'file' => $css_file,
94+
$this->css_files[] = array(
95+
'file' => $css_file,
9696
'type' => 'theme',
9797
'position' => $position,
98-
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : ['android', 'ios', 'pwa']
98+
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : $this->platforms
9999
);
100100
}
101101
}
102102
}
103-
103+
104104
public function add_html( $html_file, $type = 'layout', $position = 'after', $data = array(), $platforms = [] ) {
105105

106106
$file_type = pathinfo( $html_file, PATHINFO_EXTENSION );
107107
if( $file_type !== 'html' ){
108108
return;
109109
}
110-
110+
111111
$full_html_file = '';
112112

113113
if ( strpos( $html_file, $this->directory ) !== false ) {
@@ -120,24 +120,24 @@ public function add_html( $html_file, $type = 'layout', $position = 'after', $da
120120

121121
if ( file_exists( $full_html_file ) ) {
122122
if ( !in_array( $html_file, $this->html_files ) ) {
123-
$this->html_files[] = array(
124-
'file' => $html_file,
123+
$this->html_files[] = array(
124+
'file' => $html_file,
125125
'type' => $type ,
126126
'position' => $position,
127127
'data' => $data,
128-
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : ['android', 'ios', 'pwa']
128+
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : $this->platforms
129129
);
130130
}
131131
}
132132
}
133-
133+
134134
public function add_template( $template_file, $platforms = [] ) {
135135

136136
$file_type = pathinfo( $template_file, PATHINFO_EXTENSION );
137137
if( $file_type !== 'html' ){
138138
return;
139139
}
140-
140+
141141
$full_template_file = '';
142142

143143
if ( strpos( $template_file, $this->directory ) !== false ) {
@@ -150,14 +150,14 @@ public function add_template( $template_file, $platforms = [] ) {
150150

151151
if ( file_exists( $full_template_file ) ) {
152152
if ( !in_array( $template_file, $this->template_files ) ) {
153-
$this->template_files[] = array(
153+
$this->template_files[] = array(
154154
'file' => $template_file,
155-
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : ['android', 'ios', 'pwa']
155+
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : $this->platforms
156156
);
157157
}
158158
}
159159
}
160-
160+
161161
/**
162162
* PHP files that are included only if the addon is activated
163163
* for a given app.
@@ -167,7 +167,7 @@ public function require_php( $php_file, $platforms = [] ) {
167167
if( $file_type !== 'php' ){
168168
return;
169169
}
170-
170+
171171
$full_php_file = '';
172172

173173
if ( strpos( $php_file, $this->directory ) !== false ) {
@@ -177,17 +177,17 @@ public function require_php( $php_file, $platforms = [] ) {
177177
$php_file = ltrim( $php_file, '/\\' );
178178
$full_php_file = $this->directory . '/' . $php_file;
179179
}
180-
180+
181181
if ( file_exists( $full_php_file ) ) {
182182
if ( !in_array( $php_file, $this->php_files ) ) {
183-
$this->php_files[] = array(
183+
$this->php_files[] = array(
184184
'file' => $php_file,
185-
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : ['android', 'ios', 'pwa']
185+
'platforms' => !empty( $platforms ) && is_array( $platforms ) ? $platforms : $this->platforms
186186
);
187187
}
188188
}
189189
}
190-
190+
191191
public function require_php_files( $app_id ) {
192192
$app_platform = WpakApps::get_app_info( $app_id, 'platform' );
193193
foreach ( $this->php_files as $php_file ) {
@@ -202,14 +202,14 @@ public function require_php_files( $app_id ) {
202202
}
203203

204204
/**
205-
* Set the addon callback that will retrieve additionnal addon static data
205+
* Set the addon callback that will retrieve additionnal addon static data
206206
* (added to config.js) specific to a given app.
207207
* @param type $callback Should be a function that takes $app_id as argument and returns an associative array
208208
*/
209209
public function add_app_static_data( $callback ){
210210
$this->app_static_data_callback = $callback;
211211
}
212-
212+
213213
public function set_app_static_data( $app_id ){
214214
if( $this->app_static_data_callback !== null && is_callable($this->app_static_data_callback) ){
215215
$app_data = call_user_func( $this->app_static_data_callback, $app_id );
@@ -218,16 +218,16 @@ public function set_app_static_data( $app_id ){
218218
}
219219
}
220220
}
221-
221+
222222
/**
223-
* Set the addon callback that will retrieve additionnal addon dynamic data
223+
* Set the addon callback that will retrieve additionnal addon dynamic data
224224
* (added to the synchronization web service) specific to a given app.
225225
* @param type $callback Should be a function that takes $app_id as argument and returns an associative array
226226
*/
227227
public function add_app_dynamic_data( $callback ){
228228
$this->app_dynamic_data_callback = $callback;
229229
}
230-
230+
231231
public function set_app_dynamic_data( $app_id ){
232232
if( $this->app_dynamic_data_callback !== null && is_callable($this->app_dynamic_data_callback) ){
233233
$app_data = call_user_func( $this->app_dynamic_data_callback, $app_id );
@@ -240,7 +240,7 @@ public function set_app_dynamic_data( $app_id ){
240240
public function get_asset_file( $file_relative_to_addon ) {
241241

242242
$found = false;
243-
243+
244244
$file_type = pathinfo( $file_relative_to_addon, PATHINFO_EXTENSION );
245245
if ( isset( $this->{$file_type . '_files'} ) ) {
246246
foreach ( $this->{$file_type . '_files'} as $file ) {
@@ -260,7 +260,7 @@ public function get_asset_file( $file_relative_to_addon ) {
260260
}
261261
}
262262
}
263-
263+
264264
$file_full_path = $this->directory . '/' . $file_relative_to_addon;
265265

266266
return $found && file_exists( $file_full_path ) ? $file_full_path : false;
@@ -299,7 +299,7 @@ protected function filter_files_by_platform( $files, $app_id ) {
299299

300300
return $filtered_files;
301301
}
302-
302+
303303
public function get_all_files( $app_id, $indexed_by_type = false ) {
304304
$all_files = array();
305305

wp-appkit/lib/apps/apps.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
vertical-align:middle;
2525
}
2626

27-
#wpak_export_link, .wpak_export_link_pwa {
27+
.button.wpak_export_link, .wpak_export_link_pwa {
2828
margin-left:10px;
2929
vertical-align:middle;
3030
}
@@ -1094,7 +1094,7 @@ a.list-group-item-danger.active:focus {
10941094
line-height:28px;
10951095
}
10961096

1097-
.wpak_phonegap_export {
1097+
.wpak_phonegap_export, .wpak_cordova_template_export, .wpak_voltbuilder_export {
10981098
float:right;
10991099
}
11001100

@@ -1145,4 +1145,4 @@ a.list-group-item-danger.active:focus {
11451145
}
11461146
.wpak_settings .wp-picker-container {
11471147
display:block;
1148-
}
1148+
}

0 commit comments

Comments
 (0)