-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin rename: Rename associated files
- Loading branch information
Showing
25 changed files
with
568 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,102 @@ | ||
history | ||
======= | ||
|
||
Your personal **history** storyboarded with photo and video albums. Associate photos with their meta data including geocode, caption, friends (characters)... in XML albums. | ||
* Plot thumbnails on a map | ||
* Code runs on static web hosts | ||
* Includes administration tools for XML generation | ||
* Free & open source (dependant on other open source projects see indiviual licenses) | ||
|
||
[Demo site 0.15.0](http://danactive.github.io/history/) | ||
|
||
|
||
Basic Demo Usage | ||
------ | ||
|
||
* Clone this repository. | ||
* Open Index.htm in Firefox. | ||
* Click View Photo Galleries. | ||
* Click Sample. | ||
* From there it becomes more obvious. | ||
|
||
Technologies | ||
------ | ||
####Viewing | ||
* XML databases for photo/video galleries | ||
* XSLT to transform XML to HTML/CSS/JavaScript/jQuery | ||
* JavaScript/jQuery for the pagination & lightbox | ||
|
||
####Administration | ||
* Node.js to support AJAX & image manipulation | ||
* AJAX to read the XML gallery data | ||
|
||
|
||
Dependancies | ||
------ | ||
Included in this project | ||
* [jQuery](http://jquery.com/) via bower | ||
* [ColorBox (jQuery plugin)](http://www.jacklmoore.com/colorbox) via bower | ||
* [Mapstraction (mapping)](http://mapstraction.com/) build 2.0.18 | ||
* [Google Maps (map provider)](https://developers.google.com/maps/) v3 | ||
* [Twitter Bootstrap (admin)](http://twitter.github.com/bootstrap/) v2.0.3 | ||
* [Fluid 960 Grid System (admin)](http://www.designinfluences.com/fluid960gs/) | ||
|
||
To use the administration tools | ||
* [node.js](http://nodejs.org/) | ||
* [hapi.js](http://hapijs.org/) | ||
* [GraphicsMagick](https://www.npmjs.com/package/gm) Install GraphicsMagick before npm | ||
* [bower](http://bower.io/) via npm | ||
* npm install -g bower | ||
|
||
Folder structures | ||
------- | ||
* admin/ - administration files for generating XML. Copy and paste the XML structure into the albums | ||
* gallery-demo/ - demonstration of a gallery with the sample album inside | ||
* node_modules/ - Backup of installed modules for Node.js | ||
* .gitignore - blacklist files/folders for GitHub | ||
* README.md - this file | ||
* index.htm - Home page when avoiding Node.js | ||
* video.htm - Reads a query string and generates the HTML5 video tags | ||
* app.js - Node.js code for creating a web server | ||
* webserver_node START.bat - (Windows) Executes the Node.js web server for localhost viewing and administration image manipulation | ||
* webserver_node VIEW.url - (Windows) Opens http://localhost in default browser | ||
|
||
Photo/video album XML schemas | ||
------- | ||
### Current schema (2.0) | ||
|
||
Example | ||
|
||
<album> | ||
<meta> | ||
<gallery>demo</gallery> <!-- gallery directory name excluding 'gallery-'; new in schema 2.0 --> | ||
<id>sample</id> <!--Filename is album_sample.xml; new in schema 2.0--> | ||
<version>1.8</version> <!--Reference schema version; new in schema 2.0--> | ||
</meta> | ||
<item><!-- photo --> | ||
<id>1</id> <!-- id attribute must be unique for this album; used by JavaScript & for character association --> | ||
<filename>2001-03-21-01.jpg</filename> <!-- must start with YYYY year; photos and thumbs must be places in this folder too --> | ||
<geo> <!-- geocode --> | ||
<lat>49.25</lat> <!-- latitude --> | ||
<lon>-123.1</lon> <!-- longitude --> | ||
</geo> | ||
<photo_city>Vancouver, BC</photo_city> <!-- Political location name often City, Province/State --> | ||
<photo_loc>Granville Island</photo_loc> <!-- General location name often neighourhood or building --> | ||
<photo_desc>An oversized avocado</photo_desc> <!-- The photo description only viewable in the lightbox view --> | ||
<thumb_caption>Lunch</thumb_caption> <!-- Less than three words to descibe the thumbnail in gallery view --> | ||
</item> | ||
<item><!-- video --> | ||
<id>1</id> <!-- id attribute must be unique for this album; used by JavaScript & for character association --> | ||
<filename>2012-fireplace.mp4</filename> <!-- History supports both HTML5 video formats for best browser support; must start with YYYY year; photos and thumbs must be places in this folder too --> | ||
<filename>2012-fireplace.webm</filename> | ||
<photo_city>Vancouver, BC</photo_city> | ||
<photo_loc>Home</photo_loc> | ||
<thumb_caption>Video: Fireplace</thumb_caption> | ||
<photo_desc>A sample HTML5 video in both MP4 and WebM formats</photo_desc> | ||
<size><w>1280</w><h>720</h></size> <!-- Dimensions for opening the popup window and enlarging the HTML5 video --> | ||
<geo> | ||
<lat>49.25</lat> | ||
<lon>-123.1</lon> | ||
</geo> | ||
</item> | ||
</album> | ||
|
||
License | ||
------- | ||
History is open-source and released under the [BSD License.](http://www.opensource.org/licenses/bsd-license.php) | ||
|
||
Versioning | ||
------- | ||
http://semver.org/ | ||
history | ||
======= | ||
|
||
Your personal **history** storyboarded with photo and video albums. Associate photos with their meta data including geocode, caption, friends (characters)... in XML albums. | ||
* Plot thumbnails on a map | ||
* Code runs on static web hosts | ||
* Includes administration tools for XML generation | ||
* Free & open source (dependant on other open source projects see indiviual licenses) | ||
|
||
[Demo site 0.15.0](http://danactive.github.io/history/) | ||
|
||
|
||
Basic Demo Usage | ||
------ | ||
|
||
* Clone this repository. | ||
* Open Index.htm in Firefox. | ||
* Click View Photo Galleries. | ||
* Click Sample. | ||
* From there it becomes more obvious. | ||
|
||
Technologies | ||
------ | ||
####Viewing | ||
* XML databases for photo/video galleries | ||
* XSLT to transform XML to HTML/CSS/JavaScript/jQuery | ||
* JavaScript/jQuery for the pagination & lightbox | ||
|
||
####Administration | ||
* Node.js to support AJAX & image manipulation | ||
* AJAX to read the XML gallery data | ||
|
||
|
||
Dependancies | ||
------ | ||
Included in this project | ||
* [jQuery](http://jquery.com/) via bower | ||
* [ColorBox (jQuery plugin)](http://www.jacklmoore.com/colorbox) via bower | ||
* [Mapstraction (mapping)](http://mapstraction.com/) build 2.0.18 | ||
* [Google Maps (map provider)](https://developers.google.com/maps/) v3 | ||
* [Twitter Bootstrap (admin)](http://twitter.github.com/bootstrap/) v2.0.3 | ||
* [Fluid 960 Grid System (admin)](http://www.designinfluences.com/fluid960gs/) | ||
|
||
To use the administration tools | ||
* [node.js](http://nodejs.org/) | ||
* [hapi.js](http://hapijs.org/) | ||
* [GraphicsMagick](https://www.npmjs.com/package/gm) Install GraphicsMagick before npm | ||
* [bower](http://bower.io/) via npm | ||
* npm install -g bower | ||
|
||
Folder structures | ||
------- | ||
* admin/ - administration files for generating XML. Copy and paste the XML structure into the albums | ||
* gallery-demo/ - demonstration of a gallery with the sample album inside | ||
* node_modules/ - Backup of installed modules for Node.js | ||
* .gitignore - blacklist files/folders for GitHub | ||
* README.md - this file | ||
* index.htm - Home page when avoiding Node.js | ||
* video.htm - Reads a query string and generates the HTML5 video tags | ||
* app.js - Node.js code for creating a web server | ||
* webserver_node START.bat - (Windows) Executes the Node.js web server for localhost viewing and administration image manipulation | ||
* webserver_node VIEW.url - (Windows) Opens http://localhost in default browser | ||
|
||
Photo/video album XML schemas | ||
------- | ||
### Current schema (2.0) | ||
|
||
Example | ||
|
||
<album> | ||
<meta> | ||
<gallery>demo</gallery> <!-- gallery directory name excluding 'gallery-'; new in schema 2.0 --> | ||
<id>sample</id> <!--Filename is album_sample.xml; new in schema 2.0--> | ||
<version>1.8</version> <!--Reference schema version; new in schema 2.0--> | ||
</meta> | ||
<item><!-- photo --> | ||
<id>1</id> <!-- id attribute must be unique for this album; used by JavaScript & for character association --> | ||
<filename>2001-03-21-01.jpg</filename> <!-- must start with YYYY year; photos and thumbs must be places in this folder too --> | ||
<geo> <!-- geocode --> | ||
<lat>49.25</lat> <!-- latitude --> | ||
<lon>-123.1</lon> <!-- longitude --> | ||
</geo> | ||
<photo_city>Vancouver, BC</photo_city> <!-- Political location name often City, Province/State --> | ||
<photo_loc>Granville Island</photo_loc> <!-- General location name often neighourhood or building --> | ||
<photo_desc>An oversized avocado</photo_desc> <!-- The photo description only viewable in the lightbox view --> | ||
<thumb_caption>Lunch</thumb_caption> <!-- Less than three words to descibe the thumbnail in gallery view --> | ||
</item> | ||
<item><!-- video --> | ||
<id>1</id> <!-- id attribute must be unique for this album; used by JavaScript & for character association --> | ||
<filename>2012-fireplace.mp4</filename> <!-- History supports both HTML5 video formats for best browser support; must start with YYYY year; photos and thumbs must be places in this folder too --> | ||
<filename>2012-fireplace.webm</filename> | ||
<photo_city>Vancouver, BC</photo_city> | ||
<photo_loc>Home</photo_loc> | ||
<thumb_caption>Video: Fireplace</thumb_caption> | ||
<photo_desc>A sample HTML5 video in both MP4 and WebM formats</photo_desc> | ||
<size><w>1280</w><h>720</h></size> <!-- Dimensions for opening the popup window and enlarging the HTML5 video --> | ||
<geo> | ||
<lat>49.25</lat> | ||
<lon>-123.1</lon> | ||
</geo> | ||
</item> | ||
</album> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,28 @@ | ||
'use strict'; | ||
/* | ||
* ####### | ||
* # # # # #### ##### #### | ||
* # # # # # # # | ||
* ##### ## # #### # #### | ||
* # ## # # # # | ||
* # # # # # # # # # | ||
* ####### # # # #### # #### | ||
* | ||
*/ | ||
/** | ||
Verify if a path exists on the file system | ||
@method folderExists | ||
@param {string} path absolute path (file or folder) on the file system | ||
@method pathExists | ||
@param {string} path relative/absolute path (file or folder) on the file system | ||
@param {promise} | ||
**/ | ||
function folderExists(verifyPath) { | ||
function pathExists(verifyPath) { | ||
return new Promise((resolve, reject) => { | ||
const fs = require('fs'); | ||
const appRoot = require('app-root-path'); | ||
let verifiedPath = verifyPath; | ||
|
||
if (verifyPath.charAt(0) === '.' || verifyPath.charAt(0) === '/') { // convert relative to absolute | ||
verifiedPath = appRoot.resolve(verifyPath); | ||
const boom = require('boom'); | ||
if (verifyPath === undefined) { | ||
reject(boom.notFound(`pathExists module: is missing a path to verify`)); | ||
} | ||
const verifiedPath = require('path').isAbsolute(verifyPath) ? | ||
verifyPath : require('app-root-path').resolve(verifyPath); | ||
|
||
fs.stat(verifiedPath, (error, type) => { | ||
const boom = require('boom'); | ||
require('fs').stat(verifiedPath, (error, type) => { | ||
if (error) { | ||
return reject(boom.notFound(`File system path is missing ${error}`)); | ||
return reject(boom.notFound(`pathExists module: File system path is missing ${error}`)); | ||
} | ||
if (type.isFile() || type.isDirectory()) { | ||
return resolve(verifiedPath); | ||
} | ||
}); | ||
}); | ||
} | ||
exports.folderExists = folderExists; | ||
exports.pathExists = pathExists; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.