This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Sage
committed
May 7, 2015
1 parent
e59e103
commit 6b91a72
Showing
1 changed file
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,57 @@ | ||
# Acumen Brands Modal Utilities Library for Picreel | ||
|
||
--- | ||
# Acumen Brands Utilities Library for Picreel | ||
|
||
Whosoever embeds this library in a Picreel template, if he be worthy, shall possess the power to send emails to SailThru and track them using Lighthouse. | ||
|
||
## An Important Note on [Semantic Versioning](http://semver.org/) | ||
|
||
This library attempts to follow the SemVer specification. Before deploying, be sure to update the library version in <code>package.json</code>. This library will deploy to a semantically versioned path in the specified S3 bucket, so breaking changes will not affect previously deployed versions. | ||
|
||
|
||
## Environment Setup | ||
|
||
1. Install [Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) | ||
1. Run <code>npm install</code>, which will install all necessary support libraries for testing building, and exporting | ||
1. Copy <code>config/aws-config.json.example</code> to <code>config/aws-config.json</code> and fill in with appropriate values.<br> | ||
_If you don't have actual values for the config params, the example values may be left or changed simply to <code>""</code>, and the <code>grunt aws</code> task simply won't complete._ | ||
|
||
## Export APLS for Browsers | ||
|
||
1. Follow the [Environment Setup](#environment-setup) steps above | ||
1. Run <code>grunt</code> to build the libraries. If all tests pass, normal and minified libraries will be in the <code>/build</code> directory. | ||
|
||
## Run Acceptance Tests Only | ||
|
||
1. Follow the [Environment Setup](#environment-setup) steps above | ||
1. Run <code>grunt test</code> | ||
|
||
## Deploy to Production | ||
|
||
1. Follow the [Environment Setup](#environment-setup) steps above | ||
1. Update the semantic version in <code>package.json</code> | ||
1. Run <code>grunt deploy:production</code>. If all tests pass, normal and minified libraries will be uploaded to the S3 bucket specified in <code>config/aws-config.json</code> along a semantically versioned path, and a matching CloudFront invalidation will be created. | ||
|
||
## Implementation Example | ||
|
||
In the Picreel template editor... | ||
|
||
```JavaScript | ||
<script src="//my-cloudfront-dist-id.cloudfront.net/libs/picreel/0.1.0/picreel.min.js"></script> | ||
<script> | ||
if(window.jQuery){ | ||
|
||
jQuery(document).ready(function($) { | ||
var params = { | ||
submitSelector: "#submit-button", | ||
emailSelector: "input[name='email']", | ||
action: "http://countryoutfitter.com/subscribe/" | ||
}; | ||
window.APLS = new APLSubscriber(params); | ||
}); | ||
|
||
}; | ||
</script> | ||
``` | ||
|
||
_NOTE 1: Pireel's editor does not load jQuery, but we're dependent on jQuery. Therefore, be sure to wrap <code>new APLSubscriber</code> declaration in an <code>if()</code>_ | ||
|
||
_NOTE 2: Most new APLS attributes may be specified when creating a new object. See <code>lib/factories/subscriber.js</code> for what may be created as arguments_ |
6b91a72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, all your lists are belong to the number 1.
6b91a72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, any number followed by a period will render as a numbered list, so doing it this way beats having to update a cascade of line numbers with a weird change log, in the case we insert a new number in the middle.
Do you prefer them to be manually numbered, though?
6b91a72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰 !