Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
* update angular promise library
* use .then() instead of .promise()
* create non-minified dist file
* move promise library from bower deps to npm dev deps
* create npm reference
* update readme

(close #3)
  • Loading branch information
JohnnyTheTank committed Jan 9, 2016
1 parent f8b0634 commit 229bfd0
Show file tree
Hide file tree
Showing 10 changed files with 562 additions and 49 deletions.
36 changes: 24 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
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-tumblr-directive.js',
'src/aping-tumblr-helper.js',
'node_modules/angular-tumblr-api-factory/src/angular-tumblr-api-factory.js'
];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
js: {
files : {
'dist/aping-plugin-tumblr.min.js' : [
'src/aping-tumblr-directive.js',
'src/aping-tumblr-helper.js',
'bower_components/angular-tumblr-api-factory/src/angular-tumblr-api-factory.js'
]
'dist/aping-plugin-tumblr.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-tumblr.js' : files
}
},
},
watch: {
minifiyJs: {
files: [
'src/aping-tumblr-directive.js',
'src/aping-tumblr-helper.js',
'bower_components/angular-tumblr-api-factory/src/angular-tumblr-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
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@

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

# Documentation
I. INSTALLATION
II. API KEY
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-tumblr --save`
* Download from github: [apiNG-plugin-tumblr.zip](https://github.com/JohnnyTheTank/apiNG-plugin-tumblr/zipball/master)
Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:

### b) Include files
* `bower install apiNG-plugin-tumblr --save`
* `npm install aping-plugin-tumblr --save`
* download [apiNG-plugin-tumblr.zip](https://github.com/JohnnyTheTank/apiNG-plugin-tumblr/zipball/master)

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

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

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

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

### c) Add dependencies
Expand Down
7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"authors": [
"Jonathan Hornung <jonathan.hornung@gmail.com>"
],
"version": "0.6.0",
"version": "0.7.0",
"description": "tumblr plugin for apiNG",
"main": "dist/apiNG-plugin-tumblr.min.js",
"main": "dist/aping-plugin-tumblr.min.js",
"moduleType": [],
"keywords": [
"aping",
Expand All @@ -25,7 +25,6 @@
"tests"
],
"dependencies": {
"apiNG": "*",
"angular-tumblr-api-factory": "*"
"apiNG": "*"
}
}
2 changes: 1 addition & 1 deletion demo/aping-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apingApp.config(['$provide', function ($provide) {

$provide.constant("apingApiKeys", {
'tumblr': [
tumblr: [
{'api_key':'<YOUR_TUMBLR_API_KEY>'},
],
});
Expand Down
4 changes: 1 addition & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<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-tumblr-api-factory/src/angular-tumblr-api-factory.js"></script>
<script src="../src/aping-tumblr-directive.js"></script>
<script src="../src/aping-tumblr-helper.js"></script>
<script src="../dist/aping-plugin-tumblr.js"></script>
</head>
<body ng-app="app">

Expand Down
Loading

0 comments on commit 229bfd0

Please sign in to comment.