Skip to content

Commit

Permalink
Release 3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Jun 4, 2017
2 parents 6d9f1aa + 89d69fb commit 5bd1da2
Show file tree
Hide file tree
Showing 59 changed files with 5,308 additions and 2,938 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**Issues guidelines**
## Issues guidelines

- **Indicate your Photo-Sphere-Viewer, ThreeJS and web browser versions**
- Please search in the [documentation](http://photo-sphere-viewer.js.org) before asking.
- Any issue without enough details won't get any answer and will be closed.
- Help requests must be exhaustive, precise and come with some code explaining the need (use Markdown code highlight).
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/node_modules
/bower_components
/.sass-cache
/.idea
/*.iml
/node_modules
/bower_components
/.sass-cache
/.idea
/*.iml
40 changes: 40 additions & 0 deletions .jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"opts": {
"private": false,
"template": "node_modules/foodoc/template",
"readme": "build/jsdoc.md"
},
"plugins": [
"plugins/markdown"
],
"templates": {
"systemName": "Photo Sphere Viewer API",
"systemSummary": "A JavaScript library to display Photo Sphere panoramas",
"favicon": "build/jsdoc.png",
"systemColor": "#1C9F72",
"copyright": "Licensed under MIT License, documentation under CC BY 3.0.",
"includeDate": false,
"inverseNav": false,
"cleverLinks": true,
"sort": "longname, version, since",
"analytics": {
"ua": "UA-28192323-3",
"domain": "auto"
},
"navMembers": [
{"kind": "class", "title": "Classes", "summary": "All documented classes."},
{"kind": "external", "title": "Externals", "summary": "All documented external members."},
{"kind": "global", "title": "Globals", "summary": "All documented globals."},
{"kind": "mixin", "title": "Mixins", "summary": "All documented mixins."},
{"kind": "interface", "title": "Interfaces", "summary": "All documented interfaces."},
{"kind": "module", "title": "Components", "summary": "All documented components."},
{"kind": "event", "title": "Events", "summary": "All documented events."},
{"kind": "namespace", "title": "Namespaces", "summary": "All documented namespaces."},
{"kind": "tutorial", "title": "Tutorials", "summary": "All available tutorials."}
],
"scripts": [
"https://cdnjs.cloudflare.com/ajax/libs/trianglify/1.0.1/trianglify.min.js",
"js/custom.js"
]
}
}
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.*
build
doc
example
bower_components
Gruntfile.js
bower.json
147 changes: 115 additions & 32 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt, {
scsslint: 'grunt-scss-lint'
scsslint: 'grunt-scss-lint',
usebanner: 'grunt-banner'
});

require('simple-cli')('git')(grunt);

grunt.util.linefeed = '\n';

// some classes have to be executed before other
Expand All @@ -21,13 +24,12 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

banner:
'/*!\n' +
' * Photo Sphere Viewer <%= pkg.version %>\n' +
' * Copyright (c) 2014-2015 Jérémy Heleine\n' +
' * Copyright (c) 2015-<%= grunt.template.today("yyyy") %> Damien "Mistic" Sorel\n' +
' * Licensed under MIT (http://opensource.org/licenses/MIT)\n' +
' */',
banner: '/*!\n' +
' * Photo Sphere Viewer <%= grunt.option("tag") || pkg.version %>\n' +
' * Copyright (c) 2014-2015 Jérémy Heleine\n' +
' * Copyright (c) 2015-<%= grunt.template.today("yyyy") %> Damien "Mistic" Sorel\n' +
' * Licensed under MIT (http://opensource.org/licenses/MIT)\n' +
' */',

concat: {
/**
Expand All @@ -50,24 +52,11 @@ module.exports = function(grunt) {
},
src: files_in_order.concat(['src/icons/*.svg']),
dest: 'dist/photo-sphere-viewer.js'
},
/**
* Add banner to generated CSS files
*/
css: {
options: {
banner: '<%= banner %>\n\n'
},
files: [{
expand: true,
src: 'dist/*.css',
dest: ''
}]
}
},

/**
* Add AMD wrapper and banner to dist JS file
* Add AMD wrapper
*/
wrap: {
dist: {
Expand All @@ -76,22 +65,28 @@ module.exports = function(grunt) {
options: {
separator: '',
wrapper: function() {
var wrapper = grunt.file.read('src/js/.wrapper.js').replace(/\r\n/g, '\n').split(/@@js\n/);
wrapper[0] = grunt.template.process('<%= banner %>\n\n') + wrapper[0];
wrapper[1] = '\n' + wrapper[1];
return wrapper;
return grunt.file.read('src/js/.wrapper.js').replace(/\r\n/g, '\n').split(/@@js\n/);
}
}
}
},

/**
* Minify dist JS file
* Add banners
*/
uglify: {
usebanner: {
options: {
banner: '<%= banner %>\n\n'
banner: '<%= banner %>'
},
all: {
src: ['dist/*.{js,css}']
}
},

/**
* Minify dist JS file
*/
uglify: {
dist: {
src: 'dist/photo-sphere-viewer.js',
dest: 'dist/photo-sphere-viewer.min.js'
Expand Down Expand Up @@ -165,6 +160,36 @@ module.exports = function(grunt) {
}
},

/**
* Copy doc custom script
*/
copy: {
doc_script: {
src: 'build/jsdoc.js',
dest: 'doc/js/custom.js'
}
},

/**
* Clean doc
*/
clean: {
doc: ['doc']
},

/**
* jsDoc generation
*/
jsdoc: {
lib: {
src: ['src/js/**/*.js', '!src/js/.wrapper.js', '!src/js/lib/*.js'],
options: {
destination: 'doc',
config: '.jsdoc.json'
}
}
},

/**
* Mocha unit tests
*/
Expand Down Expand Up @@ -216,19 +241,54 @@ module.exports = function(grunt) {
dev: {
path: 'http://localhost:<%= connect.dev.options.port%>/example/index.htm'
}
},

/**
* Release tasks
*/
git: {
checkout: {
args: ['master']
},

merge: {
args: ['dev'],
options: {
'strategy-option': 'theirs',
'm': 'Release <%= grunt.option("tag") %>'
}
},

commit: {
options: {
'a': true,
'amend': true,
'no-edit': true
}
},

tag: {
args: ['<%= grunt.option("tag") %>']
}
}
});

grunt.registerTask('updatePackage', 'Update version in package.json', function() {
var pkg = grunt.config('pkg');
pkg.version = grunt.option('tag');
grunt.file.write('package.json', JSON.stringify(pkg, null, 2) + '\n');
});

/**
* Build the lib
*/
grunt.registerTask('default', [
'concat:js',
grunt.registerTask('build', [
'concat',
'wrap',
'uglify',
'sass',
'cssmin',
'concat:css'
'usebanner'
]);

/**
Expand All @@ -250,4 +310,27 @@ module.exports = function(grunt) {
'open',
'watch'
]);

/**
* Documentation
*/
grunt.registerTask('doc', [
'clean:doc',
'jsdoc',
'copy:doc_script'
]);

/**
* Release
*/
grunt.registerTask('release', [
'git:checkout',
'git:merge',
'updatePackage',
'build',
'git:commit',
'git:tag'
]);

grunt.registerTask('default', ['build']);
};
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,61 @@
[![Bower version](https://img.shields.io/bower/v/Photo-Sphere-Viewer.svg?style=flat-square)](http://photo-sphere-viewer.js.org)
[![NPM version](https://img.shields.io/npm/v/photo-sphere-viewer.svg?style=flat-square)](https://www.npmjs.com/package/photo-sphere-viewer)
[![Build Status](https://img.shields.io/travis/mistic100/Photo-Sphere-Viewer/master.svg?style=flat-square)](https://travis-ci.org/mistic100/Photo-Sphere-Viewer)
[![Dependencies Status](https://david-dm.org/mistic100/Photo-Sphere-Viewer/status.svg?style=flat-square)](https://david-dm.org/mistic100/Photo-Sphere-Viewer)

Photo Sphere Viewer is a JavaScript library that allows you to display 360×180 degrees panoramas on any web page. Panoramas must use the equirectangular projection and can be taken with the Google Camera, the Ricoh Theta or any 360° camera.

Forked from [JeremyHeleine/Photo-Sphere-Viewer](https://github.com/JeremyHeleine/Photo-Sphere-Viewer).

## Documentation
http://photo-sphere-viewer.js.org
[photo-sphere-viewer.js.org](http://photo-sphere-viewer.js.org)

## Dependencies
* [three.js](http://threejs.org)
* [doT.js](http://olado.github.io/doT) (@master)
* [doT.js](http://olado.github.io/doT)
* [uEvent](https://github.com/mistic100/uEvent)
* [D.js](http://malko.github.io/D.js)

## Install

#### Manually

[Download the latest release](https://github.com/mistic100/Photo-Sphere-Viewer/releases)

#### With Bower

```bash
$ bower install Photo-Sphere-Viewer
```

#### With npm

```bash
$ npm install photo-sphere-viewer
```

#### Via CDN

Photo Sphere Viewer is available on [jsDelivr](https://cdn.jsdelivr.net/npm/photo-sphere-viewer/dist/) and [unpkg](https://unpkg.com/photo-sphere-viewer/dist/)

## Build

### Prerequisites
#### Prerequisites
* NodeJS + NPM: `apt-get install nodejs-legacy npm`
* Ruby Dev: `apt-get install ruby-dev`
* Grunt CLI: `npm install -g grunt-cli`
* Bower: `npm install -g bower`
* SASS: `gem install sass`

### Run
#### Run

Install Node and Bower dependencies `npm install & bower install` then run `grunt` in the root directory to generate production files inside `dist`.

### Other commands
#### Other commands

* `grunt test` to run jshint/jscs/scsslint.
* `grunt serve` to open the example page with automatic build and livereload.
* `grunt jsdoc` to generate the documentation.

## License
This library is available under the MIT license.
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"three.js": ">= 0.70.0",
"D.js": "~0.7.3",
"uevent": "~1.0.0",
"doT": "master"
"doT": ">=1.0.3"
},
"devDependencies": {
"three.js-examples": "master"
Expand All @@ -41,6 +41,8 @@
"**/.*",
"node_modules",
"bower_components",
"build",
"example",
"src",
"tests",
"package.json",
Expand Down
12 changes: 12 additions & 0 deletions build/jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(function() {
var header = $('.page-header');
var pattern = Trianglify({
width: window.screen.width | header.outerWidth(),
height: header.outerHeight(),
cell_size: 90,
seed: 'Photo Sphere Viewer',
x_colors: ['#09B4E9', '#15884C']
});

header.css('background-image', 'url(' + pattern.png() + ')');
}());
9 changes: 9 additions & 0 deletions build/jsdoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# <i class="glyphicon glyphicon-home"></i> [Main documentation](..)

# [PhotoSphereViewer](PhotoSphereViewer.html)

# [Events](list_event.html)

# [Components](module-components.html)

# [PSVMarker](PSVMarker.html) & [PSVHUD](module-components.PSVHUD.html)
Binary file added build/jsdoc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5bd1da2

Please sign in to comment.