Skip to content

Commit

Permalink
Plugin rename: Rename associated files
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Feb 23, 2016
1 parent 7906b23 commit c71cde4
Show file tree
Hide file tree
Showing 25 changed files with 568 additions and 263 deletions.
212 changes: 102 additions & 110 deletions README.md
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>
11 changes: 10 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

### 1.3.0 - hapi plugins for exists and rename
#### 2016-Feb-09
* Exist green code coverage
* Rename green code coverage
* Dev-mode no gulp

### 1.2.0 - hapi.js v12
#### 2016-Jan-30

### 1.1.0 - Up-to-date and passes
#### 2016-Jan-24
* All tests pass
Expand Down Expand Up @@ -75,4 +84,4 @@
* Sample album with three Vancouver markers on map
* jQuery v1.7.2
* Mapstraction Build 2.0.18 - pre-release using Google Maps v3
* ColorBox v1.3.19
* ColorBox v1.3.19
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"gulp-mocha": "^2.2.0",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.0",
"lout": "^8.1.1",
"node-notifier": "^4.1.2"
},
"scripts": {
Expand Down Expand Up @@ -67,9 +68,8 @@
},
"homepage": "https://github.com/danactive/history",
"engines": {
"node": ">=0.10.35"
"npm": ">3"
},
"readmeFilename": "README.md",
"tuxharness": "./tuxharness.js",
"engines" : { "npm" : ">3" }
"tuxharness": "./tuxharness.js"
}
34 changes: 11 additions & 23 deletions plugins/exists/lib/index.js
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;
2 changes: 1 addition & 1 deletion plugins/exists/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "history-exists",
"version": "1.2.0",
"version": "2.0.0",
"description": "Verify if folder path exists",
"main": "index.js",
"scripts": {
Expand Down
Loading

0 comments on commit c71cde4

Please sign in to comment.