From b1e8cb0fea8d3c46ab2dc3d4b405028f74c47666 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 07:34:59 -0500 Subject: [PATCH 01/39] tweaked travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a45d4373..da5ee4283 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ node_js: - 0.8 branches: - only: - - dev \ No newline at end of file + only: + - master \ No newline at end of file From 042b04883f48675d40a904de96bc645bce3175ab Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 07:38:17 -0500 Subject: [PATCH 02/39] adding grunt-cli to travis build --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index da5ee4283..e8dfeb2f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ node_js: - 0.9 - 0.8 +before_script: + - npm install -g grunt-cli + branches: only: - master \ No newline at end of file From cd74c95d9c403a3e6f2165761fd72bfb9781a9b8 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 07:54:23 -0500 Subject: [PATCH 03/39] getting close with travis --- .travis.yml | 3 +++ Gruntfile.js | 5 +++++ test/{text.html => tests.html} | 0 3 files changed, 8 insertions(+) rename test/{text.html => tests.html} (100%) diff --git a/.travis.yml b/.travis.yml index e8dfeb2f0..7c5c97c46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ node_js: - 0.9 - 0.8 +before_install: + - phantomjs --version + before_script: - npm install -g grunt-cli diff --git a/Gruntfile.js b/Gruntfile.js index eba8d3bb0..a57a044e5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -66,6 +66,11 @@ module.exports = function(grunt) { } }, qunit: { + all:{ + options:{ + urls: ['./test/tests.html'] + } + } files: ["./test/tests.js"] } }); diff --git a/test/text.html b/test/tests.html similarity index 100% rename from test/text.html rename to test/tests.html From 87dab82e63e838a1e52b0fc7a22f628b509cc827 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 07:56:41 -0500 Subject: [PATCH 04/39] typo --- Gruntfile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index a57a044e5..86c0ab950 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -71,7 +71,6 @@ module.exports = function(grunt) { urls: ['./test/tests.html'] } } - files: ["./test/tests.js"] } }); From a69b0c6708366d8c6f6b1054651f648951c4419b Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 08:05:54 -0500 Subject: [PATCH 05/39] added the build status badge to the readme also updated the roadmap --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index be6a9642e..452ce4fd6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) + ## About the Node Version of Pattern Lab The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the [Mustache](http://mustache.github.io/)-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the [PHP version](https://github.com/pattern-lab/patternlab-php) should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice. @@ -23,9 +25,9 @@ To have patternlab-node watch for changes to either a mustache template, data, o Patternlab Node has reached [minimum viable product](http://en.wikipedia.org/wiki/Minimum_viable_product) status. The main branch will always have the most up to date version of patternlab-node. Watch the dev branch for what it coming next! #### Roadmap -* Full Patternlab site support. (This is the uber cool navigation found at [demo.pattern-lab.info](http://demo.pattern-lab.info)). -* More Documentation -* Tests +* DRY & Testing. +* Lineage +* Documentation **THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL** From 33a842e986a4b3f3a90ff6946b8dacb8c2f127dc Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 08:07:07 -0500 Subject: [PATCH 06/39] moved the badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 452ce4fd6..65ef4d724 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) + ## About the Node Version of Pattern Lab @@ -6,7 +6,7 @@ The Node version of Pattern Lab is, at its core, a static site generator. It com ## Under Active Development -The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). Contributions welcome! +The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). [![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) Contributions welcome! ### Getting Started From 8edfe791da159158f8b879f4578cdb596f17db8c Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sun, 16 Mar 2014 08:08:56 -0500 Subject: [PATCH 07/39] last move --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 65ef4d724..052f2a202 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ - - ## About the Node Version of Pattern Lab The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the [Mustache](http://mustache.github.io/)-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the [PHP version](https://github.com/pattern-lab/patternlab-php) should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice. ## Under Active Development -The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). [![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) Contributions welcome! +[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). Contributions welcome! ### Getting Started From 907738738a4c028d9f02ae22e05434be7713bd9f Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 17 Mar 2014 22:32:23 -0500 Subject: [PATCH 08/39] remove view all code fixes #2 --- builder/patternlab.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/builder/patternlab.js b/builder/patternlab.js index 7baedf008..7100c1f2f 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -286,40 +286,6 @@ module.exports = function(grunt) { } - //check to see if this bucket has a View All yet. If not, add it. - // var navItem = bucket.navItems[navItemIndex]; - // if(navItem){ - // var hasViewAll = navItem.navSubItemsIndex.indexOf('View All'); - // if(hasViewAll === -1){ - // console.log('add a view all pattern'); - - // var navSubItem = new oNavSubItem('View All'); - // navSubItem.patternPath = pattern.flatPatternPath + '/index.html'; //this is likely wrong - // navSubItem.patternPartial = 'viewall-' + bucketName + '-' + pattern.patternSubGroup; - - // //add the navSubItem - // console.log(navSubItem); - // navItem.navSubItems.push(navSubItem); - // navItem.navSubItemsIndex.push('View All'); - // } - // } - } - - //VIEW ALL LOGIC CAN LOOP THROUGH PATTERNS TOO - //only add if it's an atom, molecule, or organism - // if(pattern.patternGroup === 'atoms' || pattern.patternGroup === 'molecules' || pattern.patternGroup === 'organisms'){ - // if(patternlab.viewAllPaths[pattern.patternGroup]){ - - // //add the pattern sub-group - // patternlab.viewAllPaths[pattern.patternGroup][pattern.patternSubGroup] = pattern.flatPatternPath; - // } - // else{ - // //add the new group then the subgroup - // patternlab.viewAllPaths[pattern.patternGroup] = {}; - // patternlab.viewAllPaths[pattern.patternGroup][pattern.patternSubGroup] = pattern.flatPatternPath; - // } - // } - }; //the patternlab site requires a lot of partials to be rendered. From dd6c651af052acd7fac1e2b606b1efb92a2b10ad Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sat, 19 Apr 2014 15:13:13 -0500 Subject: [PATCH 09/39] contributing file --- CHANGELOG | 6 ++++++ CONTRIBUTING.md | 8 ++++++++ Gruntfile.js | 5 ++++- README.md | 13 ++++--------- builder/patternlab.js | 15 ++++++++++----- package.json | 5 +++-- 6 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG b/CHANGELOG index 36748fa97..12fea0c27 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,11 @@ THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT. +PL-node-v0.1.1 + - FIX: Removed View All Pattern SubItem Link Logic, no longer in reference implementation + - ADD: Flag for generating debug file + - ADD: Travis CI test support! + - ADD: Contributing file + PL-node-v0.1.0 - FIX: Links to patterns did not work when visited from a server - FIX: Patterns with hyphens in the name were breaking the iframe messaging diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..fc94f2124 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,8 @@ +#Contributing to Patternlab - Node +If you'd like to contribute to patternlab - node, please do so! There is always a lot of ground to cover, with patternlab - php being so feature-rich. + +No pull request is too small. + +##Guidelines +1. Please keep your pull requests concise +2. _ALWAYS_ submit it against the [dev branch](https://github.com/pattern-lab/patternlab-node/tree/dev). If this does not occur, I will first, try to redirect you gently, second, port over your contribution manually if time allows, and/or third, close your pull request. \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 86c0ab950..99b5969ef 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,7 +3,10 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), - clean: ['./public/patterns'], + clean: { + options: { force: true }, + files: ['./public/patterns'] + }, concat: { options: { stripBanners: true, diff --git a/README.md b/README.md index 052f2a202..a156c6782 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the [Mustache](http://mustache.github.io/)-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the [PHP version](https://github.com/pattern-lab/patternlab-php) should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice. -## Under Active Development - -[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). Contributions welcome! - ### Getting Started To run patternlab-node, just do the following from the command line at the root of patternlab-node: @@ -18,15 +14,14 @@ This creates all patterns, the styleguide, and the patternlab site. `patternlab. To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run `grunt watch`. The `Gruntfile` governs what is watched. It should be easy to add scss or whatever preprocessor you fancy. +### Under Active Development + +[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). Contributions welcome, but please take a moment to read the [guidelines](https://github.com/pattern-lab/patternlab-node/blob/master/CONTRIBUTING.md). + #### Watching Progress Patternlab Node has reached [minimum viable product](http://en.wikipedia.org/wiki/Minimum_viable_product) status. The main branch will always have the most up to date version of patternlab-node. Watch the dev branch for what it coming next! -#### Roadmap -* DRY & Testing. -* Lineage -* Documentation - **THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL** diff --git a/builder/patternlab.js b/builder/patternlab.js index 7100c1f2f..9d29c0a5f 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.0 - 2014-01-21 + * patternlab-node - v0.1.1 - 2014-04-18 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. @@ -57,7 +57,9 @@ var mustache = require('./lib/Mustache/mustache.js'); module.exports = function(grunt) { grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) { + var patternlab = {}; + patternlab.package = grunt.file.readJSON('package.json'); patternlab.data = grunt.file.readJSON('./source/_data/data.json'); patternlab.listitems = grunt.file.readJSON('./source/_data/listitems.json'); patternlab.header = grunt.file.read('./source/_patternlab-files/pattern-header-footer/header.html'); @@ -286,6 +288,8 @@ module.exports = function(grunt) { } + } + }; //the patternlab site requires a lot of partials to be rendered. @@ -323,9 +327,10 @@ module.exports = function(grunt) { }); grunt.file.write('./public/index.html', patternlabSiteHtml); - //debug - var outputFilename = './patternlab.json'; - grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); - + //debug file can be written by setting flag on package.json + if(patternlab.package.debug){ + var outputFilename = './patternlab.json'; + grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); + } }); }; \ No newline at end of file diff --git a/package.json b/package.json index 154533263..677a0466a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "patternlab-node", "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).", - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-watch": "~0.2.0", @@ -27,5 +27,6 @@ }, "engines": { "node": ">=0.8" - } + }, + "debug": false } From d7e4ec24e333caee81abae95ed392c5d1da6c7dc Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:04:01 -0500 Subject: [PATCH 10/39] updated readme mentions to spec --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a156c6782..35cc5eb14 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,22 @@ To run patternlab-node, just do the following from the command line at the root 2. `npm install -g grunt-cli` 3. `grunt` -This creates all patterns, the styleguide, and the patternlab site. `patternlab.json` is a file created for debugging purposes. It tells you all the secrets in tidy json. +This creates all patterns, the styleguide, and the pattern lab site. `patternlab.json` is a file created for debugging purposes. It tells you all the secrets in tidy json. To have patternlab-node watch for changes to either a mustache template, data, or stylesheets, run `grunt watch`. The `Gruntfile` governs what is watched. It should be easy to add scss or whatever preprocessor you fancy. ### Under Active Development -[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer). Contributions welcome, but please take a moment to read the [guidelines](https://github.com/pattern-lab/patternlab-node/blob/master/CONTRIBUTING.md). +[![Build Status](https://travis-ci.org/pattern-lab/patternlab-node.png?branch=master)](https://travis-ci.org/pattern-lab/patternlab-node) The Node version of Pattern Lab is under active development by [@bmuenzenmeyer](https://twitter.com/bmuenzenmeyer) and contributors. Pull requests welcome, but please take a moment to read the [guidelines](https://github.com/pattern-lab/patternlab-node/blob/master/CONTRIBUTING.md). -#### Watching Progress +#### Forward, To the Specification! + +Dave Olsen has published the [specification](https://github.com/pattern-lab/the-spec/blob/draft/SPEC.md) for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together. + +#### Is Pattern Lab a Platform or a Build Tool? + +A lot of good conversation has revolved around whether Pattern Lab is a platform or a tool in the toolbox, part of a larger solution. It's my goal to #1) adhere to the specification and #2) meet the needs of both use cases. -Patternlab Node has reached [minimum viable product](http://en.wikipedia.org/wiki/Minimum_viable_product) status. The main branch will always have the most up to date version of patternlab-node. Watch the dev branch for what it coming next! **THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL** From ee79775d24ede114f7b212d57e09e794f752b343 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:07:46 -0500 Subject: [PATCH 11/39] added repository to package.json fixes #32 --- CHANGELOG | 2 ++ package.json | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 12fea0c27..7312afffc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,8 @@ PL-node-v0.1.1 - ADD: Flag for generating debug file - ADD: Travis CI test support! - ADD: Contributing file + - ADD: Repository to package.json + - THX: thank you @tbranyen for tip on repository PL-node-v0.1.0 - FIX: Links to patterns did not work when visited from a server diff --git a/package.json b/package.json index 677a0466a..56cffd6d8 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,10 @@ "Grunt", "Javascript" ], + "repository": { + "type": "git", + "url": "git://github.com/pattern-lab/patternlab-node.git" + }, "author": "Brian Muenzenmeyer", "license": "MIT", "scripts": { From 461eda8295b9fa3599e7e13050eec67182b0ca32 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:12:09 -0500 Subject: [PATCH 12/39] changed dependencies should support NPM this way. need to reconcile with Travis --- CHANGELOG | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7312afffc..aa08b7cfc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,8 @@ PL-node-v0.1.1 - ADD: Travis CI test support! - ADD: Contributing file - ADD: Repository to package.json - - THX: thank you @tbranyen for tip on repository + - CHG: Changed devDependencies to dependencies + - THX: thank you @tbranyen for tip on repository, dependencies, and NPM PL-node-v0.1.0 - FIX: Links to patterns did not work when visited from a server diff --git a/package.json b/package.json index 56cffd6d8..eacd39f42 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "patternlab-node", "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).", "version": "0.1.1", - "devDependencies": { + "dependencies": { "grunt": "~0.4.0", "grunt-contrib-watch": "~0.2.0", "grunt-contrib-sass": "~0.2.2", From feec29fc9c8d3f997c0878a76062f65d4321d7ed Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:14:25 -0500 Subject: [PATCH 13/39] removed scripts files not supported feature yet --- scripts/README | 6 ------ scripts/generateSite.command | 3 --- scripts/startAutoReloadServer.command | 3 --- scripts/startPageFollowServer.command | 3 --- scripts/startWatcher.command | 3 --- 5 files changed, 18 deletions(-) delete mode 100644 scripts/README delete mode 100644 scripts/generateSite.command delete mode 100644 scripts/startAutoReloadServer.command delete mode 100644 scripts/startPageFollowServer.command delete mode 100644 scripts/startWatcher.command diff --git a/scripts/README b/scripts/README deleted file mode 100644 index 95dca5ed7..000000000 --- a/scripts/README +++ /dev/null @@ -1,6 +0,0 @@ -These are Mac OS X-compatible files to open up select command line scripts. Simply double-click on a file and it should run -the appropriate shell command. If you receive a permissions error you will need to use the command line to fix it. -Simply go to the command line, cd to the scripts/php directory and type chmod +x [filename]. Replace [filename] with the -appropriate filenames. - -That's confusing. \ No newline at end of file diff --git a/scripts/generateSite.command b/scripts/generateSite.command deleted file mode 100644 index acd0220e4..000000000 --- a/scripts/generateSite.command +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -DIR="$( cd "$( dirname "$0" )" && pwd )" -php $DIR/../builder/builder.php -g \ No newline at end of file diff --git a/scripts/startAutoReloadServer.command b/scripts/startAutoReloadServer.command deleted file mode 100644 index 8dfc8676e..000000000 --- a/scripts/startAutoReloadServer.command +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -DIR="$( cd "$( dirname "$0" )" && pwd )" -php $DIR/../listeners/contentSyncBroadcasterServer.php \ No newline at end of file diff --git a/scripts/startPageFollowServer.command b/scripts/startPageFollowServer.command deleted file mode 100644 index 8bfa8a9db..000000000 --- a/scripts/startPageFollowServer.command +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -DIR="$( cd "$( dirname "$0" )" && pwd )" -php $DIR/../listeners/navSyncBroadcasterServer.php \ No newline at end of file diff --git a/scripts/startWatcher.command b/scripts/startWatcher.command deleted file mode 100644 index c1a8b937e..000000000 --- a/scripts/startWatcher.command +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -DIR="$( cd "$( dirname "$0" )" && pwd )" -php $DIR/../builder/builder.php -w \ No newline at end of file From 8e7422b4fa6bb89a6ab459429ae5537e364aeb07 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:22:33 -0500 Subject: [PATCH 14/39] reverted dependencies for now. pl is a development tool. it cannot run in a production mode since it needs to be built at least once... --- CHANGELOG | 3 +-- builder/patternlab.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index aa08b7cfc..1bc2456a1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,8 +6,7 @@ PL-node-v0.1.1 - ADD: Travis CI test support! - ADD: Contributing file - ADD: Repository to package.json - - CHG: Changed devDependencies to dependencies - - THX: thank you @tbranyen for tip on repository, dependencies, and NPM + - THX: thank you @tbranyen for tip on repository, and NPM PL-node-v0.1.0 - FIX: Links to patterns did not work when visited from a server diff --git a/builder/patternlab.js b/builder/patternlab.js index 9d29c0a5f..0e7f8b72e 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.1 - 2014-04-18 + * patternlab-node - v0.1.1 - 2014-05-05 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/package.json b/package.json index eacd39f42..56cffd6d8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "patternlab-node", "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).", "version": "0.1.1", - "dependencies": { + "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-watch": "~0.2.0", "grunt-contrib-sass": "~0.2.2", From 8752d9e66cf4d07db65f4e6375232993052c28a8 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:34:58 -0500 Subject: [PATCH 15/39] removed mustache as a local dependency using npm. fixes #29 --- builder/lib/Mustache/.gitignore | 10 - builder/lib/Mustache/.gitmodules | 3 - builder/lib/Mustache/.jshintrc | 5 - builder/lib/Mustache/.travis.yml | 4 - builder/lib/Mustache/CHANGES | 43 -- builder/lib/Mustache/LICENSE | 10 - builder/lib/Mustache/README.md | 405 ------------- builder/lib/Mustache/Rakefile | 68 --- builder/lib/Mustache/mustache.js | 536 ------------------ builder/lib/Mustache/mustache.js.nuspec | 14 - builder/lib/Mustache/package.json | 21 - .../Mustache/test/_files/ampersand_escape.js | 3 - .../test/_files/ampersand_escape.mustache | 1 - .../Mustache/test/_files/ampersand_escape.txt | 1 - .../lib/Mustache/test/_files/apostrophe.js | 4 - .../Mustache/test/_files/apostrophe.mustache | 1 - .../lib/Mustache/test/_files/apostrophe.txt | 1 - .../Mustache/test/_files/array_of_strings.js | 3 - .../test/_files/array_of_strings.mustache | 1 - .../Mustache/test/_files/array_of_strings.txt | 1 - .../lib/Mustache/test/_files/backslashes.js | 3 - .../Mustache/test/_files/backslashes.mustache | 7 - .../lib/Mustache/test/_files/backslashes.txt | 7 - .../test/_files/bug_11_eating_whitespace.js | 3 - .../_files/bug_11_eating_whitespace.mustache | 1 - .../test/_files/bug_11_eating_whitespace.txt | 1 - .../test/_files/changing_delimiters.js | 4 - .../test/_files/changing_delimiters.mustache | 1 - .../test/_files/changing_delimiters.txt | 1 - .../lib/Mustache/test/_files/check_falsy.js | 7 - .../Mustache/test/_files/check_falsy.mustache | 1 - .../lib/Mustache/test/_files/check_falsy.txt | 1 - builder/lib/Mustache/test/_files/comments.js | 5 - .../Mustache/test/_files/comments.mustache | 1 - builder/lib/Mustache/test/_files/comments.txt | 1 - builder/lib/Mustache/test/_files/complex.js | 19 - .../lib/Mustache/test/_files/complex.mustache | 16 - builder/lib/Mustache/test/_files/complex.txt | 6 - .../Mustache/test/_files/context_lookup.js | 8 - .../test/_files/context_lookup.mustache | 1 - .../Mustache/test/_files/context_lookup.txt | 1 - .../lib/Mustache/test/_files/delimiters.js | 6 - .../Mustache/test/_files/delimiters.mustache | 7 - .../lib/Mustache/test/_files/delimiters.txt | 5 - .../test/_files/disappearing_whitespace.js | 4 - .../_files/disappearing_whitespace.mustache | 1 - .../test/_files/disappearing_whitespace.txt | 1 - .../lib/Mustache/test/_files/dot_notation.js | 23 - .../test/_files/dot_notation.mustache | 9 - .../lib/Mustache/test/_files/dot_notation.txt | 9 - .../lib/Mustache/test/_files/double_render.js | 5 - .../test/_files/double_render.mustache | 1 - .../Mustache/test/_files/double_render.txt | 1 - .../lib/Mustache/test/_files/empty_list.js | 3 - .../Mustache/test/_files/empty_list.mustache | 4 - .../lib/Mustache/test/_files/empty_list.txt | 1 - .../Mustache/test/_files/empty_sections.js | 1 - .../test/_files/empty_sections.mustache | 1 - .../Mustache/test/_files/empty_sections.txt | 1 - .../lib/Mustache/test/_files/empty_string.js | 6 - .../test/_files/empty_string.mustache | 1 - .../lib/Mustache/test/_files/empty_string.txt | 1 - .../Mustache/test/_files/empty_template.js | 1 - .../test/_files/empty_template.mustache | 1 - .../Mustache/test/_files/empty_template.txt | 1 - .../Mustache/test/_files/error_not_found.js | 3 - .../test/_files/error_not_found.mustache | 1 - .../Mustache/test/_files/error_not_found.txt | 0 builder/lib/Mustache/test/_files/escaped.js | 6 - .../lib/Mustache/test/_files/escaped.mustache | 2 - builder/lib/Mustache/test/_files/escaped.txt | 2 - builder/lib/Mustache/test/_files/falsy.js | 8 - .../lib/Mustache/test/_files/falsy.mustache | 12 - builder/lib/Mustache/test/_files/falsy.txt | 12 - .../test/_files/grandparent_context.js | 19 - .../test/_files/grandparent_context.mustache | 10 - .../test/_files/grandparent_context.txt | 17 - .../test/_files/higher_order_sections.js | 9 - .../_files/higher_order_sections.mustache | 1 - .../test/_files/higher_order_sections.txt | 1 - .../lib/Mustache/test/_files/included_tag.js | 3 - .../test/_files/included_tag.mustache | 1 - .../lib/Mustache/test/_files/included_tag.txt | 1 - .../Mustache/test/_files/inverted_section.js | 3 - .../test/_files/inverted_section.mustache | 3 - .../Mustache/test/_files/inverted_section.txt | 3 - .../test/_files/keys_with_questionmarks.js | 5 - .../_files/keys_with_questionmarks.mustache | 3 - .../test/_files/keys_with_questionmarks.txt | 1 - .../test/_files/malicious_template.js | 1 - .../test/_files/malicious_template.mustache | 5 - .../test/_files/malicious_template.txt | 2 - .../Mustache/test/_files/multiline_comment.js | 1 - .../test/_files/multiline_comment.mustache | 6 - .../test/_files/multiline_comment.txt | 1 - .../_files/nested_higher_order_sections.js | 8 - .../nested_higher_order_sections.mustache | 1 - .../_files/nested_higher_order_sections.txt | 1 - .../Mustache/test/_files/nested_iterating.js | 8 - .../test/_files/nested_iterating.mustache | 1 - .../Mustache/test/_files/nested_iterating.txt | 1 - builder/lib/Mustache/test/_files/nesting.js | 7 - .../lib/Mustache/test/_files/nesting.mustache | 5 - builder/lib/Mustache/test/_files/nesting.txt | 3 - .../Mustache/test/_files/nesting_same_name.js | 8 - .../test/_files/nesting_same_name.mustache | 1 - .../test/_files/nesting_same_name.txt | 1 - .../lib/Mustache/test/_files/null_string.js | 10 - .../Mustache/test/_files/null_string.mustache | 6 - .../lib/Mustache/test/_files/null_string.txt | 6 - builder/lib/Mustache/test/_files/null_view.js | 4 - .../Mustache/test/_files/null_view.mustache | 1 - .../lib/Mustache/test/_files/null_view.txt | 1 - .../lib/Mustache/test/_files/partial_array.js | 3 - .../test/_files/partial_array.mustache | 1 - .../test/_files/partial_array.partial | 4 - .../Mustache/test/_files/partial_array.txt | 5 - .../test/_files/partial_array_of_partials.js | 8 - .../_files/partial_array_of_partials.mustache | 4 - .../_files/partial_array_of_partials.partial | 1 - .../test/_files/partial_array_of_partials.txt | 5 - .../partial_array_of_partials_implicit.js | 3 - ...artial_array_of_partials_implicit.mustache | 4 - ...partial_array_of_partials_implicit.partial | 1 - .../partial_array_of_partials_implicit.txt | 5 - .../lib/Mustache/test/_files/partial_empty.js | 3 - .../test/_files/partial_empty.mustache | 2 - .../test/_files/partial_empty.partial | 0 .../Mustache/test/_files/partial_empty.txt | 1 - .../Mustache/test/_files/partial_template.js | 6 - .../test/_files/partial_template.mustache | 2 - .../test/_files/partial_template.partial | 1 - .../Mustache/test/_files/partial_template.txt | 2 - .../lib/Mustache/test/_files/partial_view.js | 14 - .../test/_files/partial_view.mustache | 3 - .../Mustache/test/_files/partial_view.partial | 5 - .../lib/Mustache/test/_files/partial_view.txt | 5 - .../test/_files/partial_whitespace.js | 14 - .../test/_files/partial_whitespace.mustache | 3 - .../test/_files/partial_whitespace.partial | 5 - .../test/_files/partial_whitespace.txt | 5 - .../test/_files/recursion_with_same_names.js | 8 - .../_files/recursion_with_same_names.mustache | 7 - .../test/_files/recursion_with_same_names.txt | 7 - .../test/_files/reuse_of_enumerables.js | 6 - .../test/_files/reuse_of_enumerables.mustache | 8 - .../test/_files/reuse_of_enumerables.txt | 8 - .../test/_files/section_as_context.js | 10 - .../test/_files/section_as_context.mustache | 9 - .../test/_files/section_as_context.txt | 6 - builder/lib/Mustache/test/_files/simple.js | 8 - .../lib/Mustache/test/_files/simple.mustache | 5 - builder/lib/Mustache/test/_files/simple.txt | 3 - .../Mustache/test/_files/string_as_context.js | 4 - .../test/_files/string_as_context.mustache | 5 - .../test/_files/string_as_context.txt | 5 - .../lib/Mustache/test/_files/two_in_a_row.js | 4 - .../test/_files/two_in_a_row.mustache | 1 - .../lib/Mustache/test/_files/two_in_a_row.txt | 1 - .../lib/Mustache/test/_files/two_sections.js | 1 - .../test/_files/two_sections.mustache | 4 - .../lib/Mustache/test/_files/two_sections.txt | 0 builder/lib/Mustache/test/_files/unescaped.js | 5 - .../Mustache/test/_files/unescaped.mustache | 1 - .../lib/Mustache/test/_files/unescaped.txt | 1 - .../lib/Mustache/test/_files/whitespace.js | 4 - .../Mustache/test/_files/whitespace.mustache | 4 - .../lib/Mustache/test/_files/whitespace.txt | 4 - builder/lib/Mustache/test/context-test.js | 51 -- builder/lib/Mustache/test/helper.js | 2 - .../lib/Mustache/test/mustache-spec-test.js | 89 --- builder/lib/Mustache/test/parse-test.js | 106 ---- builder/lib/Mustache/test/render-test.js | 68 --- builder/lib/Mustache/test/scanner-test.js | 78 --- builder/lib/Mustache/test/writer-test.js | 43 -- .../Mustache/wrappers/dojo/mustache.js.post | 4 - .../Mustache/wrappers/dojo/mustache.js.pre | 9 - .../Mustache/wrappers/jquery/mustache.js.post | 13 - .../Mustache/wrappers/jquery/mustache.js.pre | 9 - .../wrappers/mootools/mustache.js.post | 5 - .../wrappers/mootools/mustache.js.pre | 2 - .../wrappers/qooxdoo/mustache.js.post | 9 - .../Mustache/wrappers/qooxdoo/mustache.js.pre | 164 ------ builder/patternlab.js | 2 +- package.json | 1 + 185 files changed, 2 insertions(+), 2436 deletions(-) delete mode 100644 builder/lib/Mustache/.gitignore delete mode 100644 builder/lib/Mustache/.gitmodules delete mode 100644 builder/lib/Mustache/.jshintrc delete mode 100644 builder/lib/Mustache/.travis.yml delete mode 100644 builder/lib/Mustache/CHANGES delete mode 100644 builder/lib/Mustache/LICENSE delete mode 100644 builder/lib/Mustache/README.md delete mode 100644 builder/lib/Mustache/Rakefile delete mode 100644 builder/lib/Mustache/mustache.js delete mode 100644 builder/lib/Mustache/mustache.js.nuspec delete mode 100644 builder/lib/Mustache/package.json delete mode 100644 builder/lib/Mustache/test/_files/ampersand_escape.js delete mode 100644 builder/lib/Mustache/test/_files/ampersand_escape.mustache delete mode 100644 builder/lib/Mustache/test/_files/ampersand_escape.txt delete mode 100644 builder/lib/Mustache/test/_files/apostrophe.js delete mode 100644 builder/lib/Mustache/test/_files/apostrophe.mustache delete mode 100644 builder/lib/Mustache/test/_files/apostrophe.txt delete mode 100644 builder/lib/Mustache/test/_files/array_of_strings.js delete mode 100644 builder/lib/Mustache/test/_files/array_of_strings.mustache delete mode 100644 builder/lib/Mustache/test/_files/array_of_strings.txt delete mode 100644 builder/lib/Mustache/test/_files/backslashes.js delete mode 100644 builder/lib/Mustache/test/_files/backslashes.mustache delete mode 100644 builder/lib/Mustache/test/_files/backslashes.txt delete mode 100644 builder/lib/Mustache/test/_files/bug_11_eating_whitespace.js delete mode 100644 builder/lib/Mustache/test/_files/bug_11_eating_whitespace.mustache delete mode 100644 builder/lib/Mustache/test/_files/bug_11_eating_whitespace.txt delete mode 100644 builder/lib/Mustache/test/_files/changing_delimiters.js delete mode 100644 builder/lib/Mustache/test/_files/changing_delimiters.mustache delete mode 100644 builder/lib/Mustache/test/_files/changing_delimiters.txt delete mode 100644 builder/lib/Mustache/test/_files/check_falsy.js delete mode 100644 builder/lib/Mustache/test/_files/check_falsy.mustache delete mode 100644 builder/lib/Mustache/test/_files/check_falsy.txt delete mode 100644 builder/lib/Mustache/test/_files/comments.js delete mode 100644 builder/lib/Mustache/test/_files/comments.mustache delete mode 100644 builder/lib/Mustache/test/_files/comments.txt delete mode 100644 builder/lib/Mustache/test/_files/complex.js delete mode 100644 builder/lib/Mustache/test/_files/complex.mustache delete mode 100644 builder/lib/Mustache/test/_files/complex.txt delete mode 100644 builder/lib/Mustache/test/_files/context_lookup.js delete mode 100644 builder/lib/Mustache/test/_files/context_lookup.mustache delete mode 100644 builder/lib/Mustache/test/_files/context_lookup.txt delete mode 100644 builder/lib/Mustache/test/_files/delimiters.js delete mode 100644 builder/lib/Mustache/test/_files/delimiters.mustache delete mode 100644 builder/lib/Mustache/test/_files/delimiters.txt delete mode 100644 builder/lib/Mustache/test/_files/disappearing_whitespace.js delete mode 100644 builder/lib/Mustache/test/_files/disappearing_whitespace.mustache delete mode 100644 builder/lib/Mustache/test/_files/disappearing_whitespace.txt delete mode 100644 builder/lib/Mustache/test/_files/dot_notation.js delete mode 100644 builder/lib/Mustache/test/_files/dot_notation.mustache delete mode 100644 builder/lib/Mustache/test/_files/dot_notation.txt delete mode 100644 builder/lib/Mustache/test/_files/double_render.js delete mode 100644 builder/lib/Mustache/test/_files/double_render.mustache delete mode 100644 builder/lib/Mustache/test/_files/double_render.txt delete mode 100644 builder/lib/Mustache/test/_files/empty_list.js delete mode 100644 builder/lib/Mustache/test/_files/empty_list.mustache delete mode 100644 builder/lib/Mustache/test/_files/empty_list.txt delete mode 100644 builder/lib/Mustache/test/_files/empty_sections.js delete mode 100644 builder/lib/Mustache/test/_files/empty_sections.mustache delete mode 100644 builder/lib/Mustache/test/_files/empty_sections.txt delete mode 100644 builder/lib/Mustache/test/_files/empty_string.js delete mode 100644 builder/lib/Mustache/test/_files/empty_string.mustache delete mode 100644 builder/lib/Mustache/test/_files/empty_string.txt delete mode 100644 builder/lib/Mustache/test/_files/empty_template.js delete mode 100644 builder/lib/Mustache/test/_files/empty_template.mustache delete mode 100644 builder/lib/Mustache/test/_files/empty_template.txt delete mode 100644 builder/lib/Mustache/test/_files/error_not_found.js delete mode 100644 builder/lib/Mustache/test/_files/error_not_found.mustache delete mode 100644 builder/lib/Mustache/test/_files/error_not_found.txt delete mode 100644 builder/lib/Mustache/test/_files/escaped.js delete mode 100644 builder/lib/Mustache/test/_files/escaped.mustache delete mode 100644 builder/lib/Mustache/test/_files/escaped.txt delete mode 100644 builder/lib/Mustache/test/_files/falsy.js delete mode 100644 builder/lib/Mustache/test/_files/falsy.mustache delete mode 100644 builder/lib/Mustache/test/_files/falsy.txt delete mode 100644 builder/lib/Mustache/test/_files/grandparent_context.js delete mode 100644 builder/lib/Mustache/test/_files/grandparent_context.mustache delete mode 100644 builder/lib/Mustache/test/_files/grandparent_context.txt delete mode 100644 builder/lib/Mustache/test/_files/higher_order_sections.js delete mode 100644 builder/lib/Mustache/test/_files/higher_order_sections.mustache delete mode 100644 builder/lib/Mustache/test/_files/higher_order_sections.txt delete mode 100644 builder/lib/Mustache/test/_files/included_tag.js delete mode 100644 builder/lib/Mustache/test/_files/included_tag.mustache delete mode 100644 builder/lib/Mustache/test/_files/included_tag.txt delete mode 100644 builder/lib/Mustache/test/_files/inverted_section.js delete mode 100644 builder/lib/Mustache/test/_files/inverted_section.mustache delete mode 100644 builder/lib/Mustache/test/_files/inverted_section.txt delete mode 100644 builder/lib/Mustache/test/_files/keys_with_questionmarks.js delete mode 100644 builder/lib/Mustache/test/_files/keys_with_questionmarks.mustache delete mode 100644 builder/lib/Mustache/test/_files/keys_with_questionmarks.txt delete mode 100644 builder/lib/Mustache/test/_files/malicious_template.js delete mode 100644 builder/lib/Mustache/test/_files/malicious_template.mustache delete mode 100644 builder/lib/Mustache/test/_files/malicious_template.txt delete mode 100644 builder/lib/Mustache/test/_files/multiline_comment.js delete mode 100644 builder/lib/Mustache/test/_files/multiline_comment.mustache delete mode 100644 builder/lib/Mustache/test/_files/multiline_comment.txt delete mode 100644 builder/lib/Mustache/test/_files/nested_higher_order_sections.js delete mode 100644 builder/lib/Mustache/test/_files/nested_higher_order_sections.mustache delete mode 100644 builder/lib/Mustache/test/_files/nested_higher_order_sections.txt delete mode 100644 builder/lib/Mustache/test/_files/nested_iterating.js delete mode 100644 builder/lib/Mustache/test/_files/nested_iterating.mustache delete mode 100644 builder/lib/Mustache/test/_files/nested_iterating.txt delete mode 100644 builder/lib/Mustache/test/_files/nesting.js delete mode 100644 builder/lib/Mustache/test/_files/nesting.mustache delete mode 100644 builder/lib/Mustache/test/_files/nesting.txt delete mode 100644 builder/lib/Mustache/test/_files/nesting_same_name.js delete mode 100644 builder/lib/Mustache/test/_files/nesting_same_name.mustache delete mode 100644 builder/lib/Mustache/test/_files/nesting_same_name.txt delete mode 100644 builder/lib/Mustache/test/_files/null_string.js delete mode 100644 builder/lib/Mustache/test/_files/null_string.mustache delete mode 100644 builder/lib/Mustache/test/_files/null_string.txt delete mode 100644 builder/lib/Mustache/test/_files/null_view.js delete mode 100644 builder/lib/Mustache/test/_files/null_view.mustache delete mode 100644 builder/lib/Mustache/test/_files/null_view.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_array.js delete mode 100644 builder/lib/Mustache/test/_files/partial_array.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_array.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_array.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials.js delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.js delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_empty.js delete mode 100644 builder/lib/Mustache/test/_files/partial_empty.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_empty.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_empty.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_template.js delete mode 100644 builder/lib/Mustache/test/_files/partial_template.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_template.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_template.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_view.js delete mode 100644 builder/lib/Mustache/test/_files/partial_view.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_view.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_view.txt delete mode 100644 builder/lib/Mustache/test/_files/partial_whitespace.js delete mode 100644 builder/lib/Mustache/test/_files/partial_whitespace.mustache delete mode 100644 builder/lib/Mustache/test/_files/partial_whitespace.partial delete mode 100644 builder/lib/Mustache/test/_files/partial_whitespace.txt delete mode 100644 builder/lib/Mustache/test/_files/recursion_with_same_names.js delete mode 100644 builder/lib/Mustache/test/_files/recursion_with_same_names.mustache delete mode 100644 builder/lib/Mustache/test/_files/recursion_with_same_names.txt delete mode 100644 builder/lib/Mustache/test/_files/reuse_of_enumerables.js delete mode 100644 builder/lib/Mustache/test/_files/reuse_of_enumerables.mustache delete mode 100644 builder/lib/Mustache/test/_files/reuse_of_enumerables.txt delete mode 100644 builder/lib/Mustache/test/_files/section_as_context.js delete mode 100644 builder/lib/Mustache/test/_files/section_as_context.mustache delete mode 100644 builder/lib/Mustache/test/_files/section_as_context.txt delete mode 100644 builder/lib/Mustache/test/_files/simple.js delete mode 100644 builder/lib/Mustache/test/_files/simple.mustache delete mode 100644 builder/lib/Mustache/test/_files/simple.txt delete mode 100644 builder/lib/Mustache/test/_files/string_as_context.js delete mode 100644 builder/lib/Mustache/test/_files/string_as_context.mustache delete mode 100644 builder/lib/Mustache/test/_files/string_as_context.txt delete mode 100644 builder/lib/Mustache/test/_files/two_in_a_row.js delete mode 100644 builder/lib/Mustache/test/_files/two_in_a_row.mustache delete mode 100644 builder/lib/Mustache/test/_files/two_in_a_row.txt delete mode 100644 builder/lib/Mustache/test/_files/two_sections.js delete mode 100644 builder/lib/Mustache/test/_files/two_sections.mustache delete mode 100644 builder/lib/Mustache/test/_files/two_sections.txt delete mode 100644 builder/lib/Mustache/test/_files/unescaped.js delete mode 100644 builder/lib/Mustache/test/_files/unescaped.mustache delete mode 100644 builder/lib/Mustache/test/_files/unescaped.txt delete mode 100644 builder/lib/Mustache/test/_files/whitespace.js delete mode 100644 builder/lib/Mustache/test/_files/whitespace.mustache delete mode 100644 builder/lib/Mustache/test/_files/whitespace.txt delete mode 100644 builder/lib/Mustache/test/context-test.js delete mode 100644 builder/lib/Mustache/test/helper.js delete mode 100644 builder/lib/Mustache/test/mustache-spec-test.js delete mode 100644 builder/lib/Mustache/test/parse-test.js delete mode 100644 builder/lib/Mustache/test/render-test.js delete mode 100644 builder/lib/Mustache/test/scanner-test.js delete mode 100644 builder/lib/Mustache/test/writer-test.js delete mode 100644 builder/lib/Mustache/wrappers/dojo/mustache.js.post delete mode 100644 builder/lib/Mustache/wrappers/dojo/mustache.js.pre delete mode 100644 builder/lib/Mustache/wrappers/jquery/mustache.js.post delete mode 100644 builder/lib/Mustache/wrappers/jquery/mustache.js.pre delete mode 100644 builder/lib/Mustache/wrappers/mootools/mustache.js.post delete mode 100644 builder/lib/Mustache/wrappers/mootools/mustache.js.pre delete mode 100644 builder/lib/Mustache/wrappers/qooxdoo/mustache.js.post delete mode 100644 builder/lib/Mustache/wrappers/qooxdoo/mustache.js.pre diff --git a/builder/lib/Mustache/.gitignore b/builder/lib/Mustache/.gitignore deleted file mode 100644 index 90007769a..000000000 --- a/builder/lib/Mustache/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.DS_Store -.rvmrc -node_modules -runner.js -jquery.mustache.js -qooxdoo.mustache.js -dojox -yui3 -requirejs.mustache.js - diff --git a/builder/lib/Mustache/.gitmodules b/builder/lib/Mustache/.gitmodules deleted file mode 100644 index 9e2fdf850..000000000 --- a/builder/lib/Mustache/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "test/spec"] - path = test/spec - url = https://github.com/mustache/spec diff --git a/builder/lib/Mustache/.jshintrc b/builder/lib/Mustache/.jshintrc deleted file mode 100644 index 28dff7105..000000000 --- a/builder/lib/Mustache/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "eqnull": true, - "evil": true -} - diff --git a/builder/lib/Mustache/.travis.yml b/builder/lib/Mustache/.travis.yml deleted file mode 100644 index 3d839b0ef..000000000 --- a/builder/lib/Mustache/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - diff --git a/builder/lib/Mustache/CHANGES b/builder/lib/Mustache/CHANGES deleted file mode 100644 index ad80e95f4..000000000 --- a/builder/lib/Mustache/CHANGES +++ /dev/null @@ -1,43 +0,0 @@ -= HEAD - - * Don't require the original template to be passed to the rendering function - when using compiled templates. This is still required when using higher-order - functions in order to be able to extract the portion of the template - that was contained by that section. Fixes #262. - * Performance improvements. - -= 0.7.2 / 27 Dec 2012 - - * Fixed a rendering bug (#274) when using nested higher-order sections. - * Better error reporting on failed parse. - * Converted tests to use mocha instead of vows. - -= 0.7.1 / 6 Dec 2012 - - * Handle empty templates gracefully. Fixes #265, #267, and #270. - * Cache partials by template, not by name. Fixes #257. - * Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes - #258. - -= 0.7.0 / 10 Sep 2012 - - * Rename Renderer => Writer. - * Allow partials to be loaded dynamically using a callback (thanks - @TiddoLangerak for the suggestion). - * Fixed a bug with higher-order sections that prevented them from being - passed the raw text of the section from the original template. - * More concise token format. Tokens also include start/end indices in the - original template. - * High-level API is consistent with the Writer API. - * Allow partials to be passed to the pre-compiled function (thanks - @fallenice). - * Don't use eval (thanks @cweider). - -= 0.6.0 / 31 Aug 2012 - - * Use JavaScript's definition of falsy when determining whether to render an - inverted section or not. Issue #186. - * Use Mustache.escape to escape values inside {{}}. This function may be - reassigned to alter the default escaping behavior. Issue #244. - * Fixed a bug that clashed with QUnit (thanks @kannix). - * Added volo support (thanks @guybedford). diff --git a/builder/lib/Mustache/LICENSE b/builder/lib/Mustache/LICENSE deleted file mode 100644 index 6626848b3..000000000 --- a/builder/lib/Mustache/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -The MIT License - -Copyright (c) 2009 Chris Wanstrath (Ruby) -Copyright (c) 2010 Jan Lehnardt (JavaScript) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/builder/lib/Mustache/README.md b/builder/lib/Mustache/README.md deleted file mode 100644 index 95c92788b..000000000 --- a/builder/lib/Mustache/README.md +++ /dev/null @@ -1,405 +0,0 @@ -# mustache.js - Logic-less {{mustache}} templates with JavaScript - -> What could be more logical awesome than no logic at all? - -[mustache.js](http://github.com/janl/mustache.js) is an implementation of the [mustache](http://mustache.github.com/) template system in JavaScript. - -[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. - -We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values. - -For a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html). - -## Where to use mustache.js? - -You can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [node](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views. - -mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD. - -## Who uses mustache.js? - -An updated list of mustache.js users is kept [on the Github wiki](http://wiki.github.com/janl/mustache.js/beard-competition). Add yourself or your company if you use mustache.js! - -## Usage - -Below is quick example how to use mustache.js: - - var view = { - title: "Joe", - calc: function () { - return 2 + 4; - } - }; - - var output = Mustache.render("{{title}} spends {{calc}}", view); - -In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template. - -## Templates - -A [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key. - -There are several types of tags available in mustache.js. - -### Variables - -The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered. - -All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable. - -View: - - { - "name": "Chris", - "company": "GitHub" - } - -Template: - - * {{name}} - * {{age}} - * {{company}} - * {{{company}}} - * {{&company}} - -Output: - - * Chris - * - * <b>GitHub</b> - * GitHub - * GitHub - -JavaScript's dot notation may be used to access keys that are properties of objects in a view. - -View: - - { - "name": { - "first": "Michael", - "last": "Jackson" - }, - "age": "RIP" - } - -Template: - - * {{name.first}} {{name.last}} - * {{age}} - -Output: - - * Michael Jackson - * RIP - -### Sections - -Sections render blocks of text one or more times, depending on the value of the key in the current context. - -A section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's "block". - -The behavior of the section is determined by the value of the key. - -#### False Values or Empty Lists - -If the `person` key does not exist, or exists and has a value of `null`, `undefined`, or `false`, or is an empty list, the block will not be rendered. - -View: - - { - "person": false - } - -Template: - - Shown. - {{#person}} - Never shown! - {{/person}} - -Output: - - Shown. - -#### Non-Empty Lists - -If the `person` key exists and is not `null`, `undefined`, or `false`, and is not an empty list the block will be rendered one or more times. - -When the value is a list, the block is rendered once for each item in the list. The context of the block is set to the current item in the list for each iteration. In this way we can loop over collections. - -View: - - { - "stooges": [ - { "name": "Moe" }, - { "name": "Larry" }, - { "name": "Curly" } - ] - } - -Template: - - {{#stooges}} - {{name}} - {{/stooges}} - -Output: - - Moe - Larry - Curly - -When looping over an array of strings, a `.` can be used to refer to the current item in the list. - -View: - - { - "musketeers": ["Athos", "Aramis", "Porthos", "D'Artagnan"] - } - -Template: - - {{#musketeers}} - * {{.}} - {{/musketeers}} - -Output: - - * Athos - * Aramis - * Porthos - * D'Artagnan - -If the value of a section variable is a function, it will be called in the context of the current item in the list on each iteration. - -View: - - { - "beatles": [ - { "firstName": "John", "lastName": "Lennon" }, - { "firstName": "Paul", "lastName": "McCartney" }, - { "firstName": "George", "lastName": "Harrison" }, - { "firstName": "Ringo", "lastName": "Starr" } - ], - "name": function () { - return this.firstName + " " + this.lastName; - } - } - -Template: - - {{#beatles}} - * {{name}} - {{/beatles}} - -Output: - - * John Lennon - * Paul McCartney - * George Harrison - * Ringo Starr - -#### Functions - -If the value of a section key is a function, it is called with the section's literal block of text, un-rendered, as its first argument. The second argument is a special rendering function that uses the current view as its view argument. It is called in the context of the current view object. - -View: - - { - "name": "Tater", - "bold": function () { - return function (text, render) { - return "" + render(text) + ""; - } - } - } - -Template: - - {{#bold}}Hi {{name}}.{{/bold}} - -Output: - - Hi Tater. - -### Inverted Sections - -An inverted section opens with `{{^section}}` instead of `{{#section}}`. The block of an inverted section is rendered only if the value of that section's tag is `null`, `undefined`, `false`, or an empty list. - -View: - - { - "repos": [] - } - -Template: - - {{#repos}}{{name}}{{/repos}} - {{^repos}}No repos :({{/repos}} - -Output: - - No repos :( - -### Comments - -Comments begin with a bang and are ignored. The following template: - -

Today{{! ignore me }}.

- -Will render as follows: - -

Today.

- -Comments may contain newlines. - -### Partials - -Partials begin with a greater than sign, like {{> box}}. - -Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Just avoid infinite loops. - -They also inherit the calling context. Whereas in ERB you may have this: - - <%= partial :next_more, :start => start, :size => size %> - -Mustache requires only this: - - {{> next_more}} - -Why? Because the `next_more.mustache` file will inherit the `size` and `start` variables from the calling context. In this way you may want to think of partials as includes, or template expansion, even though it's not literally true. - -For example, this template and partial: - - base.mustache: -

Names

- {{#names}} - {{> user}} - {{/names}} - - user.mustache: - {{name}} - -Can be thought of as a single, expanded template: - -

Names

- {{#names}} - {{name}} - {{/names}} - -In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text. - -### Set Delimiter - -Set Delimiter tags start with an equals sign and change the tag delimiters from `{{` and `}}` to custom strings. - -Consider the following contrived example: - - * {{ default_tags }} - {{=<% %>=}} - * <% erb_style_tags %> - <%={{ }}=%> - * {{ default_tags_again }} - -Here we have a list with three items. The first item uses the default tag style, the second uses ERB style as defined by the Set Delimiter tag, and the third returns to the default style after yet another Set Delimiter declaration. - -According to [ctemplates](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html), this "is useful for languages like TeX, where double-braces may occur in the text and are awkward to use for markup." - -Custom delimiters may not contain whitespace or the equals sign. - -### Compiled Templates - -Mustache templates can be compiled into JavaScript functions using `Mustache.compile` for improved rendering performance. - -If you have template views that are rendered multiple times, compiling your template into a JavaScript function will minimise the amount of work required for each re-render. - -Pre-compiled templates can also be generated server-side, for delivery to the browser as ready to use JavaScript functions, further reducing the amount of client side processing required for initialising templates. - -**Mustache.compile** - -Use `Mustache.compile` to compile standard Mustache string templates into reusable Mustache template functions. - - var compiledTemplate = Mustache.compile(stringTemplate); - -The function returned from `Mustache.compile` can then be called directly, passing in the template data as an argument (with an object of partials as an optional second parameter), to generate the final output. - - var templateOutput = compiledTemplate(templateData); - -**Mustache.compilePartial** - -Template partials can also be compiled using the `Mustache.compilePartial` function. The first parameter of this function, is the name of the partial as it appears within parent templates. - - Mustache.compilePartial('partial-name', stringTemplate); - -Compiled partials are then available to both `Mustache.render` and `Mustache.compile`. - -## Plugins for JavaScript Libraries - -mustache.js may be built specifically for several different client libraries, including the following: - - - [jQuery](http://jquery.com/) - - [MooTools](http://mootools.net/) - - [Dojo](http://www.dojotoolkit.org/) - - [YUI](http://developer.yahoo.com/yui/) - - [qooxdoo](http://qooxdoo.org/) - -These may be built using [Rake](http://rake.rubyforge.org/) and one of the following commands: - - $ rake jquery - $ rake mootools - $ rake dojo - $ rake yui3 - $ rake qooxdoo - -## Testing - -The mustache.js test suite uses the [mocha](http://visionmedia.github.com/mocha/) testing framework. In order to run the tests you'll need to install [node](http://nodejs.org/). Once that's done you can install mocha using [npm](http://npmjs.org/). - - $ npm install -g mocha - -You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root. - - $ git submodule init - $ git submodule update - -Then run the tests. - - $ mocha test - -The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following: - - 1. Create a template file named `mytest.mustache` in the `test/_files` - directory. Replace `mytest` with the name of your test. - 2. Create a corresponding view file named `mytest.js` in the same directory. - This file should contain a JavaScript object literal enclosed in - parentheses. See any of the other view files for an example. - 3. Create a file with the expected output in `mytest.txt` in the same - directory. - -Then, you can run the test with: - - $ TEST=mytest mocha test/render_test.js - -## Thanks - -mustache.js wouldn't kick ass if it weren't for these fine souls: - - * Chris Wanstrath / defunkt - * Alexander Lang / langalex - * Sebastian Cohnen / tisba - * J Chris Anderson / jchris - * Tom Robinson / tlrobinson - * Aaron Quint / quirkey - * Douglas Crockford - * Nikita Vasilyev / NV - * Elise Wood / glytch - * Damien Mathieu / dmathieu - * Jakub Kuźma / qoobaa - * Will Leinweber / will - * dpree - * Jason Smith / jhs - * Aaron Gibralter / agibralter - * Ross Boucher / boucher - * Matt Sanford / mzsanford - * Ben Cherry / bcherry - * Michael Jackson / mjijackson diff --git a/builder/lib/Mustache/Rakefile b/builder/lib/Mustache/Rakefile deleted file mode 100644 index bc3217586..000000000 --- a/builder/lib/Mustache/Rakefile +++ /dev/null @@ -1,68 +0,0 @@ -require 'rake' -require 'rake/clean' - -task :default => :test - -ROOT = File.expand_path('..', __FILE__) -MUSTACHE_JS = File.read(File.join(ROOT, 'mustache.js')) - -def mustache_version - match = MUSTACHE_JS.match(/exports\.version = "([^"]+)";/) - match[1] -end - -def minified_file - ENV['FILE'] || 'mustache.min.js' -end - -desc "Run all tests, requires vows (see http://vowsjs.org)" -task :test do - sh "vows --spec" -end - -desc "Minify to #{minified_file}, requires UglifyJS (see http://marijnhaverbeke.nl/uglifyjs)" -task :minify do - sh "uglifyjs mustache.js > #{minified_file}" -end - -desc "Run JSHint, requires jshint (see http://www.jshint.com)" -task :lint do - sh "jshint mustache.js" -end - -# Creates a task that uses the various template wrappers to make a wrapped -# output file. There is some extra complexity because Dojo and YUI use -# different final locations. -def templated_build(name, opts={}) - short = name.downcase - source = File.join("wrappers", short) - dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*") - target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js" - - CLEAN.include(opts[:location] ? opts[:location] : target_js) - - desc "Package for #{name}" - task short.to_sym => dependencies do - puts "Packaging for #{name}" - - mkdir_p opts[:location] if opts[:location] - - files = [ - "#{source}/mustache.js.pre", - 'mustache.js', - "#{source}/mustache.js.post" - ] - - open("#{opts[:location] || '.'}/#{target_js}", 'w') do |f| - files.each {|file| f << File.read(file) } - end - - puts "Done, see #{opts[:location] || '.'}/#{target_js}" - end -end - -templated_build "jQuery" -templated_build "MooTools" -templated_build "Dojo", :location => "dojox/string" -templated_build "YUI3", :location => "yui3/mustache" -templated_build "qooxdoo" diff --git a/builder/lib/Mustache/mustache.js b/builder/lib/Mustache/mustache.js deleted file mode 100644 index bee26f965..000000000 --- a/builder/lib/Mustache/mustache.js +++ /dev/null @@ -1,536 +0,0 @@ -/*! - * mustache.js - Logic-less {{mustache}} templates with JavaScript - * http://github.com/janl/mustache.js - */ - -/*global define: false*/ - -(function (root, factory) { - if (typeof exports === "object" && exports) { - factory(exports); // CommonJS - } else { - var mustache = {}; - factory(mustache); - if (typeof define === "function" && define.amd) { - define(mustache); // AMD - } else { - root.Mustache = mustache; // diff --git a/builder/lib/Mustache/test/_files/backslashes.txt b/builder/lib/Mustache/test/_files/backslashes.txt deleted file mode 100644 index 038dd37e4..000000000 --- a/builder/lib/Mustache/test/_files/backslashes.txt +++ /dev/null @@ -1,7 +0,0 @@ -* \abc -* \abc -* \abc - diff --git a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.js b/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.js deleted file mode 100644 index e41ccd15d..000000000 --- a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - tag: "yo" -}) diff --git a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.mustache b/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.mustache deleted file mode 100644 index 8d5cd921a..000000000 --- a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.mustache +++ /dev/null @@ -1 +0,0 @@ -{{tag}} foo diff --git a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.txt b/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.txt deleted file mode 100644 index f5bbc85ce..000000000 --- a/builder/lib/Mustache/test/_files/bug_11_eating_whitespace.txt +++ /dev/null @@ -1 +0,0 @@ -yo foo diff --git a/builder/lib/Mustache/test/_files/changing_delimiters.js b/builder/lib/Mustache/test/_files/changing_delimiters.js deleted file mode 100644 index b808f4c8b..000000000 --- a/builder/lib/Mustache/test/_files/changing_delimiters.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - "foo": "foooooooooooooo", - "bar": "bar!" -}) diff --git a/builder/lib/Mustache/test/_files/changing_delimiters.mustache b/builder/lib/Mustache/test/_files/changing_delimiters.mustache deleted file mode 100644 index 0cd044c93..000000000 --- a/builder/lib/Mustache/test/_files/changing_delimiters.mustache +++ /dev/null @@ -1 +0,0 @@ -{{=<% %>=}}<% foo %> {{foo}} <%{bar}%> {{{bar}}} diff --git a/builder/lib/Mustache/test/_files/changing_delimiters.txt b/builder/lib/Mustache/test/_files/changing_delimiters.txt deleted file mode 100644 index 1b1510dab..000000000 --- a/builder/lib/Mustache/test/_files/changing_delimiters.txt +++ /dev/null @@ -1 +0,0 @@ -foooooooooooooo {{foo}} bar! {{{bar}}} diff --git a/builder/lib/Mustache/test/_files/check_falsy.js b/builder/lib/Mustache/test/_files/check_falsy.js deleted file mode 100644 index 5a599cab7..000000000 --- a/builder/lib/Mustache/test/_files/check_falsy.js +++ /dev/null @@ -1,7 +0,0 @@ -({ - number: function(text, render) { - return function(text, render) { - return +render(text); - } - } -}) diff --git a/builder/lib/Mustache/test/_files/check_falsy.mustache b/builder/lib/Mustache/test/_files/check_falsy.mustache deleted file mode 100644 index 30e2547f4..000000000 --- a/builder/lib/Mustache/test/_files/check_falsy.mustache +++ /dev/null @@ -1 +0,0 @@ -

{{#number}}0{{/number}}

diff --git a/builder/lib/Mustache/test/_files/check_falsy.txt b/builder/lib/Mustache/test/_files/check_falsy.txt deleted file mode 100644 index 3bb2f51f6..000000000 --- a/builder/lib/Mustache/test/_files/check_falsy.txt +++ /dev/null @@ -1 +0,0 @@ -

0

diff --git a/builder/lib/Mustache/test/_files/comments.js b/builder/lib/Mustache/test/_files/comments.js deleted file mode 100644 index f20b8b11c..000000000 --- a/builder/lib/Mustache/test/_files/comments.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - title: function () { - return "A Comedy of Errors"; - } -}) diff --git a/builder/lib/Mustache/test/_files/comments.mustache b/builder/lib/Mustache/test/_files/comments.mustache deleted file mode 100644 index 503680186..000000000 --- a/builder/lib/Mustache/test/_files/comments.mustache +++ /dev/null @@ -1 +0,0 @@ -

{{title}}{{! just something interesting... or not... }}

diff --git a/builder/lib/Mustache/test/_files/comments.txt b/builder/lib/Mustache/test/_files/comments.txt deleted file mode 100644 index 0133517bb..000000000 --- a/builder/lib/Mustache/test/_files/comments.txt +++ /dev/null @@ -1 +0,0 @@ -

A Comedy of Errors

diff --git a/builder/lib/Mustache/test/_files/complex.js b/builder/lib/Mustache/test/_files/complex.js deleted file mode 100644 index 68a48093e..000000000 --- a/builder/lib/Mustache/test/_files/complex.js +++ /dev/null @@ -1,19 +0,0 @@ -({ - header: function () { - return "Colors"; - }, - item: [ - {name: "red", current: true, url: "#Red"}, - {name: "green", current: false, url: "#Green"}, - {name: "blue", current: false, url: "#Blue"} - ], - link: function () { - return this["current"] !== true; - }, - list: function () { - return this.item.length !== 0; - }, - empty: function () { - return this.item.length === 0; - } -}) diff --git a/builder/lib/Mustache/test/_files/complex.mustache b/builder/lib/Mustache/test/_files/complex.mustache deleted file mode 100644 index 869a4f067..000000000 --- a/builder/lib/Mustache/test/_files/complex.mustache +++ /dev/null @@ -1,16 +0,0 @@ -

{{header}}

-{{#list}} -
    - {{#item}} - {{#current}} -
  • {{name}}
  • - {{/current}} - {{#link}} -
  • {{name}}
  • - {{/link}} - {{/item}} -
-{{/list}} -{{#empty}} -

The list is empty.

-{{/empty}} diff --git a/builder/lib/Mustache/test/_files/complex.txt b/builder/lib/Mustache/test/_files/complex.txt deleted file mode 100644 index 596d3f693..000000000 --- a/builder/lib/Mustache/test/_files/complex.txt +++ /dev/null @@ -1,6 +0,0 @@ -

Colors

- diff --git a/builder/lib/Mustache/test/_files/context_lookup.js b/builder/lib/Mustache/test/_files/context_lookup.js deleted file mode 100644 index 8ce62999e..000000000 --- a/builder/lib/Mustache/test/_files/context_lookup.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - "outer": { - "id": 1, - "second": { - "nothing": 2 - } - } -}) diff --git a/builder/lib/Mustache/test/_files/context_lookup.mustache b/builder/lib/Mustache/test/_files/context_lookup.mustache deleted file mode 100644 index 3c7b76777..000000000 --- a/builder/lib/Mustache/test/_files/context_lookup.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#outer}}{{#second}}{{id}}{{/second}}{{/outer}} diff --git a/builder/lib/Mustache/test/_files/context_lookup.txt b/builder/lib/Mustache/test/_files/context_lookup.txt deleted file mode 100644 index d00491fd7..000000000 --- a/builder/lib/Mustache/test/_files/context_lookup.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/builder/lib/Mustache/test/_files/delimiters.js b/builder/lib/Mustache/test/_files/delimiters.js deleted file mode 100644 index 365d01e8e..000000000 --- a/builder/lib/Mustache/test/_files/delimiters.js +++ /dev/null @@ -1,6 +0,0 @@ -({ - first: "It worked the first time.", - second: "And it worked the second time.", - third: "Then, surprisingly, it worked the third time.", - fourth: "Fourth time also fine!." -}) diff --git a/builder/lib/Mustache/test/_files/delimiters.mustache b/builder/lib/Mustache/test/_files/delimiters.mustache deleted file mode 100644 index 7fac8469d..000000000 --- a/builder/lib/Mustache/test/_files/delimiters.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{{=<% %>=}}* -<% first %> -* <% second %> -<%=| |=%> -* | third | -|={{ }}=| -* {{ fourth }} diff --git a/builder/lib/Mustache/test/_files/delimiters.txt b/builder/lib/Mustache/test/_files/delimiters.txt deleted file mode 100644 index 698a6bbd0..000000000 --- a/builder/lib/Mustache/test/_files/delimiters.txt +++ /dev/null @@ -1,5 +0,0 @@ -* -It worked the first time. -* And it worked the second time. -* Then, surprisingly, it worked the third time. -* Fourth time also fine!. diff --git a/builder/lib/Mustache/test/_files/disappearing_whitespace.js b/builder/lib/Mustache/test/_files/disappearing_whitespace.js deleted file mode 100644 index 973dd1c9c..000000000 --- a/builder/lib/Mustache/test/_files/disappearing_whitespace.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - bedrooms: true, - total: 1 -}) diff --git a/builder/lib/Mustache/test/_files/disappearing_whitespace.mustache b/builder/lib/Mustache/test/_files/disappearing_whitespace.mustache deleted file mode 100644 index 16c16e055..000000000 --- a/builder/lib/Mustache/test/_files/disappearing_whitespace.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#bedrooms}}{{total}}{{/bedrooms}} BED diff --git a/builder/lib/Mustache/test/_files/disappearing_whitespace.txt b/builder/lib/Mustache/test/_files/disappearing_whitespace.txt deleted file mode 100644 index 66e98ef47..000000000 --- a/builder/lib/Mustache/test/_files/disappearing_whitespace.txt +++ /dev/null @@ -1 +0,0 @@ -1 BED diff --git a/builder/lib/Mustache/test/_files/dot_notation.js b/builder/lib/Mustache/test/_files/dot_notation.js deleted file mode 100644 index de06a03a5..000000000 --- a/builder/lib/Mustache/test/_files/dot_notation.js +++ /dev/null @@ -1,23 +0,0 @@ -({ - name: "A Book", - authors: ["John Power", "Jamie Walsh"], - price: { - value: 200, - vat: function () { - return this.value * 0.2; - }, - currency: { - symbol: '$', - name: 'USD' - } - }, - availability: { - status: true, - text: "In Stock" - }, - // And now, some truthy false values - truthy: { - zero: 0, - notTrue: false - } -}) diff --git a/builder/lib/Mustache/test/_files/dot_notation.mustache b/builder/lib/Mustache/test/_files/dot_notation.mustache deleted file mode 100644 index f89d70ba2..000000000 --- a/builder/lib/Mustache/test/_files/dot_notation.mustache +++ /dev/null @@ -1,9 +0,0 @@ - -

{{name}}

-

Authors:

    {{#authors}}
  • {{.}}
  • {{/authors}}

-

Price: {{{price.currency.symbol}}}{{price.value}} {{#price.currency}}{{name}} {{availability.text}}{{/price.currency}}

-

VAT: {{{price.currency.symbol}}}{{#price}}{{vat}}{{/price}}

- -

Test truthy false values:

-

Zero: {{truthy.zero}}

-

False: {{truthy.notTrue}}

diff --git a/builder/lib/Mustache/test/_files/dot_notation.txt b/builder/lib/Mustache/test/_files/dot_notation.txt deleted file mode 100644 index 08afa0529..000000000 --- a/builder/lib/Mustache/test/_files/dot_notation.txt +++ /dev/null @@ -1,9 +0,0 @@ - -

A Book

-

Authors:

  • John Power
  • Jamie Walsh

-

Price: $200 USD In Stock

-

VAT: $40

- -

Test truthy false values:

-

Zero: 0

-

False: false

diff --git a/builder/lib/Mustache/test/_files/double_render.js b/builder/lib/Mustache/test/_files/double_render.js deleted file mode 100644 index 28acb2c1a..000000000 --- a/builder/lib/Mustache/test/_files/double_render.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - foo: true, - bar: "{{win}}", - win: "FAIL" -}) diff --git a/builder/lib/Mustache/test/_files/double_render.mustache b/builder/lib/Mustache/test/_files/double_render.mustache deleted file mode 100644 index 4500fd76c..000000000 --- a/builder/lib/Mustache/test/_files/double_render.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#foo}}{{bar}}{{/foo}} diff --git a/builder/lib/Mustache/test/_files/double_render.txt b/builder/lib/Mustache/test/_files/double_render.txt deleted file mode 100644 index b6e652d05..000000000 --- a/builder/lib/Mustache/test/_files/double_render.txt +++ /dev/null @@ -1 +0,0 @@ -{{win}} diff --git a/builder/lib/Mustache/test/_files/empty_list.js b/builder/lib/Mustache/test/_files/empty_list.js deleted file mode 100644 index c0e115942..000000000 --- a/builder/lib/Mustache/test/_files/empty_list.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - jobs: [] -}) diff --git a/builder/lib/Mustache/test/_files/empty_list.mustache b/builder/lib/Mustache/test/_files/empty_list.mustache deleted file mode 100644 index 4fdf13d00..000000000 --- a/builder/lib/Mustache/test/_files/empty_list.mustache +++ /dev/null @@ -1,4 +0,0 @@ -These are the jobs: -{{#jobs}} -{{.}} -{{/jobs}} diff --git a/builder/lib/Mustache/test/_files/empty_list.txt b/builder/lib/Mustache/test/_files/empty_list.txt deleted file mode 100644 index d9b4a6729..000000000 --- a/builder/lib/Mustache/test/_files/empty_list.txt +++ /dev/null @@ -1 +0,0 @@ -These are the jobs: diff --git a/builder/lib/Mustache/test/_files/empty_sections.js b/builder/lib/Mustache/test/_files/empty_sections.js deleted file mode 100644 index b4100a597..000000000 --- a/builder/lib/Mustache/test/_files/empty_sections.js +++ /dev/null @@ -1 +0,0 @@ -({}) diff --git a/builder/lib/Mustache/test/_files/empty_sections.mustache b/builder/lib/Mustache/test/_files/empty_sections.mustache deleted file mode 100644 index b6065dbb6..000000000 --- a/builder/lib/Mustache/test/_files/empty_sections.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#foo}}{{/foo}}foo{{#bar}}{{/bar}} diff --git a/builder/lib/Mustache/test/_files/empty_sections.txt b/builder/lib/Mustache/test/_files/empty_sections.txt deleted file mode 100644 index 257cc5642..000000000 --- a/builder/lib/Mustache/test/_files/empty_sections.txt +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/builder/lib/Mustache/test/_files/empty_string.js b/builder/lib/Mustache/test/_files/empty_string.js deleted file mode 100644 index be6e05876..000000000 --- a/builder/lib/Mustache/test/_files/empty_string.js +++ /dev/null @@ -1,6 +0,0 @@ -({ - description: "That is all!", - child: { - description: "" - } -}) diff --git a/builder/lib/Mustache/test/_files/empty_string.mustache b/builder/lib/Mustache/test/_files/empty_string.mustache deleted file mode 100644 index f568441c0..000000000 --- a/builder/lib/Mustache/test/_files/empty_string.mustache +++ /dev/null @@ -1 +0,0 @@ -{{description}}{{#child}}{{description}}{{/child}} diff --git a/builder/lib/Mustache/test/_files/empty_string.txt b/builder/lib/Mustache/test/_files/empty_string.txt deleted file mode 100644 index 22e2a6e58..000000000 --- a/builder/lib/Mustache/test/_files/empty_string.txt +++ /dev/null @@ -1 +0,0 @@ -That is all! diff --git a/builder/lib/Mustache/test/_files/empty_template.js b/builder/lib/Mustache/test/_files/empty_template.js deleted file mode 100644 index b4100a597..000000000 --- a/builder/lib/Mustache/test/_files/empty_template.js +++ /dev/null @@ -1 +0,0 @@ -({}) diff --git a/builder/lib/Mustache/test/_files/empty_template.mustache b/builder/lib/Mustache/test/_files/empty_template.mustache deleted file mode 100644 index bb2367a20..000000000 --- a/builder/lib/Mustache/test/_files/empty_template.mustache +++ /dev/null @@ -1 +0,0 @@ -

Test

\ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/empty_template.txt b/builder/lib/Mustache/test/_files/empty_template.txt deleted file mode 100644 index bb2367a20..000000000 --- a/builder/lib/Mustache/test/_files/empty_template.txt +++ /dev/null @@ -1 +0,0 @@ -

Test

\ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/error_not_found.js b/builder/lib/Mustache/test/_files/error_not_found.js deleted file mode 100644 index 10e470918..000000000 --- a/builder/lib/Mustache/test/_files/error_not_found.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - bar: 2 -}) diff --git a/builder/lib/Mustache/test/_files/error_not_found.mustache b/builder/lib/Mustache/test/_files/error_not_found.mustache deleted file mode 100644 index 24369f73a..000000000 --- a/builder/lib/Mustache/test/_files/error_not_found.mustache +++ /dev/null @@ -1 +0,0 @@ -{{foo}} \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/error_not_found.txt b/builder/lib/Mustache/test/_files/error_not_found.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/builder/lib/Mustache/test/_files/escaped.js b/builder/lib/Mustache/test/_files/escaped.js deleted file mode 100644 index cd77c1f49..000000000 --- a/builder/lib/Mustache/test/_files/escaped.js +++ /dev/null @@ -1,6 +0,0 @@ -({ - title: function () { - return "Bear > Shark"; - }, - entities: "" \"'<>/" -}) diff --git a/builder/lib/Mustache/test/_files/escaped.mustache b/builder/lib/Mustache/test/_files/escaped.mustache deleted file mode 100644 index 93e800b31..000000000 --- a/builder/lib/Mustache/test/_files/escaped.mustache +++ /dev/null @@ -1,2 +0,0 @@ -

{{title}}

-And even {{entities}}, but not {{{entities}}}. diff --git a/builder/lib/Mustache/test/_files/escaped.txt b/builder/lib/Mustache/test/_files/escaped.txt deleted file mode 100644 index c1527d510..000000000 --- a/builder/lib/Mustache/test/_files/escaped.txt +++ /dev/null @@ -1,2 +0,0 @@ -

Bear > Shark

-And even &quot; "'<>/, but not " "'<>/. diff --git a/builder/lib/Mustache/test/_files/falsy.js b/builder/lib/Mustache/test/_files/falsy.js deleted file mode 100644 index ae9b9bf25..000000000 --- a/builder/lib/Mustache/test/_files/falsy.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - "emptyString": "", - "emptyArray": [], - "zero": 0, - "null": null, - "undefined": undefined, - "NaN": 0/0 -}) \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/falsy.mustache b/builder/lib/Mustache/test/_files/falsy.mustache deleted file mode 100644 index f3698da64..000000000 --- a/builder/lib/Mustache/test/_files/falsy.mustache +++ /dev/null @@ -1,12 +0,0 @@ -{{#emptyString}}empty string{{/emptyString}} -{{^emptyString}}inverted empty string{{/emptyString}} -{{#emptyArray}}empty array{{/emptyArray}} -{{^emptyArray}}inverted empty array{{/emptyArray}} -{{#zero}}zero{{/zero}} -{{^zero}}inverted zero{{/zero}} -{{#null}}null{{/null}} -{{^null}}inverted null{{/null}} -{{#undefined}}undefined{{/undefined}} -{{^undefined}}inverted undefined{{/undefined}} -{{#NaN}}NaN{{/NaN}} -{{^NaN}}inverted NaN{{/NaN}} diff --git a/builder/lib/Mustache/test/_files/falsy.txt b/builder/lib/Mustache/test/_files/falsy.txt deleted file mode 100644 index 9b7cde39c..000000000 --- a/builder/lib/Mustache/test/_files/falsy.txt +++ /dev/null @@ -1,12 +0,0 @@ - -inverted empty string - -inverted empty array - -inverted zero - -inverted null - -inverted undefined - -inverted NaN diff --git a/builder/lib/Mustache/test/_files/grandparent_context.js b/builder/lib/Mustache/test/_files/grandparent_context.js deleted file mode 100644 index 97dbfd398..000000000 --- a/builder/lib/Mustache/test/_files/grandparent_context.js +++ /dev/null @@ -1,19 +0,0 @@ -({ - grand_parent_id: 'grand_parent1', - parent_contexts: [ - { - parent_id: 'parent1', - child_contexts: [ - { child_id: 'parent1-child1' }, - { child_id: 'parent1-child2' } - ] - }, - { - parent_id: 'parent2', - child_contexts: [ - { child_id: 'parent2-child1' }, - { child_id: 'parent2-child2' } - ] - } - ] -}) diff --git a/builder/lib/Mustache/test/_files/grandparent_context.mustache b/builder/lib/Mustache/test/_files/grandparent_context.mustache deleted file mode 100644 index e6c07a221..000000000 --- a/builder/lib/Mustache/test/_files/grandparent_context.mustache +++ /dev/null @@ -1,10 +0,0 @@ -{{grand_parent_id}} -{{#parent_contexts}} -{{grand_parent_id}} -{{parent_id}} -{{#child_contexts}} -{{grand_parent_id}} -{{parent_id}} -{{child_id}} -{{/child_contexts}} -{{/parent_contexts}} diff --git a/builder/lib/Mustache/test/_files/grandparent_context.txt b/builder/lib/Mustache/test/_files/grandparent_context.txt deleted file mode 100644 index 64996ad4c..000000000 --- a/builder/lib/Mustache/test/_files/grandparent_context.txt +++ /dev/null @@ -1,17 +0,0 @@ -grand_parent1 -grand_parent1 -parent1 -grand_parent1 -parent1 -parent1-child1 -grand_parent1 -parent1 -parent1-child2 -grand_parent1 -parent2 -grand_parent1 -parent2 -parent2-child1 -grand_parent1 -parent2 -parent2-child2 diff --git a/builder/lib/Mustache/test/_files/higher_order_sections.js b/builder/lib/Mustache/test/_files/higher_order_sections.js deleted file mode 100644 index bacb0a44a..000000000 --- a/builder/lib/Mustache/test/_files/higher_order_sections.js +++ /dev/null @@ -1,9 +0,0 @@ -({ - name: "Tater", - helper: "To tinker?", - bolder: function () { - return function (text, render) { - return text + ' => ' + render(text) + ' ' + this.helper; - } - } -}) diff --git a/builder/lib/Mustache/test/_files/higher_order_sections.mustache b/builder/lib/Mustache/test/_files/higher_order_sections.mustache deleted file mode 100644 index 04f5318df..000000000 --- a/builder/lib/Mustache/test/_files/higher_order_sections.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#bolder}}Hi {{name}}.{{/bolder}} diff --git a/builder/lib/Mustache/test/_files/higher_order_sections.txt b/builder/lib/Mustache/test/_files/higher_order_sections.txt deleted file mode 100644 index be50ad764..000000000 --- a/builder/lib/Mustache/test/_files/higher_order_sections.txt +++ /dev/null @@ -1 +0,0 @@ -Hi {{name}}. => Hi Tater. To tinker? diff --git a/builder/lib/Mustache/test/_files/included_tag.js b/builder/lib/Mustache/test/_files/included_tag.js deleted file mode 100644 index eb032a42c..000000000 --- a/builder/lib/Mustache/test/_files/included_tag.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - html: "I like {{mustache}}" -}) diff --git a/builder/lib/Mustache/test/_files/included_tag.mustache b/builder/lib/Mustache/test/_files/included_tag.mustache deleted file mode 100644 index 70631c259..000000000 --- a/builder/lib/Mustache/test/_files/included_tag.mustache +++ /dev/null @@ -1 +0,0 @@ -You said "{{{html}}}" today diff --git a/builder/lib/Mustache/test/_files/included_tag.txt b/builder/lib/Mustache/test/_files/included_tag.txt deleted file mode 100644 index 1af45567f..000000000 --- a/builder/lib/Mustache/test/_files/included_tag.txt +++ /dev/null @@ -1 +0,0 @@ -You said "I like {{mustache}}" today diff --git a/builder/lib/Mustache/test/_files/inverted_section.js b/builder/lib/Mustache/test/_files/inverted_section.js deleted file mode 100644 index f8f08fd26..000000000 --- a/builder/lib/Mustache/test/_files/inverted_section.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - "repos": [] -}) diff --git a/builder/lib/Mustache/test/_files/inverted_section.mustache b/builder/lib/Mustache/test/_files/inverted_section.mustache deleted file mode 100644 index b0a183b10..000000000 --- a/builder/lib/Mustache/test/_files/inverted_section.mustache +++ /dev/null @@ -1,3 +0,0 @@ -{{#repos}}{{name}}{{/repos}} -{{^repos}}No repos :({{/repos}} -{{^nothin}}Hello!{{/nothin}} diff --git a/builder/lib/Mustache/test/_files/inverted_section.txt b/builder/lib/Mustache/test/_files/inverted_section.txt deleted file mode 100644 index b421582e7..000000000 --- a/builder/lib/Mustache/test/_files/inverted_section.txt +++ /dev/null @@ -1,3 +0,0 @@ - -No repos :( -Hello! diff --git a/builder/lib/Mustache/test/_files/keys_with_questionmarks.js b/builder/lib/Mustache/test/_files/keys_with_questionmarks.js deleted file mode 100644 index becd63102..000000000 --- a/builder/lib/Mustache/test/_files/keys_with_questionmarks.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - "person?": { - name: "Jon" - } -}) diff --git a/builder/lib/Mustache/test/_files/keys_with_questionmarks.mustache b/builder/lib/Mustache/test/_files/keys_with_questionmarks.mustache deleted file mode 100644 index 417f17f3c..000000000 --- a/builder/lib/Mustache/test/_files/keys_with_questionmarks.mustache +++ /dev/null @@ -1,3 +0,0 @@ -{{#person?}} - Hi {{name}}! -{{/person?}} diff --git a/builder/lib/Mustache/test/_files/keys_with_questionmarks.txt b/builder/lib/Mustache/test/_files/keys_with_questionmarks.txt deleted file mode 100644 index 0f69b9433..000000000 --- a/builder/lib/Mustache/test/_files/keys_with_questionmarks.txt +++ /dev/null @@ -1 +0,0 @@ - Hi Jon! diff --git a/builder/lib/Mustache/test/_files/malicious_template.js b/builder/lib/Mustache/test/_files/malicious_template.js deleted file mode 100644 index b4100a597..000000000 --- a/builder/lib/Mustache/test/_files/malicious_template.js +++ /dev/null @@ -1 +0,0 @@ -({}) diff --git a/builder/lib/Mustache/test/_files/malicious_template.mustache b/builder/lib/Mustache/test/_files/malicious_template.mustache deleted file mode 100644 index b956867ec..000000000 --- a/builder/lib/Mustache/test/_files/malicious_template.mustache +++ /dev/null @@ -1,5 +0,0 @@ -{{"+(function () {throw "evil"})()+"}} -{{{"+(function () {throw "evil"})()+"}}} -{{> "+(function () {throw "evil"})()+"}} -{{# "+(function () {throw "evil"})()+"}} -{{/ "+(function () {throw "evil"})()+"}} diff --git a/builder/lib/Mustache/test/_files/malicious_template.txt b/builder/lib/Mustache/test/_files/malicious_template.txt deleted file mode 100644 index 139597f9c..000000000 --- a/builder/lib/Mustache/test/_files/malicious_template.txt +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/builder/lib/Mustache/test/_files/multiline_comment.js b/builder/lib/Mustache/test/_files/multiline_comment.js deleted file mode 100644 index b4100a597..000000000 --- a/builder/lib/Mustache/test/_files/multiline_comment.js +++ /dev/null @@ -1 +0,0 @@ -({}) diff --git a/builder/lib/Mustache/test/_files/multiline_comment.mustache b/builder/lib/Mustache/test/_files/multiline_comment.mustache deleted file mode 100644 index dff0893d0..000000000 --- a/builder/lib/Mustache/test/_files/multiline_comment.mustache +++ /dev/null @@ -1,6 +0,0 @@ -{{! - -This is a multi-line comment. - -}} -Hello world! diff --git a/builder/lib/Mustache/test/_files/multiline_comment.txt b/builder/lib/Mustache/test/_files/multiline_comment.txt deleted file mode 100644 index cd0875583..000000000 --- a/builder/lib/Mustache/test/_files/multiline_comment.txt +++ /dev/null @@ -1 +0,0 @@ -Hello world! diff --git a/builder/lib/Mustache/test/_files/nested_higher_order_sections.js b/builder/lib/Mustache/test/_files/nested_higher_order_sections.js deleted file mode 100644 index 3ccf4d372..000000000 --- a/builder/lib/Mustache/test/_files/nested_higher_order_sections.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - bold: function () { - return function (text, render) { - return '' + render(text) + ''; - }; - }, - person: { name: 'Jonas' } -}); diff --git a/builder/lib/Mustache/test/_files/nested_higher_order_sections.mustache b/builder/lib/Mustache/test/_files/nested_higher_order_sections.mustache deleted file mode 100644 index e312fe79a..000000000 --- a/builder/lib/Mustache/test/_files/nested_higher_order_sections.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#bold}}{{#person}}My name is {{name}}!{{/person}}{{/bold}} diff --git a/builder/lib/Mustache/test/_files/nested_higher_order_sections.txt b/builder/lib/Mustache/test/_files/nested_higher_order_sections.txt deleted file mode 100644 index 0ee6a406a..000000000 --- a/builder/lib/Mustache/test/_files/nested_higher_order_sections.txt +++ /dev/null @@ -1 +0,0 @@ -My name is Jonas! diff --git a/builder/lib/Mustache/test/_files/nested_iterating.js b/builder/lib/Mustache/test/_files/nested_iterating.js deleted file mode 100644 index 2708b2db5..000000000 --- a/builder/lib/Mustache/test/_files/nested_iterating.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - inner: [{ - foo: 'foo', - inner: [{ - bar: 'bar' - }] - }] -}) diff --git a/builder/lib/Mustache/test/_files/nested_iterating.mustache b/builder/lib/Mustache/test/_files/nested_iterating.mustache deleted file mode 100644 index 1a3bb1a2e..000000000 --- a/builder/lib/Mustache/test/_files/nested_iterating.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#inner}}{{foo}}{{#inner}}{{bar}}{{/inner}}{{/inner}} diff --git a/builder/lib/Mustache/test/_files/nested_iterating.txt b/builder/lib/Mustache/test/_files/nested_iterating.txt deleted file mode 100644 index 323fae03f..000000000 --- a/builder/lib/Mustache/test/_files/nested_iterating.txt +++ /dev/null @@ -1 +0,0 @@ -foobar diff --git a/builder/lib/Mustache/test/_files/nesting.js b/builder/lib/Mustache/test/_files/nesting.js deleted file mode 100644 index 264cc2f77..000000000 --- a/builder/lib/Mustache/test/_files/nesting.js +++ /dev/null @@ -1,7 +0,0 @@ -({ - foo: [ - {a: {b: 1}}, - {a: {b: 2}}, - {a: {b: 3}} - ] -}) diff --git a/builder/lib/Mustache/test/_files/nesting.mustache b/builder/lib/Mustache/test/_files/nesting.mustache deleted file mode 100644 index 551366dea..000000000 --- a/builder/lib/Mustache/test/_files/nesting.mustache +++ /dev/null @@ -1,5 +0,0 @@ -{{#foo}} - {{#a}} - {{b}} - {{/a}} -{{/foo}} diff --git a/builder/lib/Mustache/test/_files/nesting.txt b/builder/lib/Mustache/test/_files/nesting.txt deleted file mode 100644 index 7db34b172..000000000 --- a/builder/lib/Mustache/test/_files/nesting.txt +++ /dev/null @@ -1,3 +0,0 @@ - 1 - 2 - 3 diff --git a/builder/lib/Mustache/test/_files/nesting_same_name.js b/builder/lib/Mustache/test/_files/nesting_same_name.js deleted file mode 100644 index 10a0c1401..000000000 --- a/builder/lib/Mustache/test/_files/nesting_same_name.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - items: [ - { - name: 'name', - items: [1, 2, 3, 4] - } - ] -}) diff --git a/builder/lib/Mustache/test/_files/nesting_same_name.mustache b/builder/lib/Mustache/test/_files/nesting_same_name.mustache deleted file mode 100644 index 777dbd685..000000000 --- a/builder/lib/Mustache/test/_files/nesting_same_name.mustache +++ /dev/null @@ -1 +0,0 @@ -{{#items}}{{name}}{{#items}}{{.}}{{/items}}{{/items}} diff --git a/builder/lib/Mustache/test/_files/nesting_same_name.txt b/builder/lib/Mustache/test/_files/nesting_same_name.txt deleted file mode 100644 index 34fcfd3e8..000000000 --- a/builder/lib/Mustache/test/_files/nesting_same_name.txt +++ /dev/null @@ -1 +0,0 @@ -name1234 diff --git a/builder/lib/Mustache/test/_files/null_string.js b/builder/lib/Mustache/test/_files/null_string.js deleted file mode 100644 index 984ee516a..000000000 --- a/builder/lib/Mustache/test/_files/null_string.js +++ /dev/null @@ -1,10 +0,0 @@ -({ - name: "Elise", - glytch: true, - binary: false, - value: null, - undef: undefined, - numeric: function() { - return NaN; - } -}) diff --git a/builder/lib/Mustache/test/_files/null_string.mustache b/builder/lib/Mustache/test/_files/null_string.mustache deleted file mode 100644 index a6f33009f..000000000 --- a/builder/lib/Mustache/test/_files/null_string.mustache +++ /dev/null @@ -1,6 +0,0 @@ -Hello {{name}} -glytch {{glytch}} -binary {{binary}} -value {{value}} -undef {{undef}} -numeric {{numeric}} diff --git a/builder/lib/Mustache/test/_files/null_string.txt b/builder/lib/Mustache/test/_files/null_string.txt deleted file mode 100644 index bcabe0a5a..000000000 --- a/builder/lib/Mustache/test/_files/null_string.txt +++ /dev/null @@ -1,6 +0,0 @@ -Hello Elise -glytch true -binary false -value -undef -numeric NaN diff --git a/builder/lib/Mustache/test/_files/null_view.js b/builder/lib/Mustache/test/_files/null_view.js deleted file mode 100644 index dbdae728e..000000000 --- a/builder/lib/Mustache/test/_files/null_view.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - name: 'Joe', - friends: null -}) diff --git a/builder/lib/Mustache/test/_files/null_view.mustache b/builder/lib/Mustache/test/_files/null_view.mustache deleted file mode 100644 index 115b376b5..000000000 --- a/builder/lib/Mustache/test/_files/null_view.mustache +++ /dev/null @@ -1 +0,0 @@ -{{name}}'s friends: {{#friends}}{{name}}, {{/friends}} \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/null_view.txt b/builder/lib/Mustache/test/_files/null_view.txt deleted file mode 100644 index 15ed2abe1..000000000 --- a/builder/lib/Mustache/test/_files/null_view.txt +++ /dev/null @@ -1 +0,0 @@ -Joe's friends: \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/partial_array.js b/builder/lib/Mustache/test/_files/partial_array.js deleted file mode 100644 index 2a6ddf1cf..000000000 --- a/builder/lib/Mustache/test/_files/partial_array.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - array: ['1', '2', '3', '4'] -}) diff --git a/builder/lib/Mustache/test/_files/partial_array.mustache b/builder/lib/Mustache/test/_files/partial_array.mustache deleted file mode 100644 index 7a336fee8..000000000 --- a/builder/lib/Mustache/test/_files/partial_array.mustache +++ /dev/null @@ -1 +0,0 @@ -{{>partial}} \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/partial_array.partial b/builder/lib/Mustache/test/_files/partial_array.partial deleted file mode 100644 index 0ba652c1e..000000000 --- a/builder/lib/Mustache/test/_files/partial_array.partial +++ /dev/null @@ -1,4 +0,0 @@ -Here's a non-sense array of values -{{#array}} - {{.}} -{{/array}} diff --git a/builder/lib/Mustache/test/_files/partial_array.txt b/builder/lib/Mustache/test/_files/partial_array.txt deleted file mode 100644 index 892837cb7..000000000 --- a/builder/lib/Mustache/test/_files/partial_array.txt +++ /dev/null @@ -1,5 +0,0 @@ -Here's a non-sense array of values - 1 - 2 - 3 - 4 diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials.js b/builder/lib/Mustache/test/_files/partial_array_of_partials.js deleted file mode 100644 index 03f13c946..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - numbers: [ - {i: '1'}, - {i: '2'}, - {i: '3'}, - {i: '4'} - ] -}) diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials.mustache b/builder/lib/Mustache/test/_files/partial_array_of_partials.mustache deleted file mode 100644 index 1af6d68c6..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials.mustache +++ /dev/null @@ -1,4 +0,0 @@ -Here is some stuff! -{{#numbers}} -{{>partial}} -{{/numbers}} diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials.partial b/builder/lib/Mustache/test/_files/partial_array_of_partials.partial deleted file mode 100644 index bdde77daf..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials.partial +++ /dev/null @@ -1 +0,0 @@ -{{i}} diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials.txt b/builder/lib/Mustache/test/_files/partial_array_of_partials.txt deleted file mode 100644 index f622375c8..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials.txt +++ /dev/null @@ -1,5 +0,0 @@ -Here is some stuff! -1 -2 -3 -4 diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.js b/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.js deleted file mode 100644 index 9ec0c00ff..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - numbers: ['1', '2', '3', '4'] -}) diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.mustache b/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.mustache deleted file mode 100644 index 1af6d68c6..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.mustache +++ /dev/null @@ -1,4 +0,0 @@ -Here is some stuff! -{{#numbers}} -{{>partial}} -{{/numbers}} diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.partial b/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.partial deleted file mode 100644 index 12f715986..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.partial +++ /dev/null @@ -1 +0,0 @@ -{{.}} diff --git a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.txt b/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.txt deleted file mode 100644 index f622375c8..000000000 --- a/builder/lib/Mustache/test/_files/partial_array_of_partials_implicit.txt +++ /dev/null @@ -1,5 +0,0 @@ -Here is some stuff! -1 -2 -3 -4 diff --git a/builder/lib/Mustache/test/_files/partial_empty.js b/builder/lib/Mustache/test/_files/partial_empty.js deleted file mode 100644 index 82b8c2242..000000000 --- a/builder/lib/Mustache/test/_files/partial_empty.js +++ /dev/null @@ -1,3 +0,0 @@ -({ - foo: 1 -}) diff --git a/builder/lib/Mustache/test/_files/partial_empty.mustache b/builder/lib/Mustache/test/_files/partial_empty.mustache deleted file mode 100644 index a71004703..000000000 --- a/builder/lib/Mustache/test/_files/partial_empty.mustache +++ /dev/null @@ -1,2 +0,0 @@ -hey {{foo}} -{{>partial}} diff --git a/builder/lib/Mustache/test/_files/partial_empty.partial b/builder/lib/Mustache/test/_files/partial_empty.partial deleted file mode 100644 index e69de29bb..000000000 diff --git a/builder/lib/Mustache/test/_files/partial_empty.txt b/builder/lib/Mustache/test/_files/partial_empty.txt deleted file mode 100644 index 1a679077b..000000000 --- a/builder/lib/Mustache/test/_files/partial_empty.txt +++ /dev/null @@ -1 +0,0 @@ -hey 1 diff --git a/builder/lib/Mustache/test/_files/partial_template.js b/builder/lib/Mustache/test/_files/partial_template.js deleted file mode 100644 index a913f8784..000000000 --- a/builder/lib/Mustache/test/_files/partial_template.js +++ /dev/null @@ -1,6 +0,0 @@ -({ - title: function () { - return "Welcome"; - }, - again: "Goodbye" -}) diff --git a/builder/lib/Mustache/test/_files/partial_template.mustache b/builder/lib/Mustache/test/_files/partial_template.mustache deleted file mode 100644 index 6a7492e00..000000000 --- a/builder/lib/Mustache/test/_files/partial_template.mustache +++ /dev/null @@ -1,2 +0,0 @@ -

{{title}}

-{{>partial}} diff --git a/builder/lib/Mustache/test/_files/partial_template.partial b/builder/lib/Mustache/test/_files/partial_template.partial deleted file mode 100644 index a40452924..000000000 --- a/builder/lib/Mustache/test/_files/partial_template.partial +++ /dev/null @@ -1 +0,0 @@ -Again, {{again}}! diff --git a/builder/lib/Mustache/test/_files/partial_template.txt b/builder/lib/Mustache/test/_files/partial_template.txt deleted file mode 100644 index 692698f08..000000000 --- a/builder/lib/Mustache/test/_files/partial_template.txt +++ /dev/null @@ -1,2 +0,0 @@ -

Welcome

-Again, Goodbye! diff --git a/builder/lib/Mustache/test/_files/partial_view.js b/builder/lib/Mustache/test/_files/partial_view.js deleted file mode 100644 index 3ad70d35c..000000000 --- a/builder/lib/Mustache/test/_files/partial_view.js +++ /dev/null @@ -1,14 +0,0 @@ -({ - greeting: function () { - return "Welcome"; - }, - farewell: function () { - return "Fair enough, right?"; - }, - name: "Chris", - value: 10000, - taxed_value: function () { - return this.value - (this.value * 0.4); - }, - in_ca: true -}) diff --git a/builder/lib/Mustache/test/_files/partial_view.mustache b/builder/lib/Mustache/test/_files/partial_view.mustache deleted file mode 100644 index f8f6a5b7d..000000000 --- a/builder/lib/Mustache/test/_files/partial_view.mustache +++ /dev/null @@ -1,3 +0,0 @@ -

{{greeting}}

-{{>partial}} -

{{farewell}}

diff --git a/builder/lib/Mustache/test/_files/partial_view.partial b/builder/lib/Mustache/test/_files/partial_view.partial deleted file mode 100644 index 03df20686..000000000 --- a/builder/lib/Mustache/test/_files/partial_view.partial +++ /dev/null @@ -1,5 +0,0 @@ -Hello {{name}} -You have just won ${{value}}! -{{#in_ca}} -Well, ${{ taxed_value }}, after taxes. -{{/in_ca}} \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/partial_view.txt b/builder/lib/Mustache/test/_files/partial_view.txt deleted file mode 100644 index c09147c7f..000000000 --- a/builder/lib/Mustache/test/_files/partial_view.txt +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome

-Hello Chris -You have just won $10000! -Well, $6000, after taxes. -

Fair enough, right?

diff --git a/builder/lib/Mustache/test/_files/partial_whitespace.js b/builder/lib/Mustache/test/_files/partial_whitespace.js deleted file mode 100644 index 3ad70d35c..000000000 --- a/builder/lib/Mustache/test/_files/partial_whitespace.js +++ /dev/null @@ -1,14 +0,0 @@ -({ - greeting: function () { - return "Welcome"; - }, - farewell: function () { - return "Fair enough, right?"; - }, - name: "Chris", - value: 10000, - taxed_value: function () { - return this.value - (this.value * 0.4); - }, - in_ca: true -}) diff --git a/builder/lib/Mustache/test/_files/partial_whitespace.mustache b/builder/lib/Mustache/test/_files/partial_whitespace.mustache deleted file mode 100644 index 48bd1ff80..000000000 --- a/builder/lib/Mustache/test/_files/partial_whitespace.mustache +++ /dev/null @@ -1,3 +0,0 @@ -

{{ greeting }}

-{{> partial }} -

{{ farewell }}

diff --git a/builder/lib/Mustache/test/_files/partial_whitespace.partial b/builder/lib/Mustache/test/_files/partial_whitespace.partial deleted file mode 100644 index 30de8f6c1..000000000 --- a/builder/lib/Mustache/test/_files/partial_whitespace.partial +++ /dev/null @@ -1,5 +0,0 @@ -Hello {{ name}} -You have just won ${{value }}! -{{# in_ca }} -Well, ${{ taxed_value }}, after taxes. -{{/ in_ca }} \ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/partial_whitespace.txt b/builder/lib/Mustache/test/_files/partial_whitespace.txt deleted file mode 100644 index c09147c7f..000000000 --- a/builder/lib/Mustache/test/_files/partial_whitespace.txt +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome

-Hello Chris -You have just won $10000! -Well, $6000, after taxes. -

Fair enough, right?

diff --git a/builder/lib/Mustache/test/_files/recursion_with_same_names.js b/builder/lib/Mustache/test/_files/recursion_with_same_names.js deleted file mode 100644 index ce2650291..000000000 --- a/builder/lib/Mustache/test/_files/recursion_with_same_names.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - name: 'name', - description: 'desc', - terms: [ - {name: 't1', index: 0}, - {name: 't2', index: 1} - ] -}) diff --git a/builder/lib/Mustache/test/_files/recursion_with_same_names.mustache b/builder/lib/Mustache/test/_files/recursion_with_same_names.mustache deleted file mode 100644 index c331d0453..000000000 --- a/builder/lib/Mustache/test/_files/recursion_with_same_names.mustache +++ /dev/null @@ -1,7 +0,0 @@ -{{ name }} -{{ description }} - -{{#terms}} - {{name}} - {{index}} -{{/terms}} diff --git a/builder/lib/Mustache/test/_files/recursion_with_same_names.txt b/builder/lib/Mustache/test/_files/recursion_with_same_names.txt deleted file mode 100644 index cb15d750e..000000000 --- a/builder/lib/Mustache/test/_files/recursion_with_same_names.txt +++ /dev/null @@ -1,7 +0,0 @@ -name -desc - - t1 - 0 - t2 - 1 diff --git a/builder/lib/Mustache/test/_files/reuse_of_enumerables.js b/builder/lib/Mustache/test/_files/reuse_of_enumerables.js deleted file mode 100644 index 4368b5743..000000000 --- a/builder/lib/Mustache/test/_files/reuse_of_enumerables.js +++ /dev/null @@ -1,6 +0,0 @@ -({ - terms: [ - {name: 't1', index: 0}, - {name: 't2', index: 1} - ] -}) diff --git a/builder/lib/Mustache/test/_files/reuse_of_enumerables.mustache b/builder/lib/Mustache/test/_files/reuse_of_enumerables.mustache deleted file mode 100644 index cc0cb7a41..000000000 --- a/builder/lib/Mustache/test/_files/reuse_of_enumerables.mustache +++ /dev/null @@ -1,8 +0,0 @@ -{{#terms}} - {{name}} - {{index}} -{{/terms}} -{{#terms}} - {{name}} - {{index}} -{{/terms}} diff --git a/builder/lib/Mustache/test/_files/reuse_of_enumerables.txt b/builder/lib/Mustache/test/_files/reuse_of_enumerables.txt deleted file mode 100644 index 6d05d9643..000000000 --- a/builder/lib/Mustache/test/_files/reuse_of_enumerables.txt +++ /dev/null @@ -1,8 +0,0 @@ - t1 - 0 - t2 - 1 - t1 - 0 - t2 - 1 diff --git a/builder/lib/Mustache/test/_files/section_as_context.js b/builder/lib/Mustache/test/_files/section_as_context.js deleted file mode 100644 index 425b29cb4..000000000 --- a/builder/lib/Mustache/test/_files/section_as_context.js +++ /dev/null @@ -1,10 +0,0 @@ -({ - a_object: { - title: 'this is an object', - description: 'one of its attributes is a list', - a_list: [ - {label: 'listitem1'}, - {label: 'listitem2'} - ] - } -}) diff --git a/builder/lib/Mustache/test/_files/section_as_context.mustache b/builder/lib/Mustache/test/_files/section_as_context.mustache deleted file mode 100644 index 59990f658..000000000 --- a/builder/lib/Mustache/test/_files/section_as_context.mustache +++ /dev/null @@ -1,9 +0,0 @@ -{{#a_object}} -

{{title}}

-

{{description}}

-
    - {{#a_list}} -
  • {{label}}
  • - {{/a_list}} -
-{{/a_object}} diff --git a/builder/lib/Mustache/test/_files/section_as_context.txt b/builder/lib/Mustache/test/_files/section_as_context.txt deleted file mode 100644 index d834e8047..000000000 --- a/builder/lib/Mustache/test/_files/section_as_context.txt +++ /dev/null @@ -1,6 +0,0 @@ -

this is an object

-

one of its attributes is a list

-
    -
  • listitem1
  • -
  • listitem2
  • -
diff --git a/builder/lib/Mustache/test/_files/simple.js b/builder/lib/Mustache/test/_files/simple.js deleted file mode 100644 index 1d8d6f425..000000000 --- a/builder/lib/Mustache/test/_files/simple.js +++ /dev/null @@ -1,8 +0,0 @@ -({ - name: "Chris", - value: 10000, - taxed_value: function () { - return this.value - (this.value * 0.4); - }, - in_ca: true -}) diff --git a/builder/lib/Mustache/test/_files/simple.mustache b/builder/lib/Mustache/test/_files/simple.mustache deleted file mode 100644 index 2fea6327a..000000000 --- a/builder/lib/Mustache/test/_files/simple.mustache +++ /dev/null @@ -1,5 +0,0 @@ -Hello {{name}} -You have just won ${{value}}! -{{#in_ca}} -Well, ${{ taxed_value }}, after taxes. -{{/in_ca}} diff --git a/builder/lib/Mustache/test/_files/simple.txt b/builder/lib/Mustache/test/_files/simple.txt deleted file mode 100644 index 5d75d6562..000000000 --- a/builder/lib/Mustache/test/_files/simple.txt +++ /dev/null @@ -1,3 +0,0 @@ -Hello Chris -You have just won $10000! -Well, $6000, after taxes. diff --git a/builder/lib/Mustache/test/_files/string_as_context.js b/builder/lib/Mustache/test/_files/string_as_context.js deleted file mode 100644 index e8bb4da00..000000000 --- a/builder/lib/Mustache/test/_files/string_as_context.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - a_string: 'aa', - a_list: ['a','b','c'] -}) diff --git a/builder/lib/Mustache/test/_files/string_as_context.mustache b/builder/lib/Mustache/test/_files/string_as_context.mustache deleted file mode 100644 index 00f7181b1..000000000 --- a/builder/lib/Mustache/test/_files/string_as_context.mustache +++ /dev/null @@ -1,5 +0,0 @@ -
    -{{#a_list}} -
  • {{a_string}}/{{.}}
  • -{{/a_list}} -
\ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/string_as_context.txt b/builder/lib/Mustache/test/_files/string_as_context.txt deleted file mode 100644 index 8bd87ff82..000000000 --- a/builder/lib/Mustache/test/_files/string_as_context.txt +++ /dev/null @@ -1,5 +0,0 @@ -
    -
  • aa/a
  • -
  • aa/b
  • -
  • aa/c
  • -
\ No newline at end of file diff --git a/builder/lib/Mustache/test/_files/two_in_a_row.js b/builder/lib/Mustache/test/_files/two_in_a_row.js deleted file mode 100644 index 9c17c1173..000000000 --- a/builder/lib/Mustache/test/_files/two_in_a_row.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - name: "Joe", - greeting: "Welcome" -}) diff --git a/builder/lib/Mustache/test/_files/two_in_a_row.mustache b/builder/lib/Mustache/test/_files/two_in_a_row.mustache deleted file mode 100644 index b23f29e87..000000000 --- a/builder/lib/Mustache/test/_files/two_in_a_row.mustache +++ /dev/null @@ -1 +0,0 @@ -{{greeting}}, {{name}}! diff --git a/builder/lib/Mustache/test/_files/two_in_a_row.txt b/builder/lib/Mustache/test/_files/two_in_a_row.txt deleted file mode 100644 index c6d6a9b48..000000000 --- a/builder/lib/Mustache/test/_files/two_in_a_row.txt +++ /dev/null @@ -1 +0,0 @@ -Welcome, Joe! diff --git a/builder/lib/Mustache/test/_files/two_sections.js b/builder/lib/Mustache/test/_files/two_sections.js deleted file mode 100644 index b4100a597..000000000 --- a/builder/lib/Mustache/test/_files/two_sections.js +++ /dev/null @@ -1 +0,0 @@ -({}) diff --git a/builder/lib/Mustache/test/_files/two_sections.mustache b/builder/lib/Mustache/test/_files/two_sections.mustache deleted file mode 100644 index a4b9f2a78..000000000 --- a/builder/lib/Mustache/test/_files/two_sections.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{#foo}} -{{/foo}} -{{#bar}} -{{/bar}} diff --git a/builder/lib/Mustache/test/_files/two_sections.txt b/builder/lib/Mustache/test/_files/two_sections.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/builder/lib/Mustache/test/_files/unescaped.js b/builder/lib/Mustache/test/_files/unescaped.js deleted file mode 100644 index b6d064f12..000000000 --- a/builder/lib/Mustache/test/_files/unescaped.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - title: function () { - return "Bear > Shark"; - } -}) diff --git a/builder/lib/Mustache/test/_files/unescaped.mustache b/builder/lib/Mustache/test/_files/unescaped.mustache deleted file mode 100644 index 6b07d7b71..000000000 --- a/builder/lib/Mustache/test/_files/unescaped.mustache +++ /dev/null @@ -1 +0,0 @@ -

{{{title}}}

diff --git a/builder/lib/Mustache/test/_files/unescaped.txt b/builder/lib/Mustache/test/_files/unescaped.txt deleted file mode 100644 index 089ad7967..000000000 --- a/builder/lib/Mustache/test/_files/unescaped.txt +++ /dev/null @@ -1 +0,0 @@ -

Bear > Shark

diff --git a/builder/lib/Mustache/test/_files/whitespace.js b/builder/lib/Mustache/test/_files/whitespace.js deleted file mode 100644 index f41cb5640..000000000 --- a/builder/lib/Mustache/test/_files/whitespace.js +++ /dev/null @@ -1,4 +0,0 @@ -({ - tag1: "Hello", - tag2: "World" -}) diff --git a/builder/lib/Mustache/test/_files/whitespace.mustache b/builder/lib/Mustache/test/_files/whitespace.mustache deleted file mode 100644 index aa76e08ea..000000000 --- a/builder/lib/Mustache/test/_files/whitespace.mustache +++ /dev/null @@ -1,4 +0,0 @@ -{{tag1}} - - -{{tag2}}. diff --git a/builder/lib/Mustache/test/_files/whitespace.txt b/builder/lib/Mustache/test/_files/whitespace.txt deleted file mode 100644 index 851fa7448..000000000 --- a/builder/lib/Mustache/test/_files/whitespace.txt +++ /dev/null @@ -1,4 +0,0 @@ -Hello - - -World. diff --git a/builder/lib/Mustache/test/context-test.js b/builder/lib/Mustache/test/context-test.js deleted file mode 100644 index 752f74bc7..000000000 --- a/builder/lib/Mustache/test/context-test.js +++ /dev/null @@ -1,51 +0,0 @@ -require('./helper'); -var Context = Mustache.Context; - -describe('A new Mustache.Context', function () { - var context; - beforeEach(function () { - context = new Context({ name: 'parent', message: 'hi', a: { b: 'b' } }); - }); - - it('is able to lookup properties of its own view', function () { - assert.equal(context.lookup('name'), 'parent'); - }); - - it('is able to lookup nested properties of its own view', function () { - assert.equal(context.lookup('a.b'), 'b'); - }); - - describe('when pushed', function () { - beforeEach(function () { - context = context.push({ name: 'child', c: { d: 'd' } }); - }); - - it('returns the child context', function () { - assert.equal(context.view.name, 'child'); - assert.equal(context.parent.view.name, 'parent'); - }); - - it('is able to lookup properties of its own view', function () { - assert.equal(context.lookup('name'), 'child'); - }); - - it("is able to lookup properties of the parent context's view", function () { - assert.equal(context.lookup('message'), 'hi'); - }); - - it('is able to lookup nested properties of its own view', function () { - assert.equal(context.lookup('c.d'), 'd'); - }); - - it('is able to lookup nested properties of its parent view', function () { - assert.equal(context.lookup('a.b'), 'b'); - }); - }); -}); - -describe('Mustache.Context.make', function () { - it('returns the same object when given a Context', function () { - var context = new Context; - assert.strictEqual(Context.make(context), context); - }); -}); diff --git a/builder/lib/Mustache/test/helper.js b/builder/lib/Mustache/test/helper.js deleted file mode 100644 index a91fe499f..000000000 --- a/builder/lib/Mustache/test/helper.js +++ /dev/null @@ -1,2 +0,0 @@ -assert = require('assert'); -Mustache = require('../mustache'); diff --git a/builder/lib/Mustache/test/mustache-spec-test.js b/builder/lib/Mustache/test/mustache-spec-test.js deleted file mode 100644 index 1050ea43d..000000000 --- a/builder/lib/Mustache/test/mustache-spec-test.js +++ /dev/null @@ -1,89 +0,0 @@ -require('./helper'); - -var fs = require('fs'); -var path = require('path'); -var specsDir = path.join(__dirname, 'spec/specs'); - -var skipTests = { - comments: [ - 'Standalone Without Newline' - ], - delimiters: [ - 'Standalone Without Newline' - ], - inverted: [ - 'Standalone Without Newline' - ], - partials: [ - 'Standalone Without Previous Line', - 'Standalone Without Newline', - 'Standalone Indentation' - ], - sections: [ - 'Standalone Without Newline' - ], - '~lambdas': [ - 'Interpolation', - 'Interpolation - Expansion', - 'Interpolation - Alternate Delimiters', - 'Interpolation - Multiple Calls', - 'Escaping', - 'Section - Expansion', - 'Section - Alternate Delimiters' - ] -}; - -// You can run the skiped tests by setting the NOSKIP environment variable to -// true (e.g. NOSKIP=true mocha test/mustache-spec-test.js) -var noSkip = process.env.NOSKIP; - -// You can put the name of a specific test file to run in the TEST environment -// variable (e.g. TEST=interpolation mocha test/mustache-spec-test.js) -var fileToRun = process.env.TEST; - -// Mustache should work on node 0.6 that doesn't have fs.exisisSync -function existsDir(path) { - try { - return fs.statSync(path).isDirectory(); - } catch (x) { - return false; - } -} - -var specFiles; -if (fileToRun) { - specFiles = [fileToRun]; -} else if (existsDir(specsDir)) { - specFiles = fs.readdirSync(specsDir).filter(function (file) { - return (/\.json$/).test(file); - }).map(function (file) { - return path.basename(file).replace(/\.json$/, ''); - }).sort(); -} else { - specFiles = []; -} - -function getSpecs(specArea) { - return JSON.parse(fs.readFileSync(path.join(specsDir, specArea + '.' + 'json'), 'utf8')); -} - -describe('Mustache spec compliance', function() { - beforeEach(function () { - Mustache.clearCache(); - }); - - specFiles.forEach(function(specArea) { - describe('- ' + specArea + ':', function() { - var specs = getSpecs(specArea); - specs.tests.forEach(function(test) { - var it_ = (!noSkip && skipTests[specArea] && skipTests[specArea].indexOf(test.name) >= 0) ? it.skip : it; - it_(test.name + ' - ' + test.desc, function() { - if (test.data.lambda && test.data.lambda.__tag__ === 'code') - test.data.lambda = eval('(function() { return ' + test.data.lambda.js + '; })'); - var output = Mustache.render(test.template, test.data, test.partials); - assert.equal(output, test.expected); - }); - }); - }); - }); -}); \ No newline at end of file diff --git a/builder/lib/Mustache/test/parse-test.js b/builder/lib/Mustache/test/parse-test.js deleted file mode 100644 index 40d23a431..000000000 --- a/builder/lib/Mustache/test/parse-test.js +++ /dev/null @@ -1,106 +0,0 @@ -require('./helper'); - -// A map of templates to their expected token output. Tokens are in the format: -// [type, value, startIndex, endIndex, subTokens]. -var expectations = { - '' : [], - '{{hi}}' : [ [ 'name', 'hi', 0, 6 ] ], - '{{hi.world}}' : [ [ 'name', 'hi.world', 0, 12 ] ], - '{{hi . world}}' : [ [ 'name', 'hi . world', 0, 14 ] ], - '{{ hi}}' : [ [ 'name', 'hi', 0, 7 ] ], - '{{hi }}' : [ [ 'name', 'hi', 0, 7 ] ], - '{{ hi }}' : [ [ 'name', 'hi', 0, 8 ] ], - '{{{hi}}}' : [ [ '&', 'hi', 0, 8 ] ], - '{{!hi}}' : [ [ '!', 'hi', 0, 7 ] ], - '{{! hi}}' : [ [ '!', 'hi', 0, 8 ] ], - '{{! hi }}' : [ [ '!', 'hi', 0, 9 ] ], - '{{ !hi}}' : [ [ '!', 'hi', 0, 8 ] ], - '{{ ! hi}}' : [ [ '!', 'hi', 0, 9 ] ], - '{{ ! hi }}' : [ [ '!', 'hi', 0, 10 ] ], - 'a\n b' : [ [ 'text', 'a\n b', 0, 4 ] ], - 'a{{hi}}' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ] ], - 'a {{hi}}' : [ [ 'text', 'a ', 0, 2 ], [ 'name', 'hi', 2, 8 ] ], - ' a{{hi}}' : [ [ 'text', ' a', 0, 2 ], [ 'name', 'hi', 2, 8 ] ], - ' a {{hi}}' : [ [ 'text', ' a ', 0, 3 ], [ 'name', 'hi', 3, 9 ] ], - 'a{{hi}}b' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', 'b', 7, 8 ] ], - 'a{{hi}} b' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', ' b', 7, 9 ] ], - 'a{{hi}}b ' : [ [ 'text', 'a', 0, 1 ], [ 'name', 'hi', 1, 7 ], [ 'text', 'b ', 7, 9 ] ], - 'a\n{{hi}} b \n' : [ [ 'text', 'a\n', 0, 2 ], [ 'name', 'hi', 2, 8 ], [ 'text', ' b \n', 8, 12 ] ], - 'a\n {{hi}} \nb' : [ [ 'text', 'a\n ', 0, 3 ], [ 'name', 'hi', 3, 9 ], [ 'text', ' \nb', 9, 12 ] ], - 'a\n {{!hi}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '!', 'hi', 3, 10 ], [ 'text', 'b', 12, 13 ] ], - 'a\n{{#a}}{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 8 ], [ 'text', 'b', 15, 16 ] ], - 'a\n {{#a}}{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 9 ], [ 'text', 'b', 16, 17 ] ], - 'a\n {{#a}}{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 9 ], [ 'text', 'b', 17, 18 ] ], - 'a\n{{#a}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 9 ], [ 'text', 'b', 16, 17 ] ], - 'a\n {{#a}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ 'text', 'b', 17, 18 ] ], - 'a\n {{#a}}\n{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ 'text', 'b', 18, 19 ] ], - 'a\n{{#a}}\n{{/a}}\n{{#b}}\n{{/b}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [], 9 ], [ '#', 'b', 16, 22, [], 23 ], [ 'text', 'b', 30, 31 ] ], - 'a\n {{#a}}\n{{/a}}\n{{#b}}\n{{/b}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ '#', 'b', 17, 23, [], 24 ], [ 'text', 'b', 31, 32 ] ], - 'a\n {{#a}}\n{{/a}}\n{{#b}}\n{{/b}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [], 10 ], [ '#', 'b', 17, 23, [], 24 ], [ 'text', 'b', 32, 33 ] ], - 'a\n{{#a}}\n{{#b}}\n{{/b}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 2, 8, [ [ '#', 'b', 9, 15, [], 16 ] ], 23 ], [ 'text', 'b', 30, 31 ] ], - 'a\n {{#a}}\n{{#b}}\n{{/b}}\n{{/a}}\nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [ [ '#', 'b', 10, 16, [], 17 ] ], 24 ], [ 'text', 'b', 31, 32 ] ], - 'a\n {{#a}}\n{{#b}}\n{{/b}}\n{{/a}} \nb' : [ [ 'text', 'a\n', 0, 2 ], [ '#', 'a', 3, 9, [ [ '#', 'b', 10, 16, [], 17 ] ], 24 ], [ 'text', 'b', 32, 33 ] ], - '{{>abc}}' : [ [ '>', 'abc', 0, 8 ] ], - '{{> abc }}' : [ [ '>', 'abc', 0, 10 ] ], - '{{ > abc }}' : [ [ '>', 'abc', 0, 11 ] ], - '{{=<% %>=}}' : [ [ '=', '<% %>', 0, 11 ] ], - '{{= <% %> =}}' : [ [ '=', '<% %>', 0, 13 ] ], - '{{=<% %>=}}<%={{ }}=%>' : [ [ '=', '<% %>', 0, 11 ], [ '=', '{{ }}', 11, 22 ] ], - '{{=<% %>=}}<%hi%>' : [ [ '=', '<% %>', 0, 11 ], [ 'name', 'hi', 11, 17 ] ], - '{{#a}}{{/a}}hi{{#b}}{{/b}}\n' : [ [ '#', 'a', 0, 6, [], 6 ], [ 'text', 'hi', 12, 14 ], [ '#', 'b', 14, 20, [], 20 ], [ 'text', '\n', 26, 27 ] ], - '{{a}}\n{{b}}\n\n{{#c}}\n{{/c}}\n' : [ [ 'name', 'a', 0, 5 ], [ 'text', '\n', 5, 6 ], [ 'name', 'b', 6, 11 ], [ 'text', '\n\n', 11, 13 ], [ '#', 'c', 13, 19, [], 20 ] ], - '{{#foo}}\n {{#a}}\n {{b}}\n {{/a}}\n{{/foo}}\n' - : [ [ '#', 'foo', 0, 8, [ [ '#', 'a', 11, 17, [ [ 'text', ' ', 18, 22 ], [ 'name', 'b', 22, 27 ], [ 'text', '\n', 27, 28 ] ], 30 ] ], 37 ] ] -}; - -describe('Mustache.parse', function () { - - for (var template in expectations) { - (function (template, tokens) { - it('knows how to parse ' + JSON.stringify(template), function () { - assert.deepEqual(Mustache.parse(template), tokens); - }); - })(template, expectations[template]); - } - - describe('when there is an unclosed tag', function () { - it('throws an error', function () { - assert.throws(function () { - Mustache.parse('My name is {{name'); - }, /unclosed tag at 17/i); - }); - }); - - describe('when there is an unclosed section', function () { - it('throws an error', function () { - assert.throws(function () { - Mustache.parse('A list: {{#people}}{{name}}'); - }, /unclosed section "people" at 27/i); - }); - }); - - describe('when there is an unopened section', function () { - it('throws an error', function () { - assert.throws(function () { - Mustache.parse('The end of the list! {{/people}}'); - }, /unopened section "people" at 21/i); - }); - }); - - describe('when invalid tags are given as an argument', function () { - it('throws an error', function () { - assert.throws(function () { - Mustache.parse('A template <% name %>', [ '<%' ]); - }, /invalid tags/i); - }); - }); - - describe('when the template contains invalid tags', function () { - it('throws an error', function () { - assert.throws(function () { - Mustache.parse('A template {{=<%=}}'); - }, /invalid tags at 11/i); - }); - }); - -}); diff --git a/builder/lib/Mustache/test/render-test.js b/builder/lib/Mustache/test/render-test.js deleted file mode 100644 index acec47ffd..000000000 --- a/builder/lib/Mustache/test/render-test.js +++ /dev/null @@ -1,68 +0,0 @@ -require('./helper'); - -var fs = require('fs'); -var path = require('path'); -var _files = path.join(__dirname, '_files'); - -function getContents(testName, ext) { - return fs.readFileSync(path.join(_files, testName + '.' + ext), 'utf8'); -} - -function getView(testName) { - var view = getContents(testName, 'js'); - if (!view) throw new Error('Cannot find view for test "' + testName + '"'); - return eval(view); -} - -function getPartial(testName) { - try { - return getContents(testName, 'partial'); - } catch (e) { - // No big deal. Not all tests need to test partial support. - } -} - -function getTest(testName) { - var test = {}; - test.view = getView(testName); - test.template = getContents(testName, 'mustache'); - test.partial = getPartial(testName); - test.expect = getContents(testName, 'txt'); - return test; -} - -// You can put the name of a specific test to run in the TEST environment -// variable (e.g. TEST=backslashes vows test/render-test.js) -var testToRun = process.env.TEST; - -var testNames; -if (testToRun) { - testNames = [testToRun]; -} else { - testNames = fs.readdirSync(_files).filter(function (file) { - return (/\.js$/).test(file); - }).map(function (file) { - return path.basename(file).replace(/\.js$/, ''); - }); -} - -describe('Mustache.render', function () { - beforeEach(function () { - Mustache.clearCache(); - }); - - testNames.forEach(function (testName) { - var test = getTest(testName); - - it('knows how to render ' + testName, function () { - var output; - if (test.partial) { - output = Mustache.render(test.template, test.view, { partial: test.partial }); - } else { - output = Mustache.render(test.template, test.view); - } - - assert.equal(output, test.expect); - }); - }); -}); diff --git a/builder/lib/Mustache/test/scanner-test.js b/builder/lib/Mustache/test/scanner-test.js deleted file mode 100644 index 9c9766420..000000000 --- a/builder/lib/Mustache/test/scanner-test.js +++ /dev/null @@ -1,78 +0,0 @@ -require('./helper'); -var Scanner = Mustache.Scanner; - -describe('A new Mustache.Scanner', function () { - describe('for an empty string', function () { - it('is at the end', function () { - var scanner = new Scanner(''); - assert(scanner.eos()); - }); - }); - - describe('for a non-empty string', function () { - var scanner; - beforeEach(function () { - scanner = new Scanner('a b c'); - }); - - describe('scan', function () { - describe('when the RegExp matches the entire string', function () { - it('returns the entire string', function () { - var match = scanner.scan(/a b c/); - assert.equal(match, scanner.string); - assert(scanner.eos()); - }); - }); - - describe('when the RegExp matches at index 0', function () { - it('returns the portion of the string that matched', function () { - var match = scanner.scan(/a/); - assert.equal(match, 'a'); - assert.equal(scanner.pos, 1); - }); - }); - - describe('when the RegExp matches at some index other than 0', function () { - it('returns the empty string', function () { - var match = scanner.scan(/b/); - assert.equal(match, ''); - assert.equal(scanner.pos, 0); - }); - }); - - describe('when the RegExp does not match', function () { - it('returns the empty string', function () { - var match = scanner.scan(/z/); - assert.equal(match, ''); - assert.equal(scanner.pos, 0); - }); - }); - }); // scan - - describe('scanUntil', function () { - describe('when the RegExp matches at index 0', function () { - it('returns the empty string', function () { - var match = scanner.scanUntil(/a/); - assert.equal(match, ''); - assert.equal(scanner.pos, 0); - }); - }); - - describe('when the RegExp matches at some index other than 0', function () { - it('returns the string up to that index', function () { - var match = scanner.scanUntil(/b/); - assert.equal(match, 'a '); - assert.equal(scanner.pos, 2); - }); - }); - - describe('when the RegExp does not match', function () { - it('returns the entire string', function () { - var match = scanner.scanUntil(/z/); - assert.equal(match, scanner.string); - assert(scanner.eos()); - }); - }); - }); // scanUntil - }); // for a non-empty string -}); diff --git a/builder/lib/Mustache/test/writer-test.js b/builder/lib/Mustache/test/writer-test.js deleted file mode 100644 index db2813a5f..000000000 --- a/builder/lib/Mustache/test/writer-test.js +++ /dev/null @@ -1,43 +0,0 @@ -require('./helper'); -var Writer = Mustache.Writer; - -describe('A new Mustache.Writer', function () { - var writer; - beforeEach(function () { - writer = new Writer; - }); - - it('loads partials correctly', function () { - var partial = 'The content of the partial.'; - var result = writer.render('{{>partial}}', {}, function (name) { - assert.equal(name, 'partial'); - return partial; - }); - - assert.equal(result, partial); - }); - - it('caches partials by content, not name', function () { - var result = writer.render('{{>partial}}', {}, { - partial: 'partial one' - }); - - assert.equal(result, 'partial one'); - - result = writer.render('{{>partial}}', {}, { - partial: 'partial two' - }); - - assert.equal(result, 'partial two'); - }); - - it('can compile an array of tokens', function () { - var template = 'Hello {{name}}!'; - var tokens = Mustache.parse(template); - var render = writer.compileTokens(tokens, template); - - var result = render({ name: 'Michael' }); - - assert.equal(result, 'Hello Michael!'); - }); -}); diff --git a/builder/lib/Mustache/wrappers/dojo/mustache.js.post b/builder/lib/Mustache/wrappers/dojo/mustache.js.post deleted file mode 100644 index eeeb4b7f0..000000000 --- a/builder/lib/Mustache/wrappers/dojo/mustache.js.post +++ /dev/null @@ -1,4 +0,0 @@ - - dojox.mustache = dojo.hitch(Mustache, "render"); - -})(); \ No newline at end of file diff --git a/builder/lib/Mustache/wrappers/dojo/mustache.js.pre b/builder/lib/Mustache/wrappers/dojo/mustache.js.pre deleted file mode 100644 index f87f3cd77..000000000 --- a/builder/lib/Mustache/wrappers/dojo/mustache.js.pre +++ /dev/null @@ -1,9 +0,0 @@ -/* -Shameless port of a shameless port -@defunkt => @janl => @aq => @voodootikigod - -See http://github.com/defunkt/mustache for more info. -*/ - -dojo.provide("dojox.mustache._base"); -(function(){ diff --git a/builder/lib/Mustache/wrappers/jquery/mustache.js.post b/builder/lib/Mustache/wrappers/jquery/mustache.js.post deleted file mode 100644 index 3209e915f..000000000 --- a/builder/lib/Mustache/wrappers/jquery/mustache.js.post +++ /dev/null @@ -1,13 +0,0 @@ - $.mustache = function (template, view, partials) { - return Mustache.render(template, view, partials); - }; - - $.fn.mustache = function (view, partials) { - return $(this).map(function (i, elm) { - var template = $.trim($(elm).html()); - var output = $.mustache(template, view, partials); - return $(output).get(); - }); - }; - -})(jQuery); diff --git a/builder/lib/Mustache/wrappers/jquery/mustache.js.pre b/builder/lib/Mustache/wrappers/jquery/mustache.js.pre deleted file mode 100644 index b4d8af5e1..000000000 --- a/builder/lib/Mustache/wrappers/jquery/mustache.js.pre +++ /dev/null @@ -1,9 +0,0 @@ -/* -Shameless port of a shameless port -@defunkt => @janl => @aq - -See http://github.com/defunkt/mustache for more info. -*/ - -;(function($) { - diff --git a/builder/lib/Mustache/wrappers/mootools/mustache.js.post b/builder/lib/Mustache/wrappers/mootools/mustache.js.post deleted file mode 100644 index aa9b8fab7..000000000 --- a/builder/lib/Mustache/wrappers/mootools/mustache.js.post +++ /dev/null @@ -1,5 +0,0 @@ - - Object.implement('mustache', function(view, partials){ - return Mustache.render(view, this, partials); - }); -})(); diff --git a/builder/lib/Mustache/wrappers/mootools/mustache.js.pre b/builder/lib/Mustache/wrappers/mootools/mustache.js.pre deleted file mode 100644 index 9839f9931..000000000 --- a/builder/lib/Mustache/wrappers/mootools/mustache.js.pre +++ /dev/null @@ -1,2 +0,0 @@ -(function(){ - diff --git a/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.post b/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.post deleted file mode 100644 index 6488b9c9c..000000000 --- a/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.post +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Above is the original mustache code. - */ - -// EXPOSE qooxdoo variant -qx.bom.Template.version = this.Mustache.version; -qx.bom.Template.render = this.Mustache.render; - -}).call({}); \ No newline at end of file diff --git a/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.pre b/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.pre deleted file mode 100644 index 22aca98c6..000000000 --- a/builder/lib/Mustache/wrappers/qooxdoo/mustache.js.pre +++ /dev/null @@ -1,164 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2004-2012 1&1 Internet AG, Germany, http://www.1und1.de - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Martin Wittemann (martinwittemann) - - ====================================================================== - - This class contains code based on the following work: - - * Mustache.js version 0.7.2 - - Code: - https://github.com/janl/mustache.js - - Copyright: - (c) 2009 Chris Wanstrath (Ruby) - (c) 2010 Jan Lehnardt (JavaScript) - - License: - MIT: http://www.opensource.org/licenses/mit-license.php - - ---------------------------------------------------------------------- - - Copyright (c) 2009 Chris Wanstrath (Ruby) - Copyright (c) 2010 Jan Lehnardt (JavaScript) - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -************************************************************************ */ - -/** - * The is a template class which can be used for HTML templating. In fact, - * this is a wrapper for mustache.js which is a "framework-agnostic way to - * render logic-free views". - * - * Here is a basic example how to use it: - * Template: - *
- * var template = "Hi, my name is {{name}}!";
- * var view = {name: "qooxdoo"};
- * qx.bom.Template.render(template, view);
- * // return "Hi, my name is qooxdoo!"
- * 
- * - * For further details, please visit the mustache.js documentation here: - * https://github.com/janl/mustache.js/blob/master/README.md - * - * @ignore(module) - */ -qx.Bootstrap.define("qx.bom.Template", { - statics : { - /** Contains the mustache.js version. */ - version: null, - - /** - * Original and only template method of mustache.js. For further - * documentation, please visit https://github.com/janl/mustache.js - * - * @signature function(template, view, partials) - * @param template {String} The String containing the template. - * @param view {Object} The object holding the data to render. - * @param partials {Object} Object holding parts of a template. - * @return {String} The parsed template. - */ - render: null, - - /** - * Combines {@link #render} and {@link #get}. Input is equal to {@link #render} - * and output is equal to {@link #get}. The advantage over {@link #get} - * is that you don't need a HTML template but can use a template - * string and still get a DOM element. Keep in mind that templates - * can only have one root element. - * - * @param template {String} The String containing the template. - * @param view {Object} The object holding the data to render. - * @param partials {Object} Object holding parts of a template. - * @return {Element} A DOM element holding the parsed template data. - */ - renderToNode : function(template, view, partials) { - var renderedTmpl = this.render(template, view, partials); - return this._createNodeFromTemplate(renderedTmpl); - }, - - /** - * Helper method which provides you with a direct access to templates - * stored as HTML in the DOM. The DOM node with the given ID will be used - * as a template, parsed and a new DOM node will be returned containing the - * parsed data. Keep in mind to have only one root DOM element in the the - * template. - * Additionally, you should not put the template into a regular, hidden - * DOM element because the template may not be valid HTML due to the containing - * mustache tags. We suggest to put it into a script tag with the type - * text/template. - * - * @param id {String} The id of the HTML template in the DOM. - * @param view {Object} The object holding the data to render. - * @param partials {Object} Object holding parts of a template. - * @return {Element} A DOM element holding the parsed template data. - */ - get : function(id, view, partials) { - // get the content stored in the DOM - var template = document.getElementById(id); - return this.renderToNode(template.innerHTML, view, partials); - }, - - /** - * Accepts a parsed template and returns a (potentially nested) node. - * - * @param template {String} The String containing the template. - * @return {Element} A DOM element holding the parsed template data. - */ - _createNodeFromTemplate : function(template) { - // template is text only (no html elems) so use text node - if (template.search(/<|>/) === -1) { - return document.createTextNode(template); - } - - // template has html elems so convert string into DOM nodes - var helper = qx.dom.Element.create("div"); - helper.innerHTML = template; - - return helper.children[0]; - } - } -}); - -(function() { - -/** - * Below is the original mustache.js code. Snapshot date is mentioned in - * the head of this file. - * @ignore(exports) - * @ignore(define.*) - * @ignore(module.*) - */ diff --git a/builder/patternlab.js b/builder/patternlab.js index 0e7f8b72e..879ad3041 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -52,7 +52,7 @@ var oPatternItem = function(){ this.patternName = ''; }; -var mustache = require('./lib/Mustache/mustache.js'); +var mustache = require('mustache'); module.exports = function(grunt) { grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) { diff --git a/package.json b/package.json index 56cffd6d8..d3a38d211 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-qunit": "~0.4.0", + "mustache": "~0.8.1", "matchdep": "~0.3.0" }, "keywords": [ From d212af30198788956aafdb10692622c0d9f65b4e Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Mon, 5 May 2014 23:36:06 -0500 Subject: [PATCH 16/39] added thanks --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1bc2456a1..8c6c69a54 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,7 +6,8 @@ PL-node-v0.1.1 - ADD: Travis CI test support! - ADD: Contributing file - ADD: Repository to package.json - - THX: thank you @tbranyen for tip on repository, and NPM + - FIX: Manage Mustache dependency using NPM + - THX: thank you @tbranyen for tip on repository, Mustache, and NPM! PL-node-v0.1.0 - FIX: Links to patterns did not work when visited from a server From 3c975dff6c64188303a25438f8f1f7fda3a117e5 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Tue, 6 May 2014 01:14:07 -0500 Subject: [PATCH 17/39] reorganized patternlab.js should be the makings of a more sustainable, unit testable library. having some challenges referencing node from qunit js. added support for version command, which fixes #36 --- builder/patternlab.js | 141 ++++++++++++++++++++++++++---------------- test/runner.js | 7 +++ test/tests.html | 1 + test/tests.js | 9 ++- 4 files changed, 102 insertions(+), 56 deletions(-) create mode 100644 test/runner.js diff --git a/builder/patternlab.js b/builder/patternlab.js index 879ad3041..d0bab81d5 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.1 - 2014-05-05 + * patternlab-node - v0.1.1 - 2014-05-06 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. @@ -8,58 +8,61 @@ * */ -var path = require('path'); - -var oPattern = function(name, subdir, filename, data){ - this.name = name; //this is the unique name with the subDir - this.subdir = subdir; - this.filename = filename; - this.data = data; - this.template = ''; - this.patternPartial = ''; - this.patternName = ''; //this is the display name for the ui - this.patternLink = ''; - this.patternGroup = name.substring(name.indexOf('-') + 1, name.indexOf('-', 4) + 1 - name.indexOf('-') + 1); - this.patternSubGroup = subdir.substring(subdir.indexOf('/') + 4); - this.flatPatternPath = subdir.replace(/\//g, '-'); -}; - -var oBucket = function(name){ - this.bucketNameLC = name; - this.bucketNameUC = name.charAt(0).toUpperCase() + name.slice(1); - this.navItems = []; - this.navItemsIndex = []; - this.patternItems = []; - this.patternItemsIndex = []; -}; - -var oNavItem = function(name){ - this.sectionNameLC = name; - this.sectionNameUC = name.charAt(0).toUpperCase() + name.slice(1); - this.navSubItems = []; - this.navSubItemsIndex = []; -}; - -var oNavSubItem = function(name){ - this.patternPath = ''; - this.patternPartial = ''; - this.patternName = name.charAt(0).toUpperCase() + name.slice(1);; -}; +var plnode = function(grunt){ + var path = require('path'), + mustache = require('mustache'), + patternlab = {}; + + patternlab.package = grunt.file.readJSON('package.json'); + + var oPattern = function(name, subdir, filename, data){ + this.name = name; //this is the unique name with the subDir + this.subdir = subdir; + this.filename = filename; + this.data = data; + this.template = ''; + this.patternPartial = ''; + this.patternName = ''; //this is the display name for the ui + this.patternLink = ''; + this.patternGroup = name.substring(name.indexOf('-') + 1, name.indexOf('-', 4) + 1 - name.indexOf('-') + 1); + this.patternSubGroup = subdir.substring(subdir.indexOf('/') + 4); + this.flatPatternPath = subdir.replace(/\//g, '-'); + }; + + var oBucket = function(name){ + this.bucketNameLC = name; + this.bucketNameUC = name.charAt(0).toUpperCase() + name.slice(1); + this.navItems = []; + this.navItemsIndex = []; + this.patternItems = []; + this.patternItemsIndex = []; + }; + + var oNavItem = function(name){ + this.sectionNameLC = name; + this.sectionNameUC = name.charAt(0).toUpperCase() + name.slice(1); + this.navSubItems = []; + this.navSubItemsIndex = []; + }; + + var oNavSubItem = function(name){ + this.patternPath = ''; + this.patternPartial = ''; + this.patternName = name.charAt(0).toUpperCase() + name.slice(1); + }; + + var oPatternItem = function(){ + this.patternPath = ''; + this.patternPartial = ''; + this.patternName = ''; + }; + + function getVersion() { + grunt.log.ok(patternlab.package.version); + } + + function build(){ -var oPatternItem = function(){ - this.patternPath = ''; - this.patternPartial = ''; - this.patternName = ''; -}; - -var mustache = require('mustache'); - -module.exports = function(grunt) { - grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) { - - - var patternlab = {}; - patternlab.package = grunt.file.readJSON('package.json'); patternlab.data = grunt.file.readJSON('./source/_data/data.json'); patternlab.listitems = grunt.file.readJSON('./source/_data/listitems.json'); patternlab.header = grunt.file.read('./source/_patternlab-files/pattern-header-footer/header.html'); @@ -76,7 +79,7 @@ module.exports = function(grunt) { //check if the pattern already exists. var patternName = filename.substring(0, filename.indexOf('.')); var patternIndex = patternlab.patternIndex.indexOf(subdir + '-' + patternName); - var currentPattern; + var currentPattern; var flatPatternPath; //ignore _underscored patterns @@ -173,7 +176,7 @@ module.exports = function(grunt) { //loop through all patterns. deciding to do this separate from the recursion, even at a performance hit, to attempt to separate the tasks of styleguide creation versus site menu creation for(var i = 0; i < patternlab.patterns.length; i++){ - var pattern = patternlab.patterns[i]; + var pattern = patternlab.patterns[i]; var bucketName = pattern.name.replace(/\//g, '-').split('-')[1]; //check if the bucket already exists @@ -225,7 +228,7 @@ module.exports = function(grunt) { //add to patternPaths patternlab.patternPaths[bucketName][pattern.patternName] = pattern.subdir + "/" + pattern.filename.substring(0, pattern.filename.indexOf('.')); - } + } //add the bucket. patternlab.buckets.push(bucket); @@ -332,5 +335,33 @@ module.exports = function(grunt) { var outputFilename = './patternlab.json'; grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); } + + } + + return { + version: function(){ + return getVersion(); + }, + build: function(){ + build(); + } + }; + +}; + +module.exports = plnode; + +module.exports = function(grunt) { + grunt.registerTask('patternlab', 'create design systems with atomic design', function(v) { + + var pl = plnode(grunt); + + if(v && v === 'v'){ + pl.version(); + } else{ + pl.build(); + } + }); + }; \ No newline at end of file diff --git a/test/runner.js b/test/runner.js new file mode 100644 index 000000000..6bfa5a28d --- /dev/null +++ b/test/runner.js @@ -0,0 +1,7 @@ +var runner = require('../node_modules/grunt-contrib-qunit/tasks/qunit.js'); +var plnode = require('plnode'); + +runner.run({ + code: "../builder/patternlab.js", + tests: "tests.js" +}, callback); \ No newline at end of file diff --git a/test/tests.html b/test/tests.html index 32faa1d59..bbec2f9a6 100644 --- a/test/tests.html +++ b/test/tests.html @@ -9,6 +9,7 @@
+ \ No newline at end of file diff --git a/test/tests.js b/test/tests.js index bfef1858c..58dc5d3f7 100644 --- a/test/tests.js +++ b/test/tests.js @@ -1,3 +1,10 @@ + + test( "hello test", function() { - ok( 2 == "2", "Passed!" ); + ok( 2 == "2", "Passed!" ); +}); + +test( "hello patternlab", function() { + console.log(plnode); + ok( 2 == "2", "Passed!" ); }); \ No newline at end of file From 7a5fc0d00133f8eca9c9cb07e3828e2a00a32232 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Wed, 7 May 2014 23:56:12 -0500 Subject: [PATCH 18/39] more tests. node refactor started help logic started patterns only logic built out more tests and some file reorganization! --- Gruntfile.js | 16 +++--- builder/object_factory.js | 64 ++++++++++++++++++++++ builder/pattern_assembler.js | 5 ++ builder/patternlab.js | 100 +++++++++++++++-------------------- package.json | 2 +- test/object_factory_tests.js | 67 +++++++++++++++++++++++ test/patternlab_tests.js | 8 +++ test/runner.js | 7 --- test/tests.html | 15 ------ test/tests.js | 10 ---- 10 files changed, 195 insertions(+), 99 deletions(-) create mode 100644 builder/object_factory.js create mode 100644 builder/pattern_assembler.js create mode 100644 test/object_factory_tests.js create mode 100644 test/patternlab_tests.js delete mode 100644 test/runner.js delete mode 100644 test/tests.html delete mode 100644 test/tests.js diff --git a/Gruntfile.js b/Gruntfile.js index 99b5969ef..9c16acb21 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -12,9 +12,13 @@ module.exports = function(grunt) { stripBanners: true, banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n', }, - dist: { + patternlab: { src: './builder/patternlab.js', dest: './builder/patternlab.js' + }, + object_factory: { + src: './builder/object_factory.js', + dest: './builder/object_factory.js' } }, copy: { @@ -68,12 +72,8 @@ module.exports = function(grunt) { } } }, - qunit: { - all:{ - options:{ - urls: ['./test/tests.html'] - } - } + nodeunit: { + all: ['test/*_tests.js'] } }); @@ -87,5 +87,5 @@ module.exports = function(grunt) { grunt.registerTask('default', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy']); //travis CI task - grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'qunit']) + grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']) }; \ No newline at end of file diff --git a/builder/object_factory.js b/builder/object_factory.js new file mode 100644 index 000000000..7a4fae875 --- /dev/null +++ b/builder/object_factory.js @@ -0,0 +1,64 @@ +/* + * patternlab-node - v0.1.1 - 2014-05-07 + * + * Brian Muenzenmeyer, and the web community. + * Licensed under the MIT license. + * + * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. + * + */ + +(function () { + "use strict"; + + var oPattern = function(name, subdir, filename, data){ + this.name = name; //this is the unique name with the subDir + this.subdir = subdir; + this.filename = filename; + this.data = data; + this.template = ''; + this.patternPartial = ''; + this.patternName = ''; //this is the display name for the ui + this.patternLink = ''; + this.patternGroup = name.substring(name.indexOf('-') + 1, name.indexOf('-', 4) + 1 - name.indexOf('-') + 1); + this.patternSubGroup = subdir.substring(subdir.indexOf('/') + 4); + this.flatPatternPath = subdir.replace(/\//g, '-'); + }; + + var oBucket = function(name){ + this.bucketNameLC = name; + this.bucketNameUC = name.charAt(0).toUpperCase() + name.slice(1); + this.navItems = []; + this.navItemsIndex = []; + this.patternItems = []; + this.patternItemsIndex = []; + }; + + var oNavItem = function(name){ + this.sectionNameLC = name; + this.sectionNameUC = name.charAt(0).toUpperCase() + name.slice(1); + this.navSubItems = []; + this.navSubItemsIndex = []; + }; + + var oNavSubItem = function(name){ + this.patternPath = ''; + this.patternPartial = ''; + this.patternName = name.charAt(0).toUpperCase() + name.slice(1); + }; + + var oPatternItem = function(){ + this.patternPath = ''; + this.patternPartial = ''; + this.patternName = ''; + }; + + module.exports = { + oPattern: oPattern, + oBucket: oBucket, + oNavItem: oNavItem, + oNavSubItem: oNavSubItem, + oPatternItem: oPatternItem + }; + +}()); \ No newline at end of file diff --git a/builder/pattern_assembler.js b/builder/pattern_assembler.js new file mode 100644 index 000000000..2f77339d3 --- /dev/null +++ b/builder/pattern_assembler.js @@ -0,0 +1,5 @@ +(function () { + "use strict"; + + +}()); \ No newline at end of file diff --git a/builder/patternlab.js b/builder/patternlab.js index d0bab81d5..cc26bd80f 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.1 - 2014-05-06 + * patternlab-node - v0.1.1 - 2014-05-07 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. @@ -11,56 +11,20 @@ var plnode = function(grunt){ var path = require('path'), mustache = require('mustache'), + of = require('./object_factory'), + pa = require('./pattern_assembler'), patternlab = {}; patternlab.package = grunt.file.readJSON('package.json'); - var oPattern = function(name, subdir, filename, data){ - this.name = name; //this is the unique name with the subDir - this.subdir = subdir; - this.filename = filename; - this.data = data; - this.template = ''; - this.patternPartial = ''; - this.patternName = ''; //this is the display name for the ui - this.patternLink = ''; - this.patternGroup = name.substring(name.indexOf('-') + 1, name.indexOf('-', 4) + 1 - name.indexOf('-') + 1); - this.patternSubGroup = subdir.substring(subdir.indexOf('/') + 4); - this.flatPatternPath = subdir.replace(/\//g, '-'); - }; - - var oBucket = function(name){ - this.bucketNameLC = name; - this.bucketNameUC = name.charAt(0).toUpperCase() + name.slice(1); - this.navItems = []; - this.navItemsIndex = []; - this.patternItems = []; - this.patternItemsIndex = []; - }; - - var oNavItem = function(name){ - this.sectionNameLC = name; - this.sectionNameUC = name.charAt(0).toUpperCase() + name.slice(1); - this.navSubItems = []; - this.navSubItemsIndex = []; - }; - - var oNavSubItem = function(name){ - this.patternPath = ''; - this.patternPartial = ''; - this.patternName = name.charAt(0).toUpperCase() + name.slice(1); - }; - - var oPatternItem = function(){ - this.patternPath = ''; - this.patternPartial = ''; - this.patternName = ''; - }; - function getVersion() { grunt.log.ok(patternlab.package.version); } + function help(){ + grunt.log.ok('patternlab help coming soon'); + } + function build(){ patternlab.data = grunt.file.readJSON('./source/_data/data.json'); @@ -91,18 +55,18 @@ var plnode = function(grunt){ //returns -1 if patterns does not exist, otherwise returns the index //add the pattern array if first time, otherwise pull it up if(patternIndex === -1){ - grunt.log.ok('pattern not found, adding to array'); + grunt.verbose.ok('pattern not found, adding to array'); var flatPatternName = subdir.replace(/\//g, '-') + '-' + patternName; flatPatternName = flatPatternName.replace(/\//g, '-'); - currentPattern = new oPattern(flatPatternName, subdir, filename, {}); + currentPattern = new of.oPattern(flatPatternName, subdir, filename, {}); currentPattern.patternName = patternName.substring(patternName.indexOf('-') + 1); if(grunt.util._.str.include(filename, 'json')){ - grunt.log.writeln('json file found first, so add it to the pattern and continuing'); + grunt.verbose.ok('json file found first, so add it to the pattern and continuing'); currentPattern.data = grunt.file.readJSON(abspath); //done } else{ - grunt.log.writeln('mustache file found, assume no data, so compile it right away'); + grunt.verbose.ok('mustache file found, assume no data, so compile it right away'); currentPattern.template = grunt.file.read(abspath); //render the pattern. pass partials object just in case. @@ -138,7 +102,7 @@ var plnode = function(grunt){ } else{ //if we get here, we can almost ensure we found the json first, so render the template and pass in the unique json currentPattern = patternlab.patterns[patternIndex]; - grunt.log.ok('pattern found, loaded'); + grunt.verbose.ok('pattern found, loaded'); //determine if this file is data or pattern if(grunt.util._.str.include(filename, 'mustache')){ @@ -146,7 +110,7 @@ var plnode = function(grunt){ //render the pattern. pass partials object just in case. currentPattern.patternPartial = mustache.render(currentPattern.template, currentPattern.data, patternlab.partials); - grunt.log.writeln('template compiled with data!'); + grunt.verbose.ok('template compiled with data!'); //write the compiled template to the public patterns directory flatPatternPath = currentPattern.name + '/' + currentPattern.name + '.html'; @@ -183,7 +147,7 @@ var plnode = function(grunt){ var bucketIndex = patternlab.bucketIndex.indexOf(bucketName); if(bucketIndex === -1){ //add the bucket - var bucket = new oBucket(bucketName); + var bucket = new of.oBucket(bucketName); //add paternPath patternlab.patternPaths[bucketName] = {}; @@ -203,10 +167,10 @@ var plnode = function(grunt){ } //assume the navItem does not exist. - var navItem = new oNavItem(navItemName); + var navItem = new of.oNavItem(navItemName); //assume the navSubItem does not exist. - var navSubItem = new oNavSubItem(navSubItemName); + var navSubItem = new of.oNavSubItem(navSubItemName); navSubItem.patternPath = pattern.patternLink; navSubItem.patternPartial = bucketName + "-" + pattern.patternName; //add the hyphenated name @@ -247,7 +211,7 @@ var plnode = function(grunt){ var navSubItemName = pattern.patternName.replace(/-/g, ' '); //assume the navSubItem does not exist. - var navSubItem = new oNavSubItem(navSubItemName); + var navSubItem = new of.oNavSubItem(navSubItemName); navSubItem.patternPath = pattern.patternLink; navSubItem.patternPartial = bucketName + "-" + pattern.patternName; //add the hyphenated name @@ -271,7 +235,7 @@ var plnode = function(grunt){ var navItemIndex = bucket.navItemsIndex.indexOf(navItemName); if(navItemIndex === -1){ - var navItem = new oNavItem(navItemName); + var navItem = new of.oNavItem(navItemName); //add the navItem and navSubItem navItem.navSubItems.push(navSubItem); @@ -344,6 +308,12 @@ var plnode = function(grunt){ }, build: function(){ build(); + }, + help: function(){ + help(); + }, + build_patterns_only: function(){ + grunt.log.ok('only_patterns argument not yet implemented'); } }; @@ -352,14 +322,28 @@ var plnode = function(grunt){ module.exports = plnode; module.exports = function(grunt) { - grunt.registerTask('patternlab', 'create design systems with atomic design', function(v) { + grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) { var pl = plnode(grunt); - if(v && v === 'v'){ - pl.version(); - } else{ + if(arguments.length === 0){ pl.build(); + } + + if(arg && arg === 'v'){ + pl.version(); + } + + if(arg && arg === "only_patterns"){ + pl.build_patterns_only(); + } + + if(arg && arg === "help"){ + pl.help(); + } + + if(arg && (arg !== "v" && arg !=="only_patterns")){ + pl.help(); } }); diff --git a/package.json b/package.json index d3a38d211..24b418e27 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "grunt-contrib-jshint": "~0.4.0", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-qunit": "~0.4.0", + "grunt-contrib-nodeunit": "~0.3.0", "mustache": "~0.8.1", "matchdep": "~0.3.0" }, diff --git a/test/object_factory_tests.js b/test/object_factory_tests.js new file mode 100644 index 000000000..8fcd2aa5f --- /dev/null +++ b/test/object_factory_tests.js @@ -0,0 +1,67 @@ +(function () { +"use strict"; + + var of = require('../builder/object_factory'); + + exports['oPattern initialization'] = { + 'test oPattern initializes correctly' : function(test){ + var p = new of.oPattern('00-atoms-00-global-00-colors', '00-atoms/00-global', 'file.txt', { d: 123}); + test.equals(p.name, '00-atoms-00-global-00-colors'); + test.equals(p.subdir, '00-atoms/00-global'); + test.equals(p.filename, 'file.txt'); + test.equals(p.data.d, 123); + test.equals(p.template, ''); + test.equals(p.patternPartial, ''); + test.equals(p.patternName, ''); + test.equals(p.patternLink, ''); + test.equals(p.patternGroup, 'atoms'); + test.equals(p.patternSubGroup, 'global'); + test.equals(p.flatPatternPath, '00-atoms-00-global'); + test.done(); + } + }; + + exports['oBucket initialization'] = { + 'test oBucket initializes correctly' : function(test){ + var b = new of.oBucket('test'); + test.equals(b.bucketNameLC, 'test'); + test.equals(b.bucketNameUC, 'Test'); + test.equals(b.navItems.length, 0); + test.equals(b.navItemsIndex.length, 0); + test.equals(b.patternItems.length, 0); + test.equals(b.patternItemsIndex.length, 0); + test.done(); + } + }; + + exports['oNavItem initialization'] = { + 'test oNavItem initializes correctly' : function(test){ + var ni = new of.oNavItem('test'); + test.equals(ni.sectionNameLC, 'test'); + test.equals(ni.navSubItems.length, 0); + test.equals(ni.navSubItemsIndex.length, 0); + test.done(); + } + }; + + exports['oSubNavItem initialization'] = { + 'test oSubNavItem initializes correctly' : function(test){ + var sni = new of.oNavSubItem('test'); + test.equals(sni.patternName, 'Test'); + test.equals(sni.patternPath, ''); + test.equals(sni.patternPartial, ''); + test.done(); + } + }; + + exports['oPatternItem initialization'] = { + 'test oPatternItem initializes correctly' : function(test){ + var pi = new of.oPatternItem(); + test.equals(pi.patternName, ''); + test.equals(pi.patternPath, ''); + test.equals(pi.patternPartial, ''); + test.done(); + } + }; + +}()); \ No newline at end of file diff --git a/test/patternlab_tests.js b/test/patternlab_tests.js new file mode 100644 index 000000000..d71fdbb52 --- /dev/null +++ b/test/patternlab_tests.js @@ -0,0 +1,8 @@ +'use strict'; + +exports['test nodeunit'] = { + 'hello world' : function(test){ + test.equals(1,1); + test.done(); + } +}; \ No newline at end of file diff --git a/test/runner.js b/test/runner.js deleted file mode 100644 index 6bfa5a28d..000000000 --- a/test/runner.js +++ /dev/null @@ -1,7 +0,0 @@ -var runner = require('../node_modules/grunt-contrib-qunit/tasks/qunit.js'); -var plnode = require('plnode'); - -runner.run({ - code: "../builder/patternlab.js", - tests: "tests.js" -}, callback); \ No newline at end of file diff --git a/test/tests.html b/test/tests.html deleted file mode 100644 index bbec2f9a6..000000000 --- a/test/tests.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Hello Tests - - - -
-
- - - - - \ No newline at end of file diff --git a/test/tests.js b/test/tests.js deleted file mode 100644 index 58dc5d3f7..000000000 --- a/test/tests.js +++ /dev/null @@ -1,10 +0,0 @@ - - -test( "hello test", function() { - ok( 2 == "2", "Passed!" ); -}); - -test( "hello patternlab", function() { - console.log(plnode); - ok( 2 == "2", "Passed!" ); -}); \ No newline at end of file From fb4909b8bfbcd9f330de3d152eb5339e88e1d49c Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Wed, 7 May 2014 23:58:41 -0500 Subject: [PATCH 19/39] added dev to travis --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7c5c97c46..adc58ed02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,5 @@ before_script: branches: only: - - master \ No newline at end of file + - master + - dev \ No newline at end of file From 0f51b455803b60a66353c014ff12ec0239e5cda1 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Thu, 8 May 2014 00:13:22 -0500 Subject: [PATCH 20/39] messy banner file --- builder/patternlab.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/builder/patternlab.js b/builder/patternlab.js index 49a17f90e..cc26bd80f 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,9 +1,5 @@ /* -<<<<<<< HEAD * patternlab-node - v0.1.1 - 2014-05-07 -======= - * patternlab-node - v0.1.1 - 2014-05-05 ->>>>>>> master * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. From 3525b2800f9126bbe02dac840ffc9cabc11b77e3 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Thu, 8 May 2014 12:27:44 -0500 Subject: [PATCH 21/39] pattern only compilation --- Gruntfile.js | 4 +-- README.md | 7 +++++ builder/object_factory.js | 2 +- builder/patternlab.js | 64 ++++++++++++++++++++++----------------- package.json | 2 +- 5 files changed, 48 insertions(+), 31 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9c16acb21..2fb9da78b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -78,7 +78,7 @@ module.exports = function(grunt) { }); // load all grunt tasks - require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); + require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); //load the patternlab task grunt.task.loadTasks('./builder/'); @@ -87,5 +87,5 @@ module.exports = function(grunt) { grunt.registerTask('default', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy']); //travis CI task - grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']) + grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']); }; \ No newline at end of file diff --git a/README.md b/README.md index 35cc5eb14..aff6f189f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,13 @@ Dave Olsen has published the [specification](https://github.com/pattern-lab/the- A lot of good conversation has revolved around whether Pattern Lab is a platform or a tool in the toolbox, part of a larger solution. It's my goal to #1) adhere to the specification and #2) meet the needs of both use cases. +If you want to only build the patterns, alter your `Gruntfile.js` patternlab task to the following: + +``` +grunt.registerTask('default', ['clean', 'concat', 'patternlab:only_patterns', /*'sass',*/ 'copy']); +``` + +This will output compiled patterns to ./public/patterns/ **THE FOLLOWING IS FROM THE PATTERNLAB-PHP PROJECT. A LOT STILL APPLIES TO PATTERNLAB-NODE, BUT IT HAS NOT BEEN ADAPTED YET. USE AT YOUR OWN PERIL** diff --git a/builder/object_factory.js b/builder/object_factory.js index 7a4fae875..b7a7fd595 100644 --- a/builder/object_factory.js +++ b/builder/object_factory.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.1 - 2014-05-07 + * patternlab-node - v0.1.2 - 2014-05-08 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/builder/patternlab.js b/builder/patternlab.js index cc26bd80f..708d8ca69 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.1 - 2014-05-07 + * patternlab-node - v0.1.2 - 2014-05-08 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. @@ -8,12 +8,12 @@ * */ -var plnode = function(grunt){ +var patternlab_engine = function(grunt){ var path = require('path'), - mustache = require('mustache'), - of = require('./object_factory'), - pa = require('./pattern_assembler'), - patternlab = {}; + mustache = require('mustache'), + of = require('./object_factory'), + pa = require('./pattern_assembler'), + patternlab = {}; patternlab.package = grunt.file.readJSON('package.json'); @@ -25,8 +25,15 @@ var plnode = function(grunt){ grunt.log.ok('patternlab help coming soon'); } - function build(){ + function printDebug() { + //debug file can be written by setting flag on package.json + if(patternlab.package.debug){ + var outputFilename = './patternlab.json'; + grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); + } + } + function buildPatterns(){ patternlab.data = grunt.file.readJSON('./source/_data/data.json'); patternlab.listitems = grunt.file.readJSON('./source/_data/listitems.json'); patternlab.header = grunt.file.read('./source/_patternlab-files/pattern-header-footer/header.html'); @@ -34,10 +41,6 @@ var plnode = function(grunt){ patternlab.patterns = []; patternlab.patternIndex = []; patternlab.partials = {}; - patternlab.buckets = []; - patternlab.bucketIndex = []; - patternlab.patternPaths = {}; - patternlab.viewAllPaths = {}; grunt.file.recurse('./source/_patterns', function(abspath, rootdir, subdir, filename){ //check if the pattern already exists. @@ -130,6 +133,14 @@ var plnode = function(grunt){ }); + } + + function buildFrontEnd(){ + patternlab.buckets = []; + patternlab.bucketIndex = []; + patternlab.patternPaths = {}; + patternlab.viewAllPaths = {}; + //build the styleguide var styleguideTemplate = grunt.file.read('./source/_patternlab-files/styleguide.mustache'); var styleguideHtml = mustache.render(styleguideTemplate, {partials: patternlab.patterns}); @@ -294,12 +305,6 @@ var plnode = function(grunt){ }); grunt.file.write('./public/index.html', patternlabSiteHtml); - //debug file can be written by setting flag on package.json - if(patternlab.package.debug){ - var outputFilename = './patternlab.json'; - grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); - } - } return { @@ -307,43 +312,48 @@ var plnode = function(grunt){ return getVersion(); }, build: function(){ - build(); + buildPatterns(); + buildFrontEnd(); + printDebug(); + }, help: function(){ help(); }, build_patterns_only: function(){ grunt.log.ok('only_patterns argument not yet implemented'); + buildPatterns(); + printDebug(); } }; }; -module.exports = plnode; +module.exports = patternlab_engine; module.exports = function(grunt) { grunt.registerTask('patternlab', 'create design systems with atomic design', function(arg) { - var pl = plnode(grunt); + var patternlab = patternlab_engine(grunt); if(arguments.length === 0){ - pl.build(); - } + patternlab.build(); + } if(arg && arg === 'v'){ - pl.version(); - } + patternlab.version(); + } if(arg && arg === "only_patterns"){ - pl.build_patterns_only(); + patternlab.build_patterns_only(); } if(arg && arg === "help"){ - pl.help(); + patternlab.help(); } if(arg && (arg !== "v" && arg !=="only_patterns")){ - pl.help(); + patternlab.help(); } }); diff --git a/package.json b/package.json index 24b418e27..a18923a0c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "patternlab-node", "description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).", - "version": "0.1.1", + "version": "0.1.2", "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-watch": "~0.2.0", From 645f68a51eed128278035c76b3da050874afd481 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Tue, 10 Jun 2014 16:36:48 +0200 Subject: [PATCH 22/39] Modified styleguide SCSS to be closer to the latest state of patternlab-php (so that it even works with Twitter Bootstrap) --- public/styleguide/css/styleguide.css | 632 ++++++++++++++++---------- public/styleguide/css/styleguide.scss | 26 +- 2 files changed, 400 insertions(+), 258 deletions(-) diff --git a/public/styleguide/css/styleguide.css b/public/styleguide/css/styleguide.css index 40ec4a27f..3806bf3eb 100644 --- a/public/styleguide/css/styleguide.css +++ b/public/styleguide/css/styleguide.css @@ -53,11 +53,13 @@ margin: 0; padding: 0; background: #dddddd; - -webkit-text-size-adjust: 100%; } + -webkit-text-size-adjust: 100%; +} .sg-nav-wrapper { overflow: hidden; - background: #dddddd; } + background: #dddddd; +} .is-vishidden { position: absolute !important; @@ -66,7 +68,8 @@ height: 1px; padding: 0; border: 0; - clip: rect(1px, 1px, 1px, 1px); } + clip: rect(1px, 1px, 1px, 1px); +} /*------------------------------------*\ $STYLE GUIDE HEADER @@ -84,50 +87,60 @@ width: 100%; -webkit-box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); -moz-box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); - box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); } - .sg-header * { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; } - .sg-header ul, .sg-header ol { - padding: 0; - margin: 0; } - .sg-header li { - list-style: none; - border-bottom: 1px solid rgba(255, 255, 255, 0.05); } - .sg-header a { - font-size: 70%; - color: gray; - text-decoration: none; - display: block; - line-height: 1; - padding: 1em; - -webkit-transition: background 0.15s ease-out; - -moz-transition: background 0.15s ease-out; - -ms-transition: background 0.15s ease-out; - -o-transition: background 0.15s ease-out; - transition: background 0.15s ease-out; - -webkit-transition: color 0.15s ease-out; - -moz-transition: color 0.15s ease-out; - -ms-transition: color 0.15s ease-out; - -o-transition: color 0.15s ease-out; - transition: color 0.15s ease-out; } - .sg-header a:hover, .sg-header a:focus, .sg-header a.active { - color: white; - background: rgba(255, 255, 255, 0.05); } - .sg-header ol li ol li ol li a { - padding-left: 2em; - text-transform: none; } + box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); +} +.sg-header * { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.sg-header ul, .sg-header ol { + padding: 0; + margin: 0; +} +.sg-header li { + list-style: none; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); +} +.sg-header a { + font-size: 70%; + color: gray; + text-decoration: none; + display: block; + line-height: 1; + padding: 1em; + -webkit-transition: background 0.15s ease-out; + -moz-transition: background 0.15s ease-out; + -ms-transition: background 0.15s ease-out; + -o-transition: background 0.15s ease-out; + transition: background 0.15s ease-out; + -webkit-transition: color 0.15s ease-out; + -moz-transition: color 0.15s ease-out; + -ms-transition: color 0.15s ease-out; + -o-transition: color 0.15s ease-out; + transition: color 0.15s ease-out; +} +.sg-header a:hover, .sg-header a:focus, .sg-header a.active { + color: white; + background: rgba(255, 255, 255, 0.05); +} +.sg-header ol li ol li ol li a { + padding-left: 2em; + text-transform: none; +} /* Navigation */ .sg-header .sg-nav-toggle { padding: 1em; - border-bottom: 1px solid rgba(0, 0, 0, 0); + border-bottom: 1px solid transparent; position: relative; - z-index: 2; } - @media all and (min-width: 44em) { - .sg-header .sg-nav-toggle { - display: none; } } + z-index: 2; +} +@media all and (min-width: 44em) { + .sg-header .sg-nav-toggle { + display: none; + } +} @media all and (max-width: 44em) { .sg-nav-container { @@ -137,46 +150,60 @@ -moz-transition: max-height 0.5s ease-out; -ms-transition: max-height 0.5s ease-out; -o-transition: max-height 0.5s ease-out; - transition: max-height 0.5s ease-out; } - .sg-nav-container.active { - max-height: 50em; } } + transition: max-height 0.5s ease-out; + } + .sg-nav-container.active { + max-height: 50em; + } +} .sg-nav { z-index: 1; margin: 0; padding: 0; - list-style: none; } - @media all and (min-width: 44em) { - .sg-nav > li { - border-bottom: 0; - border-right: 1px solid rgba(255, 255, 255, 0.05); - float: left; - position: relative; } - .sg-nav > li > ol { - position: absolute; - top: 2em; - left: 0; } } + list-style: none; +} +@media all and (min-width: 44em) { + .sg-nav > li { + border-bottom: 0; + border-right: 1px solid rgba(255, 255, 255, 0.05); + float: left; + position: relative; + } + .sg-nav > li > ol { + position: absolute; + top: 2em; + left: 0; + } +} /* Accordion */ .sg-acc-handle:after { content: ' +'; float: right; - font-size: 70%; } - @media all and (min-width: 44em) { - .sg-acc-handle:after { - float: none; } } + font-size: 70%; +} +@media all and (min-width: 44em) { + .sg-acc-handle:after { + float: none; + } +} .sg-acc-handle.active { color: white; - background: rgba(255, 255, 255, 0.05); } - .sg-acc-handle.active:after { - content: ' -'; } + background: rgba(255, 255, 255, 0.05); +} +.sg-acc-handle.active:after { + content: ' -'; +} .sg-acc-handle.sg-icon:after { - content: ""; } + content: ""; +} .sg-header .sg-icon { width: auto; font-size: 1rem; - padding: 0.5rem 1rem; } + padding: 0.5rem 1rem; +} .sg-acc-panel { overflow: hidden; @@ -187,13 +214,16 @@ -moz-transition: max-height 0.5s ease-out; -ms-transition: max-height 0.5s ease-out; -o-transition: max-height 0.5s ease-out; - transition: max-height 0.5s ease-out; } - .sg-acc-panel.active { - max-height: 50em; } - .sg-acc-panel.sg-right { - position: absolute; - left: auto; - right: 0; } + transition: max-height 0.5s ease-out; +} +.sg-acc-panel.active { + max-height: 50em; +} +.sg-acc-panel.sg-right { + position: absolute; + left: auto; + right: 0; +} /* Controls (sizing, view mode) */ .sg-controls { @@ -201,89 +231,118 @@ position: absolute; top: 0; right: 0; - z-index: 2; } - .sg-controls .sg-acc-panel.active { - max-height: 17em; } - .sg-controls .sg-nav-phases .sg-acc-panel { - min-width: 0; } - .sg-controls .sg-nav-phases .sg-acc-panel.active { - max-height: none; } + z-index: 2; +} +.sg-controls .sg-acc-panel.active { + max-height: 17em; +} +.sg-controls .sg-nav-phases .sg-acc-panel { + min-width: 0; +} +.sg-controls .sg-nav-phases .sg-acc-panel.active { + max-height: none; +} .sg-control-trigger { - border-bottom: 1px solid rgba(255, 255, 255, 0.05); } - @media all and (min-width: 44em) { - .sg-control-trigger { - border: 0; } } - @media all and (min-width: 65em) { - .sg-control-trigger { - float: left; - width: 6em; } } + border-bottom: 1px solid rgba(255, 255, 255, 0.05); +} +@media all and (min-width: 44em) { + .sg-control-trigger { + border: 0; + } +} +@media all and (min-width: 65em) { + .sg-control-trigger { + float: left; + width: 6em; + } +} @media all and (min-width: 44em) { .sg-control > li { float: left; border-bottom: 0; - border-left: 1px solid rgba(255, 255, 255, 0.05); } } + border-left: 1px solid rgba(255, 255, 255, 0.05); + } +} .sg-control > li { - float: left; } + float: left; +} .sg-control .sg-input { padding: 0.1em; -webkit-transition: all 0.2s ease-out; -moz-transition: all 0.2s ease-out; -ms-transition: all 0.2s ease-out; -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; } - .sg-control .sg-input:active, .sg-control .sg-input:focus { - outline: 0; - background: #f7f7f7; - color: #000; } + transition: all 0.2s ease-out; +} +.sg-control .sg-input:active, .sg-control .sg-input:focus { + outline: 0; + background: #f7f7f7; + color: #000; +} @media all and (max-width: 65em) { .sg-quarter { float: left; width: 25%; border-left: 1px solid rgba(255, 255, 255, 0.05); - text-align: center; } - .sg-quarter:first-child { - border-left: 0; } } + text-align: center; + } + .sg-quarter:first-child { + border-left: 0; + } +} @media all and (max-width: 65em) { .sg-half { float: left; width: 50%; border-left: 1px solid rgba(255, 255, 255, 0.05); - text-align: center; } - .sg-half:nth-child(odd) { - border-left: 0; } } + text-align: center; + } + .sg-half:nth-child(odd) { + border-left: 0; + } +} .sg-current-size { font-size: 70%; color: gray; - padding: 0.8em 0.95em; } - .sg-current-size:hover .sg-input { - background: #f7f7f7; - color: #000; } - @media all and (min-width: 65em) { - .sg-current-size { - float: left; } } + padding: 0.8em 0.95em; +} +.sg-current-size:hover .sg-input { + background: #f7f7f7; + color: #000; +} +@media all and (min-width: 65em) { + .sg-current-size { + float: left; + } +} .sg-size-options { - max-width: 10em; } - @media all and (min-width: 65em) { - .sg-size-options { - position: static; - max-height: none; - max-width: none; } - .sg-size-options > li { - float: left; - border: 0; - border-left: 1px solid rgba(255, 255, 255, 0.05); } } + max-width: 10em; +} +@media all and (min-width: 65em) { + .sg-size-options { + position: static; + max-height: none; + max-width: none; + } + .sg-size-options > li { + float: left; + border: 0; + border-left: 1px solid rgba(255, 255, 255, 0.05); + } +} #sg-form { margin: 0; border: 0; - padding: 0; } + padding: 0; +} .sg-input { margin: -2px 0 0 0; @@ -292,22 +351,27 @@ background-color: #222; color: gray; width: 35px; - text-align: right; } + text-align: right; +} .sg-input-active { background-color: #fff; - color: #000; } + color: #000; +} .sg-view { - position: relative; } - .sg-view > ul { - position: absolute; - top: 2em; - left: 0; } + position: relative; +} +.sg-view > ul { + position: absolute; + top: 2em; + left: 0; +} .sg-checkbox:before { display: inline-block; - margin-right: 0.4em; } + margin-right: 0.4em; +} /*------------------------------------*\ $STYLE GUIDE VIEWPORT @@ -315,33 +379,46 @@ /* Viewport */ #sg-vp-wrap { text-align: center; - width: 100%; } - @media all and (min-width: 44em) { - #sg-vp-wrap { - position: fixed; - top: 2em; - bottom: 0; - left: 0; - right: 0; - z-index: 0; } } - #sg-vp-wrap.wrap-animate { - -webkit-transition: left 0.3s ease-out; - -moz-transition: left 0.3s ease-out; - -ms-transition: left 0.3s ease-out; - -o-transition: left 0.3s ease-out; - transition: left 0.3s ease-out; } + width: 100%; +} +@media all and (min-width: 44em) { + #sg-vp-wrap { + position: fixed; + top: 2em; + bottom: 0; + left: 0; + right: 0; + z-index: 0; + } +} +#sg-vp-wrap.wrap-animate { + -webkit-transition: left 0.3s ease-out; + -moz-transition: left 0.3s ease-out; + -ms-transition: left 0.3s ease-out; + -o-transition: left 0.3s ease-out; + transition: left 0.3s ease-out; +} #sg-viewport { - border: 0; - x-margin: 0 auto; + position: absolute; height: 100%; - width: 100%; } - #sg-viewport.hay-mode { - -webkit-transition: all 40s linear; - -moz-transition: all 40s linear; - -ms-transition: all 40s linear; - -o-transition: all 40s linear; - transition: all 40s linear; } + width: 100%; + border: 0; + padding: 0; + margin: 0; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: white; +} +#sg-viewport.hay-mode { + -webkit-transition: all 40s linear; + -moz-transition: all 40s linear; + -ms-transition: all 40s linear; + -o-transition: all 40s linear; + transition: all 40s linear; +} #sg-cover { width: 100%; @@ -349,25 +426,32 @@ display: none; position: absolute; z-index: 20; - cursor: col-resize; } + cursor: col-resize; +} #sg-gen-container { height: 100%; + position: relative; text-align: center; - margin: 0 auto; } - #sg-gen-container.hay-mode { - -webkit-transition: all 40s linear; - -moz-transition: all 40s linear; - -ms-transition: all 40s linear; - -o-transition: all 40s linear; - transition: all 40s linear; } + margin: 0px auto; + overflow-y: auto; + overflow-x: hidden; +} +#sg-gen-container.hay-mode { + -webkit-transition: all 40s linear; + -moz-transition: all 40s linear; + -ms-transition: all 40s linear; + -o-transition: all 40s linear; + transition: all 40s linear; +} #sg-rightpull-container { width: 10px; float: right; margin: 0; height: 100%; - cursor: col-resize; } + cursor: col-resize; +} #sg-rightpull { margin: 0; @@ -378,19 +462,23 @@ -moz-transition: background 0.2s ease-out; -ms-transition: background 0.2s ease-out; -o-transition: background 0.2s ease-out; - transition: background 0.2s ease-out; } - #sg-rightpull:hover { - background: #666; } - #sg-rightpull:active { - cursor: col-resize; - background: #444; } + transition: background 0.2s ease-out; +} +#sg-rightpull:hover { + background: #666; +} +#sg-rightpull:active { + cursor: col-resize; + background: #444; +} .vp-animate { -webkit-transition: width 0.8s ease-out; -moz-transition: width 0.8s ease-out; -ms-transition: width 0.8s ease-out; -o-transition: width 0.8s ease-out; - transition: width 0.8s ease-out; } + transition: width 0.8s ease-out; +} /*------------------------------------*\ $STYLE GUIDE CONTENT @@ -398,7 +486,8 @@ /* Section Pattern */ .sg-pattern { margin-bottom: 2em; - overflow: hidden; } + overflow: hidden; +} /* Section Head */ .sg-pattern-head { @@ -407,27 +496,33 @@ font-size: 70%; font-weight: normal; padding: 1em 0; - border-bottom: 1px solid gray; } - .sg-pattern-head a { - display: block; - color: gray; - text-decoration: none; - cursor: pointer; } - .sg-pattern-head a:hover { - color: #222222; } + border-bottom: 1px solid gray; +} +.sg-pattern-head a { + display: block; + color: gray; + text-decoration: none; + cursor: pointer; +} +.sg-pattern-head a:hover { + color: #222222; +} /* Clean View */ .sg-clean .sg-main { - padding: 0; } + padding: 0; +} .sg-code, .sg-annotations { clear: both; background: #dddddd; color: #222222; padding: 1em 0.5em; - margin: 1em 0; } - .sg-code a, .sg-annotations a { - text-decoration: underline; } + margin: 1em 0; +} +.sg-code a, .sg-annotations a { + text-decoration: underline; +} .sg-code pre { white-space: -moz-pre-line; @@ -436,89 +531,112 @@ word-wrap: break-word; white-space: pre-line; border: 1px solid rgba(0, 0, 0, 0.1); - padding: 0.5em; } + padding: 0.5em; +} .sg-code-contains { margin-bottom: 1rem; font-size: 85%; - color: gray; } - .sg-code-contains code { - padding: 0.2em; - background: rgba(0, 0, 0, 0.3); - color: #f7f7f7; - position: relative; - top: -2px; } + color: gray; +} +.sg-code-contains code { + padding: 0.2em; + background: rgba(0, 0, 0, 0.3); + color: #f7f7f7; + position: relative; + top: -2px; +} .sg-code-head { color: gray; - font-size: 1em; } + font-size: 1em; +} .demo { overflow: hidden; - margin-bottom: 1rem; } + margin-bottom: 1rem; +} .demo .gi, .demo .demo-block { background: #dddddd; color: gray; text-align: center; margin-bottom: 0.5em; - padding: 1em !important; } - .demo .gi:nth-of-type(2n), .demo .demo-block:nth-of-type(2n) { - color: #dddddd; - background: gray; } - .demo .gi .gi, .demo .demo-block .gi { - background: rgba(0, 0, 0, 0.1); - color: #dddddd; } - .demo .gi .gi:nth-of-type(2n), .demo .demo-block .gi:nth-of-type(2n) { - background: rgba(0, 0, 0, 0.3); } + padding: 1em !important; +} +.demo .gi:nth-of-type(2n), .demo .demo-block:nth-of-type(2n) { + color: #dddddd; + background: gray; +} +.demo .gi .gi, .demo .demo-block .gi { + background: rgba(0, 0, 0, 0.1); + color: #dddddd; +} +.demo .gi .gi:nth-of-type(2n), .demo .demo-block .gi:nth-of-type(2n) { + background: rgba(0, 0, 0, 0.3); +} .demo-animate { background: #dddddd; padding: 1em; margin-bottom: 1em; - text-align: center; } + text-align: center; +} .animate-move { - position: relative; } - .animate-move .demo-shape { - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: 20px; - background: gray; } - .animate-move:hover > .demo-shape { - left: 100%; - margin-left: -20px; } + position: relative; +} +.animate-move .demo-shape { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 20px; + background: gray; +} +.animate-move:hover > .demo-shape { + left: 100%; + margin-left: -20px; +} .sg-colors { - overflow: hidden; } + overflow: hidden; +} +.sg-colors li { + overflow: hidden; + border: 1px solid #dddddd; + padding: 0.3em; + margin: 0 0.2em 0.2em 0; +} +@media all and (min-width: 30em) { .sg-colors li { - overflow: hidden; - border: 1px solid #dddddd; - padding: 0.3em; - margin: 0 0.2em 0.2em 0; } - @media all and (min-width: 30em) { - .sg-colors li { - float: left; - width: 5em; } } + float: left; + width: 5em; + } +} .sg-swatch { display: block; height: 1.5em; - width: 50%; } - @media all and (max-width: 30em) { - .sg-swatch { - float: left; - margin-right: 0.3em; } } - @media all and (min-width: 30em) { - .sg-swatch { - width: 100%; - height: 4em; - margin-bottom: 0.2em; } } + width: 50%; +} +@media all and (max-width: 30em) { + .sg-swatch { + float: left; + margin-right: 0.3em; + } +} +@media all and (min-width: 30em) { + .sg-swatch { + width: 100%; + height: 4em; + margin-bottom: 0.2em; + } +} .sg-label { - line-height: 1; } + line-height: 1; +} #sg-annotation-container { position: fixed; @@ -526,7 +644,8 @@ left: 0; z-index: 99; width: 100%; - padding: 1em; } + padding: 1em; +} /* Annotations */ #sg-annotation-container, #sg-code-container { @@ -549,16 +668,20 @@ -webkit-transition: bottom 0.3s ease-out; -ms-transition: bottom 0.3s ease-out; -o-transition: bottom 0.3s ease-out; - transition: bottom 0.3s ease-out; } - #sg-annotation-container a, #sg-code-container a { - color: #dddddd; } + transition: bottom 0.3s ease-out; +} +#sg-annotation-container a, #sg-code-container a { + color: #dddddd; +} #sg-code-container pre { max-height: 300px; - padding: 0 1em; } + padding: 0 1em; +} #sg-code-container .with-css pre { - max-height: 200px; } + max-height: 200px; +} #sg-annotation-close-btn, #sg-code-close-btn { color: #fff; @@ -567,18 +690,20 @@ right: 1em; text-transform: uppercase; text-decoration: none; - text-align: right; } + text-align: right; +} .has-comment, .has-comment a { - cursor: help !important; } + cursor: help !important; +} @font-face { font-family: 'icons'; src: url("../assets/icons.eot"); src: url("../assets/icons.eot?#iefix") format("embedded-opentype"), url("../assets/icons.woff") format("woff"), url("../assets/icons.ttf") format("truetype"), url("../assets/icons.svg#icons") format("svg"); font-weight: normal; - font-style: normal; } - + font-style: normal; +} /* Pattern Lab icon fonts */ .icon-reload, .icon-cog, .icon-minus, .icon-plus, .icon-menu, .sg-header .sg-nav-toggle, .icon-checkbox-unchecked, .sg-checkbox, .icon-checkbox-checked, .sg-checkbox.active, .icon-eye { font-family: 'icons'; @@ -588,28 +713,37 @@ font-variant: normal; text-transform: none; line-height: 1; - -webkit-font-smoothing: antialiased; } + -webkit-font-smoothing: antialiased; +} .icon-reload:before { - content: "\e002"; } + content: "\e002"; +} .icon-cog:before { - content: "\e000"; } + content: "\e000"; +} .icon-minus:before { - content: "\e003"; } + content: "\e003"; +} .icon-plus:before { - content: "\e004"; } + content: "\e004"; +} .icon-menu:before, .sg-header .sg-nav-toggle:before { - content: "\e005"; } + content: "\e005"; +} .icon-checkbox-unchecked:before, .sg-checkbox:before { - content: "\e006"; } + content: "\e006"; +} .icon-checkbox-checked:before, .sg-checkbox.active:before { - content: "\e007"; } + content: "\e007"; +} .icon-eye:before { - content: "\e001"; } + content: "\e001"; +} diff --git a/public/styleguide/css/styleguide.scss b/public/styleguide/css/styleguide.scss index 5b4cd6d07..eb97598e6 100644 --- a/public/styleguide/css/styleguide.scss +++ b/public/styleguide/css/styleguide.scss @@ -501,10 +501,17 @@ $animate-quick: 0.2s; } #sg-viewport { - border: 0; - x-margin: 0 auto; - height: 100%; - width: 100%; + position: absolute; + height: 100%; + width: 100%; + border: 0; + padding: 0; + margin: 0; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: white; &.hay-mode { -webkit-transition: all 40s linear; @@ -525,11 +532,12 @@ $animate-quick: 0.2s; } #sg-gen-container { - height: 100%; - text-align: center; - margin: 0 auto; - -webkit-overflow-scrolling: touch; - overflow: scroll; + height: 100%; + position: relative; + text-align: center; + margin: 0px auto; + overflow-y: auto; + overflow-x: hidden; &.hay-mode { -webkit-transition: all 40s linear; From 17680edf7cc53bd6c2eddb3051ec2b567cc603d6 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sat, 21 Jun 2014 07:43:02 -0500 Subject: [PATCH 23/39] version bump on rebuild --- builder/object_factory.js | 2 +- builder/patternlab.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/object_factory.js b/builder/object_factory.js index b7a7fd595..0d6f04647 100644 --- a/builder/object_factory.js +++ b/builder/object_factory.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-05-08 + * patternlab-node - v0.1.2 - 2014-06-21 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/builder/patternlab.js b/builder/patternlab.js index 708d8ca69..cf6e3d9ab 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-05-08 + * patternlab-node - v0.1.2 - 2014-06-21 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. From 548325fb9be4096e534133dc23696cd99d840f2c Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sat, 21 Jun 2014 07:43:02 -0500 Subject: [PATCH 24/39] version bump on rebuild --- builder/object_factory.js | 2 +- builder/patternlab.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/object_factory.js b/builder/object_factory.js index b7a7fd595..0d6f04647 100644 --- a/builder/object_factory.js +++ b/builder/object_factory.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-05-08 + * patternlab-node - v0.1.2 - 2014-06-21 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/builder/patternlab.js b/builder/patternlab.js index 708d8ca69..cf6e3d9ab 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-05-08 + * patternlab-node - v0.1.2 - 2014-06-21 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. From 0abe83eeda1efff60a52c8e295bcbaa678de34d3 Mon Sep 17 00:00:00 2001 From: BRIAN MUENZENMEYER Date: Sat, 12 Jul 2014 07:05:48 -0500 Subject: [PATCH 25/39] annotation, code support, ishOptions synced some client code with pl-php. support for ishControlsVisible - which can turn off features as not needed or implemented yet. annotation and code support is present reorganized some files to align with pl-php, not as clean yet but working toward it! --- builder/object_factory.js | 2 +- builder/patternlab.js | 14 +- config.json | 31 + config/config.json | 10 - package.json | 3 +- public/styleguide/assets/icons.dev.svg | 37 - public/styleguide/assets/icons.eot | Bin 2288 -> 0 bytes public/styleguide/assets/icons.svg | 37 - public/styleguide/assets/icons.ttf | Bin 2132 -> 0 bytes public/styleguide/assets/icons.woff | Bin 2036 -> 0 bytes public/styleguide/css/styleguide-specific.css | 80 ++ .../styleguide/css/styleguide-specific.scss | 141 +++ public/styleguide/css/styleguide.css | 936 +++++++++--------- public/styleguide/css/styleguide.scss | 648 ++++++------ public/styleguide/fonts/icomoon.eot | Bin 0 -> 3872 bytes public/styleguide/fonts/icomoon.svg | 22 + public/styleguide/fonts/icomoon.ttf | Bin 0 -> 3708 bytes public/styleguide/fonts/icomoon.woff | Bin 0 -> 3144 bytes public/styleguide/js/annotations-pattern.js | 222 +++-- public/styleguide/js/annotations-viewer.js | 261 ++++- public/styleguide/js/code-pattern.js | 73 +- public/styleguide/js/code-viewer.js | 450 +++++++-- .../js/vendor/classlist-polyfill.js | 176 ++++ public/styleguide/js/{ => vendor}/jquery.js | 0 public/styleguide/js/vendor/jwerty.js | 523 ++++++++++ public/styleguide/js/{ => vendor}/prism.js | 0 .../js/vendor/typeahead.bundle.min.js | 7 + source/Thumbs.db | Bin 6144 -> 6144 bytes source/_patternlab-files/index.mustache | 56 +- .../partials/ishControls.mustache | 65 +- .../pattern-header-footer/footer.html | 3 +- .../pattern-header-footer/header.html | 1 + source/_patternlab-files/styleguide.mustache | 3 + 33 files changed, 2679 insertions(+), 1122 deletions(-) create mode 100644 config.json delete mode 100644 config/config.json delete mode 100644 public/styleguide/assets/icons.dev.svg delete mode 100644 public/styleguide/assets/icons.eot delete mode 100644 public/styleguide/assets/icons.svg delete mode 100644 public/styleguide/assets/icons.ttf delete mode 100644 public/styleguide/assets/icons.woff create mode 100644 public/styleguide/css/styleguide-specific.css create mode 100644 public/styleguide/css/styleguide-specific.scss create mode 100644 public/styleguide/fonts/icomoon.eot create mode 100644 public/styleguide/fonts/icomoon.svg create mode 100644 public/styleguide/fonts/icomoon.ttf create mode 100644 public/styleguide/fonts/icomoon.woff create mode 100644 public/styleguide/js/vendor/classlist-polyfill.js rename public/styleguide/js/{ => vendor}/jquery.js (100%) create mode 100644 public/styleguide/js/vendor/jwerty.js rename public/styleguide/js/{ => vendor}/prism.js (100%) create mode 100644 public/styleguide/js/vendor/typeahead.bundle.min.js diff --git a/builder/object_factory.js b/builder/object_factory.js index 0d6f04647..3016f7d72 100644 --- a/builder/object_factory.js +++ b/builder/object_factory.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-06-21 + * patternlab-node - v0.1.2 - 2014-07-12 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. diff --git a/builder/patternlab.js b/builder/patternlab.js index cf6e3d9ab..7efa9f124 100644 --- a/builder/patternlab.js +++ b/builder/patternlab.js @@ -1,5 +1,5 @@ /* - * patternlab-node - v0.1.2 - 2014-06-21 + * patternlab-node - v0.1.2 - 2014-07-12 * * Brian Muenzenmeyer, and the web community. * Licensed under the MIT license. @@ -16,6 +16,7 @@ var patternlab_engine = function(grunt){ patternlab = {}; patternlab.package = grunt.file.readJSON('package.json'); + patternlab.config = grunt.file.readJSON('config.json'); function getVersion() { grunt.log.ok(patternlab.package.version); @@ -26,8 +27,8 @@ var patternlab_engine = function(grunt){ } function printDebug() { - //debug file can be written by setting flag on package.json - if(patternlab.package.debug){ + //debug file can be written by setting flag on config.json + if(patternlab.config.debug){ var outputFilename = './patternlab.json'; grunt.file.write(outputFilename, JSON.stringify(patternlab, null, 3)); } @@ -277,7 +278,7 @@ var patternlab_engine = function(grunt){ //ishControls var ishControlsTemplate = grunt.file.read('./source/_patternlab-files/partials/ishControls.mustache'); - var ishControlsPartialHtml = mustache.render(ishControlsTemplate); + var ishControlsPartialHtml = mustache.render(ishControlsTemplate, patternlab.config); //patternPaths var patternPathsTemplate = grunt.file.read('./source/_patternlab-files/partials/patternPaths.mustache'); @@ -289,9 +290,8 @@ var patternlab_engine = function(grunt){ //websockets var websocketsTemplate = grunt.file.read('./source/_patternlab-files/partials/websockets.mustache'); - var config = grunt.file.readJSON('./config/config.json'); - patternlab.contentsyncport = config.contentSyncPort; - patternlab.navsyncport = config.navSyncPort; + patternlab.contentsyncport = patternlab.config.contentSyncPort; + patternlab.navsyncport = patternlab.config.navSyncPort; var websocketsPartialHtml = mustache.render(websocketsTemplate, patternlab); diff --git a/config.json b/config.json new file mode 100644 index 000000000..84e5356e9 --- /dev/null +++ b/config.json @@ -0,0 +1,31 @@ + { + "patterns" : { + "source" : "./source/_patterns/", + "public" : "./public/patterns/" + }, + "ignored-extensions" : ["scss", "DS_Store", "less"], + "ignored-directories" : ["scss"], + "contentSyncPort" : 8002, + "navSyncPort" : 8003, + "debug": false, + "ishControlsVisible": { + "s": true, + "m": true, + "l": true, + "full": true, + "ranndom": true, + "disco": true, + "hay": true, + "mqs": false, + "find": false, + "views-all": true, + "views-annotations": true, + "views-code": true, + "views-new": true, + "tools-all": true, + "tools-follow": false, + "tools-reload": false, + "tools-shortcuts": false, + "tools-docs": true + } + } \ No newline at end of file diff --git a/config/config.json b/config/config.json deleted file mode 100644 index 1f97027f4..000000000 --- a/config/config.json +++ /dev/null @@ -1,10 +0,0 @@ - { - "patterns" : { - "source" : "/../../source/_patterns/", - "public" : "/../../public/patterns/" - }, - "ignored-extensions" : ["scss", "DS_Store", "less"], - "ignored-directories" : ["scss"], - "contentSyncPort" : 8002, - "navSyncPort" : 8003 - } \ No newline at end of file diff --git a/package.json b/package.json index a18923a0c..40daea2e0 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,5 @@ }, "engines": { "node": ">=0.8" - }, - "debug": false + } } diff --git a/public/styleguide/assets/icons.dev.svg b/public/styleguide/assets/icons.dev.svg deleted file mode 100644 index 1fff93785..000000000 --- a/public/styleguide/assets/icons.dev.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/styleguide/assets/icons.eot b/public/styleguide/assets/icons.eot deleted file mode 100644 index ba04dfea41544a1369156504a8eda8eac5f71c06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2288 zcmds3&2Jl35TCcZ-nCoji#T?JY`V5%yEL-nZ2STFkSvtAX;XwrqbLVHY!b%_O>8S4 zQjs`Vhyzp{azaQT6jeD@9CG52Qw|7mK!8vV9D48x1gBhj#NqeeKF6lOKfpR~XXf{2 z=DjyFZztzYq9qJQ3h_rFhbkB#2aI!f3${%Cl46D$oNwLtAGNU#y+WI`N;Rs|F2G(| zq%u`#pSGw(J3zd&3}gqhn?lQ^aY|4UGk>=Pz}N4=S}GOt`K4DkDhu;O&X<7tZ_Uo- z>1EO(UxRGEc5loYJ9%;)Mk|n)SGP;`X6kGh@)^cEmC|ng;sTz?$Ng5>Rlc9+ zw@VM|^g2yop37#nv|aAWe*6oO?gv(_*LL?l`|9i8h>TA#|A9Cg&UfU$-+H@m`YBzt zT0j__UcJPJuxi!i)>0IssdovrCJFrgxwZ|BEAm;=_WJ<~j-xVKz zu_vN8An`N!NfY|c_Gz2OIU#3w_=+~yZ|mwD#R;y$MkfOnE|d>3;O%hWkYWo$v;AsM zw&njf?WGhd?MwQJ{y+hkYz@an1Y}hqJ_9VMpomzrB?7^C{Mjix#U-VPM-N3)nJH%Y zvN6LK4(T4Rl}WS4!n+F#>F8j*REiHq3-$V8{WQG*a4=ph#s?wR3-AW-a-A5B!CN{O zjloZJjD-!|fJ42H4f(u2c=ujs6WL4_%Ve@*P0Q<1=(a;2ot^IKbr;>eJ=3$Jy5sg8 z4bY5RK<*hp+UJ=_BojIAsB~M|DtFpe8Z;vreo$TohqwbK^&tjB9`8iZ%FM7-G#m`+ zE`v155$#LO7j@j=f}eOn0x84 z%zOrrb9@bzOfp%MHNY9DZyF2^UH(jV+R9yyM$yC%Hl0{=8yaT80W~;))S6tIXBSz9 zEmZlB~Jss^nhNNVrP4TdpJ8X6=3qqFmltb(qxN$*x5l~1sUcjNV(U{k#8+r(d z&LEvSf`NKT#k{&*Nfui?dN?xjkiXta1Okc4k0v=$G$*RZslD&N;rHKQjg|TN6$~|y zNCYAg{#KMBA4)9k8&Y(xgD)x`H+?EH$@AiXWZ!KCrwU14#SW{I*P!!-&CopI=gug07bvJpPGb3R9WJ986~hb21mZ zV(eEp^T}kA)462QlC&*PNI4~GTGEW9SxLvmS`1wP#Rt9@ - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/styleguide/assets/icons.ttf b/public/styleguide/assets/icons.ttf deleted file mode 100644 index f5d06ee2ed83b6442c346a7e35e84ce09476e6d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2132 zcmds2&2Jk;6n}5M-nCoji#T?JY`S)0yEL-nZ0t4UL$XlfrVWVDR#6Uo*d&eN!IP|b55S()9k%Zsuj$@1d2h3{bz2BSn z-n@BlW|o+UdZM> z|M?%V4FZpDZ13GuA5$6l5IDZoSgm-zSD@<=@w~WQx!0t(XcF@R8}-U|wWsj;??hSz zvU;DDvUidwny{=&}L<(a*t?nGQX-6=ECMNA9#^!}hsN z86h|mV&SQ~c^yfBvSPPrLXjO=Q9v|?*9YV!AHUA)z&9j)M#J=}Fz~vTjW@utX zm+NV7gLC z44`BX9mKgn?((KQ_owLTsShr;k4y2_IU ztAJ&!g0rR>3MzEdtBuXg^z;VGf!>~(xiQUq^Og$HY`_r(W+76)wh{>|aoADmwsKW& zwXIZWCM>a0aS9G_2Mp>%4u*oE$(U))axOU%i)((JZQbwJ&kWtq{bj+50VZ9!8vz)} z=aOR_*P@KvL^&9mX1JPW;cC+L$ESym^`Y?6VcGbPK+cIZJYH=`Uf^g=8ue)^sh7LR%=OhGgKpZg%Rm03=jVZ%f5!B433u!Yu0hNxIc09{i zX$SFbI_n$oB-W(m>dx+Fqi#%O0G_vc{v~xv&@}|WGbyaFhgJ5n#yb1h&zJQ5`erGc z%?di7&6<+7@ub8#N%N9gk`^SLaMoh{1#tMl_o82MWCD9oQO3WZ9jDNspJpHaB53zN F^tPxqpAaoclD#kXJW{i$Kj=h+UG82{2NU|J+ zM$#Ehm_pe*IF*+nhAf5G`f601pYtyNyw7!gujl%H?)!KD?&o^0>$zjy2?Tc%$sGU? z>%cw$ToNPzvb+EPvLg^M007wo0I(J?KT}Ih(vUzPxdMQACz!1S3LO&cLUgouAb@Nd z^anv<08;?w?x}AC0B{)ST|klb1p=D@nqLISPJ!MTtm{9aJtPql)Y`=A{OG`q(sQ=B^rRKer+PLe&s*80oeQTv=#9|NpYrmOt_PMGhry;8_ zgF>t&>qS$N<1%lm zx&%L36^Tkw?u5H`H6MbZ`_IFuB(=*5SvRg2L9Z!)nyvb_uJzpUybCPI z_ZO-hEzzt>xnWCEo9|npom*`E^bNUb1X67A_RQkpXj<9spj^J{s$_CD_<6Ofg zLNdyI>Kq%cJ-aeltN0<>IWv0rexc;x#sQ*K&C|n^*0rvGE{Ni$+hhCfv(2?z^Ot# zWfr;;sVCjtkc~CQL5(ydc5?f-?`}%yenQFEPO_0^x7^3tAK8D*X-dF&jzQN1B{wN~ z%Dbp|AefLuf5e`bVtd&w1$qg6Zz;NG9&iyxvRS8F&)sg{R6RX)t#WHB2dn;ta-d$g zQp_B>)Xuygx|k|vKJsh0fokrWWl3dD{Nwrp5%p(R=P-8UJ4*c5L6wVK55-GTLzbg* zvC}vm3kyR{uOe;kIa0{`%UqNFtsR1b(HzsM(^qi09t39l3HC)~*8mKc-B#gTJgLb; z-b7}6I~^m|QETekar@KRM2NoUC{%37-YWUEiR2r(LscR76xwa3rVE@c`2j%9c>W33#}`o!_kh`cdz;QZHsTR5K0rKr~Vrw?vUawfI) z=k`*xwqR^-z;!`woVvt3?StIXrJ zoWUY-e<)Sa*nzLVNv6q>vB532^Bw$SUeZq5>R&>4RjP#4r#Gs;KQ9L_LbE3n6g5O}K6pxZ49~1^8)9 z(ZPyeQf0J|hEdaEKyK2WkN@i%5W4q8f1VQ2T8tv_hADh=mX67utsN*9{t98Ehk%|{ z0&H~mfir9O9N;+8HsgZv3dFF>1x{_F3!e+qzw!x37Z5L*Z!E(?IO z0USSjcVo1hhGA_s(hfz`F15=Oe26SviM8$J;BB!@PAAHTpceg6#?;s+c}L@z3C!ueO04n=?JZ;-!W<2E zaj0n_efMb!>*3tG+TA_0TqW0HU7Z+GSm#B%gT+>j#y4uw#yVFwtuJYc&+GNy(350W dUmT8YF?IFYso#JWJvU1D?;Z2O0sk`q`wQ6IW>o+H diff --git a/public/styleguide/css/styleguide-specific.css b/public/styleguide/css/styleguide-specific.css new file mode 100644 index 000000000..5aaf94c33 --- /dev/null +++ b/public/styleguide/css/styleguide-specific.css @@ -0,0 +1,80 @@ +/*------------------------------------*\ + $PATTERN LAB-SPECIFIC STYLES +\*------------------------------------*/ +/** + * This stylesheet is for styles you want to include only when the interface is being viewed within Pattern Lab. + * This is helpful for displaying demo styles for grids, animations, color swatches, etc + * It's also helpful for overriding context-specific styles like fixed or absolutely positioned elements + * These styles will not be your production CSS. + */ +/* Style Guide Interface Colors */ +/* Typography */ +/* Defaults */ +/* Dimensions */ +/* Breakpoints */ +.demo { + overflow: hidden; + margin-bottom: 1rem; } + +.demo .gi, .demo .demo-block { + background: #dddddd; + color: gray; + text-align: center; + margin-bottom: 0.5em; + padding: 1em !important; } + .demo .gi:nth-of-type(2n), .demo .demo-block:nth-of-type(2n) { + color: #dddddd; + background: gray; } + .demo .gi .gi, .demo .demo-block .gi { + background: rgba(0, 0, 0, 0.1); + color: #dddddd; } + .demo .gi .gi:nth-of-type(2n), .demo .demo-block .gi:nth-of-type(2n) { + background: rgba(0, 0, 0, 0.3); } + +.demo-animate { + background: #ddd; + padding: 1em; + margin-bottom: 1em; + text-align: center; } + +.animate-move { + position: relative; } + .animate-move .demo-shape { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 20px; + background: gray; } + .animate-move:hover > .demo-shape { + left: 100%; + margin-left: -20px; } + +.sg-colors { + overflow: hidden; } + .sg-colors li { + overflow: hidden; + border: 1px solid #dddddd; + padding: 0.3em; + margin: 0 0.2em 0.2em 0; } + @media all and (min-width: 30em) { + .sg-colors li { + float: left; + width: 5em; } } + +.sg-swatch { + display: block; + height: 1.5em; + width: 50%; } + @media all and (max-width: 30em) { + .sg-swatch { + float: left; + margin-right: 0.3em; } } + @media all and (min-width: 30em) { + .sg-swatch { + width: 100%; + height: 4em; + margin-bottom: 0.2em; } } + +.sg-label { + line-height: 1; } diff --git a/public/styleguide/css/styleguide-specific.scss b/public/styleguide/css/styleguide-specific.scss new file mode 100644 index 000000000..f55a99390 --- /dev/null +++ b/public/styleguide/css/styleguide-specific.scss @@ -0,0 +1,141 @@ +/*------------------------------------*\ + $PATTERN LAB-SPECIFIC STYLES +\*------------------------------------*/ +/** + * This stylesheet is for styles you want to include only when the interface is being viewed within Pattern Lab. + * This is helpful for displaying demo styles for grids, animations, color swatches, etc + * It's also helpful for overriding context-specific styles like fixed or absolutely positioned elements + * These styles will not be your production CSS. + */ + + +/* Style Guide Interface Colors */ +$sg-primary : #222; +$sg-secondary : #808080; +$sg-tertiary : #ddd; +$sg-quaternary : #fff; +$sg-quinary : #999; +$sg-tint : rgba(255,255,255,0.05); +$sg-tint-2 : rgba(255,255,255,0.25); +$sg-tone : rgba(0,0,0,0.1); +$sg-tone-2 : rgba(0,0,0,0.3); + +/* Typography */ +$sg-font-size-norm : 100%; +$sg-font-size-sm : 70%; +$sg-font-size-large : 120%; + +/* Defaults */ +$sg-space : 1em; +$sg-doublespace : $sg-space*2; +$sg-pad : 1em; +$sg-pad-half : $sg-pad/2; + +/* Dimensions */ +$offset-top: 2em; + +/* Breakpoints */ +$sg-bp-small : 24em; +$sg-bp-small-2 : 30em; +$sg-bp-med : 48em; +$sg-bp-large : 72em; +$sg-bp-xl : 80em; + +$animate-quick: 0.2s; + + +// Demo to show grid system - in this stylesheet because it shouldn't be included in the production styles +.demo { + overflow: hidden; + margin-bottom: 1rem; +} + +.demo .gi, .demo .demo-block { + background: $sg-tertiary; + color: $sg-secondary; + text-align: center; + margin-bottom: $sg-pad-half; + padding: 1em !important; + + &:nth-of-type(2n) { + color: $sg-tertiary; + background: $sg-secondary; + } + + .gi { + background: $sg-tone; + color: $sg-tertiary; + + &:nth-of-type(2n) { + background: $sg-tone-2; + } + } +} + +//Demo box for animation +.demo-animate { + background: #ddd; + padding: $sg-pad; + margin-bottom: $sg-space; + text-align: center; +} + +//Animate Demo to show +.animate-move { + position: relative; + + .demo-shape { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 20px; + background: $sg-secondary; + } + + &:hover { + > .demo-shape { + left: 100%; + margin-left: -20px; + } + } +} + +// Style Guide color swatches +.sg-colors { + overflow: hidden; + + li { + overflow: hidden; + border: 1px solid $sg-tertiary; + padding: 0.3em; + margin: 0 0.2em 0.2em 0; + + @media all and (min-width: $sg-bp-small-2) { + float: left; + width: 5em; + } + } +} + +.sg-swatch { + display: block; + height: 1.5em; + width: 50%; + + @media all and (max-width: $sg-bp-small-2) { + float: left; + margin-right: 0.3em; + } + + @media all and (min-width: $sg-bp-small-2) { + width: 100%; + height: 4em; + margin-bottom: 0.2em; + } + +} + +.sg-label { + line-height: 1; +} \ No newline at end of file diff --git a/public/styleguide/css/styleguide.css b/public/styleguide/css/styleguide.css index 3806bf3eb..459a602d7 100644 --- a/public/styleguide/css/styleguide.css +++ b/public/styleguide/css/styleguide.css @@ -1,9 +1,9 @@ /*------------------------------------*\ - $STYLE GUIDE CONTAINER STYLES + $PATTERN LAB STYLES \*------------------------------------*/ /** - * NOTE: These styles are specific to the style guide container and should not be modified. - * Use style.scss for all content styles that don't pertain to the style guide container. + * NOTE: These styles are specific to Pattern Lab and should not be modified. + * Edit all project styles in /source/css/ * * Second note: Any important declarations are to prevent brand styles from overriding style guide */ @@ -18,14 +18,13 @@ * -----Defaults * -----Breakpoints * MIXINS---------------------------------Sass mixins - * RESET----------------------------------Set reset defaults * GLOBAL ELEMENTS------------------------Establish global styles * -----Main * -----Headings * -----Text-related elements (p, blockquote, lists) * -----Defaults * -----Breakpoints - * STYLE GUIDE INTERFACE------------------CSS for the Style Guide Container. Should not influence the containing styles at all. + * STYLE GUIDE INTERFACE------------------CSS for the Pattern Lab Container. * -----Header * -----Navigation * -----Controls @@ -33,9 +32,10 @@ * -----Viewport * -----Section Headers * -----Code View + * -----Icon Fonts */ /*------------------------------------*\ - $STYLE GUIDE VARIABLES + $PATTERN LAB VARIABLES \*------------------------------------*/ /*Fonts*/ /* Style Guide Interface Colors */ @@ -44,22 +44,20 @@ /* Dimensions */ /* Breakpoints */ /*------------------------------------*\ - $STYLE GUIDE MIXINS + $PATTERN LAB MIXINS \*------------------------------------*/ /*------------------------------------*\ - $STYLE GUIDE INTERFACE + $PATTERN LAB INTERFACE \*------------------------------------*/ #patternlab-html, #patternlab-body { margin: 0; padding: 0; background: #dddddd; - -webkit-text-size-adjust: 100%; -} + -webkit-text-size-adjust: 100%; } .sg-nav-wrapper { overflow: hidden; - background: #dddddd; -} + background: #dddddd; } .is-vishidden { position: absolute !important; @@ -68,11 +66,18 @@ height: 1px; padding: 0; border: 0; - clip: rect(1px, 1px, 1px, 1px); -} + clip: rect(1px, 1px, 1px, 1px); } + +.sg-cf, .sg-pattern { + /**zoom: 1;*/ } + .sg-cf:before, .sg-pattern:before, .sg-cf:after, .sg-pattern:after { + content: " "; + display: table; } + .sg-cf:after, .sg-pattern:after { + clear: both; } /*------------------------------------*\ - $STYLE GUIDE HEADER + $PATTERN LAB HEADER \*------------------------------------*/ /* Header */ .sg-header { @@ -84,146 +89,131 @@ top: 0; left: 0; z-index: 2; - width: 100%; - -webkit-box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); - -moz-box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); - box-shadow: inset 0 1px 0 #5f6164, inset 0 -1px 0 #2e2f2f, 0 1px 3px rgba(0, 0, 0, 0.3); -} -.sg-header * { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.sg-header ul, .sg-header ol { - padding: 0; - margin: 0; -} -.sg-header li { - list-style: none; - border-bottom: 1px solid rgba(255, 255, 255, 0.05); -} -.sg-header a { - font-size: 70%; - color: gray; - text-decoration: none; - display: block; - line-height: 1; - padding: 1em; - -webkit-transition: background 0.15s ease-out; - -moz-transition: background 0.15s ease-out; - -ms-transition: background 0.15s ease-out; - -o-transition: background 0.15s ease-out; - transition: background 0.15s ease-out; - -webkit-transition: color 0.15s ease-out; - -moz-transition: color 0.15s ease-out; - -ms-transition: color 0.15s ease-out; - -o-transition: color 0.15s ease-out; - transition: color 0.15s ease-out; -} -.sg-header a:hover, .sg-header a:focus, .sg-header a.active { - color: white; - background: rgba(255, 255, 255, 0.05); -} -.sg-header ol li ol li ol li a { - padding-left: 2em; - text-transform: none; -} + width: 100%; } + .sg-header * { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; } + .sg-header ul, .sg-header ol { + padding: 0; + margin: 0; } + .sg-header li { + list-style: none; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); } + .sg-header a { + font-size: 70%; + color: gray; + text-decoration: none; + display: block; + line-height: 1; + padding: 1em; + -webkit-transition: background 0.15s ease-out; + -moz-transition: background 0.15s ease-out; + -ms-transition: background 0.15s ease-out; + -o-transition: background 0.15s ease-out; + transition: background 0.15s ease-out; + -webkit-transition: color 0.15s ease-out; + -moz-transition: color 0.15s ease-out; + -ms-transition: color 0.15s ease-out; + -o-transition: color 0.15s ease-out; + transition: color 0.15s ease-out; } + .sg-header a:hover, .sg-header a:focus, .sg-header a.active { + color: white; + background: rgba(255, 255, 255, 0.05); } + .sg-header ol ol ol a { + padding-left: 2em; + text-transform: none; } /* Navigation */ .sg-header .sg-nav-toggle { - padding: 1em; - border-bottom: 1px solid transparent; + display: inline-block; + padding: 0.9em 1em; + border-bottom: 1px solid rgba(0, 0, 0, 0); position: relative; - z-index: 2; -} -@media all and (min-width: 44em) { - .sg-header .sg-nav-toggle { - display: none; - } -} - -@media all and (max-width: 44em) { + text-transform: uppercase; + z-index: 2; } + .sg-header .sg-nav-toggle span { + display: inline-block; + padding-right: 0.2em; } + @media all and (min-width: 48em) { + .sg-header .sg-nav-toggle { + display: none; } } + +@media all and (max-width: 48em) { .sg-nav-container { overflow: hidden; max-height: 0; - -webkit-transition: max-height 0.5s ease-out; - -moz-transition: max-height 0.5s ease-out; - -ms-transition: max-height 0.5s ease-out; - -o-transition: max-height 0.5s ease-out; - transition: max-height 0.5s ease-out; - } - .sg-nav-container.active { - max-height: 50em; - } -} + -webkit-transition: max-height 0.1s ease-out; + -moz-transition: max-height 0.1s ease-out; + -ms-transition: max-height 0.1s ease-out; + -o-transition: max-height 0.1s ease-out; + transition: max-height 0.1s ease-out; } + .sg-nav-container.active { + max-height: 50em; } } .sg-nav { z-index: 1; margin: 0; padding: 0; - list-style: none; -} -@media all and (min-width: 44em) { + list-style: none; } .sg-nav > li { - border-bottom: 0; - border-right: 1px solid rgba(255, 255, 255, 0.05); - float: left; - position: relative; - } - .sg-nav > li > ol { - position: absolute; - top: 2em; - left: 0; - } -} + cursor: pointer; } + @media all and (min-width: 48em) { + .sg-nav > li { + border-bottom: 0; + border-right: 1px solid rgba(255, 255, 255, 0.05); + float: left; + position: relative; } + .sg-nav > li > ol { + position: absolute; + top: 2em; + left: 0; } } /* Accordion */ .sg-acc-handle:after { content: ' +'; float: right; - font-size: 70%; -} -@media all and (min-width: 44em) { - .sg-acc-handle:after { - float: none; - } -} + font-size: 70%; } + @media all and (min-width: 48em) { + .sg-acc-handle:after { + float: none; } } .sg-acc-handle.active { color: white; - background: rgba(255, 255, 255, 0.05); -} -.sg-acc-handle.active:after { - content: ' -'; -} + background: rgba(255, 255, 255, 0.05); } + .sg-acc-handle.active:after { + content: ' -'; } .sg-acc-handle.sg-icon:after { - content: ""; -} + content: ""; } .sg-header .sg-icon { width: auto; font-size: 1rem; - padding: 0.5rem 1rem; -} + padding: 0.5rem 1rem; } .sg-acc-panel { overflow: hidden; max-height: 0; min-width: 10em; - background: #222222; - -webkit-transition: max-height 0.5s ease-out; - -moz-transition: max-height 0.5s ease-out; - -ms-transition: max-height 0.5s ease-out; - -o-transition: max-height 0.5s ease-out; - transition: max-height 0.5s ease-out; -} -.sg-acc-panel.active { - max-height: 50em; -} -.sg-acc-panel.sg-right { - position: absolute; - left: auto; - right: 0; -} + -webkit-transition: max-height 0.1s ease-out; + -moz-transition: max-height 0.1s ease-out; + -ms-transition: max-height 0.1s ease-out; + -o-transition: max-height 0.1s ease-out; + transition: max-height 0.1s ease-out; } + .sg-acc-panel li { + background: #222222; } + .sg-acc-panel.active { + max-height: 120em; + overflow: auto; } + .sg-acc-panel.sg-right { + position: absolute; + left: auto; + right: 0; } + .sg-acc-panel.sg-left { + position: absolute; + left: auto; } + .sg-acc-panel [class^="sg-icon-"]:before { + display: inline-block; + margin-right: 0.4em; } /* Controls (sizing, view mode) */ .sg-controls { @@ -231,173 +221,161 @@ position: absolute; top: 0; right: 0; - z-index: 2; -} -.sg-controls .sg-acc-panel.active { - max-height: 17em; -} -.sg-controls .sg-nav-phases .sg-acc-panel { - min-width: 0; -} -.sg-controls .sg-nav-phases .sg-acc-panel.active { - max-height: none; -} + z-index: 2; } .sg-control-trigger { - border-bottom: 1px solid rgba(255, 255, 255, 0.05); -} -@media all and (min-width: 44em) { - .sg-control-trigger { - border: 0; - } -} -@media all and (min-width: 65em) { - .sg-control-trigger { - float: left; - width: 6em; - } -} - -@media all and (min-width: 44em) { - .sg-control > li { - float: left; - border-bottom: 0; - border-left: 1px solid rgba(255, 255, 255, 0.05); - } -} + border-bottom: 1px solid rgba(255, 255, 255, 0.05); } + @media all and (min-width: 48em) { + .sg-control-trigger { + border: 0; } } + @media all and (min-width: 72em) { + .sg-control-trigger { + float: left; + width: 6em; } } .sg-control > li { - float: left; -} + float: left; } + @media all and (min-width: 48em) { + .sg-control > li { + border-bottom: 0; + border-left: 1px solid rgba(255, 255, 255, 0.05); } } .sg-control .sg-input { padding: 0.1em; -webkit-transition: all 0.2s ease-out; -moz-transition: all 0.2s ease-out; -ms-transition: all 0.2s ease-out; -o-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -.sg-control .sg-input:active, .sg-control .sg-input:focus { - outline: 0; - background: #f7f7f7; - color: #000; -} - -@media all and (max-width: 65em) { - .sg-quarter { - float: left; - width: 25%; - border-left: 1px solid rgba(255, 255, 255, 0.05); - text-align: center; - } - .sg-quarter:first-child { - border-left: 0; - } -} - -@media all and (max-width: 65em) { - .sg-half { - float: left; - width: 50%; - border-left: 1px solid rgba(255, 255, 255, 0.05); - text-align: center; - } - .sg-half:nth-child(odd) { - border-left: 0; - } -} + transition: all 0.2s ease-out; } + .sg-control .sg-input:active, .sg-control .sg-input:focus { + outline: 0; + background: #999999; + color: #000; } .sg-current-size { font-size: 70%; color: gray; - padding: 0.8em 0.95em; -} -.sg-current-size:hover .sg-input { - background: #f7f7f7; - color: #000; -} -@media all and (min-width: 65em) { - .sg-current-size { - float: left; - } -} - -.sg-size-options { - max-width: 10em; -} -@media all and (min-width: 65em) { + padding: 0.85em 0.7em; } + .sg-current-size:hover .sg-input { + background: #999999; + color: #000; } + @media all and (min-width: 72em) { + .sg-current-size { + float: left; } } + +.sg-size { + width: 135px; } + @media all and (min-width: 48em) { + .sg-size { + width: auto; } } + +@media all and (min-width: 72em) { .sg-size-options { + float: left; position: static; max-height: none; - max-width: none; - } - .sg-size-options > li { - float: left; - border: 0; - border-left: 1px solid rgba(255, 255, 255, 0.05); - } -} + max-width: none; } + .sg-size-options > li { + float: left; + border: 0; + border-left: 1px solid rgba(255, 255, 255, 0.05); } } + +#sg-size-mq { + display: none; } + @media all and (min-width: 72em) { + #sg-size-mq { + display: block; } } #sg-form { margin: 0; border: 0; - padding: 0; -} + padding: 0; } .sg-input { margin: -2px 0 0 0; padding: 0; - border: 1px solid #222; + border: 0; background-color: #222; color: gray; - width: 35px; - text-align: right; -} + width: 25px; + text-align: right; } + @media all and (min-width: 48em) { + .sg-input { + width: 35px; } } .sg-input-active { background-color: #fff; - color: #000; -} + color: #000; } .sg-view { - position: relative; -} -.sg-view > ul { - position: absolute; - top: 2em; - left: 0; -} + position: relative; } + .sg-view > ul { + position: absolute; + top: 2em; + left: 0; } .sg-checkbox:before { display: inline-block; - margin-right: 0.4em; -} + margin-right: 0.4em; } + +/* basic styling */ +.sg-pattern-state:before { + margin-right: 4px; + content: "\2022"; + display: inline-block; + margin-bottom: -4px; + font-size: 18px; + vertical-align: bottom; } + +/* nav styling */ +.sg-nav .sg-pattern-state:before { + margin-top: -4px; + margin-bottom: 0; + margin-left: -4px; + height: 20px; + display: block; + float: left; } + +.sg-sub-nav .sg-pattern-state:before { + margin-left: -11px; + margin-right: 4px; } + +/* call out for pattern's pattern state */ +span.sg-pattern-state { + color: #999; } + +span.sg-pattern-state:before { + margin-bottom: -3px; + margin-left: 4px; } + +/* pattern states */ +.inprogress:before { + color: #FF4136 !important; } + +.inreview:before { + color: #FFCC00 !important; } + +.complete:before { + color: #2ECC40 !important; } /*------------------------------------*\ - $STYLE GUIDE VIEWPORT + $PATTERN LAB VIEWPORT \*------------------------------------*/ /* Viewport */ #sg-vp-wrap { text-align: center; width: 100%; -} -@media all and (min-width: 44em) { - #sg-vp-wrap { - position: fixed; - top: 2em; - bottom: 0; - left: 0; - right: 0; - z-index: 0; - } -} -#sg-vp-wrap.wrap-animate { - -webkit-transition: left 0.3s ease-out; - -moz-transition: left 0.3s ease-out; - -ms-transition: left 0.3s ease-out; - -o-transition: left 0.3s ease-out; - transition: left 0.3s ease-out; -} + position: fixed; + top: 2em; + bottom: 0; + left: 0; + right: 0; + z-index: 0; } + #sg-vp-wrap.wrap-animate { + -webkit-transition: left 0.3s ease-out; + -moz-transition: left 0.3s ease-out; + -ms-transition: left 0.3s ease-out; + -o-transition: left 0.3s ease-out; + transition: left 0.3s ease-out; } #sg-viewport { position: absolute; @@ -410,15 +388,18 @@ bottom: 0; left: 0; right: 0; - background-color: white; -} -#sg-viewport.hay-mode { - -webkit-transition: all 40s linear; - -moz-transition: all 40s linear; - -ms-transition: all 40s linear; - -o-transition: all 40s linear; - transition: all 40s linear; -} + background-color: white; } + #sg-viewport.hay-mode { + -webkit-transition: all 40s linear; + -moz-transition: all 40s linear; + -ms-transition: all 40s linear; + -o-transition: all 40s linear; + transition: all 40s linear; } + +.no-resize #sg-cover, .no-resize #sg-rightpull-container { + display: none; } +.no-resize #sg-viewport { + overflow: hidden !important; } #sg-cover { width: 100%; @@ -426,68 +407,60 @@ display: none; position: absolute; z-index: 20; - cursor: col-resize; -} + cursor: col-resize; } #sg-gen-container { height: 100%; position: relative; text-align: center; - margin: 0px auto; + margin: 0 auto; + -webkit-overflow-scrolling: touch; overflow-y: auto; - overflow-x: hidden; -} -#sg-gen-container.hay-mode { - -webkit-transition: all 40s linear; - -moz-transition: all 40s linear; - -ms-transition: all 40s linear; - -o-transition: all 40s linear; - transition: all 40s linear; -} + overflow-x: hidden; } + #sg-gen-container.hay-mode { + -webkit-transition: all 40s linear; + -moz-transition: all 40s linear; + -ms-transition: all 40s linear; + -o-transition: all 40s linear; + transition: all 40s linear; } #sg-rightpull-container { - width: 10px; + width: 14px; float: right; margin: 0; height: 100%; - cursor: col-resize; -} + cursor: col-resize; } #sg-rightpull { margin: 0; - width: 10px; + width: 100%; height: 100%; background: #999; -webkit-transition: background 0.2s ease-out; -moz-transition: background 0.2s ease-out; -ms-transition: background 0.2s ease-out; -o-transition: background 0.2s ease-out; - transition: background 0.2s ease-out; -} -#sg-rightpull:hover { - background: #666; -} -#sg-rightpull:active { - cursor: col-resize; - background: #444; -} + transition: background 0.2s ease-out; } + #sg-rightpull:hover { + background: #666; } + #sg-rightpull:active { + cursor: col-resize; + background: #444; } .vp-animate { -webkit-transition: width 0.8s ease-out; -moz-transition: width 0.8s ease-out; -ms-transition: width 0.8s ease-out; -o-transition: width 0.8s ease-out; - transition: width 0.8s ease-out; -} + transition: width 0.8s ease-out; } /*------------------------------------*\ - $STYLE GUIDE CONTENT + $PATTERN LAB CONTENT \*------------------------------------*/ /* Section Pattern */ .sg-pattern { margin-bottom: 2em; - overflow: hidden; -} + position: relative; } /* Section Head */ .sg-pattern-head { @@ -496,33 +469,103 @@ font-size: 70%; font-weight: normal; padding: 1em 0; - border-bottom: 1px solid gray; -} -.sg-pattern-head a { - display: block; + border-bottom: 1px solid gray; } + .sg-pattern-head a { + display: block; + color: gray; + text-decoration: none; + cursor: pointer; } + .sg-pattern-head a:hover { + color: #222222; } + +.sg-view-container { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + font-family: "HelveticaNeue", "Helvetica", "Arial", sans-serif; + line-height: 1.4; + font-size: 90%; + background: #222222; color: gray; + position: fixed; + top: auto; + padding: 1em; + bottom: 0; + left: 0; + z-index: 2; + width: 100%; + height: 50%; + overflow-y: auto; + overflow-x: hidden; } + .sg-view-container a { + color: #999999; } + .sg-view-container pre { + padding: 0 1em; } + .sg-view-container.anim-ready { + -webkit-transition: bottom 0.3s ease-out; + -moz-transition: bottom 0.3s ease-out; + -webkit-transition: bottom 0.3s ease-out; + -ms-transition: bottom 0.3s ease-out; + -o-transition: bottom 0.3s ease-out; + transition: bottom 0.3s ease-out; } + +.sg-view-close { + width: 100%; + margin-bottom: -10px; } + +.sg-view-close-btn { + color: #fff; + text-transform: uppercase; text-decoration: none; - cursor: pointer; -} -.sg-pattern-head a:hover { - color: #222222; -} + text-align: right; + display: block; } -/* Clean View */ -.sg-clean .sg-main { - padding: 0; -} +.has-annotation { + cursor: help !important; + box-shadow: 0 0 10px gray; } + .has-annotation a, .has-annotation input { + cursor: help !important; } + .has-annotation:hover { + box-shadow: 0 0 10px #222222; } + .has-annotation.active { + box-shadow: inset 0 0 20px gray; } + +.annotation-tip { + display: block; + position: absolute; + margin-top: -10px !important; + margin-left: -10px !important; + width: 25px !important; + height: 25px !important; + border-radius: 13px !important; + text-align: center !important; + background: #444 !important; + color: #fff !important; + font-weight: bold !important; + font-size: 16px !important; + z-index: 100; } + +#sg-comments-container { + max-width: 60em; + margin: 0 auto; } + +.sg-comment-container { + padding-bottom: 2em; + margin-bottom: 1em; + border-bottom: 1px solid rgba(255, 255, 255, 0.25); } + .sg-comment-container p:last-child { + margin-bottom: 0; } + .sg-comment-container h2 { + margin-bottom: 0.25em; } .sg-code, .sg-annotations { clear: both; background: #dddddd; color: #222222; padding: 1em 0.5em; - margin: 1em 0; -} -.sg-code a, .sg-annotations a { - text-decoration: underline; -} + margin: 1em 0; } + .sg-code a, .sg-annotations a { + text-decoration: underline; } .sg-code pre { white-space: -moz-pre-line; @@ -531,219 +574,130 @@ word-wrap: break-word; white-space: pre-line; border: 1px solid rgba(0, 0, 0, 0.1); - padding: 0.5em; -} + padding: 0.5em; } .sg-code-contains { margin-bottom: 1rem; font-size: 85%; - color: gray; -} -.sg-code-contains code { - padding: 0.2em; - background: rgba(0, 0, 0, 0.3); - color: #f7f7f7; - position: relative; - top: -2px; -} + color: gray; } + .sg-code-contains code { + padding: 0.2em; + background: rgba(0, 0, 0, 0.3); + color: #999999; + position: relative; + top: -2px; } .sg-code-head { color: gray; - font-size: 1em; -} + font-size: 1em; } -.demo { - overflow: hidden; - margin-bottom: 1rem; -} +#sg-code-markup { + padding-top: 10px; } -.demo .gi, .demo .demo-block { - background: #dddddd; - color: gray; - text-align: center; - margin-bottom: 0.5em; - padding: 1em !important; -} -.demo .gi:nth-of-type(2n), .demo .demo-block:nth-of-type(2n) { - color: #dddddd; - background: gray; -} -.demo .gi .gi, .demo .demo-block .gi { - background: rgba(0, 0, 0, 0.1); - color: #dddddd; -} -.demo .gi .gi:nth-of-type(2n), .demo .demo-block .gi:nth-of-type(2n) { - background: rgba(0, 0, 0, 0.3); -} - -.demo-animate { - background: #dddddd; - padding: 1em; - margin-bottom: 1em; - text-align: center; -} +#sg-code-tabs { + list-style: none; + margin: 0; + padding: 0; } -.animate-move { - position: relative; -} -.animate-move .demo-shape { - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: 20px; - background: gray; -} -.animate-move:hover > .demo-shape { - left: 100%; - margin-left: -20px; -} - -.sg-colors { - overflow: hidden; -} -.sg-colors li { - overflow: hidden; - border: 1px solid #dddddd; - padding: 0.3em; - margin: 0 0.2em 0.2em 0; -} -@media all and (min-width: 30em) { - .sg-colors li { - float: left; - width: 5em; - } -} +#sg-code-tabs li { + float: left; + background-color: #333; + font-size: 1.3em; + font-weight: bold; + padding: 5px 15px; + border-top: 2px solid #666; + margin-right: 2px; + cursor: pointer; } -.sg-swatch { - display: block; - height: 1.5em; - width: 50%; -} -@media all and (max-width: 30em) { - .sg-swatch { - float: left; - margin-right: 0.3em; - } -} -@media all and (min-width: 30em) { - .sg-swatch { - width: 100%; - height: 4em; - margin-bottom: 0.2em; - } -} - -.sg-label { - line-height: 1; -} +.sg-code-title-active { + color: #bbb; + background-color: #272822 !important; } -#sg-annotation-container { - position: fixed; - bottom: 0; - left: 0; - z-index: 99; - width: 100%; - padding: 1em; -} +div.clear { + clear: both; } -/* Annotations */ -#sg-annotation-container, #sg-code-container { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - font-family: "HelveticaNeue", "Helvetica", "Arial", sans-serif; - font-size: 90%; - background: #222222; - color: gray; - position: fixed; - top: auto; - padding: 1rem 1rem 4rem; - bottom: 0; - left: 0; - width: 100%; - z-index: 2; - -webkit-transition: bottom 0.3s ease-out; - -moz-transition: bottom 0.3s ease-out; - -webkit-transition: bottom 0.3s ease-out; - -ms-transition: bottom 0.3s ease-out; - -o-transition: bottom 0.3s ease-out; - transition: bottom 0.3s ease-out; -} -#sg-annotation-container a, #sg-code-container a { - color: #dddddd; -} - -#sg-code-container pre { - max-height: 300px; - padding: 0 1em; -} - -#sg-code-container .with-css pre { - max-height: 200px; -} - -#sg-annotation-close-btn, #sg-code-close-btn { - color: #fff; - position: absolute; - top: 1em; - right: 1em; - text-transform: uppercase; - text-decoration: none; - text-align: right; -} +.sg-code-patternname { + color: #aaa; } -.has-comment, .has-comment a { - cursor: help !important; -} +#sg-code-loader { + display: none; + position: absolute; + left: 45%; + top: 20%; + width: 150px; + padding: 10px; + text-align: center; + border-radius: 10px; + background-color: #000; + z-index: 100; } + +.spinner { + height: 30px; + width: 30px; + margin-left: auto; + margin-right: auto; + background-position: center center; + background-repeat: no-repeat; + background: url("../images/spinner.gif"); + border-radius: 50%; + opacity: .7; } +/* Pattern Lab icon fonts */ @font-face { - font-family: 'icons'; - src: url("../assets/icons.eot"); - src: url("../assets/icons.eot?#iefix") format("embedded-opentype"), url("../assets/icons.woff") format("woff"), url("../assets/icons.ttf") format("truetype"), url("../assets/icons.svg#icons") format("svg"); + font-family: 'icomoon'; + src: url("../fonts/icomoon.eot"); + src: url("../fonts/icomoon.eot") format("embedded-opentype"), url("../fonts/icomoon.woff") format("woff"), url("../fonts/icomoon.ttf") format("truetype"), url("../fonts/icomoon.svg") format("svg"); font-weight: normal; - font-style: normal; -} -/* Pattern Lab icon fonts */ -.icon-reload, .icon-cog, .icon-minus, .icon-plus, .icon-menu, .sg-header .sg-nav-toggle, .icon-checkbox-unchecked, .sg-checkbox, .icon-checkbox-checked, .sg-checkbox.active, .icon-eye { - font-family: 'icons'; + font-style: normal; } + +.sg-icon-search, .sg-icon-cog, .sg-icon-minus, .sg-icon-plus, .sg-icon-menu, .sg-icon-radio-checked, .sg-checkbox.active, .sg-icon-radio-unchecked, .sg-checkbox, .sg-icon-file, .sg-icon-link, .sg-icon-keyboard, .sg-icon-qrcode, .sg-icon-eye, .sg-checkbox { + font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; + /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -} + -moz-osx-font-smoothing: grayscale; } + +.sg-icon-search:before { + content: "\e600"; + font-size: 85%; } + +.sg-icon-cog:before { + content: "\e601"; } + +.sg-icon-minus:before { + content: "\e602"; } + +.sg-icon-plus:before { + content: "\e603"; } + +.sg-icon-menu:before { + content: "\e604"; } -.icon-reload:before { - content: "\e002"; -} +.sg-icon-radio-checked:before, .sg-checkbox.active:before, .sg-checkbox.active:before { + content: "\e605"; } -.icon-cog:before { - content: "\e000"; -} +.sg-icon-radio-unchecked:before, .sg-checkbox:before, .sg-checkbox:before { + content: "\e606"; } -.icon-minus:before { - content: "\e003"; -} +.sg-icon-file:before { + content: "\e607"; } -.icon-plus:before { - content: "\e004"; -} +.sg-icon-link:before { + content: "\e608"; } -.icon-menu:before, .sg-header .sg-nav-toggle:before { - content: "\e005"; -} +.sg-icon-keyboard:before { + content: "\e609"; } -.icon-checkbox-unchecked:before, .sg-checkbox:before { - content: "\e006"; -} +.sg-icon-qrcode:before { + content: "\e60a"; } -.icon-checkbox-checked:before, .sg-checkbox.active:before { - content: "\e007"; -} +.sg-icon-eye:before { + content: "\e60b"; } -.icon-eye:before { - content: "\e001"; -} +/******************************************************************/ +/* End Pattern Lab Interface code */ \ No newline at end of file diff --git a/public/styleguide/css/styleguide.scss b/public/styleguide/css/styleguide.scss index eb97598e6..b0b38c0f7 100644 --- a/public/styleguide/css/styleguide.scss +++ b/public/styleguide/css/styleguide.scss @@ -1,9 +1,9 @@ /*------------------------------------*\ - $STYLE GUIDE CONTAINER STYLES + $PATTERN LAB STYLES \*------------------------------------*/ /** - * NOTE: These styles are specific to the style guide container and should not be modified. - * Use style.scss for all content styles that don't pertain to the style guide container. + * NOTE: These styles are specific to Pattern Lab and should not be modified. + * Edit all project styles in /source/css/ * * Second note: Any important declarations are to prevent brand styles from overriding style guide */ @@ -20,14 +20,13 @@ * -----Defaults * -----Breakpoints * MIXINS---------------------------------Sass mixins - * RESET----------------------------------Set reset defaults * GLOBAL ELEMENTS------------------------Establish global styles * -----Main * -----Headings * -----Text-related elements (p, blockquote, lists) * -----Defaults * -----Breakpoints - * STYLE GUIDE INTERFACE------------------CSS for the Style Guide Container. Should not influence the containing styles at all. + * STYLE GUIDE INTERFACE------------------CSS for the Pattern Lab Container. * -----Header * -----Navigation * -----Controls @@ -35,6 +34,7 @@ * -----Viewport * -----Section Headers * -----Code View + * -----Icon Fonts */ @@ -42,7 +42,7 @@ /*------------------------------------*\ - $STYLE GUIDE VARIABLES + $PATTERN LAB VARIABLES \*------------------------------------*/ /*Fonts*/ $sg-font : "HelveticaNeue", "Helvetica", "Arial", sans-serif; @@ -52,7 +52,7 @@ $sg-primary : #222; $sg-secondary : #808080; $sg-tertiary : #ddd; $sg-quaternary : #fff; -$sg-quinary : #f7f7f7; +$sg-quinary : #999; $sg-tint : rgba(255,255,255,0.05); $sg-tint-2 : rgba(255,255,255,0.25); $sg-tone : rgba(0,0,0,0.1); @@ -75,8 +75,8 @@ $offset-top: 2em; /* Breakpoints */ $sg-bp-small : 24em; $sg-bp-small-2 : 30em; -$sg-bp-med : 44em; -$sg-bp-large : 65em; +$sg-bp-med : 48em; +$sg-bp-large : 72em; $sg-bp-xl : 80em; $animate-quick: 0.2s; @@ -86,7 +86,7 @@ $animate-quick: 0.2s; /*------------------------------------*\ - $STYLE GUIDE MIXINS + $PATTERN LAB MIXINS \*------------------------------------*/ @mixin sg-transition($transition-property, $transition-time, $method) { -webkit-transition: $transition-property $transition-time $method; @@ -102,7 +102,7 @@ $animate-quick: 0.2s; /*------------------------------------*\ - $STYLE GUIDE INTERFACE + $PATTERN LAB INTERFACE \*------------------------------------*/ #patternlab-html, #patternlab-body { @@ -128,10 +128,24 @@ $animate-quick: 0.2s; } +//Clearfix +.sg-cf { + /**zoom: 1;*/ + + &:before, &:after { + content: " "; + display: table; + } + + &:after { + clear: both; + } +} + /*------------------------------------*\ - $STYLE GUIDE HEADER + $PATTERN LAB HEADER \*------------------------------------*/ /* Header */ .sg-header { @@ -145,10 +159,6 @@ $animate-quick: 0.2s; z-index: 2; width: 100%; - -webkit-box-shadow: inset 0 1px 0 #5f6164,inset 0 -1px 0 #2e2f2f,0 1px 3px rgba(0,0,0,0.3); - -moz-box-shadow: inset 0 1px 0 #5f6164,inset 0 -1px 0 #2e2f2f,0 1px 3px rgba(0,0,0,0.3); - box-shadow: inset 0 1px 0 #5f6164,inset 0 -1px 0 #2e2f2f,0 1px 3px rgba(0,0,0,0.3); - * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; @@ -164,6 +174,7 @@ $animate-quick: 0.2s; list-style: none; border-bottom: 1px solid $sg-tint; } + a { font-size: $sg-font-size-sm; color: $sg-secondary; @@ -180,35 +191,28 @@ $animate-quick: 0.2s; } } - ol{ - li{ - ol{ - li{ - ol{ - li{ - //3rd level nav item - a { - padding-left: 2em; - text-transform: none; - } - } - } - } - } + ol ol ol a { //3rd level nav item + padding-left: 2em; + text-transform: none; } - } - } /* Navigation */ .sg-header .sg-nav-toggle { - @extend .icon-menu; - padding: $sg-pad; + display: inline-block; + padding: 0.9em $sg-pad; border-bottom: 1px solid rgba(0,0,0,0); position: relative; + text-transform: uppercase; z-index: 2; + + span { + display: inline-block; + padding-right: 0.2em; + } + @media all and (min-width: $sg-bp-med) { display: none; } @@ -218,7 +222,7 @@ $animate-quick: 0.2s; @media all and (max-width: $sg-bp-med) { overflow: hidden; max-height: 0; - @include sg-transition(max-height,0.5s,ease-out); + @include sg-transition(max-height,0.1s,ease-out); &.active { max-height: 50em; @@ -233,7 +237,8 @@ $animate-quick: 0.2s; list-style: none; > li { - + cursor: pointer; + @media all and (min-width: $sg-bp-med) { border-bottom: 0; border-right: 1px solid $sg-tint; @@ -285,11 +290,15 @@ $animate-quick: 0.2s; overflow: hidden; max-height: 0; min-width: 10em; - background: $sg-primary; - @include sg-transition(max-height,0.5s,ease-out); + @include sg-transition(max-height,0.1s,ease-out); + + li { + background: $sg-primary; + } &.active { - max-height: 50em; + max-height: 120em; + overflow: auto; } &.sg-right { @@ -297,6 +306,18 @@ $animate-quick: 0.2s; left: auto; right: 0; } + + &.sg-left { + position: absolute; + left: auto; + } + + [class^="sg-icon-"] { + &:before { + display: inline-block; + margin-right: 0.4em; + } + } } /* Controls (sizing, view mode) */ @@ -306,18 +327,6 @@ $animate-quick: 0.2s; top: 0; right: 0; z-index: 2; - - .sg-acc-panel.active { - max-height: 17em; - } - - .sg-nav-phases .sg-acc-panel { - min-width: 0; - - &.active { - max-height: none; - } - } } .sg-control-trigger { @@ -335,21 +344,13 @@ $animate-quick: 0.2s; .sg-control { > li { + float: left; + @media all and (min-width: $sg-bp-med) { - float: left; border-bottom: 0; border-left: 1px solid $sg-tint; } } -} - - - - -.sg-control { - > li { - float: left; - } .sg-input { padding: 0.1em; @@ -367,53 +368,35 @@ $animate-quick: 0.2s; } } -.sg-quarter { - @media all and (max-width: $sg-bp-large) { - float: left; - width: 25%; - border-left: 1px solid $sg-tint; - text-align: center; +.sg-current-size { + font-size: 70%; + color: $sg-secondary; + padding: 0.85em 0.7em; - &:first-child { - border-left: 0; + &:hover { + .sg-input { + background: $sg-quinary; + color: #000; } } -} -.sg-half { - @media all and (max-width: $sg-bp-large) { + @media all and (min-width: $sg-bp-large) { float: left; - width: 50%; - border-left: 1px solid $sg-tint; - text-align: center; - - &:nth-child(odd) { - border-left: 0; - } } } -.sg-current-size { - font-size: 70%; - color: $sg-secondary; - padding: 0.8em 0.95em; - - &:hover { - .sg-input { - background: $sg-quinary; - color: #000; - } - } +.sg-size { + width: 135px; - @media all and (min-width: $sg-bp-large) { - float: left; - } + @media all and (min-width: $sg-bp-med) { + width: auto; } +} .sg-size-options { - max-width: 10em; @media all and (min-width: $sg-bp-large) { + float: left; position: static; max-height: none; max-width: none; @@ -426,19 +409,33 @@ $animate-quick: 0.2s; } } +//Media Queries Dropdown +#sg-size-mq { + display: none; + + @media all and (min-width: $sg-bp-large) { + display: block; + } +} + #sg-form { margin: 0; border: 0; padding: 0; } + .sg-input { margin: -2px 0 0 0; padding: 0; - border: 1px solid #222; + border: 0; background-color: #222; color: gray; - width: 35px; + width: 25px; text-align: right; + + @media all and (min-width: $sg-bp-med) { + width: 35px; + } } .sg-input-active { @@ -458,7 +455,7 @@ $animate-quick: 0.2s; //Checklist dropdown lists .sg-checkbox { - @extend .icon-checkbox-unchecked; + @extend .sg-icon-radio-unchecked; &:before { display: inline-block; @@ -466,29 +463,76 @@ $animate-quick: 0.2s; } &.active { - @extend .icon-checkbox-checked; + @extend .sg-icon-radio-checked; } } +//Pattern States (active, inprogress, complete, etc) + +/* basic styling */ +.sg-pattern-state:before { + margin-right: 4px; + content: "\2022"; + display: inline-block; + margin-bottom: -4px; + font-size: 18px; + vertical-align: bottom; +} + +/* nav styling */ +.sg-nav .sg-pattern-state:before { + margin-top: -4px; + margin-bottom: 0; + margin-left: -4px; + height: 20px; + display: block; + float: left; +} + +.sg-sub-nav .sg-pattern-state:before { + margin-left: -11px; + margin-right: 4px; +} + +/* call out for pattern's pattern state */ +span.sg-pattern-state { + color: #999; +} + +span.sg-pattern-state:before { + margin-bottom: -3px; + margin-left: 4px; +} + +/* pattern states */ +.inprogress:before { + color: #FF4136 !important; +} + +.inreview:before { + color: #FFCC00 !important; +} + +.complete:before { + color: #2ECC40 !important; +} + /*------------------------------------*\ - $STYLE GUIDE VIEWPORT + $PATTERN LAB VIEWPORT \*------------------------------------*/ /* Viewport */ #sg-vp-wrap { text-align: center; width: 100%; - - @media all and (min-width: $sg-bp-med) { - position: fixed; - top: $offset-top; - bottom: 0; - left: 0; - right: 0; - z-index: 0; - } + position: fixed; + top: $offset-top; + bottom: 0; + left: 0; + right: 0; + z-index: 0; &.wrap-animate { -webkit-transition: left 0.3s ease-out; @@ -522,6 +566,17 @@ $animate-quick: 0.2s; } } +.no-resize { + #sg-cover, #sg-rightpull-container { + display: none; + } + + #sg-viewport { + overflow: hidden !important; + } + +} + #sg-cover { width: 100%; height: 100%; @@ -534,8 +589,9 @@ $animate-quick: 0.2s; #sg-gen-container { height: 100%; position: relative; - text-align: center; - margin: 0px auto; + text-align: center; + margin: 0 auto; + -webkit-overflow-scrolling: touch; overflow-y: auto; overflow-x: hidden; @@ -549,7 +605,7 @@ $animate-quick: 0.2s; } #sg-rightpull-container { - width: 10px; + width: 14px; float: right; margin: 0; height: 100%; @@ -558,7 +614,7 @@ $animate-quick: 0.2s; #sg-rightpull { margin: 0; - width: 10px; + width: 100%; height: 100%; background: #999; -webkit-transition: background $animate-quick ease-out; @@ -590,13 +646,14 @@ $animate-quick: 0.2s; /*------------------------------------*\ - $STYLE GUIDE CONTENT + $PATTERN LAB CONTENT \*------------------------------------*/ /* Section Pattern */ .sg-pattern { margin-bottom: $sg-doublespace; - overflow: hidden; + position: relative; //Prevents absolutely-positioned elements from floating to the top + @extend .sg-cf; } /* Section Head */ @@ -620,13 +677,113 @@ $animate-quick: 0.2s; } } -/* Clean View */ -.sg-clean .sg-main { - padding: 0; +//Annotations and code view container +.sg-view-container { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + font-family: $sg-font; + line-height: 1.4; + font-size: 90%; + background: $sg-primary; + color: $sg-secondary; + position: fixed; + top: auto; + padding: $sg-pad; + bottom: 0; + left: 0; + z-index: 2; + width: 100%; + height: 50%; + overflow-y: auto; + overflow-x: hidden; + + a { + color: $sg-quinary; + } + + pre { + padding: 0 1em; + } + + &.anim-ready { + -webkit-transition: bottom 0.3s ease-out; + -moz-transition: bottom 0.3s ease-out; + -webkit-transition: bottom 0.3s ease-out; + -ms-transition: bottom 0.3s ease-out; + -o-transition: bottom 0.3s ease-out; + transition: bottom 0.3s ease-out; + } +} + +//Annotation and code view close button +.sg-view-close { + width: 100%; + margin-bottom: -10px; +} + +.sg-view-close-btn { + color: #fff; + text-transform: uppercase; + text-decoration: none; + text-align: right; + display: block; } +//Annotated elements Styles +.has-annotation { + cursor: help !important; + box-shadow: 0 0 10px $sg-secondary; + + a, input { + cursor: help !important; + } + + &:hover { + box-shadow: 0 0 10px $sg-primary; + } + + &.active { + box-shadow: inset 0 0 20px $sg-secondary; + } + +} + +.annotation-tip { + display: block; + position: absolute; + margin-top: -10px !important; + margin-left: -10px !important; + width: 25px !important; + height: 25px !important; + border-radius: 13px !important; + text-align: center !important; + background: #444 !important; + color: #fff !important; + font-weight: bold !important; + font-size: 16px !important; + z-index: 100; +} + +#sg-comments-container { + max-width: 60em; + margin: 0 auto; +} + +.sg-comment-container { + padding-bottom: 2em; + margin-bottom: $sg-space; + border-bottom: 1px solid $sg-tint-2; + + p:last-child { + margin-bottom: 0; + } + + h2 { + margin-bottom: 0.25em; + } +} -// Code View Blocks .sg-code, .sg-annotations { clear: both; background: $sg-tertiary; @@ -670,208 +827,127 @@ $animate-quick: 0.2s; font-size: 1em; } -// Demo to show grid system - in this stylesheet because it shouldn't be included in the production styles -.demo { - overflow: hidden; - margin-bottom: 1rem; -} -.demo .gi, .demo .demo-block { - background: $sg-tertiary; - color: $sg-secondary; - text-align: center; - margin-bottom: $sg-pad-half; - padding: 1em !important; - - &:nth-of-type(2n) { - color: $sg-tertiary; - background: $sg-secondary; - } - - .gi { - background: $sg-tone; - color: $sg-tertiary; - - &:nth-of-type(2n) { - background: $sg-tone-2; - } - } -} - -//Demo box for animation -.demo-animate { - background: $sg-tertiary; - padding: $sg-pad; - margin-bottom: $sg-space; - text-align: center; -} - -//Animate Demo to show -.animate-move { - position: relative; - - .demo-shape { - position: absolute; - top: 0; - left: 0; - bottom: 0; - width: 20px; - background: $sg-secondary; - } - - &:hover { - > .demo-shape { - left: 100%; - margin-left: -20px; - } - } -} - -// Style Guide color swatches -.sg-colors { - overflow: hidden; - - li { - overflow: hidden; - border: 1px solid $sg-tertiary; - padding: 0.3em; - margin: 0 0.2em 0.2em 0; - - @media all and (min-width: $sg-bp-small-2) { - float: left; - width: 5em; - } - } -} - -.sg-swatch { - display: block; - height: 1.5em; - width: 50%; - - @media all and (max-width: $sg-bp-small-2) { - float: left; - margin-right: 0.3em; - } - - @media all and (min-width: $sg-bp-small-2) { - width: 100%; - height: 4em; - margin-bottom: 0.2em; - } - +#sg-code-markup { + padding-top: 10px; } -.sg-label { - line-height: 1; +#sg-code-tabs { + list-style: none; + margin: 0; + padding: 0; } -//Annotation -#sg-annotation-container { - position: fixed; - bottom: 0; - left: 0; - z-index: 99; - width: 100%; - padding: $sg-pad; +#sg-code-tabs li { + float: left; + background-color: #333; + font-size: 1.3em; + font-weight: bold; + padding: 5px 15px; + border-top: 2px solid #666; + margin-right: 2px; + cursor: pointer; } - -/* Annotations */ -#sg-annotation-container, #sg-code-container { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - font-family: $sg-font; - font-size: 90%; - background: $sg-primary; - color: $sg-secondary; - position: fixed; - top: auto; - padding: 1rem 1rem 4rem; - bottom: 0; - left: 0; - width: 100%; - z-index: 2; - -webkit-transition: bottom 0.3s ease-out; - -moz-transition: bottom 0.3s ease-out; - -webkit-transition: bottom 0.3s ease-out; - -ms-transition: bottom 0.3s ease-out; - -o-transition: bottom 0.3s ease-out; - transition: bottom 0.3s ease-out; - - a { - color: $sg-tertiary; - } +.sg-code-title-active { + color: #bbb; + background-color: #272822 !important; } -#sg-code-container pre { - max-height: 300px; - padding: 0 1em; +div.clear { + clear: both; } -#sg-code-container .with-css pre { - max-height: 200px; +.sg-code-patternname { + color: #aaa; } -#sg-annotation-close-btn, #sg-code-close-btn { - color: #fff; +#sg-code-loader { + display: none; position: absolute; - top: 1em; - right: 1em; - text-transform: uppercase; - text-decoration: none; - text-align: right; + left: 45%; + top: 20%; + width: 150px; + padding: 10px; + text-align: center; + border-radius: 10px; + background-color: #000; + z-index: 100; } -.has-comment, .has-comment a { - cursor: help !important; +.spinner { + height: 30px; + width: 30px; + margin-left: auto; margin-right: auto; + background-position: center center; + background-repeat: no-repeat; + background: url('../images/spinner.gif'); + border-radius: 50%; + opacity: .7; } -// Icon Font - +/* Pattern Lab icon fonts */ @font-face { - font-family: 'icons'; - src:url('../assets/icons.eot'); - src:url('../assets/icons.eot?#iefix') format('embedded-opentype'), - url('../assets/icons.woff') format('woff'), - url('../assets/icons.ttf') format('truetype'), - url('../assets/icons.svg#icons') format('svg'); + font-family: 'icomoon'; + src:url('../fonts/icomoon.eot?srsv7g'); + src:url('../fonts/icomoon.eot?#iefixsrsv7g') format('embedded-opentype'), + url('../fonts/icomoon.woff?srsv7g') format('woff'), + url('../fonts/icomoon.ttf?srsv7g') format('truetype'), + url('../fonts/icomoon.svg?srsv7g#icomoon') format('svg'); font-weight: normal; font-style: normal; } -/* Pattern Lab icon fonts */ -.icon-reload, .icon-cog, .icon-minus, .icon-plus, .icon-menu, .icon-checkbox-unchecked, .icon-checkbox-checked, .icon-eye { - font-family: 'icons'; +.sg-icon-search, .sg-icon-cog, .sg-icon-minus, .sg-icon-plus, .sg-icon-menu, .sg-icon-radio-checked, .sg-icon-radio-unchecked, .sg-icon-file, .sg-icon-link, .sg-icon-keyboard, .sg-icon-qrcode, .sg-icon-eye, .sg-checkbox { + font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; + + /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.sg-icon-search:before { + content: "\e600"; + font-size: 85%; } -.icon-reload:before { - content: "\e002"; +.sg-icon-cog:before { + content: "\e601"; } -.icon-cog:before { - content: "\e000"; +.sg-icon-minus:before { + content: "\e602"; } -.icon-minus:before { - content: "\e003"; +.sg-icon-plus:before { + content: "\e603"; } -.icon-plus:before { - content: "\e004"; +.sg-icon-menu:before { + content: "\e604"; } -.icon-menu:before { - content: "\e005"; +.sg-icon-radio-checked:before, .sg-checkbox.active:before { + content: "\e605"; } -.icon-checkbox-unchecked:before { - content: "\e006"; +.sg-icon-radio-unchecked:before, .sg-checkbox:before { + content: "\e606"; } -.icon-checkbox-checked:before { - content: "\e007"; +.sg-icon-file:before { + content: "\e607"; } -.icon-eye:before { - content: "\e001"; +.sg-icon-link:before { + content: "\e608"; } +.sg-icon-keyboard:before { + content: "\e609"; +} +.sg-icon-qrcode:before { + content: "\e60a"; +} +.sg-icon-eye:before { + content: "\e60b"; +} + +/******************************************************************/ +/* End Pattern Lab Interface code */ \ No newline at end of file diff --git a/public/styleguide/fonts/icomoon.eot b/public/styleguide/fonts/icomoon.eot new file mode 100644 index 0000000000000000000000000000000000000000..a4482691897b80c52e5ef3d9c4269617865c24e6 GIT binary patch literal 3872 zcma)9O>7&-6@G7q+!cSc(n_Q#DHXjUtx&NOT7MK{NLDt6l2nF;ByC-^fP+#|WXXkT z39$>|PU0xFP04@Kca4h7N%4A4Ul0qR3h1Z@JaZ4mU3qB%5|q9yyi zS+2BH9mhk?zW+CWZ{Ey!14M5)L`;f$3)3AI&iR*m`Jx+?kDr}-`KXM@q06*MyHrQr zrK?bI=xek^+w?uULL2ltI3x5;a9*ct&=nnzW~odwM)#;Sn9^X18l-9F#jl^5>nr@{ zJ#c=FTHCB|?2TV||5Ye`1@!stjca>=gP?Z+`?jy#ytMY+zgVEbPu}0z+IX$=&gDN7 zrG3a3cfg1h)GX*5ppWm=uiqH+F#t;61?^wi-P{=XYyVl$AA&B_H*W0FIr=A2KS=Vf zZq&C{N8kPfpyMc!QgWg3x3ZPFl>MU6E!eMo$AKsSh$VPu?e~&VM@{@CY~=oI8ITk994K03RlX z)`0O6@DLQ$)27M8b|21zwDT$d3%xx>t3*?!vbI-rWudH!1xIBwc{M+`qN-M29pk)O ztgdjGOH+lisw}KPl!uC=iu~Elcp{mIrQEcYUwD3c`uT;tz@fsiiGEfwE52>Hu4`Ks z_u1|HkCls=OtJh}2%p@JTQSA`6UPcep{YPC?WSVz8^3Ayv1QqCVO@_JiUTvFofamp zMLu1?7%CV=JGmc=c;*qjOVK>x|*w&R`fF*KRO&mYf5R& zCs&tamTkq-wX}iDt0!4&rPj`IAU>lbVtpnM^SKW7kGjdEJK7(@dp#aBudTt+|21&v z;Yb66QD5TItoc61?9nLEuvw=`EYum6m7A2MBOS9ex3m@0g0(%tc(4{S4iNFxoxcSH zRZ$lIB*Vo7OAJgff?$cIi6u5oNJIn;@n`qMw{dkZbo>Aodk>Qy8W1AfBad6$0A?eL z(C}pT;OB9(?H|-e&BG6YkKNSme}&5cHfnx2$kE{ml3BmNCWR5xScf;GSnXGTo7tC9rDys-ET zukf7kI0JcJ+el>#k4us$*=C4_?{MMqP`|9JcGnNj8T$pu_#-v+RQW0Qsyj5~N|w-S zT50Sol}sd(^~BiNXhJ1XW_280Ul+BXJ(^n7F~6h4vMy~6Db`B!w3!T*7#$x?)TITW zV`GWAzCm{|vF?iEPrpQQ(CsQlo#VhK@|4f}$R!h0pb|Za1AdW~kWZh(>G>jkgT9Tq zHEE?cMvC@)wphub&X>Lj%NhYRvQKbjGCMC=<=~^dHrc5}Jf29|>Hur`e$Drrk?+3e z`92n%Jqepe4dPmj_r~m9m~YHPq4&QJ0ZPsMG3L_;`!I&n*P&sY@iP8tjDLm} za4Iij23F~-be>+q9DIu|QjK1t9bAm|=sMk?H*m|jO+Ta`(H(k|enNL?pWdRM(=X^A zy-mNuou^5^rQgx}bf5k}AJB)?qL1nC^eOUMF*{$W&dSWm98UF;b}u;$4W!^=@c~e# z_lso07uzY+DypoJK;b_O<{qFc`cZz=KIBLJN?%1s>VBi)VdMLVu@Gy82p0B{OUv`x zzR||FVGw+3Arghnknlq!;2e-(@1usLhWIjnZknDUNV+iSDf-?FbwkJm%tuA>5C1>| zu5W;lKn!7UkaA{`kMp~M``^oS3A+nt77~%UZIyLVt}3{>IJ$__N$xYat{{OeRvjH) z%H(7#<&o5Kw%oy@M;z0M^|O_sp~~6y6NlKXbY|GKZFe}6cJkh&>rQ%k=a7f|sw7Qw zc*8P;0{fPv3itaA2bRzWnBo4FLe1D`0*|t1Ad{4$MG0*y10cK(p(o$B5Q3TsyLPaM>2YV z2R;Kl@EPEN&j1g62Dk;=(_P!ZXYT{=!4JV6oy(iM_1)d8N8XjaZ^|A640;Q%N_k;! eAgyj8#d`EA-NbhdgW9F_gSV;KH%DhPLjMm<*A#C6 literal 0 HcmV?d00001 diff --git a/public/styleguide/fonts/icomoon.svg b/public/styleguide/fonts/icomoon.svg new file mode 100644 index 000000000..d69b0abd4 --- /dev/null +++ b/public/styleguide/fonts/icomoon.svg @@ -0,0 +1,22 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/styleguide/fonts/icomoon.ttf b/public/styleguide/fonts/icomoon.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b4fc4ac20e5af2716a5ce3e3d65cdeee287a2722 GIT binary patch literal 3708 zcma)9O>7&-6@G7qyDO3srIkogQYv~yTA^Ymv?Y;Z49UvYP<~`sNdH{4fP+#|WXXkT z3AGE@Kw%KA4?PrU4mtGT0xFP04@Kca4h7N#EYL#^0pdeY1Z@JaKL~nA(Hxpf(USe% zELU8rj^m+b-_N}F&EK0hBVr;-QiC*|e(~$476$VF`5iRBMXhbsH}|J5zWXu}e+lx1 zoz3g}pd*lXK?ioO-nzX0-9Ouqp-&zLTI{XSfW*3KvV zFO2pStr5)@OWIl0m2ycH@+p-`=hWiDs;b&Kb&PXrsk+J~F3#pls#0D>Qw}C6Rp3u= zS@A?XmUIX0T=}`Vx#!9`p`-a@(?hIcwzXrsuItz~4>;}nkCh7PbfNTENT1xX?3m)A z>0|lP&{e2C=q6*pwQe~BY}*bX>>E)>0Wd4tX<^}7wqIMTsL6iYD8o*!V&9!(I9nSGkU zMxABZxf$6y(lJ|eOWQFmT-y_lM{1$skP)oz`jrt>1=;+Q42Wr#7?@@R!7@u1%WS%k zhzL63Pwxq~fw~t0KS0Ia!&-X|axy&fxWx@{4zdW1&14RL9yiLfJjK!^LRyN+VO{C5hXYDj|&qqQr7-cuJynYB;3aikgdC+m8mn05qcx z;)vnmj7P`&2&4Vt!9B`Y$RfnVzL}tQL-o+3$=i$6dmx;vxo$#nTJp z3-fYXaBfbg$J6tL%Giv%m|1jZ5BDT9!*8!R>G5o$m2ig!28P@O*MzeYgU)Scj#-xG z6&x6)_)@LiY&P00rVgU6TYtFX3??jbY#T=d;U%);X=jRY4i&t$WyOGXseOkVjSe+E zDZyG6Nb^Vh7G_j8bK$%_%qdQfn_*Wa36!|J^bD`^g6KGn_MCQ*%F2&Rk|;W6ibkK} z{Ntg0NmrdN4lfx0GTQhfHTqQPDfgN?I_gT6&}vR;oGg`y#}oDVtd|_b39f@zaV)*kfFdT8ahEZ@z zVIe)`^8s?nH07yCPtrWra~b*cS=^p4(l_YaSX+};`eUTvEM^LoEb3zM^SF#@fJNpB zuFPZ>g{vHXl-DLF8Mmx>(ou(8%lB)(-;8_@JkR&B>Fi0^G-_zB)%ZZ%+RYGvec^oL zCI<=mkk(@*GCdX0WYcjq=pMa6zrmZQNx!Fe=v}%`@6!kLA+_jl z^mqCMd99FHtW@V^Ka6G{U@P`f zebhhHM{#AWVk7mS(eQBaeZ*MEwL%6P`^cr`d2QcV4H2}@N!A%0&XXH&)~U&1h!O7>F`k|H(N1>q?UE$4HmuPm`-e*tBj6T z&TX9NakmH4W3J=4W9h+E&YN-F884UW>5yNQq-hRcSVmA#-e`k2*GfLvZ zM0v0D+E05FH@=UX4F5C8eQFB)ASH%TJm3v0FTf=B)^~t+|iPvUw6mGCi@06R^XrS>NWV| zT|Nf>VwbmQ98zF!dY;7b?=2yWD18qKn?ZhXx19SoZv|Mc z5bqX^KQ;G5wWq3)ILd?9MSJw^Yabk`Y9=nXlzg6Ud9^iFhltxl{&vykCy)M8OC)ip z$bUvO^HZk6T92=lxKZ*;McYscG(@Y=yG{Nwqvh>``YKNialZpdJ4AClGX7IzL$i<8 zw2^Z1jg~_ZFq=V=B!0BI!PC%C50Z(vm$b)C+G9D|BjzV_VZ;7;#7w`^f_2(;&BvY~ zg>P01``sF0my_ZBYhev(tzNTk{bTvhKDW7ON69OD-l#}xr#t@^f1!Wt7XPc;w-}~S zpsm7e6Q)R*Vqvxm^MWuh3bR9)oxiW`PLZJ^bW#JD%Ld0-b?iAjqBZva-075hQ}|I*IlhCs|LRClL9V zyWgBHyBcR_f=Z{-$@_OEvHu2BdX%0s5q{M@J?*~AB4@}|_>F$1D<8?VSU-lB@Y2{A z862y}TCA#NSwQE>G64BWgC4o}g}1 zZDbXukJA!W1+h+7jAyzewrXC@DR+fgORTaIOC}ETa2Jbo_68%J{L3%d z>2NR-jBv{Ij^bC*QLaj=#73iE;iy++Mw_t8+r-~}hbb))f5^vg-eeOKc(ZbX>&1GZ z9PBwA3HI>nYS!CDLcv8fxMnTI52=i^l*tCY9DA58&NJN5X;LE z6D(<$Qz(Hq2(~D$5iXcs*S~BGLq}kUG$rD(UvpamRSkYXeJMzt^0KPJw3FzF_##9q3V#u zP)?(|1@y2S{l5PPmF#G$PgOFCbFNqh#u6D+zQC!r1(>bRCMGdclI51lTaqi!)apyk zAzPBjP9c#giT!)=q7qyvS*o}wOD>hTz}Xj2RyvEs|DR3P&1m0yaMR?bN6qO9BS1z1iLzE3D&)TP z?9SWouYP$JR)`@0rk__L*?#_(sg&j<&VZ?~s0T4uI^C24U8d5ElJJb{fdz`miqgNd z{6)UNPn$}!IRN_rQYu!sl-8H%C}oUph*_a5&F2vROd6XBzn#Vm){~cdlFR7ywKa`% zVIx$FXJTGXjL=MB6XCKnPHCq2lx7O2G*fsP 0) { + + count++; + item.displaynumber = count; + + for (var i = 0; i < els.length; ++i) { + els[i].onclick = (function(item) { + return function(e) { - // if this is for an overlay and comments overlay is false set the payload to turn the overlay on - annotationsPattern.commentsOverlay = true; - obj = { "commentOverlay": "on", "swapOverlay": false, "el": item.el, "title": item.title, "comment": item.comment }; - - } else if (annotationsPattern.commentsOverlayActive && annotationsPattern.commentsOverlay) { - - if (item.el == annotationsPattern.commentsOverlayElement) { - - // if the last element was clicked again turn off the overlay - annotationsPattern.commentsOverlay = false; - obj = { "commentOverlay": "off" }; + if (annotationsPattern.commentsOverlayActive) { - } else { + e.preventDefault(); + e.stopPropagation(); // if an element was clicked on while the overlay was already on swap it - obj = { "commentOverlay": "on", "swapOverlay": true, "el": item.el, "title": item.title, "comment": item.comment }; + var obj = JSON.stringify({ "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment }); + parent.postMessage(obj,annotationsPattern.targetOrigin); } } - - annotationsPattern.commentsOverlayElement = item.el; - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - parent.postMessage(obj,targetOrigin); - - } - })(item); + })(item); + } } + + } + + } else { + + var obj = JSON.stringify({ "commentOverlay": "off" }); + parent.postMessage(obj,annotationsPattern.targetOrigin); + } }, @@ -109,10 +108,14 @@ var annotationsPattern = { */ findParent: function(el) { - if (el.parentNode.classList.contains("sg-pattern")) { + var parentEl; + + if (el.classList.contains("sg-pattern")) { + return el; + } else if (el.parentNode.classList.contains("sg-pattern")) { return el.parentNode; } else { - var parentEl = annotationsPattern.findParent(el.parentNode); + parentEl = annotationsPattern.findParent(el.parentNode); } return parentEl; @@ -126,60 +129,138 @@ var annotationsPattern = { */ receiveIframeMessage: function(event) { + var data = (typeof event.data !== "string") ? event.data : JSON.parse(event.data); + // does the origin sending the message match the current host? if not dev/null the request if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { return; } - if (event.data.commentToggle != undefined) { + if ((data.resize !== undefined) && (annotationsPattern.commentsOverlayActive)) { + + for (var i = 0; i < annotationsPattern.trackedElements.length; ++i) { + var el = annotationsPattern.trackedElements[i]; + if (window.getComputedStyle(el.element,null).getPropertyValue("max-height") == "0px") { + el.element.firstChild.style.display = "none"; + var obj = JSON.stringify({"annotationState": false, "displayNumber": el.displayNumber }); + parent.postMessage(obj,annotationsPattern.targetOrigin); + } else { + el.element.firstChild.style.display = "block"; + var obj = JSON.stringify({"annotationState": true, "displayNumber": el.displayNumber }); + parent.postMessage(obj,annotationsPattern.targetOrigin); + } + } + + } else if (data.commentToggle !== undefined) { + + var i, els, item, displayNum; // if this is an overlay make sure it's active for the onclick event annotationsPattern.commentsOverlayActive = false; annotationsPattern.commentsEmbeddedActive = false; // see which flag to toggle based on if this is a styleguide or view-all page - var body = document.getElementsByTagName("body"); - if ((event.data.commentToggle == "on") && (body[0].classList.contains("sg-pattern-list"))) { + if ((data.commentToggle === "on") && (document.getElementById("sg-patterns") !== null)) { annotationsPattern.commentsEmbeddedActive = true; - } else if (event.data.commentToggle == "on") { + } else if (data.commentToggle === "on") { annotationsPattern.commentsOverlayActive = true; } - // if comments overlay is turned off make sure to remove the has-comment class and pointer + // if comments overlay is turned off make sure to remove the has-annotation class and pointer if (!annotationsPattern.commentsOverlayActive) { - var els = document.querySelectorAll(".has-comment"); - for (var i = 0; i < els.length; i++) { - els[i].classList.remove("has-comment"); + els = document.querySelectorAll(".has-annotation"); + for (i = 0; i < els.length; i++) { + els[i].classList.remove("has-annotation"); + } + els = document.querySelectorAll(".annotation-tip"); + for (i = 0; i < els.length; i++) { + els[i].style.display = "none"; } } // if comments embedding is turned off make sure to hide the annotations div if (!annotationsPattern.commentsEmbeddedActive) { - var els = document.getElementsByClassName("sg-annotations"); - for (var i = 0; i < els.length; i++) { + els = document.getElementsByClassName("sg-annotations"); + for (i = 0; i < els.length; i++) { els[i].style.display = "none"; } } - // if comments overlay is turned on add the has-comment class and pointer + // if comments overlay is turned on add the has-annotation class and pointer if (annotationsPattern.commentsOverlayActive) { - for (comment in comments.comments) { - var item = comments.comments[comment]; - var els = document.querySelectorAll(item.el); - for (var i = 0; i < els.length; i++) { - els[i].classList.add("has-comment"); + var count = 0; + + for (i = 0; i < comments.comments.length; i++) { + item = comments.comments[i]; + els = document.querySelectorAll(item.el); + + var state = true; + + if (els.length) { + + count++; + + //Loop through all items with annotations + for (k = 0; k < els.length; k++) { + + els[k].classList.add("has-annotation"); + + var span = document.createElement("span"); + span.innerHTML = count; + span.classList.add("annotation-tip"); + + if (window.getComputedStyle(els[k],null).getPropertyValue("max-height") == "0px") { + span.style.display = "none"; + state = false; + } + + annotationsPattern.trackedElements.push({ "itemel": item.el, "element": els[k], "displayNumber": count, "state": state }); + + els[k].insertBefore(span,els[k].firstChild); + + } + } + } + // count elements so it can be used when displaying the results in the viewer + var count = 0; + + // iterate over the comments in annotations.js + for(i = 0; i < comments.comments.length; i++) { + + var state = true; + + var item = comments.comments[i]; + var els = document.querySelectorAll(item.el); + + // if an element is found in the given pattern add it to the overall object so it can be passed when the overlay is turned on + if (els.length > 0) { + count++; + for (k = 0; k < els.length; k++) { + if (window.getComputedStyle(els[k],null).getPropertyValue("max-height") == "0px") { + state = false; + } + } + annotationsPattern.commentsGathered.comments[count] = { "el": item.el, "title": item.title, "comment": item.comment, "number": count, "state": state }; + } + + } + + // send the list of annotations for the page back to the parent + var obj = JSON.stringify(annotationsPattern.commentsGathered); + parent.postMessage(obj,annotationsPattern.targetOrigin); + } else if (annotationsPattern.commentsEmbeddedActive && !annotationsPattern.commentsEmbedded) { // if comment embedding is turned on and comments haven't been embedded yet do it - for (comment in comments.comments) { - var item = comments.comments[comment]; - var els = document.querySelectorAll(item.el); + for (i = 0; i < comments.comments.length; i++) { + item = comments.comments[i]; + els = document.querySelectorAll(item.el); if (els.length > 0) { - annotationsPattern.embedComments(els[0],item.title,item.comment); + annotationsPattern.embedComments(els[0],item.title,item.comment); //Embed the comment } annotationsPattern.commentsEmbedded = true; } @@ -187,8 +268,8 @@ var annotationsPattern = { } else if (annotationsPattern.commentsEmbeddedActive && annotationsPattern.commentsEmbedded) { // if comment embedding is turned on and comments have been embedded simply display them - var els = document.getElementsByClassName("sg-annotations"); - for (var i = 0; i < els.length; ++i) { + els = document.getElementsByClassName("sg-annotations"); + for (i = 0; i < els.length; ++i) { els[i].style.display = "block"; } @@ -201,12 +282,27 @@ var annotationsPattern = { }; // add the onclick handlers to the elements that have an annotations -annotationsPattern.showComments(); +annotationsPattern.gatherComments(); window.addEventListener("message", annotationsPattern.receiveIframeMessage, false); // before unloading the iframe make sure any active overlay is turned off/closed window.onbeforeunload = function() { - var obj = { "commentOverlay": "off" }; - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - parent.postMessage(obj,targetOrigin); -}; \ No newline at end of file + var obj = JSON.stringify({ "commentOverlay": "off" }); + parent.postMessage(obj,annotationsPattern.targetOrigin); +}; + +// tell the parent iframe that keys were pressed + +// toggle the annotations panel +jwerty.key('ctrl+shift+a', function (e) { + var obj = JSON.stringify({ "keyPress": "ctrl+shift+a" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); + +// close the annotations panel if using escape +jwerty.key('esc', function (e) { + var obj = JSON.stringify({ "keyPress": "esc" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); \ No newline at end of file diff --git a/public/styleguide/js/annotations-viewer.js b/public/styleguide/js/annotations-viewer.js index ea0fbea09..79bfd2093 100644 --- a/public/styleguide/js/annotations-viewer.js +++ b/public/styleguide/js/annotations-viewer.js @@ -8,90 +8,208 @@ var annotationsViewer = { - commentsActive: false, - sw: document.documentElement.clientWidth, - breakpoint: 650, + // set-up default sections + commentsActive: false, + commentsViewAllActive: false, + targetOrigin: (window.location.protocol === "file:") ? "*" : window.location.protocol+"//"+window.location.host, + moveToOnInit: 0, + /** + * add the onclick handler to the annotations link in the main nav + */ onReady: function() { + // not sure this is used anymore... $('body').addClass('comments-ready'); + + $(window).resize(function() { + if(!annotationsViewer.commentsActive) { + annotationsViewer.slideComment($('#sg-annotation-container').outerHeight()); + } + }); + $('#sg-t-annotations').click(function(e) { e.preventDefault(); - // make sure the code view overlay is off - $('#sg-t-code').removeClass('active'); - codeViewer.codeActive = false; - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - document.getElementById('sg-viewport').contentWindow.postMessage({ "codeToggle": "off" },targetOrigin); - codeViewer.slideCode(999); - + // remove the class from the "eye" nav item + $('#sg-t-toggle').removeClass('active'); + + // turn the annotations section on and off annotationsViewer.toggleComments(); - annotationsViewer.commentContainerInit(); }); + // initialize the annotations viewer + annotationsViewer.commentContainerInit(); + + // load the query strings in case code view has to show by default + var queryStringVars = urlHandler.getRequestVars(); + if ((queryStringVars.view !== undefined) && ((queryStringVars.view === "annotations") || (queryStringVars.view === "a"))) { + annotationsViewer.openComments(); + if (queryStringVars.number !== undefined) { + annotationsViewer.moveToOnInit = queryStringVars.number; + } + } + }, + /** + * decide on if the annotations panel should be open or closed + */ toggleComments: function() { - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - $('#sg-t-annotations').toggleClass('active'); - if (!annotationsViewer.commentsActive) { - - annotationsViewer.commentsActive = true; - document.getElementById('sg-viewport').contentWindow.postMessage({ "commentToggle": "on" },targetOrigin); - + annotationsViewer.openComments(); } else { - - annotationsViewer.commentsActive = false; - document.getElementById('sg-viewport').contentWindow.postMessage({ "commentToggle": "off" },targetOrigin); - annotationsViewer.slideComment(999); - + annotationsViewer.closeComments(); } }, - commentContainerInit: function() { + /** + * open the annotations panel + */ + openComments: function() { - if (document.getElementById("sg-annotation-container") == undefined) { - $('').html('Close

Annotation Title

Here is some comment text
').appendTo('body').css('bottom',-$(document).outerHeight()); - } + // make sure the code view overlay is off before showing the annotations view + $('#sg-t-code').removeClass('active'); + codeViewer.codeActive = false; + var obj = JSON.stringify({ "codeToggle": "off" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); + codeViewer.slideCode(999); - if (annotationsViewer.sw < annotationsViewer.breakpoint) { - $('#sg-annotation-container').hide(); - } else { - $('#sg-annotation-container').show(); + // tell the iframe annotation view has been turned on + var obj = JSON.stringify({ "commentToggle": "on" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); + + // note that it's turned on in the viewer + annotationsViewer.commentsActive = true; + $('#sg-t-annotations').addClass('active'); + }, + + /** + * close the annotations panel + */ + closeComments: function() { + annotationsViewer.commentsActive = false; + var obj = JSON.stringify({ "commentToggle": "off" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); + annotationsViewer.slideComment($('#sg-annotation-container').outerHeight()); + $('#sg-t-annotations').removeClass('active'); + }, + + /** + * add the basic mark-up and events for the annotations container + */ + commentContainerInit: function() { + + // the bulk of this template is in core/templates/index.mustache + if (document.getElementById("sg-annotation-container") === null) { + $('
').html($("#annotations-template").html()).appendTo('body').css('bottom',-$(document).outerHeight()); + setTimeout(function(){ $('#sg-annotation-container').addClass('anim-ready'); },50); //Add animation class once container is positioned out of frame } - $('body').delegate('#sg-annotation-close-btn','click',function(e) { + // make sure the close button handles the click + $('body').delegate('#sg-annotation-close-btn','click',function() { + annotationsViewer.commentsActive = false; + $('#sg-t-annotations').removeClass('active'); annotationsViewer.slideComment($('#sg-annotation-container').outerHeight()); + var obj = JSON.stringify({ "commentToggle": "off" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); return false; }); }, + /** + * slides the panel + */ slideComment: function(pos) { + $('#sg-annotation-container').css('bottom',-pos); + }, + + /** + * moves to a particular item in the viewer + */ + moveTo: function(number) { + if (document.getElementById("annotation-"+number) !== undefined) { + var top = document.getElementById("annotation-"+number).offsetTop; + $('#sg-annotation-container').animate({scrollTop: top - 10}, 600); + } + }, + + /** + * when turning on or switching between patterns with annotations view on make sure we get + * the annotations from from the pattern via post message + */ + updateComments: function(comments) { - $('#sg-annotation-container').show(); + var commentsContainer = document.getElementById("sg-comments-container"); + + // clear out the comments container + if (commentsContainer.innerHTML !== "") { + commentsContainer.innerHTML = ""; + } - if (annotationsViewer.sw > annotationsViewer.breakpoint) { - $('#sg-annotation-container').css('bottom',-pos); + // see how many comments this pattern might have. if more than zero write them out. if not alert the user to the fact their aren't any + var count = Object.keys(comments).length; + if (count > 0) { + + for (i = 1; i <= count; i++) { + + var displayNum = comments[i].number; + + var span = document.createElement("span"); + span.id = "annotation-state-" + displayNum; + span.style.fontSize = "0.8em"; + span.style.color = "#666"; + if (comments[i].state === false) { + span.innerHTML = " hidden"; + } + + var h2 = document.createElement("h2"); + h2.innerHTML = displayNum + ". " + comments[i].title; + h2.appendChild(span); + + var div = document.createElement("div"); + div.innerHTML = comments[i].comment; + + var commentDiv = document.createElement("div"); + commentDiv.classList.add("sg-comment-container"); + commentDiv.id = "annotation-" + displayNum; + commentDiv.appendChild(h2); + commentDiv.appendChild(div); + + commentsContainer.appendChild(commentDiv); + + } + } else { - var offset = $('#sg-annotation-container').offset().top; - $('html,body').animate({scrollTop: offset}, 500); + + var h2 = document.createElement("h2"); + h2.innerHTML = "No Annotations"; + + var div = document.createElement("div"); + div.innerHTML = "There are no annotations for this pattern."; + + var commentDiv = document.createElement("div"); + commentDiv.classList.add("sg-comment-container"); + commentDiv.appendChild(h2); + commentDiv.appendChild(div); + + commentsContainer.appendChild(commentDiv); + + } + + // slide the comment section into view + annotationsViewer.slideComment(0); + + if (annotationsViewer.moveToOnInit != "0") { + annotationsViewer.moveTo(annotationsViewer.moveToOnInit); + annotationsViewer.moveToOnInit = "0"; } - }, - - updateComment: function(el,title,msg) { - var $container = $('#sg-annotation-container'), - $title = $('#sg-annotation-title'), - $text = $('#sg-annotation-text'); - $title.text(title); - $text.html(msg); - annotationsViewer.slideComment(0); }, /** @@ -101,24 +219,43 @@ var annotationsViewer = { */ receiveIframeMessage: function(event) { + var data = (typeof event.data !== "string") ? event.data : JSON.parse(event.data); + // does the origin sending the message match the current host? if not dev/null the request - if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { + if ((window.location.protocol !== "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { return; } - if (event.data.commentOverlay != undefined) { - if (event.data.commentOverlay == "on") { - - annotationsViewer.updateComment(event.data.el,event.data.title,event.data.comment); - + if (data.commentOverlay !== undefined) { + if (data.commentOverlay === "on") { + annotationsViewer.updateComments(data.comments); } else { annotationsViewer.slideComment($('#sg-annotation-container').outerHeight()); } + } else if (data.annotationState !== undefined) { + document.getElementById("annotation-state-"+data.displayNumber).innerHTML = (data.annotationState == true) ? "" : " hidden"; + } else if (data.displaynumber !== undefined) { + annotationsViewer.moveTo(data.displaynumber); + } else if (data.keyPress !== undefined) { + if (data.keyPress == 'ctrl+shift+a') { + annotationsViewer.toggleComments(); + return false; + } else if (data.keyPress == 'esc') { + if (annotationsViewer.commentsActive) { + annotationsViewer.closeComments(); + return false; + } + } + } else if (data.patternpartial !== undefined) { + if (annotationsViewer.commentsViewAllActive && (data.patternpartial.indexOf("viewall-") != -1)) { + var obj = JSON.stringify({ "commentToggle": "on" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); + } } } -} +}; $(document).ready(function() { annotationsViewer.onReady(); }); window.addEventListener("message", annotationsViewer.receiveIframeMessage, false); @@ -126,8 +263,8 @@ window.addEventListener("message", annotationsViewer.receiveIframeMessage, false // make sure if a new pattern or view-all is loaded that comments are turned on as appropriate $('#sg-viewport').load(function() { if (annotationsViewer.commentsActive) { - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - document.getElementById('sg-viewport').contentWindow.postMessage({ "commentToggle": "on" },targetOrigin); + var obj = JSON.stringify({ "commentToggle": "on" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,annotationsViewer.targetOrigin); } }); @@ -136,3 +273,17 @@ $('#sg-view li a').click(function() { $(this).parent().parent().removeClass('active'); $(this).parent().parent().parent().parent().removeClass('active'); }); + +// toggle the annotations panel +jwerty.key('ctrl+shift+a', function (e) { + annotationsViewer.toggleComments(); + return false; +}); + +// close the annotations panel if using escape +jwerty.key('esc', function (e) { + if (annotationsViewer.commentsActive) { + annotationsViewer.closeComments(); + return false; + } +}); \ No newline at end of file diff --git a/public/styleguide/js/code-pattern.js b/public/styleguide/js/code-pattern.js index 96bfd4ff8..f8a949519 100644 --- a/public/styleguide/js/code-pattern.js +++ b/public/styleguide/js/code-pattern.js @@ -1,7 +1,7 @@ /*! * Code View Support for Patterns - v0.3 * - * Copyright (c) 2013 Dave Olsen, http://dmolsen.com + * Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com * Licensed under the MIT license * */ @@ -10,6 +10,7 @@ var codePattern = { codeOverlayActive: false, codeEmbeddedActive: false, + targetOrigin: (window.location.protocol === "file:") ? "*" : window.location.protocol+"//"+window.location.host, /** * toggle the annotation feature on/off @@ -18,29 +19,32 @@ var codePattern = { */ receiveIframeMessage: function(event) { + var data = (typeof event.data !== "string") ? event.data : JSON.parse(event.data); + // does the origin sending the message match the current host? if not dev/null the request if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { return; } - if (event.data.codeToggle != undefined) { + if (data.codeToggle !== undefined) { + + var els, i; // if this is an overlay make sure it's active for the onclick event codePattern.codeOverlayActive = false; codePattern.codeEmbeddedActive = false; // see which flag to toggle based on if this is a styleguide or view-all page - var body = document.getElementsByTagName("body"); - if ((event.data.codeToggle == "on") && (body[0].classList.contains("sg-pattern-list"))) { + if ((data.codeToggle == "on") && (document.getElementById("sg-patterns") !== null)) { codePattern.codeEmbeddedActive = true; - } else if (event.data.codeToggle == "on") { + } else if (data.codeToggle == "on") { codePattern.codeOverlayActive = true; } // if comments embedding is turned off make sure to hide the annotations div - if (!codePattern.codeEmbeddedActive && (body[0].classList.contains("sg-pattern-list"))) { - var els = document.getElementsByClassName("sg-code"); - for (var i = 0; i < els.length; i++) { + if (!codePattern.codeEmbeddedActive && (document.getElementById("sg-patterns") !== null)) { + els = document.getElementsByClassName("sg-code"); + for (i = 0; i < els.length; i++) { els[i].style.display = "none"; } } @@ -48,15 +52,14 @@ var codePattern = { // if comments overlay is turned on add the has-comment class and pointer if (codePattern.codeOverlayActive) { - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - obj = { "codeOverlay": "on", "lineage": lineage, "html": document.getElementById("sg-pattern-html").textContent, "css": document.getElementById("sg-pattern-css").textContent }; - parent.postMessage(obj,targetOrigin); + var obj = JSON.stringify({ "codeOverlay": "on", "lineage": lineage, "lineageR": lineageR, "patternPartial": patternPartial, "patternState": patternState, "cssEnabled": cssEnabled }); + parent.postMessage(obj,codePattern.targetOrigin); } else if (codePattern.codeEmbeddedActive) { // if code embedding is turned on simply display them - var els = document.getElementsByClassName("sg-code"); - for (var i = 0; i < els.length; ++i) { + els = document.getElementsByClassName("sg-code"); + for (i = 0; i < els.length; ++i) { els[i].style.display = "block"; } @@ -73,7 +76,43 @@ window.addEventListener("message", codePattern.receiveIframeMessage, false); // before unloading the iframe make sure any active overlay is turned off/closed window.onbeforeunload = function() { - var obj = { "codeOverlay": "off" }; - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - parent.postMessage(obj,targetOrigin); -}; \ No newline at end of file + var obj = JSON.stringify({ "codeOverlay": "off" }); + parent.postMessage(obj,codePattern.targetOrigin); +}; + +// tell the parent iframe that keys were pressed + +// toggle the code panel +jwerty.key('ctrl+shift+c', function (e) { + var obj = JSON.stringify({ "keyPress": "ctrl+shift+c" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); + +// when the code panel is open hijack cmd+a so that it only selects the code view +jwerty.key('cmd+a/ctrl+a', function (e) { + var obj = JSON.stringify({ "keyPress": "cmd+a" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); + +// open the mustache panel +jwerty.key('ctrl+shift+u', function (e) { + var obj = JSON.stringify({ "keyPress": "ctrl+shift+u" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); + +// open the html panel +jwerty.key('ctrl+shift+h', function (e) { + var obj = JSON.stringify({ "keyPress": "ctrl+shift+h" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); + +// close the code panel if using escape +jwerty.key('esc', function (e) { + var obj = JSON.stringify({ "keyPress": "esc" }); + parent.postMessage(obj,codePattern.targetOrigin); + return false; +}); \ No newline at end of file diff --git a/public/styleguide/js/code-viewer.js b/public/styleguide/js/code-viewer.js index edb716944..05c4a6fcd 100644 --- a/public/styleguide/js/code-viewer.js +++ b/public/styleguide/js/code-viewer.js @@ -8,117 +8,338 @@ var codeViewer = { - codeActive: false, - sw: document.documentElement.clientWidth, - breakpoint: 650, + // set up some defaults + codeActive: false, + tabActive: "e", + encoded: "", + mustache: "", + css: "", + ids: { "e": "#sg-code-title-html", "m": "#sg-code-title-mustache", "c": "#sg-code-title-css" }, + targetOrigin: (window.location.protocol === "file:") ? "*" : window.location.protocol+"//"+window.location.host, + copyOnInit: false, + /** + * add the onclick handler to the code link in the main nav + */ onReady: function() { + // not sure this is needed anymore... $('body').addClass('code-ready'); + + $(window).resize(function() { + if(!codeViewer.codeActive) { + codeViewer.slideCode($('#sg-code-container').outerHeight()); + } + }); + + // add the onclick handler $('#sg-t-code').click(function(e) { + e.preventDefault(); - // make sure the annotations overlay is off - $('#sg-t-annotations').removeClass('active'); - annotationsViewer.commentsActive = false; - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - document.getElementById('sg-viewport').contentWindow.postMessage({ "commentToggle": "off" },targetOrigin); - annotationsViewer.slideComment(999); + // remove the class from the "eye" nav item + $('#sg-t-toggle').removeClass('active'); - codeViewer.toggleCode(); - codeViewer.codeContainerInit(); + // if the code link in the main nav is active close the panel. otherwise open + if ($(this).hasClass('active')) { + codeViewer.closeCode(); + } else { + codeViewer.openCode(); + } }); + // initialize the code viewer + codeViewer.codeContainerInit(); + + // load the query strings in case code view has to show by default + var queryStringVars = urlHandler.getRequestVars(); + if ((queryStringVars.view !== undefined) && ((queryStringVars.view === "code") || (queryStringVars.view === "c"))) { + codeViewer.copyOnInit = ((queryStringVars.copy !== undefined) && (queryStringVars.copy === "true")) ? true : false; + codeViewer.openCode(); + } + }, + /** + * decide on if the code panel should be open or closed + */ toggleCode: function() { - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - $('#sg-t-code').toggleClass('active'); - if (!codeViewer.codeActive) { - - codeViewer.codeActive = true; - document.getElementById('sg-viewport').contentWindow.postMessage({ "codeToggle": "on" },targetOrigin); - + codeViewer.openCode(); } else { - - codeViewer.codeActive = false; - document.getElementById('sg-viewport').contentWindow.postMessage({ "codeToggle": "off" },targetOrigin); - codeViewer.slideCode(999); - + codeViewer.closeCode(); } }, - codeContainerInit: function() { + /** + * after clicking the code view link open the panel + */ + openCode: function() { - if (document.getElementById("sg-code-container") == undefined) { - $('').html('Close

HTML

').appendTo('body').css('bottom',-$(document).outerHeight()); - } + // make sure the annotations overlay is off before showing code view + $('#sg-t-annotations').removeClass('active'); + annotationsViewer.commentsActive = false; + var obj = JSON.stringify({ "commentToggle": "off" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,codeViewer.targetOrigin); + annotationsViewer.slideComment(999); - if (codeViewer.sw < codeViewer.breakpoint) { - $('#sg-code-container').hide(); - } else { - $('#sg-code-container').show(); + // tell the iframe code view has been turned on + var obj = JSON.stringify({ "codeToggle": "on" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,codeViewer.targetOrigin); + + // note it's turned on in the viewer + codeViewer.codeActive = true; + $('#sg-t-code').addClass('active'); + + }, + + /** + * after clicking the code view link close the panel + */ + closeCode: function() { + var obj = JSON.stringify({ "codeToggle": "off" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,codeViewer.targetOrigin); + codeViewer.codeActive = false; + codeViewer.slideCode($('#sg-code-container').outerHeight()); + $('#sg-t-code').removeClass('active'); + }, + + /** + * add the basic mark-up and events for the code container + */ + codeContainerInit: function() { + + // the bulk of this template is in core/templates/index.mustache + if (document.getElementById("sg-code-container") === null) { + $('
').html($("#code-template").html()).appendTo('body').css('bottom',-$(document).outerHeight()); + setTimeout(function(){ $('#sg-code-container').addClass('anim-ready'); },50); //Add animation class once container is positioned out of frame } - $('body').delegate('#sg-code-close-btn','click',function(e) { - codeViewer.slideCode($('#sg-code-container').outerHeight()); + // make sure the close button handles the click + $('body').delegate('#sg-code-close-btn','click',function() { + codeViewer.closeCode(); return false; }); + // make sure the click events are handled on the HTML tab + $(codeViewer.ids["e"]).click(function() { + codeViewer.swapCode("e"); + }); + + // make sure the click events are handled on the Mustache tab + $(codeViewer.ids["m"]).click(function() { + codeViewer.swapCode("m"); + }); + + // make sure the click events are handled on the CSS tab + $(codeViewer.ids["c"]).click(function() { + codeViewer.swapCode("c"); + }); + }, + /** + * depending on what tab is clicked this swaps out the code container. makes sure prism highlight is added. + */ + swapCode: function(type) { + + codeViewer.clearSelection(); + var fill = ""; + var className = (type == "c") ? "css" : "markup"; + $("#sg-code-fill").removeClass().addClass("language-"+className); + if (type == "m") { + fill = codeViewer.mustache; + } else if (type == "e") { + fill = codeViewer.encoded; + } else if (type == "c") { + fill = codeViewer.css; + } + $("#sg-code-fill").html(fill).text(); + codeViewer.tabActive = type; + Prism.highlightElement(document.getElementById("sg-code-fill")); + $('.sg-code-title-active').removeClass('sg-code-title-active'); + $(codeViewer.ids[type]).toggleClass("sg-code-title-active"); + }, + + /** + * select the code where using cmd+a/ctrl+a + */ + selectCode: function() { + if (codeViewer.codeActive) { + selection = window.getSelection(); + range = document.createRange(); + range.selectNodeContents(document.getElementById("sg-code-fill")); + selection.removeAllRanges(); + selection.addRange(range); + } + }, + + /** + * clear any selection of code when swapping tabs or opening a new pattern + */ + clearSelection: function() { + if (codeViewer.codeActive) { + if (window.getSelection().empty) { + window.getSelection().empty(); + } else if (window.getSelection().removeAllRanges) { + window.getSelection().removeAllRanges(); + } + } + }, + + /** + * slides the panel + */ slideCode: function(pos) { + $('#sg-code-container').css('bottom',-pos); + }, + + /** + * once the AJAX request for the encoded mark-up is finished this runs. + * if the encoded tab is the current active tab it adds the content to the default code container + */ + saveEncoded: function() { + codeViewer.encoded = this.responseText; + if (codeViewer.tabActive == "e") { + codeViewer.activateDefaultTab("e",this.responseText); + } + }, + + /** + * once the AJAX request for the mustache mark-up is finished this runs. + * if the mustache tab is the current active tab it adds the content to the default code container + */ + saveMustache: function() { + codeViewer.mustache = this.responseText; + if (codeViewer.tabActive == "m") { + codeViewer.activateDefaultTab("m",this.responseText); + } + }, + + /** + * once the AJAX request for the css mark-up is finished this runs. if this function is running then css has been enabled + * if the css tab is the current active tab it adds the content to the default code container + */ + saveCSS: function() { + $('#sg-code-title-css').css("display","block"); + codeViewer.css = this.responseText; + if (codeViewer.tabActive == "c") { + codeViewer.activateDefaultTab("c",this.responseText); + } + }, + + /** + * when loading the code view make sure the active tab is highlighted and filled in appropriately + */ + activateDefaultTab: function(type,code) { + var typeName = ""; + var className = (type == "c") ? "css" : "markup"; + if (type == "m") { + typeName = "mustache"; + } else if (type == "e") { + typeName = "html"; + } else if (type == "c") { + typeName = "css"; + } + $('.sg-code-title-active').removeClass('sg-code-title-active'); + $('#sg-code-title-'+typeName).addClass('sg-code-title-active'); + $("#sg-code-fill").removeClass().addClass("language-"+className); + $("#sg-code-fill").html(code).text(); + Prism.highlightElement(document.getElementById("sg-code-fill")); + if (codeViewer.copyOnInit) { + codeViewer.selectCode(); + codeViewer.copyOnInit = false; + } + }, + + /** + * when turning on or switching between patterns with code view on make sure we get + * the code from from the pattern via post message + */ + updateCode: function(lineage,lineageR,patternPartial,patternState,cssEnabled) { - $('#sg-code-container').show(); + // clear any selections that might have been made + codeViewer.clearSelection(); - if (codeViewer.sw > codeViewer.breakpoint) { - $('#sg-code-container').css('bottom',-pos); + // draw lineage + if (lineage.length !== 0) { + var lineageList = ""; + $("#sg-code-lineage").css("display","block"); + for (var i = 0; i < lineage.length; i++) { + lineageList += (i === 0) ? "" : ", "; + var cssClass = (lineage[i].lineageState != undefined) ? "sg-pattern-state "+lineage[i].lineageState : ""; + lineageList += ""+lineage[i].lineagePattern+""; + } + $("#sg-code-lineage-fill").html(lineageList); } else { - var offset = $('#sg-code-container').offset().top; - $('html,body').animate({scrollTop: offset}, 500); + $("#sg-code-lineage").css("display","none"); } - }, - - updateCode: function(lineage,html,css) { - - // draw lineage - if (lineage.length != 0) { - $("#sg-code-lineage").css("display","block"); - var i = 0; - var lineageList = ""; - for (pattern in lineage) { - lineageList += (i == 0) ? "" : ", "; - lineageList += ""+lineage[pattern]["lineagePattern"]+""; - i++; - } - - $("#sg-code-lineage-fill").html(lineageList); - - $('#sg-code-lineage-fill a').on("click", function(e){ - e.preventDefault(); - document.getElementById("sg-viewport").contentWindow.postMessage( { "path": urlHandler.getFileName($(this).attr("data-patternpartial")) }, urlHandler.targetOrigin); - }); + // draw reverse lineage + if (lineageR.length !== 0) { + var lineageRList = ""; + $("#sg-code-lineager").css("display","block"); + for (var i = 0; i < lineageR.length; i++) { + lineageRList += (i === 0) ? "" : ", "; + var cssClass = (lineageR[i].lineageState != undefined) ? "sg-pattern-state "+lineageR[i].lineageState : ""; + lineageRList += ""+lineageR[i].lineagePattern+""; } - - // draw html - $("#sg-code-html-fill").text(html); - Prism.highlightElement(document.getElementById("sg-code-html-fill")); - - // draw CSS - if (css.indexOf("{{ patternCSS }}") == -1) { - $("#sg-code-html").addClass("with-css"); - $("#sg-code-css").css("display","block"); - $("#sg-code-css-fill").text(css); - Prism.highlightElement(document.getElementById("sg-code-css-fill")); - } - - codeViewer.slideCode(0); - + $("#sg-code-lineager-fill").html(lineageRList); + } else { + $("#sg-code-lineager").css("display","none"); + } + + // when clicking on a lineage item change the iframe source + $('#sg-code-lineage-fill a, #sg-code-lineager-fill a').on("click", function(e){ + e.preventDefault(); + $("#sg-code-loader").css("display","block"); + var obj = JSON.stringify({ "path": urlHandler.getFileName($(this).attr("data-patternpartial")) }); + document.getElementById("sg-viewport").contentWindow.postMessage(obj,codeViewer.targetOrigin); + }); + + // show pattern state + if (patternState != "") { + $("#sg-code-patternstate").css("display","block"); + var patternStateItem = ""+patternState+""; + $("#sg-code-patternstate-fill").html(patternStateItem); + } else { + $("#sg-code-patternstate").css("display","none"); + } + + // fill in the name of the pattern + $('#sg-code-lineage-patternname, #sg-code-lineager-patternname, #sg-code-patternstate-patternname').html(patternPartial); + + // get the file name of the pattern so we can get the various editions of the code that can show in code view + var fileName = urlHandler.getFileName(patternPartial); + + // request the encoded markup version of the pattern + var e = new XMLHttpRequest(); + e.onload = this.saveEncoded; + e.open("GET", fileName.replace(/\.html/,".escaped.html") + "?" + (new Date()).getTime(), true); + e.send(); + + // request the mustache markup version of the pattern + var m = new XMLHttpRequest(); + m.onload = this.saveMustache; + m.open("GET", fileName.replace(/\.html/,".mustache") + "?" + (new Date()).getTime(), true); + m.send(); + + // if css is enabled request the css for the pattern + if (cssEnabled) { + var c = new XMLHttpRequest(); + c.onload = this.saveCSS; + c.open("GET", fileName.replace(/\.html/,".css") + "?" + (new Date()).getTime(), true); + c.send(); + } + + // move the code into view + codeViewer.slideCode(0); + + $("#sg-code-loader").css("display","none"); + }, /** @@ -128,34 +349,93 @@ var codeViewer = { */ receiveIframeMessage: function(event) { + var data = (typeof event.data !== "string") ? event.data : JSON.parse(event.data); + // does the origin sending the message match the current host? if not dev/null the request - if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { + if ((window.location.protocol !== "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) { return; } - if (event.data.codeOverlay != undefined) { - if (event.data.codeOverlay == "on") { - - codeViewer.updateCode(event.data.lineage,event.data.html,event.data.css); - + // switch based on stuff related to the postmessage + if (data.codeOverlay !== undefined) { + if (data.codeOverlay === "on") { + codeViewer.updateCode(data.lineage,data.lineageR,data.patternPartial,data.patternState,data.cssEnabled); } else { - codeViewer.slideCode($('#sg-code-container').outerHeight()); - + } + } else if (data.keyPress !== undefined) { + if (data.keyPress == 'ctrl+shift+c') { + codeViewer.toggleCode(); + return false; + } else if (data.keyPress == 'cmd+a') { + codeViewer.selectCode(); + return false; + } else if (data.keyPress == 'ctrl+shift+u') { + if (codeViewer.codeActive) { + codeViewer.swapCode("m"); + return false; + } + } else if (data.keyPress == 'ctrl+shift+y') { + if (codeViewer.codeActive) { + codeViewer.swapCode("e"); + return false; + } + } else if (data.keyPress == 'esc') { + if (codeViewer.codeActive) { + codeViewer.closeCode(); + return false; + } } } } -} +}; +// when the document is ready make the codeViewer ready $(document).ready(function() { codeViewer.onReady(); }); window.addEventListener("message", codeViewer.receiveIframeMessage, false); // make sure if a new pattern or view-all is loaded that comments are turned on as appropriate $('#sg-viewport').load(function() { if (codeViewer.codeActive) { - var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host; - document.getElementById('sg-viewport').contentWindow.postMessage({ "codeToggle": "on" },targetOrigin); + var obj = JSON.stringify({ "codeToggle": "on" }); + document.getElementById('sg-viewport').contentWindow.postMessage(obj,codeViewer.targetOrigin); + } +}); + +// toggle the code panel +jwerty.key('ctrl+shift+c', function (e) { + codeViewer.toggleCode(); + return false; +}); + +// when the code panel is open hijack cmd+a so that it only selects the code view +jwerty.key('cmd+a/ctrl+a', function (e) { + codeViewer.selectCode(); + return false; +}); + +// open the mustache panel +jwerty.key('ctrl+shift+u', function (e) { + if (codeViewer.codeActive) { + codeViewer.swapCode("m"); + return false; + } +}); + +// open the html panel +jwerty.key('ctrl+shift+y', function (e) { + if (codeViewer.codeActive) { + codeViewer.swapCode("e"); + return false; } }); + +// close the code panel if using escape +jwerty.key('esc', function (e) { + if (codeViewer.codeActive) { + codeViewer.closeCode(); + return false; + } +}); \ No newline at end of file diff --git a/public/styleguide/js/vendor/classlist-polyfill.js b/public/styleguide/js/vendor/classlist-polyfill.js new file mode 100644 index 000000000..1b38758cb --- /dev/null +++ b/public/styleguide/js/vendor/classlist-polyfill.js @@ -0,0 +1,176 @@ +/* + * classList.js: Cross-browser full element.classList implementation. + * 2012-11-15 + * + * By Eli Grey, http://eligrey.com + * Public Domain. + * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + */ + +/*global self, document, DOMException */ + +/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ + +if (typeof document !== "undefined" && !("classList" in document.documentElement)) { + +(function (view) { + +"use strict"; + +if (!('HTMLElement' in view) && !('Element' in view)) return; + +var + classListProp = "classList" + , protoProp = "prototype" + , elemCtrProto = (view.HTMLElement || view.Element)[protoProp] + , objCtr = Object + , strTrim = String[protoProp].trim || function () { + return this.replace(/^\s+|\s+$/g, ""); + } + , arrIndexOf = Array[protoProp].indexOf || function (item) { + var + i = 0 + , len = this.length + ; + for (; i < len; i++) { + if (i in this && this[i] === item) { + return i; + } + } + return -1; + } + // Vendors: please allow content code to instantiate DOMExceptions + , DOMEx = function (type, message) { + this.name = type; + this.code = DOMException[type]; + this.message = message; + } + , checkTokenAndGetIndex = function (classList, token) { + if (token === "") { + throw new DOMEx( + "SYNTAX_ERR" + , "An invalid or illegal string was specified" + ); + } + if (/\s/.test(token)) { + throw new DOMEx( + "INVALID_CHARACTER_ERR" + , "String contains an invalid character" + ); + } + return arrIndexOf.call(classList, token); + } + , ClassList = function (elem) { + var + trimmedClasses = strTrim.call(elem.className) + , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] + , i = 0 + , len = classes.length + ; + for (; i < len; i++) { + this.push(classes[i]); + } + this._updateClassName = function () { + elem.className = this.toString(); + }; + } + , classListProto = ClassList[protoProp] = [] + , classListGetter = function () { + return new ClassList(this); + } +; +// Most DOMException implementations don't allow calling DOMException's toString() +// on non-DOMExceptions. Error's toString() is sufficient here. +DOMEx[protoProp] = Error[protoProp]; +classListProto.item = function (i) { + return this[i] || null; +}; +classListProto.contains = function (token) { + token += ""; + return checkTokenAndGetIndex(this, token) !== -1; +}; +classListProto.add = function () { + var + tokens = arguments + , i = 0 + , l = tokens.length + , token + , updated = false + ; + do { + token = tokens[i] + ""; + if (checkTokenAndGetIndex(this, token) === -1) { + this.push(token); + updated = true; + } + } + while (++i < l); + + if (updated) { + this._updateClassName(); + } +}; +classListProto.remove = function () { + var + tokens = arguments + , i = 0 + , l = tokens.length + , token + , updated = false + ; + do { + token = tokens[i] + ""; + var index = checkTokenAndGetIndex(this, token); + if (index !== -1) { + this.splice(index, 1); + updated = true; + } + } + while (++i < l); + + if (updated) { + this._updateClassName(); + } +}; +classListProto.toggle = function (token, forse) { + token += ""; + + var + result = this.contains(token) + , method = result ? + forse !== true && "remove" + : + forse !== false && "add" + ; + + if (method) { + this[method](token); + } + + return !result; +}; +classListProto.toString = function () { + return this.join(" "); +}; + +if (objCtr.defineProperty) { + var classListPropDesc = { + get: classListGetter + , enumerable: true + , configurable: true + }; + try { + objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); + } catch (ex) { // IE 8 doesn't support enumerable:true + if (ex.number === -0x7FF5EC54) { + classListPropDesc.enumerable = false; + objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); + } + } +} else if (objCtr[protoProp].__defineGetter__) { + elemCtrProto.__defineGetter__(classListProp, classListGetter); +} + +}(self)); + +} \ No newline at end of file diff --git a/public/styleguide/js/jquery.js b/public/styleguide/js/vendor/jquery.js similarity index 100% rename from public/styleguide/js/jquery.js rename to public/styleguide/js/vendor/jquery.js diff --git a/public/styleguide/js/vendor/jwerty.js b/public/styleguide/js/vendor/jwerty.js new file mode 100644 index 000000000..2ba7730af --- /dev/null +++ b/public/styleguide/js/vendor/jwerty.js @@ -0,0 +1,523 @@ +/* + * jwerty - Awesome handling of keyboard events + * + * jwerty is a JS lib which allows you to bind, fire and assert key combination + * strings against elements and events. It normalises the poor std api into + * something easy to use and clear. + * + * This code is licensed under the MIT + * For the full license see: http://keithamus.mit-license.org/ + * For more information see: http://keithamus.github.com/jwerty + * + * @author Keith Cirkel ('keithamus') + * @license http://keithamus.mit-license.org/ + * @copyright Copyright © 2011, Keith Cirkel + * + */ +(function (global, exports) { + + // Helper methods & vars: + var $d = global.document, + $ = (global.jQuery || global.Zepto || global.ender || $d), + $$, // Element selector function + $b, // Event binding function + $f, // Event firing function + ke = 'keydown'; + + function realTypeOf(v, s) { + return (v === null) ? s === 'null' + : (v === undefined) ? s === 'undefined' + : (v.is && v instanceof $) ? s === 'element' + : Object.prototype.toString.call(v).toLowerCase().indexOf(s) > 7; + } + + if ($ === $d) { + $$ = function (selector, context) { + return selector ? $.querySelector(selector, context || $) : $; + }; + $b = function (e, fn) { e.addEventListener(ke, fn, false); }; + $f = function (e, jwertyEv) { + var ret = $d.createEvent('Event'), + i; + + ret.initEvent(ke, true, true); + + for (i in jwertyEv) ret[i] = jwertyEv[i]; + + return (e || $).dispatchEvent(ret); + }; + } else { + $$ = function (selector, context) { return $(selector || $d, context); }; + $b = function (e, fn) { $(e).bind(ke + '.jwerty', fn); }; + $f = function (e, ob) { $(e || $d).trigger($.Event(ke, ob)); }; + } + + // Private + var _modProps = { 16: 'shiftKey', 17: 'ctrlKey', 18: 'altKey', 91: 'metaKey' }; + + // Generate key mappings for common keys that are not printable. + var _keys = { + + // MOD aka toggleable keys + mods: { + // Shift key, ⇧ + '⇧': 16, + shift: 16, + // CTRL key, on Mac: ⌃ + '⌃': 17, + ctrl: 17, + // ALT key, on Mac: ⌥ (Alt) + '⌥': 18, + alt: 18, + option: 18, + // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super) + '⌘': 91, + meta: 91, + cmd: 91, + 'super': 91, + win: 91 + }, + + // Normal keys + keys: { + // Backspace key, on Mac: ⌫ (Backspace) + '⌫': 8, + backspace: 8, + // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥ + '⇥': 9, + '⇆': 9, + tab: 9, + // Return key, ↩ + '↩': 13, + 'return': 13, + enter: 13, + '⌅': 13, + // Pause/Break key + 'pause': 19, + 'pause-break': 19, + // Caps Lock key, ⇪ + '⇪': 20, + caps: 20, + 'caps-lock': 20, + // Escape key, on Mac: ⎋, on Windows: Esc + '⎋': 27, + escape: 27, + esc: 27, + // Space key + space: 32, + // Page-Up key, or pgup, on Mac: ↖ + '↖': 33, + pgup: 33, + 'page-up': 33, + // Page-Down key, or pgdown, on Mac: ↘ + '↘': 34, + pgdown: 34, + 'page-down': 34, + // END key, on Mac: ⇟ + '⇟': 35, + end: 35, + // HOME key, on Mac: ⇞ + '⇞': 36, + home: 36, + // Insert key, or ins + ins: 45, + insert: 45, + // Delete key, on Mac: ⌫ (Delete) + del: 46, + 'delete': 46, + + // Left Arrow Key, or ← + '←': 37, + left: 37, + 'arrow-left': 37, + // Up Arrow Key, or ↑ + '↑': 38, + up: 38, + 'arrow-up': 38, + // Right Arrow Key, or → + '→': 39, + right: 39, + 'arrow-right': 39, + // Up Arrow Key, or ↓ + '↓': 40, + down: 40, + 'arrow-down': 40, + + // odities, printing characters that come out wrong: + // Num-Multiply, or * + '*': 106, + star: 106, + asterisk: 106, + multiply: 106, + // Num-Plus or + + '+': 107, + 'plus': 107, + // Num-Subtract, or - + '-': 109, + subtract: 109, + 'num-.': 110, + 'num-period': 110, + 'num-dot': 110, + 'num-full-stop': 110, + 'num-delete': 110, + // Semicolon + ';': 186, + semicolon: 186, + // = or equals + '=': 187, + 'equals': 187, + // Comma, or , + ',': 188, + comma: 188, + //'-': 189, //??? + // Period, or ., or full-stop + '.': 190, + period: 190, + 'full-stop': 190, + // Slash, or /, or forward-slash + '/': 191, + slash: 191, + 'forward-slash': 191, + // Tick, or `, or back-quote + '`': 192, + tick: 192, + 'back-quote': 192, + // Open bracket, or [ + '[': 219, + 'open-bracket': 219, + // Back slash, or \ + '\\': 220, + 'back-slash': 220, + // Close backet, or ] + ']': 221, + 'close-bracket': 221, + // Apostraphe, or Quote, or ' + '\'': 222, + quote: 222, + apostraphe: 222 + } + + }; + + // To minimise code bloat, add all of the 0-9 and NUMPAD 0-9 keys in a loop + var i = 47, + n = 0; + while (++i < 106) { + _keys.keys[n] = i; + _keys.keys['num-' + n] = i + 48; + ++n; + } + + // To minimise code bloat, add all of the F1-F25 keys in a loop + i = 111, + n = 1; + while (++i < 136) { + _keys.keys['f' + n] = i; + ++n; + } + + // To minimise code bloat, add all of the letters of the alphabet in a loop + i = 64; + while (++i < 91) { + _keys.keys[String.fromCharCode(i).toLowerCase()] = i; + } + + function JwertyCode(jwertyCode) { + var i, + c, + n, + z, + keyCombo, + optionals, + jwertyCodeFragment, + rangeMatches, + rangeI; + + // In-case we get called with an instance of ourselves, just return that. + if (jwertyCode instanceof JwertyCode) return jwertyCode; + + // If jwertyCode isn't an array, cast it as a string and split into array. + if (!realTypeOf(jwertyCode, 'array')) { + jwertyCode = (String(jwertyCode)).replace(/\s/g, '').toLowerCase() + .match(/(?:\+,|[^,])+/g); + } + + // Loop through each key sequence in jwertyCode + for (i = 0, c = jwertyCode.length; i < c; ++i) { + + // If the key combo at this part of the sequence isn't an array, + // cast as a string and split into an array. + if (!realTypeOf(jwertyCode[i], 'array')) { + jwertyCode[i] = String(jwertyCode[i]) + .match(/(?:\+\/|[^\/])+/g); + } + + // Parse the key optionals in this sequence + optionals = [], + n = jwertyCode[i].length; + while (n--) { + + // Begin creating the object for this key combo + jwertyCodeFragment = jwertyCode[i][n]; + + keyCombo = { + jwertyCombo: String(jwertyCodeFragment), + shiftKey: false, + ctrlKey: false, + altKey: false, + metaKey: false + }; + + // If jwertyCodeFragment isn't an array then cast as a string + // and split it into one. + if (!realTypeOf(jwertyCodeFragment, 'array')) { + jwertyCodeFragment = String(jwertyCodeFragment).toLowerCase() + .match(/(?:(?:[^\+])+|\+\+|^\+$)/g); + } + + z = jwertyCodeFragment.length; + while (z--) { + + // Normalise matching errors + if (jwertyCodeFragment[z] === '++') jwertyCodeFragment[z] = '+'; + + // Inject either keyCode or ctrl/meta/shift/altKey into keyCombo + if (jwertyCodeFragment[z] in _keys.mods) { + keyCombo[_modProps[_keys.mods[jwertyCodeFragment[z]]]] = true; + } else if (jwertyCodeFragment[z] in _keys.keys) { + keyCombo.keyCode = _keys.keys[jwertyCodeFragment[z]]; + } else { + rangeMatches = jwertyCodeFragment[z].match(/^\[([^-]+\-?[^-]*)-([^-]+\-?[^-]*)\]$/); + } + } + if (realTypeOf(keyCombo.keyCode, 'undefined')) { + // If we picked up a range match earlier... + if (rangeMatches && (rangeMatches[1] in _keys.keys) && (rangeMatches[2] in _keys.keys)) { + rangeMatches[2] = _keys.keys[rangeMatches[2]]; + rangeMatches[1] = _keys.keys[rangeMatches[1]]; + + // Go from match 1 and capture all key-comobs up to match 2 + for (rangeI = rangeMatches[1]; rangeI < rangeMatches[2]; ++rangeI) { + optionals.push({ + altKey: keyCombo.altKey, + shiftKey: keyCombo.shiftKey, + metaKey: keyCombo.metaKey, + ctrlKey: keyCombo.ctrlKey, + keyCode: rangeI, + jwertyCombo: String(jwertyCodeFragment) + }); + + } + keyCombo.keyCode = rangeI; + // Inject either keyCode or ctrl/meta/shift/altKey into keyCombo + } else { + keyCombo.keyCode = 0; + } + } + optionals.push(keyCombo); + + } + this[i] = optionals; + } + this.length = i; + return this; + } + + var jwerty = exports.jwerty = { + /** + * jwerty.event + * + * `jwerty.event` will return a function, which expects the first + * argument to be a key event. When the key event matches `jwertyCode`, + * `callbackFunction` is fired. `jwerty.event` is used by `jwerty.key` + * to bind the function it returns. `jwerty.event` is useful for + * attaching to your own event listeners. It can be used as a decorator + * method to encapsulate functionality that you only want to fire after + * a specific key combo. If `callbackContext` is specified then it will + * be supplied as `callbackFunction`'s context - in other words, the + * keyword `this` will be set to `callbackContext` inside the + * `callbackFunction` function. + * + * @param {Mixed} jwertyCode can be an array, or string of key + * combinations, which includes optinals and or sequences + * @param {Function} callbackFucntion is a function (or boolean) which + * is fired when jwertyCode is matched. Return false to + * preventDefault() + * @param {Object} callbackContext (Optional) The context to call + * `callback` with (i.e this) + * + */ + event: function (jwertyCode, callbackFunction, callbackContext /*? this */) { + + // Construct a function out of callbackFunction, if it is a boolean. + if (realTypeOf(callbackFunction, 'boolean')) { + var bool = callbackFunction; + callbackFunction = function () { return bool; }; + } + + jwertyCode = new JwertyCode(jwertyCode); + + // Initialise in-scope vars. + var i = 0, + c = jwertyCode.length - 1, + returnValue, + jwertyCodeIs; + + // This is the event listener function that gets returned... + return function (event) { + + // if jwertyCodeIs returns truthy (string)... + if ((jwertyCodeIs = jwerty.is(jwertyCode, event, i))) { + // ... and this isn't the last key in the sequence, + // incriment the key in sequence to check. + if (i < c) { + ++i; + return; + // ... and this is the last in the sequence (or the only + // one in sequence), then fire the callback + } else { + returnValue = callbackFunction.call( + callbackContext || this, event, jwertyCodeIs); + + // If the callback returned false, then we should run + // preventDefault(); + if (returnValue === false) event.preventDefault(); + + // Reset i for the next sequence to fire. + i = 0; + return; + } + } + + // If the event didn't hit this time, we should reset i to 0, + // that is, unless this combo was the first in the sequence, + // in which case we should reset i to 1. + i = jwerty.is(jwertyCode, event) ? 1 : 0; + }; + }, + + /** + * jwerty.is + * + * `jwerty.is` will return a boolean value, based on if `event` matches + * `jwertyCode`. `jwerty.is` is called by `jwerty.event` to check + * whether or not to fire the callback. `event` can be a DOM event, or + * a jQuery/Zepto/Ender manufactured event. The properties of + * `jwertyCode` (speficially ctrlKey, altKey, metaKey, shiftKey and + * keyCode) should match `jwertyCode`'s properties - if they do, then + * `jwerty.is` will return `true`. If they don't, `jwerty.is` will + * return `false`. + * + * @param {Mixed} jwertyCode can be an array, or string of key + * combinations, which includes optinals and or sequences + * @param {KeyboardEvent} event is the KeyboardEvent to assert against + * @param {Integer} i (Optional) checks the `i` key in jwertyCode + * sequence + * + */ + is: function (jwertyCode, event, i /*? 0*/) { + jwertyCode = new JwertyCode(jwertyCode); + // Default `i` to 0 + i = i || 0; + // We are only interested in `i` of jwertyCode; + jwertyCode = jwertyCode[i]; + // jQuery stores the *real* event in `originalEvent`, which we use + // because it does annoything stuff to `metaKey` + event = event.originalEvent || event; + + // We'll look at each optional in this jwertyCode sequence... + var n = jwertyCode.length, + returnValue = false; + + // Loop through each fragment of jwertyCode + while (n--) { + returnValue = jwertyCode[n].jwertyCombo; + // For each property in the jwertyCode object, compare to `event` + for (var p in jwertyCode[n]) { + // ...except for jwertyCode.jwertyCombo... + if (p !== 'jwertyCombo' && event[p] != jwertyCode[n][p]) returnValue = false; + } + // If this jwertyCode optional wasn't falsey, then we can return early. + if (returnValue !== false) return returnValue; + } + return returnValue; + }, + + /** + * jwerty.key + * + * `jwerty.key` will attach an event listener and fire + * `callbackFunction` when `jwertyCode` matches. The event listener is + * attached to `document`, meaning it will listen for any key events + * on the page (a global shortcut listener). If `callbackContext` is + * specified then it will be supplied as `callbackFunction`'s context + * - in other words, the keyword `this` will be set to + * `callbackContext` inside the `callbackFunction` function. + * + * @param {Mixed} jwertyCode can be an array, or string of key + * combinations, which includes optinals and or sequences + * @param {Function} callbackFunction is a function (or boolean) which + * is fired when jwertyCode is matched. Return false to + * preventDefault() + * @param {Object} callbackContext (Optional) The context to call + * `callback` with (i.e this) + * @param {Mixed} selector can be a string, jQuery/Zepto/Ender object, + * or an HTML*Element on which to bind the eventListener + * @param {Mixed} selectorContext can be a string, jQuery/Zepto/Ender + * object, or an HTML*Element on which to scope the selector + * + */ + key: function (jwertyCode, callbackFunction, callbackContext /*? this */, selector /*? document */, selectorContext /*? body */) { + // Because callbackContext is optional, we should check if the + // `callbackContext` is a string or element, and if it is, then the + // function was called without a context, and `callbackContext` is + // actually `selector` + var realSelector = realTypeOf(callbackContext, 'element') || realTypeOf(callbackContext, 'string') ? callbackContext : selector, + // If `callbackContext` is undefined, or if we skipped it (and + // therefore it is `realSelector`), set context to `global`. + realcallbackContext = realSelector === callbackContext ? global : callbackContext, + // Finally if we did skip `callbackContext`, then shift + // `selectorContext` to the left (take it from `selector`) + realSelectorContext = realSelector === callbackContext ? selector : selectorContext; + + // If `realSelector` is already a jQuery/Zepto/Ender/DOM element, + // then just use it neat, otherwise find it in DOM using $$() + $b( + realTypeOf(realSelector, 'element') ? realSelector : $$(realSelector, realSelectorContext), + jwerty.event(jwertyCode, callbackFunction, realcallbackContext) + ); + }, + + /** + * jwerty.fire + * + * `jwerty.fire` will construct a keyup event to fire, based on + * `jwertyCode`. The event will be fired against `selector`. + * `selectorContext` is used to search for `selector` within + * `selectorContext`, similar to jQuery's + * `$('selector', 'context')`. + * + * @param {Mixed} jwertyCode can be an array, or string of key + * combinations, which includes optinals and or sequences + * @param {Mixed} selector can be a string, jQuery/Zepto/Ender object, + * or an HTML*Element on which to bind the eventListener + * @param {Mixed} selectorContext can be a string, jQuery/Zepto/Ender + * object, or an HTML*Element on which to scope the selector + * + */ + fire: function (jwertyCode, selector /*? document */, selectorContext /*? body */, i) { + jwertyCode = new JwertyCode(jwertyCode); + var realI = realTypeOf(selectorContext, 'number') ? selectorContext : i; + + // If `realSelector` is already a jQuery/Zepto/Ender/DOM element, + // then just use it neat, otherwise find it in DOM using $$() + $f( + realTypeOf(selector, 'element') ? selector : $$(selector, selectorContext), + jwertyCode[realI || 0][0] + ); + }, + + KEYS: _keys + }; + +}(this, (typeof module !== 'undefined' && module.exports ? module.exports : this))); \ No newline at end of file diff --git a/public/styleguide/js/prism.js b/public/styleguide/js/vendor/prism.js similarity index 100% rename from public/styleguide/js/prism.js rename to public/styleguide/js/vendor/prism.js diff --git a/public/styleguide/js/vendor/typeahead.bundle.min.js b/public/styleguide/js/vendor/typeahead.bundle.min.js new file mode 100644 index 000000000..e28c2ac58 --- /dev/null +++ b/public/styleguide/js/vendor/typeahead.bundle.min.js @@ -0,0 +1,7 @@ +/*! + * typeahead.js 0.10.1 + * https://github.com/twitter/typeahead.js + * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT + */ + +!function(a){var b={isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,getUniqueId:function(){var a=0;return function(){return a++}}(),templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},noop:function(){}},c="0.10.1",d=function(){function a(a){this.maxSize=a||100,this.size=0,this.hash={},this.list=new c}function c(){this.head=this.tail=null}function d(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(a.prototype,{set:function(a,b){var c,e=this.list.tail;this.size>=this.maxSize&&(this.list.remove(e),delete this.hash[e.key]),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new d(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0}}),b.mixin(c.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),a}(this),e=function(){function a(a){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}function c(){return(new Date).getTime()}function d(a){return JSON.stringify(b.isUndefined(a)?null:a)}function e(a){return JSON.parse(a)}var f,g;try{f=window.localStorage,f.setItem("~~~","!"),f.removeItem("~~~")}catch(h){f=null}return g=f&&window.JSON?{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},get:function(a){return this.isExpired(a)&&this.remove(a),e(f.getItem(this._prefix(a)))},set:function(a,e,g){return b.isNumber(g)?f.setItem(this._ttlKey(a),d(c()+g)):f.removeItem(this._ttlKey(a)),f.setItem(this._prefix(a),d(e))},remove:function(a){return f.removeItem(this._ttlKey(a)),f.removeItem(this._prefix(a)),this},clear:function(){var a,b,c=[],d=f.length;for(a=0;d>a;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},isExpired:function(a){var d=e(f.getItem(this._ttlKey(a)));return b.isNumber(d)&&c()>d?!0:!1}}:{get:b.noop,set:b.noop,remove:b.noop,clear:b.noop,isExpired:b.noop},b.mixin(a.prototype,g),a}(),f=function(){function c(b){b=b||{},this._send=b.transport?e(b.transport):a.ajax,this._get=b.rateLimiter?b.rateLimiter(this._get):this._get}function e(c){return function(d,e){function f(a){b.defer(function(){h.resolve(a)})}function g(a){b.defer(function(){h.reject(a)})}var h=a.Deferred();return c(d,e,f,g),h}}var f=0,g={},h=6,i=new d(10);return c.setMaxPendingRequests=function(a){h=a},c.resetCache=function(){i=new d(10)},b.mixin(c.prototype,{_get:function(a,b,c){function d(b){c&&c(b),i.set(a,b)}function e(){f--,delete g[a],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var j,k=this;(j=g[a])?j.done(d):h>f?(f++,g[a]=this._send(a,b).done(d).always(e)):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(a,c,d){var e;return b.isFunction(c)&&(d=c,c={}),(e=i.get(a))?b.defer(function(){d&&d(e)}):this._get(a,c,d),!!e}}),c}(),g=function(){function c(b){b=b||{},b.datumTokenizer&&b.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=b.datumTokenizer,this.queryTokenizer=b.queryTokenizer,this.datums=[],this.trie=e()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){return{ids:[],children:{}}}function f(a){for(var b={},c=[],d=0;db[e]?e++:(f.push(a[d]),d++,e++);return f}return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;f=c.datums.push(a)-1,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b.children[g]||(b.children[g]=e()),b.ids.push(f)})})},get:function(a){var c,e,h=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=h.trie,c=a.split("");b&&(d=c.shift());)b=b.children[d];return b&&0===c.length?(f=b.ids.slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return h.datums[a]}):[]},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),h=function(){function d(a){var c=a.local||null;return b.isFunction(c)&&(c=c.call(null)),c}function e(d){var e,f;return f={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(e=d.prefetch||null)&&(e=b.isString(e)?{url:e}:e,e=b.mixin(f,e),e.thumbprint=c+e.thumbprint,e.ajax.type=e.ajax.type||"GET",e.ajax.dataType=e.ajax.dataType||"json",!e.url&&a.error("prefetch requires url to be set")),e}function f(c){function d(a){return function(c){return b.debounce(c,a)}}function e(a){return function(c){return b.throttle(c,a)}}var f,g;return g={url:null,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(f=c.remote||null)&&(f=b.isString(f)?{url:f}:f,f=b.mixin(g,f),f.rateLimiter=/^throttle$/i.test(f.rateLimitBy)?e(f.rateLimitWait):d(f.rateLimitWait),f.ajax.type=f.ajax.type||"GET",f.ajax.dataType=f.ajax.dataType||"json",delete f.rateLimitBy,delete f.rateLimitWait,!f.url&&a.error("remote requires url to be set")),f}return{local:d,prefetch:e,remote:f}}(),i=(window.Bloodhound=function(){function c(b){b&&(b.local||b.prefetch||b.remote)||a.error("one of local, prefetch, or remote is required"),this.limit=b.limit||5,this.sorter=d(b.sorter),this.dupDetector=b.dupDetector||i,this.local=h.local(b),this.prefetch=h.prefetch(b),this.remote=h.remote(b),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new g({datumTokenizer:b.datumTokenizer,queryTokenizer:b.queryTokenizer}),this.storage=this.cacheKey?new e(this.cacheKey):null}function d(a){function c(b){return b.sort(a)}function d(a){return a}return b.isFunction(a)?c:d}function i(){return!1}var j;return j={data:"data",protocol:"protocol",thumbprint:"thumbprint"},c.tokenizers={whitespace:function(a){return a.split(/\s+/)},nonword:function(a){return a.split(/\W+/)}},b.mixin(c.prototype,{_loadPrefetch:function(b){function c(a){var c;c=b.filter?b.filter(a):a,f.add(c),f._saveToStorage(f.index.serialize(),b.thumbprint,b.ttl)}var d,e,f=this;return(d=this._readFromStorage(b.thumbprint))?(this.index.bootstrap(d),e=a.Deferred().resolve()):e=a.ajax(b.url,b.ajax).done(c),e},_getFromRemote:function(a,b){function c(a){var c=f.remote.filter?f.remote.filter(a):a;b(c)}var d,e,f=this;return a=a||"",e=encodeURIComponent(a),d=this.remote.replace?this.remote.replace(this.remote.url,a):this.remote.url.replace(this.remote.wildcard,e),this.transport.get(d,this.remote.ajax,c)},_saveToStorage:function(a,b,c){this.storage&&(this.storage.set(j.data,a,c),this.storage.set(j.protocol,location.protocol,c),this.storage.set(j.thumbprint,b,c))},_readFromStorage:function(a){var b,c={};return this.storage&&(c.data=this.storage.get(j.data),c.protocol=this.storage.get(j.protocol),c.thumbprint=this.storage.get(j.thumbprint)),b=c.thumbprint!==a||c.protocol!==location.protocol,c.data&&!b?c.data:null},initialize:function(){function b(){d.add(d.local)}var c,d=this;return c=this.prefetch?this._loadPrefetch(this.prefetch):a.Deferred().resolve(),this.local&&c.done(b),this.transport=this.remote?new f(this.remote):null,this.initialize=function(){return c.promise()},c.promise()},add:function(a){this.index.add(a)},get:function(a,c){function d(a){var d=e.slice(0);b.each(a,function(a){var c;return c=b.some(d,function(b){return f.dupDetector(a,b)}),!c&&d.push(a),d.length