Skip to content

Commit

Permalink
Merge branch 'release/2.0.0-beta12'
Browse files Browse the repository at this point in the history
  • Loading branch information
shprink committed Sep 18, 2016
2 parents c1ef9b7 + 5ed3c54 commit 6243664
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 35 deletions.
6 changes: 6 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ If your device is connected and in USB mode you will see your application that y
* iOS Simulator
* Provisioning profile

### iOS10

Also you will need to Assign Your App to a Team: `Project > General > Signing > Select your team ID in the dropdown`

You will also need to disabled bitcode (see iOS9)

### iOS9

Also you will need to disabled bitcode: `Project > Build Settings > Build Options > Enable Bitcode = No`
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
* [CONFIG] There is no more dev/prod distinction, WPHC turn debug OFF when building the prod app automatically.
* [ABOUT] The About feature has been removed. You can use Pages to achieve the same purpose.

<a name="2.0.0-beta12"></a>
### 2.0.0-beta12 (2016-09-18)

* [BUG] Display category/tag title instead of slug <https://github.com/shprink/wordpress-hybrid-client/issues/59>
* [BUG] Fix Russian/Chinese author title encoding
* [BUG] Removing Native transitions
* iOS 10 ready. See notes on BUILD.md

<a name="2.0.0-beta11"></a>
### 2.0.0-beta11 (2016-09-04)

Expand Down
2 changes: 2 additions & 0 deletions dist/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ mod.run(($templateCache) => {
// $templateCache.put('module/menu.html', require('!html!./module/menu.html'));
// $templateCache.put('module/bookmark.html', require('!html!./module/bookmark.html'));
// $templateCache.put('module/about.html', require('!html!./module/about.html'));
// $templateCache.put('module/authors/author.html', require('!html!./module/author.html'));
// $templateCache.put('module/authors/authors.html', require('!html!./module/authors.html'));

// Directives
// $templateCache.put('directive/author.html', require('!html!./directive/author.html'));
Expand Down
4 changes: 2 additions & 2 deletions lib/authors/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function($stateProvider) {
class: 'module-authors',
views: {
'content': {
template: require("./authors.html"),
templateProvider: ($templateCache) => $templateCache.get('module/authors/authors.html'),
controller: "WPHCAuthorsController as authorsCtrl"
}
}
Expand All @@ -16,7 +16,7 @@ export default function($stateProvider) {
class: 'module-authors-<%=id%>',
views: {
'content@public': {
template: require("./author.html"),
templateProvider: ($templateCache) => $templateCache.get('module/authors/author.html'),
controller: "WPHCAuthorController as postsCtrl"
}
}
Expand Down
16 changes: 0 additions & 16 deletions lib/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require 'angular-cache'
require 'angular-moment'
require 'moment'
require './font/font.coffee'
require 'ionic-native-transitions'
require 'expose?_!lodash'
require 'wp-api-angularjs'
require './config.js'
Expand Down Expand Up @@ -36,7 +35,6 @@ module.exports = app = angular.module 'wordpress-hybrid-client', [
'ionic'
'ngIOS9UIWebViewPatch'
'wordpress-hybrid-client.config'
'ionic-native-transitions'
'ui.router'
'wp-api-angularjs'
'angular-cache'
Expand Down Expand Up @@ -86,20 +84,6 @@ app.config ($logProvider, $compileProvider) ->
$logProvider.debugEnabled if IS_PROD then false else true
$compileProvider.debugInfoEnabled if IS_PROD then false else true

###
NATIVE TRANSITIONS CONF
###
app.config ($WPHCConfig, $ionicNativeTransitionsProvider) ->
defaultOptions = _.get $WPHCConfig, 'cordova.nativeTransitions.defaultOptions'
defaultTransition = _.get $WPHCConfig, 'cordova.nativeTransitions.defaultTransition'
defaultBackTransition = _.get $WPHCConfig, 'cordova.nativeTransitions.defaultBackTransition'
enabled = _.get $WPHCConfig, 'cordova.nativeTransitions.enabled'
enabled = if _.isBoolean enabled then enabled else true
$ionicNativeTransitionsProvider.setDefaultOptions defaultOptions if defaultOptions
$ionicNativeTransitionsProvider.setDefaultTransition defaultTransition if defaultTransition
$ionicNativeTransitionsProvider.setDefaultBackTransition defaultBackTransition if defaultBackTransition
$ionicNativeTransitionsProvider.enable enabled

###
IONIC CONF
###
Expand Down
2 changes: 1 addition & 1 deletion lib/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' data:; img-src * 'self' 'unsafe-inline' 'unsafe-eval' data: blob: filesystem:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; img-src * 'self' 'unsafe-inline' 'unsafe-eval' data: blob: filesystem:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

<title>{%=o.htmlWebpackPlugin.options.pkg.title %}</title>
<script>
Expand Down
37 changes: 35 additions & 2 deletions lib/taxonomies/posts.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import AbstractList from '../abstract/AbstractList.js';

export default class extends AbstractList {

constructor($WPHCPosts, $WPHCTaxonomiesCustomPosts, $injector, $scope, $filter, $stateParams) {
constructor($WPHCPosts, $WPHCTaxonomiesCustomPosts, $injector, $scope, $filter, $stateParams, $wpApiTerms) {
'ngInject';

super($injector, $scope);
this.showToolbar = true;
this.titleLoaded = false;
this.setType('taxonomiesPosts');
if ($stateParams.postType == 'post') {
this.setService($WPHCPosts);
Expand All @@ -17,7 +18,39 @@ export default class extends AbstractList {
this.term = $stateParams.term;
this.postType = $stateParams.postType;
this.$filter = $filter;
this.setTitle(this.getTitle($stateParams.term, _.get($stateParams, 'taxonomy.name') || $stateParams.slug));
const taxoName = _.get($stateParams, 'taxonomy.name');
if (taxoName) {
this.titleLoaded = true;
}
this.setTitle(this.getTitle($stateParams.term, taxoName || $stateParams.slug));
}

onDataLoaded(response) {
// all we have is the term slug. We cannot get the term object with the slug unfortunetly
// only the ID would work but we do not have it.
// To display the translated category/tag name as a title we need to go through
// the list of posts and get it from them
const { slug } = this.$stateParams;
const taxoName = _.get(this.$stateParams, 'taxonomy.name');
if (!this.titleLoaded && response.data.length) {
const taxonomies = _.get(response, "data[0]['_embedded']['https://api.w.org/term']")
|| _.get(response, "data[0]['_embedded']['wp:term']");
if (!taxonomies) {
return;
}
for (let i = 0, len = taxonomies.length; i < len; i++) {
const terms = taxonomies[i];
for (let j = 0, len2 = terms.length; j < len2; j++) {
const term = terms[j];
if (term.slug === slug) {
this.setTitle(this.getTitle(this.$stateParams.term, term.name));
this.titleLoaded = true;
break;
}
}
}
}
return response;
}

getQuery() {
Expand Down
2 changes: 2 additions & 0 deletions lib/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ mod.run(($templateCache) => {
$templateCache.put('module/menu.html', require('!html!./module/menu.html'));
$templateCache.put('module/bookmark.html', require('!html!./module/bookmark.html'));
$templateCache.put('module/about.html', require('!html!./module/about.html'));
$templateCache.put('module/authors/author.html', require('!html!./module/author.html'));
$templateCache.put('module/authors/authors.html', require('!html!./module/authors.html'));

// Directives
$templateCache.put('directive/author.html', require('!html!./directive/author.html'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ postsCtrl.title | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="postsCtrl.title | translate"></ion-nav-title>
<ion-content class="padding bg-gray-lighter">
<wphc-empty-list list="postsCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!postsCtrl.list" on-load="postsCtrl.init()"></wphc-loader>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ authorsCtrl.title | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="authorsCtrl.title | translate"></ion-nav-title>
<ion-content>
<wphc-empty-list list="authorsCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!authorsCtrl.list" on-load="authorsCtrl.init()"></wphc-loader>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/bookmark.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{'bookmark.title' | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="'bookmark.title' | translate"></ion-nav-title>
<ion-content class="wphc-bookmark">
<wphc-empty-list list="bookmarkCtrl.posts" text="bookmark.emptyList" icon="ion-bookmark"></wphc-empty-list>
<wphc-loader ng-if="!bookmarkCtrl.posts"></wphc-loader>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/customPosts-item.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ customPostCtrl.item.title.rendered | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="customPostCtrl.item.title.rendered | translate"></ion-nav-title>
<ion-content>
<wphc-loader ng-if="!customPostCtrl.item" on-load="customPostCtrl.init()"></wphc-loader>
<ion-refresher pulling-text="{{ 'pullToRefresh' | translate}}" on-refresh="customPostCtrl.refresh()"></ion-refresher>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/customPosts-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title ng-bind-html="customPostsCtrl.title | translate"></ion-nav-title>
<ion-nav-title ng-bind-html="customPostsCtrl.title | translate"></ion-nav-title>
<ion-content class="padding bg-gray-lighter">
<wphc-empty-list list="customPostsCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!customPostsCtrl.list" on-load="customPostsCtrl.init()"></wphc-loader>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/pages-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ pagesCtrl.title | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="pagesCtrl.title | translate"></ion-nav-title>
<ion-content class="padding bg-gray-lighter">
<wphc-empty-list list="pagesCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!pagesCtrl.list" on-load="pagesCtrl.init()"></wphc-loader>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/posts-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ postsCtrl.title | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="postsCtrl.title | translate"></ion-nav-title>
<ion-content class="padding bg-gray-lighter">
<wphc-empty-list list="postsCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!postsCtrl.list" on-load="postsCtrl.init()"></wphc-loader>
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/module/taxonomies-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ion-view>
<ion-nav-title>{{ taxonomiesCtrl.title | translate}}</ion-nav-title>
<ion-nav-title ng-bind-html="taxonomiesCtrl.title | translate"></ion-nav-title>
<ion-content>
<wphc-empty-list list="taxonomiesCtrl.list"></wphc-empty-list>
<wphc-loader ng-if="!taxonomiesCtrl.list" on-load="taxonomiesCtrl.init()"></wphc-loader>
Expand Down
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordpress-hybrid-client",
"version": "2.0.0-beta11",
"version": "2.0.0-beta12",
"title": "wordpress-hybrid-client",
"description": "AngularJS client using Ionic Framework and based on the json-rest-api plugin: https://wordpress.org/plugins/json-rest-api/ with CORS enabled.",
"main": "index.js",
Expand Down Expand Up @@ -85,7 +85,6 @@
"highlight.js": "^8.9.0",
"imagesloaded": "^3.1.8",
"imgcache.js": "^1.0.0",
"ionic-native-transitions": "v1.0.0-rc5",
"ionic-angular": "~1.3.1",
"lodash": "^3.9.3",
"moment": "^2.9.0",
Expand All @@ -111,10 +110,6 @@
"cordova-plugin-x-toast@2.1.1",
"cordova-plugin-statusbar@1.0.1",
"cordova-plugin-google-analytics@0.8.1",
{
"locator": "https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.5.5",
"id": "com.telerik.plugins.nativepagetransitions"
},
"phonegap-plugin-push@1.5.3",
"cordova-plugin-crosswalk-webview@1.6.0",
"cordova-plugin-spinner-dialog@1.3.1",
Expand Down

0 comments on commit 6243664

Please sign in to comment.