Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pin0 committed Jun 27, 2016
0 parents commit 90fcd51
Show file tree
Hide file tree
Showing 11 changed files with 405 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"globals": {
"OpenSeadragon": true,
"Caman" : true,
"_" : true
},
"rules": {
"indent": [
2,
4
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
]
},
"ecmaFeatures": {
"modules": true
},
"env": {
"es6": true,
"browser": true,
"node": true
},
"extends": "eslint:recommended"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
bower_components
62 changes: 62 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use strict';

var gulp = require('gulp');
var eslint = require('gulp-eslint');
var plugins = require('gulp-load-plugins')();

gulp.task('lint', function() {
return gulp.src([
'./src/*.js'
])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('uglify', function() {
return gulp.src([
'./src/*.js',
])
.pipe(plugins.plumber({
errorHandler: handleError
}))
.pipe(plugins.sourcemaps.init())
.pipe(plugins.concat('openseadragon-justified-collection.min.js'))
.pipe(plugins.uglify())
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
});

gulp.task('no-uglify', function() {
return gulp.src([
'./src/*.js',
])
.pipe(plugins.plumber({
errorHandler: handleError
}))
.pipe(plugins.sourcemaps.init())
.pipe(plugins.concat('openseadragon-justified-collection.js'))
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
});


gulp.task('watch', ['lint','uglify','no-uglify'], function () {
gulp.watch('./src/*.js', ['lint','uglify','no-uglify']);
});

gulp.task('serve', plugins.serve({
root: ['dist', 'images'],
port: 4040,
}));

gulp.task('default', ['watch', 'serve']);

/**
* Displays error message in the console
* @param error
*/
function handleError(error) {
plugins.util.beep();
plugins.util.log(plugins.util.colors.red(error));
}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Openseadragon plugin for arranging collections in a justified grid layout.

Much like <a href="https://github.com/flickr/justified-layout">flickr</a> does.

Demo

### Usage
Include dist/openseadragon-justified-collection.min.js after openseadragon

Add images to your viewer

And call viewer.world.arange();

19 changes: 19 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "openseadragon-justified-collection",
"homepage": "https://github.com/picturae/OpenSeadragonImageFilters",
"authors": [
"M. Nijdam <m.nijdam@picturae.nl>"
],
"description": "Openseadragon plugin for arranging collections in a justified grid layout.",
"main": "",
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
}
}
118 changes: 118 additions & 0 deletions dist/openseadragon-justified-collection.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/openseadragon-justified-collection.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/openseadragon-justified-collection.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 90fcd51

Please sign in to comment.