Skip to content

Commit

Permalink
chore & features
Browse files Browse the repository at this point in the history
* implement "showAvatar" for posts without images
* update angular promise library
* use .then() instead of .promise()
* create non-minifed dist file
* move promise library from bower deps to npm dev deps
* create npm reference
* update readme

(close #1 & close #9)
  • Loading branch information
JohnnyTheTank committed Jan 9, 2016
1 parent 203e78a commit f188489
Show file tree
Hide file tree
Showing 10 changed files with 886 additions and 84 deletions.
37 changes: 25 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
module.exports = function(grunt) {

var banner = '/**\n @name: <%= pkg.name %> \n @version: <%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) \n @author: <%= pkg.author %> \n @url: <%= pkg.homepage %> \n @license: <%= pkg.license %>\n*/\n';

var files = [
'src/aping-facebook-directive.js',
'src/aping-facebook-helper.js',
'src/aping-facebook-provider.js',
'node_modules/angular-facebook-api-factory/src/angular-facebook-api-factory.js'
];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
js: {
files : {
'dist/aping-plugin-facebook.min.js' : [
'src/aping-facebook-directive.js',
'src/aping-facebook-helper.js',
'bower_components/angular-facebook-api-factory/src/angular-facebook-api-factory.js'
]
'dist/aping-plugin-facebook.min.js' : files
}
},
options: {
banner: '\n/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) by <%= pkg.author %> */\n',
banner: banner,
}
},
concat: {
options: {
separator: ';',
banner: banner,
},
dist: {
files : {
'dist/aping-plugin-facebook.js' : files
}
},
},
watch: {
minifiyJs: {
files: [
'src/aping-facebook-directive.js',
'src/aping-facebook-helper.js',
'bower_components/angular-facebook-api-factory/src/angular-facebook-api-factory.js'
],
tasks: ['uglify'],
files: files,
tasks: ['uglify', 'concat'],
options: {
spawn: true,
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

Expand Down
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,39 @@

# Information
* **Supported apiNG models: `social`, `image`, `video`, `event`**
* Used promise library: [angular-facebook-api-factory](https://github.com/JohnnyTheTank/angular-facebook-api-factory) _(included in minified distribution file)_
* Used promise library: [angular-facebook-api-factory](https://github.com/JohnnyTheTank/angular-facebook-api-factory) _(included in distribution files)_

# Documentation
I. INSTALLATION
II. ACCESS TOKEN
III. USAGE

## I. INSTALLATION
a) Get files
b) Include files
a) Get file
b) Include file
c) Add dependencies
d) Add the plugin

### a) Get files
### a) Get file
You can choose your preferred method of installation:

* Via bower: `bower install apiNG-plugin-facebook --save`
* Download from github: [apiNG-plugin-facebook.zip](https://github.com/JohnnyTheTank/apiNG-plugin-facebook/zipball/master)
1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:
1. `bower install apiNG-plugin-facebook --save`
2. `npm install aping-plugin-facebook --save`
3. download [apiNG-plugin-facebook.zip](https://github.com/JohnnyTheTank/apiNG-plugin-facebook/zipball/master)

### b) Include files
### b) Include file
Include `aping-plugin-facebook.min.js` in your apiNG application

```html
<!-- when using bower -->
<script src="bower_components/apiNG-plugin-facebook/dist/aping-plugin-facebook.min.js"></script>

<!-- when using npm -->
<script src="node_modules/aping-plugin-facebook/dist/aping-plugin-facebook.min.js"></script>

<!-- when using downloaded files -->
<script src="aping-plugin-facebook.min.js"></script>
```

### c) Add dependencies
Expand Down Expand Up @@ -106,10 +116,11 @@ Supported apiNG models
Every **apiNG plugin** expects an array of **requests** as html attribute.

#### Requests by Page
| parameter | sample | description | optional |
|----------|---------|---------|---------|
| **`page`** | `michaeljackson` | name or id of any facebook page | no |
| **`items`** | `0`-`100` | items per request | yes |
| parameter | sample | default | description | optional |
|----------|---------|---------|---------|---------|
| **`page`** | `michaeljackson` | | name or id of any facebook page | no |
| **`items`** | `0`-`100` | `25` | items per request | yes |
| **`showAvatar`** | `true` | `false` | Use `true` for show users avatar as image if post has no own image | yes |

Samples:
* `[{'page':'muenchen'}, {'page':'Berlin'}, {'page':'Koeln'}]`
Expand Down
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Jonathan Hornung <[email protected]>"
],
"version": "0.6.4",
"version": "0.7.0",
"description": "facebook plugin for apiNG",
"main": "dist/angular-plugin-facebook.min.js",
"moduleType": [],
Expand All @@ -25,7 +25,6 @@
"tests"
],
"dependencies": {
"apiNG": "*",
"angular-facebook-api-factory": "*"
"apiNG": "*"
}
}
8 changes: 3 additions & 5 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
<script src="../bower_components/apiNG/dist/aping.min.js"></script>
<script src="aping-config.js"></script>
<script src="app.js"></script>
<script src="../bower_components/angular-facebook-api-factory/src/angular-facebook-api-factory.js"></script>
<script src="../src/aping-facebook-directive.js"></script>
<script src="../src/aping-facebook-helper.js"></script>
<script src="../dist/aping-plugin-facebook.js"></script>
</head>
<body ng-app="app">

<aping
model="video"
model="social"
items="20"
get-native-data="false"
aping-facebook="[{'page':'freundevonniemand'}]">
aping-facebook="[{'page':'johannesoerding', 'showAvatar':true}]">
</aping>


Expand Down
Loading

0 comments on commit f188489

Please sign in to comment.