loznotes is a notation layer for conveying information about wireframes, mockups and design comps. Originally a fork, this now a complete rewrite of Elliance's excellent Metaframe work (http://github.com/elliance/metaframe).
##About this fork The original tab handle/button and markers were too big for my usage needs, so this fork began as a means of addressing that as well as stripping the reset and converting the CSS to LESS.
In addition, switches have been added to enable defaulting to hidden anchors, or not displaying the anchors/notation pane at all.
If you decided to use the jQuery version, you'll need to include jQuery (http://jquery.com/download/) before referencing the "loznotes--jquery.min.js". Version 2.0.2 is included in the js/vendor folder for convenience.
The two .png files will need to be placed into your image folder – 'loznotes.less' contains a variable, @path--images, to change the path to these images.
The index.html provides an example.
N.B. This package does not include a CSS reset – this has been seperated out to avoid interference with exisiting styles.
##Usage Just add the data attribute data-notation="[your note here, but without brackets]" to any element that you would like to annotate.
For example, let's say you want to annotate a section on your page with the text, "By default, this section will contain the three most recent featured stories." And let's say the display styles for this section are in the CSS pseudoclass called "features". Here's what that would look like:
<section class="features" data-notation="By default, this section will contain the three most recent featured stories.">
loznotes numbers notes automatically, so you only have to keep track of the notes themselves and they are always located on the HTML element.
In addition to annotating elements, you can also add a page description on the body element:
<body data-notation="This is an example of a page description.">
The data-notation attribute seems to allow simple inline HTML (strong, em and links) – I've not tested this extensively though.
When content is pulled in through ajax calls there is an event listener on the document that will trigger the notes pane and anchors to be re-initialised, adding any new notes.
The enclosed index.html file provides more examples of usage and there is now a live example from a recent client project.
If you'd like to change the red colour, or the highlight color, "loznotes.less" contains two colour variables, @color--brand and @color--highlight, which you can change to whatever you need.
##Switches It is now possible to hide the note anchors by default, or turn the notes off completely, via switches.
To hide the note anchors by default:
To turn off note anchors and the notation pane completely:
http://mydomain.com/mypage.html?loznotes=off – removes the note anchors and note pane completely
A URL without a switch provided will display note anchors and the notes pane as normal. Also these switches will now work with Codekit's cachebuster query string.
N.B. The switches wont persist, so you'll need to add them to each URL.
##How it works loznotes scans the DOM for elements with a [data-notation] attribute, then creates a numbered note anchor and a tab (with a title taken from the page's title attribute) containing each of the notations.
On hand held devices it has been tested on iOS 5-7 Mobile Safari and on Andriod 4.x, in both Chrome and the default browser. It works of a fashion in the Android 3.2 browser.
You're milage may vary considerably in other browsers.
There shouldn't be too many, apart from:
- Adding [data-notation] to img elements will not work.
- Adding [data-notation] to child elements within a table, such as tr, th and td also causes problems. Adding to the table element itself works okay.
- On a Nexus 7, running Android 4.x.x Chrome browser, the pane has slight CSS issues.
Any more let me know.
######©2013 Loz Gray - Creative Commons Attribution Sharealike 3.0 Unported http://creativecommons.org/licenses/by-sa/3.0/