Permalink
Browse files

Merge branch 'v1.0rc-expressv3'

  • Loading branch information...
2 parents 54e669e + 71cd8fc commit 4238d35945dbb2052d7e55ae6073e26a6bc2ad18 @JasonGiedymin committed Oct 14, 2012
Showing with 363 additions and 568 deletions.
  1. +4 −0 History.md
  2. +5 −1 Makefile
  3. +41 −21 Readme.md
  4. +0 −1 docs/.gitignore
  5. +0 −130 docs/Makefile
  6. +0 −216 docs/source/conf.py
  7. +0 −30 docs/source/index.rst
  8. +0 −27 index.coffee
  9. +120 −27 index.js
  10. +12 −5 package.json
  11. +52 −0 test/app-lib.js
  12. +6 −0 test/app.js
  13. +20 −0 test/fixtures/index.jade
  14. +0 −1 test/fixtures/messages.ejs
  15. +50 −109 test/messages.test.js
  16. +53 −0 test/messagesv2.test.js
View
@@ -1,3 +1,7 @@
+1.0.0rc1 / 2012-09-03
+==================
+ * Complete re-write for Express 3.0
+
0.1.0 / 2012-07-01
==================
* Use button (<button>) instead of from anchor (<a>)
View
@@ -1,5 +1,9 @@
+MOCHA_OPTS= -c
+REPORTER = spec
test:
- @./support/expresso/bin/expresso --serial test/*.test.js
+ @NODE_ENV=test ./node_modules/.bin/mocha \
+ --reporter $(REPORTER) \
+ $(MOCHA_OPTS)
.PHONY: test
View
@@ -1,22 +1,17 @@
# Express Messages
+
+The _express-messages-bootstrap_ module provides flash notification rendering that is compatible with [Bootstrap](http://twitter.github.com/bootstrap/) CSS framework.
-# Express v3.x NOTE!
+ // Raw messages, do with it what you like
+ var messages = require('express-messages-bootstrap');
-See [v1.0.0rc1 branch](https://github.com/JasonGiedymin/express-messages-bootstrap/tree/v1.0rc-expressv3) for Express v3.x compatibility
+ // Old v2 rendering messages
+ var messages = require('express-messages-bootstrap').with({should_render:true});
-## Continue on for Express v2.x compatibility
-The _express-messages-bootstrap_ module provides flash notification rendering that is compatible with [Bootstrap](http://twitter.github.com/bootstrap/) CSS framework. This module is based on TJ Holowaychuk's express-messages. To use, simply assign it to a dynamic helper:
+## Rewrite
- app.dynamicHelpers({ messages: require('express-messages-bootstrap') });
+Version 1.0 is a complete rewrite from previous versions (which were forked from express-messages).
-## This Fork Code
-
-This fork is seperately maintained but I do upstream sync with the original express-messages.
-
-- The main github branch is considered stable.
-- GA's should be Tagged.
-- Major changes are milestoned.
-- If you want bleeding edge changes look for the highest versioned beta branch or tag.
## Installation
@@ -28,17 +23,44 @@ On cygwin you may need to force and display logging. Verbosity for some reason p
$ npm --force --loglevel verbose express-messages-bootstrap.
-## Usage
-Then in a view you may output the notifications based on your templating engine:
+## Backward Compatible V2 Usage
+
+By default only a raw list of messages in the order which you submit them are accessible. If you would
+like them rendered as they used to be you'll have to use:
+
+ .with({should_render:true})
-### [EJS](https://github.com/visionmedia/ejs)
+Use rmessage() method (rendering message).
- <%- messages() %>
### [Jade](http://jade-lang.com/)
- != messages()
+ if (messages_rendered)
+ h3 Rendered
+ // Rendered Messages `require('express-messages-bootstrap').with({should_render:true})`
+ div!= rmessages()
+
+
+## Normal usage
+
+You can access the raw messages and with your template iterate on them.
+
+
+### [Jade](http://jade-lang.com/)
+
+ if (!messages_rendered)
+ h3 Raw
+ // Raw Messages `require('express-messages-bootstrap')`
+ ul
+ each message in messages
+ li= message
+
+
+## Output (Only for v2 Compatibility mode)
+
+Note: You have full access to the messages list. If you want the old style of
+having the middelware render content for you follow the v2 directions.
Which outputs HTML as shown below:
@@ -73,11 +95,9 @@ Then run the tests:
## License
-Original express-messages License:
-
(The MIT License)
-Copyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+Copyright (c) 2012 Jason Giedymin
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -1 +0,0 @@
-build
View
@@ -1,130 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/express-messages.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/express-messages.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/express-messages"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/express-messages"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- make -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
Oops, something went wrong.

0 comments on commit 4238d35

Please sign in to comment.