Skip to content

Commit

Permalink
Updated docs, code checking & bump to v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
IjzerenHein committed Apr 7, 2015
1 parent 4ecda33 commit f99ecd5
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"rules": {
"valid-jsdoc": 0,
"curly": [1, "multi"],
"curly": [1, "all"],
"brace-style": [1, "stroustrup"],
"consistent-this": 2,
"no-constant-condition": 1,
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
The list is still small but I hope it will grow :)

- Hein Rutjes (IjzerenHein)


- Pierre-Eric Marchandet (PEM)
51 changes: 11 additions & 40 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,17 @@ module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Task configuration.
jshint: {
eslint: {
target: ['BkImageSurface.js'],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
browser: true,
globals: {
jQuery: true
}
},
gruntfile: {
src: 'Gruntfile.js'
},
lib_test: {
src: ['*.js', 'examples/panToPosition/*.js', 'test/**/*.js']
config: '.eslintrc'
}
},
qunit: {
files: ['test/**/*.html']
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test', 'qunit']
}
jscs: {
src: ['BkImageSurface.js'],
options: {
config: '.jscsrc'
}
},
jsdoc2md: {
separateOutputFilePerInput: {
Expand All @@ -55,12 +28,10 @@ module.exports = function(grunt) {
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');

// Default task.
grunt.registerTask('default', ['jshint', 'jsdoc2md', 'qunit']);

grunt.registerTask('default', ['eslint', 'jscs', 'jsdoc2md']);
};
8 changes: 2 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "famous-bkimagesurface",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/IjzerenHein/famous-bkimagesurface",
"repository": {
"type": "git",
Expand Down Expand Up @@ -29,9 +29,5 @@
"Gruntfile.js",
"CONTRIBUTORS.md",
"package.json"
],
"devDependencies": {
"requirejs": "~2.1.11",
"famous": "~0.2.0"
}
]
}
82 changes: 50 additions & 32 deletions docs/BkImageSurface.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,65 @@ It uses a 'div' with a background-image rather than a 'img' tag.
Can be used as a drop-in replacement for ImageSurface, in case the the size of the div is not derived
from the image.

<a name="module_BkImageSurface"></a>
<a name="exp_module_BkImageSurface"></a>
##class: BkImageSurface ⏏
**Members**

* [new BkImageSurface(options)](#module_BkImageSurface)
* [bkImageSurface.setContent(imageUrl)](#module_BkImageSurface#setContent)
* [bkImageSurface.getContent()](#module_BkImageSurface#getContent)
* [bkImageSurface.setSizeMode(sizeMode)](#module_BkImageSurface#setSizeMode)
* [bkImageSurface.getSizeMode()](#module_BkImageSurface#getSizeMode)
* [bkImageSurface.setPositionMode(positionMode)](#module_BkImageSurface#setPositionMode)
* [bkImageSurface.getPositionMode()](#module_BkImageSurface#getPositionMode)
* [bkImageSurface.setRepeatMode(repeatMode)](#module_BkImageSurface#setRepeatMode)
* [bkImageSurface.getRepeatMode()](#module_BkImageSurface#getRepeatMode)
* [enum: BkImageSurface.SizeMode](#module_BkImageSurface.SizeMode)
* [enum: BkImageSurface.PositionMode](#module_BkImageSurface.PositionMode)
* [enum: BkImageSurface.RepeatMode](#module_BkImageSurface.RepeatMode)
* [class: BkImageSurface ⏏](#exp_module_BkImageSurface)
* [new BkImageSurface(options)](#exp_new_module_BkImageSurface)
* [enum: BkImageSurface.SizeMode](#module_BkImageSurface.SizeMode)
* [module:BkImageSurface.SizeMode.AUTO](#module_BkImageSurface.SizeMode.AUTO)
* [module:BkImageSurface.SizeMode.FILL](#module_BkImageSurface.SizeMode.FILL)
* [module:BkImageSurface.SizeMode.ASPECTFILL](#module_BkImageSurface.SizeMode.ASPECTFILL)
* [module:BkImageSurface.SizeMode.ASPECTFIT](#module_BkImageSurface.SizeMode.ASPECTFIT)
* [enum: BkImageSurface.PositionMode](#module_BkImageSurface.PositionMode)
* [module:BkImageSurface.PositionMode.CENTER](#module_BkImageSurface.PositionMode.CENTER)
* [module:BkImageSurface.PositionMode.LEFT](#module_BkImageSurface.PositionMode.LEFT)
* [module:BkImageSurface.PositionMode.RIGHT](#module_BkImageSurface.PositionMode.RIGHT)
* [module:BkImageSurface.PositionMode.TOP](#module_BkImageSurface.PositionMode.TOP)
* [module:BkImageSurface.PositionMode.BOTTOM](#module_BkImageSurface.PositionMode.BOTTOM)
* [module:BkImageSurface.PositionMode.TOPLEFT](#module_BkImageSurface.PositionMode.TOPLEFT)
* [module:BkImageSurface.PositionMode.TOPRIGHT](#module_BkImageSurface.PositionMode.TOPRIGHT)
* [module:BkImageSurface.PositionMode.BOTTOMLEFT](#module_BkImageSurface.PositionMode.BOTTOMLEFT)
* [module:BkImageSurface.PositionMode.BOTTOMRIGHT](#module_BkImageSurface.PositionMode.BOTTOMRIGHT)
* [enum: BkImageSurface.RepeatMode](#module_BkImageSurface.RepeatMode)
* [module:BkImageSurface.RepeatMode.NONE](#module_BkImageSurface.RepeatMode.NONE)
* [module:BkImageSurface.RepeatMode.VERTICAL](#module_BkImageSurface.RepeatMode.VERTICAL)
* [module:BkImageSurface.RepeatMode.HORIZONTAL](#module_BkImageSurface.RepeatMode.HORIZONTAL)
* [module:BkImageSurface.RepeatMode.BOTH](#module_BkImageSurface.RepeatMode.BOTH)
* [bkImageSurface.setContent(imageUrl)](#module_BkImageSurface#setContent)
* [bkImageSurface.getContent()](#module_BkImageSurface#getContent)
* [bkImageSurface.setSizeMode(sizeMode)](#module_BkImageSurface#setSizeMode)
* [bkImageSurface.getSizeMode()](#module_BkImageSurface#getSizeMode)
* [bkImageSurface.setPositionMode(positionMode)](#module_BkImageSurface#setPositionMode)
* [bkImageSurface.getPositionMode()](#module_BkImageSurface#getPositionMode)
* [bkImageSurface.setRepeatMode(repeatMode)](#module_BkImageSurface#setRepeatMode)
* [bkImageSurface.getRepeatMode()](#module_BkImageSurface#getRepeatMode)

<a name="module_BkImageSurface"></a>
<a name="exp_new_module_BkImageSurface"></a>
###new BkImageSurface(options)
**Params**

- options `Object` - Options.
- [content] `String` - Image-url.
- [sizeMode] `SizeMode` | `String` - Size-mode to use.
- [positionMode] `PositionMode` | `String` - Position-mode to use.
- [repeatMode] `RepeatMode` | `String` - Repeat-mode to use.
- options `Object` - Options.
- \[content\] `String` - Image-url.
- \[sizeMode\] `SizeMode` | `String` - Size-mode to use.
- \[positionMode\] `PositionMode` | `String` - Position-mode to use.
- \[repeatMode\] `RepeatMode` | `String` - Repeat-mode to use.

<a name="module_BkImageSurface.SizeMode"></a>
###enum: BkImageSurface.SizeMode
**Properties**: `AUTO`, `FILL`, `ASPECTFILL`, `ASPECTFIT`
<a name="module_BkImageSurface.PositionMode"></a>
###enum: BkImageSurface.PositionMode
**Properties**: `CENTER`, `LEFT`, `RIGHT`, `TOP`, `BOTTOM`, `TOPLEFT`, `TOPRIGHT`, `BOTTOMLEFT`, `BOTTOMRIGHT`
<a name="module_BkImageSurface.RepeatMode"></a>
###enum: BkImageSurface.RepeatMode
**Properties**: `NONE`, `VERTICAL`, `HORIZONTAL`, `BOTH`
<a name="module_BkImageSurface#setContent"></a>
###bkImageSurface.setContent(imageUrl)
**Params**

- imageUrl `String` - Image-url, when set will cause re-rendering
- imageUrl `String` - Image-url, when set will cause re-rendering

<a name="module_BkImageSurface#getContent"></a>
###bkImageSurface.getContent()
Expand All @@ -46,7 +73,7 @@ from the image.
###bkImageSurface.setSizeMode(sizeMode)
**Params**

- sizeMode `SizeMode` | `String` - Sizing-mode, when set will cause re-rendering
- sizeMode `SizeMode` | `String` - Sizing-mode, when set will cause re-rendering

<a name="module_BkImageSurface#getSizeMode"></a>
###bkImageSurface.getSizeMode()
Expand All @@ -55,7 +82,7 @@ from the image.
###bkImageSurface.setPositionMode(positionMode)
**Params**

- positionMode `PositionMode` | `String` - Position-mode, when set will cause re-rendering
- positionMode `PositionMode` | `String` - Position-mode, when set will cause re-rendering

<a name="module_BkImageSurface#getPositionMode"></a>
###bkImageSurface.getPositionMode()
Expand All @@ -64,17 +91,8 @@ from the image.
###bkImageSurface.setRepeatMode(repeatMode)
**Params**

- repeatMode `RepeatMode` | `String` - Repeat-mode, when set will cause re-rendering
- repeatMode `RepeatMode` | `String` - Repeat-mode, when set will cause re-rendering

<a name="module_BkImageSurface#getRepeatMode"></a>
###bkImageSurface.getRepeatMode()
**Returns**: `RepeatMode` | `String` - Repeat-mode
<a name="module_BkImageSurface.SizeMode"></a>
###enum: BkImageSurface.SizeMode
**Properties**: `AUTO`, `FILL`, `ASPECTFILL`, `ASPECTFIT`
<a name="module_BkImageSurface.PositionMode"></a>
###enum: BkImageSurface.PositionMode
**Properties**: `CENTER`, `LEFT`, `RIGHT`, `TOP`, `BOTTOM`, `TOPLEFT`, `TOPRIGHT`, `BOTTOMLEFT`, `BOTTOMRIGHT`
<a name="module_BkImageSurface.RepeatMode"></a>
###enum: BkImageSurface.RepeatMode
**Properties**: `NONE`, `VERTICAL`, `HORIZONTAL`, `BOTH`
7 changes: 3 additions & 4 deletions examples/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<!-- shims for backwards compatibility -->
<script type="text/javascript" src="https://code.famo.us/lib/functionPrototypeBind.js"></script>
<script type="text/javascript" src="https://code.famo.us/lib/classList.js"></script>
<script type="text/javascript" src="https://code.famo.us/lib/requestAnimationFrame.js"></script>

<!-- module loader -->
<script type="text/javascript" src="https://code.famo.us/lib/require.js"></script>

Expand All @@ -25,12 +25,11 @@
require.config({
baseUrl: '',
paths: {
'famous-bkimagesurface': '../../BkImageSurface',
'famous-bkimagesurface': '../../BkImageSurface'
}
});
require(['main']);
</script>

</head>
<body></body>
</html>
2 changes: 0 additions & 2 deletions examples/demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* @copyright Gloey Apps, 2014
*/

/*global define*/

define(function(require) {
'use strict';

Expand Down
6 changes: 2 additions & 4 deletions examples/imagesurface/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* @copyright Gloey Apps, 2014
*/

/*global define*/

define(function(require) {
'use strict';

Expand Down Expand Up @@ -47,7 +45,7 @@ define(function(require) {
}
});

var text = new Surface({
var subText = new Surface({
content: 'size: ' + JSON.stringify(size) + '<br>desc: ' + text,
properties: {
color: 'white',
Expand All @@ -63,7 +61,7 @@ define(function(require) {
var renderNode = new RenderNode(modifier);
renderNode.add(back);
renderNode.add(image);
renderNode.add(text);
renderNode.add(subText);
renderables.push(renderNode);
}

Expand Down
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "famous-bkimagesurface",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/IjzerenHein/famous-bkimagesurface",
"repository": {
"type": "git",
"url": "git://github.com/IjzerenHein/famous-bkimagesurface.git"
},
"browserify": {
"transform": [
"deamdify",
"famousify",
"brfs"
"deamdify"
]
},
"author": {
Expand Down Expand Up @@ -38,14 +36,11 @@
"node": ">= 0.10.0"
},
"devDependencies": {
"brfs": "latest",
"browserify": "latest",
"deamdify": "latest",
"famousify": "latest",
"grunt": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-watch": "latest",
"grunt-contrib-qunit": "latest",
"grunt-eslint": "latest",
"grunt-jscs": "latest",
"grunt-jsdoc-to-markdown": "latest"
},
"files": [
Expand Down

0 comments on commit f99ecd5

Please sign in to comment.