diff --git a/annotator.html b/annotator.html
new file mode 100755
index 0000000..d833e26
--- /dev/null
+++ b/annotator.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ –
+
+
+
‹
+
+
›
+
+
+
+
+
diff --git a/css/annotator.css b/css/annotator.css
new file mode 100644
index 0000000..412cefc
--- /dev/null
+++ b/css/annotator.css
@@ -0,0 +1,897 @@
+/* Base Reset
+-------------------------------------------------------------------- */
+
+.annotator-notice,
+.annotator-filter *,
+.annotator-widget * {
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
+ font-weight: normal;
+ text-align: left;
+ margin: 0;
+ padding: 0;
+ background: none;
+ -webkit-transition: none;
+ -moz-transition: none;
+ -o-transition: none;
+ transition: none;
+ -moz-box-shadow: none;
+ -webkit-box-shadow: none;
+ -o-box-shadow: none;
+ box-shadow: none;
+ color: rgb(144, 144, 144);
+}
+
+/* Images
+-------------------------------------------------------------------- */
+
+.annotator-adder {
+ background-image: url(../img/annotator-icon-sprite.png);
+ background-repeat: no-repeat;
+}
+
+.annotator-resize,
+.annotator-widget::after,
+.annotator-editor a::after,
+.annotator-viewer .annotator-controls button,
+.annotator-viewer .annotator-controls a,
+.annotator-filter .annotator-filter-navigation button::after,
+.annotator-filter .annotator-filter-property .annotator-filter-clear {
+ background-image: url(../img/annotator-glyph-sprite.png);
+ background-repeat: no-repeat;
+}
+
+/* Annotator Highlight
+-------------------------------------------------------------------- */
+
+.annotator-hl {
+ background: rgba(255, 255, 10, 0.3);
+}
+
+.annotator-hl-temporary {
+ background: rgba(0, 124, 255, 0.3);
+}
+
+/* Annotator Wrapper
+-------------------------------------------------------------------- */
+
+.annotator-wrapper {
+ position: relative;
+}
+
+/* NB: If you change the list of classes for which z-index is set,
+ you should update Annotator._setupDynamicStyle() */
+.annotator-adder,
+.annotator-outer,
+.annotator-notice {
+ z-index: 1020;
+}
+
+.annotator-filter {
+ z-index: 1010;
+}
+
+.annotator-adder,
+.annotator-outer,
+.annotator-widget,
+.annotator-notice {
+ position: absolute;
+ font-size: 10px;
+ line-height: 1;
+}
+
+.annotator-hide {
+ display: none;
+ visibility: hidden;
+}
+
+/* Annotator Adder
+-------------------------------------------------------------------- */
+
+.annotator-adder {
+ margin-top: -48px;
+ margin-left: -24px;
+ width: 48px;
+ height: 48px;
+ background-position: left top;
+}
+
+.annotator-adder:hover {
+ background-position: center top;
+}
+
+.annotator-adder:active {
+ background-position: center right;
+}
+
+.annotator-adder button {
+ display: block;
+ width: 36px;
+ height: 41px;
+ margin: 0 auto;
+ border: none;
+ background: none;
+ text-indent: -999em;
+ cursor: pointer;
+}
+
+/* Annotator Widget
+
+ This applies to both the Viewer and the Editor
+-------------------------------------------------------------------- */
+
+.annotator-outer {
+ width: 0;
+ height: 0;
+}
+
+.annotator-widget {
+ margin: 0;
+ padding: 0;
+ bottom: 15px;
+ left: -18px;
+ min-width: 265px;
+ background-color: rgba(251, 251, 251, 0.98);
+ border: 1px solid rgba(122, 122, 122, 0.6);
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
+ -o-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
+}
+
+/* FRED - removed for fixed pos
+.annotator-invert-x .annotator-widget {
+ left: auto;
+ right: -18px;
+}
+
+.annotator-invert-y .annotator-widget {
+ bottom: auto;
+ top: 8px;
+} */
+
+.annotator-widget strong {
+ font-weight: bold;
+}
+
+.annotator-widget .annotator-listing,
+.annotator-widget .annotator-item {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+.annotator-widget::after {
+ content: "";
+ display: block;
+ width: 18px;
+ height: 10px;
+ background-position: 0 0;
+ position: absolute;
+ bottom: -10px;
+ left: 8px;
+}
+
+.annotator-invert-x .annotator-widget::after {
+ left: auto;
+ right: 8px;
+}
+
+.annotator-invert-y .annotator-widget::after {
+ background-position: 0 -15px;
+ bottom: auto;
+ top: -9px;
+}
+
+.annotator-widget .annotator-item,
+.annotator-editor .annotator-item input,
+.annotator-editor .annotator-item textarea {
+ position: relative;
+ font-size: 12px;
+}
+
+.annotator-viewer .annotator-item {
+ border-top: 2px solid rgba(122, 122, 122, 0.2);
+}
+
+.annotator-widget .annotator-item:first-child {
+ border-top: none;
+}
+
+.annotator-editor .annotator-item,
+.annotator-viewer div {
+ border-top: 1px solid rgba(133, 133, 133, 0.11);
+}
+
+/* Annotator Viewer
+-------------------------------------------------------------------- */
+
+.annotator-viewer div {
+ padding: 6px 6px;
+}
+
+.annotator-viewer .annotator-item ol,
+.annotator-viewer .annotator-item ul {
+ padding: 4px 16px;
+}
+
+.annotator-viewer .annotator-item li {
+}
+
+.annotator-viewer div:first-of-type,
+.annotator-editor .annotator-item:first-child textarea {
+ padding-top: 12px;
+ padding-bottom: 12px;
+ color: rgb(60, 60, 60);
+ font-size: 13px;
+ font-style: italic;
+ line-height: 1.3;
+ border-top: none;
+}
+
+.annotator-viewer .annotator-controls {
+ position: relative;
+ top: 5px;
+ right: 5px;
+ padding-left: 5px;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s ease-in;
+ -moz-transition: opacity 0.2s ease-in;
+ -o-transition: opacity 0.2s ease-in;
+ transition: opacity 0.2s ease-in;
+ float: right;
+}
+
+.annotator-viewer li:hover .annotator-controls,
+.annotator-viewer li .annotator-controls.annotator-visible {
+ opacity: 1;
+}
+
+.annotator-viewer .annotator-controls button,
+.annotator-viewer .annotator-controls a {
+ cursor: pointer;
+ display: inline-block;
+ width: 13px;
+ height: 13px;
+ margin-left: 2px;
+ border: none;
+ opacity: 0.2;
+ text-indent: -900em;
+ background-color: transparent;
+ outline: none;
+}
+
+.annotator-viewer .annotator-controls button:hover,
+.annotator-viewer .annotator-controls button:focus,
+.annotator-viewer .annotator-controls a:hover,
+.annotator-viewer .annotator-controls a:focus {
+ opacity: 0.9;
+}
+
+.annotator-viewer .annotator-controls button:active,
+.annotator-viewer .annotator-controls a:active {
+ opacity: 1;
+}
+
+.annotator-viewer .annotator-controls button[disabled] {
+ display: none;
+}
+
+.annotator-viewer .annotator-controls .annotator-edit {
+ background-position: 0 -60px;
+}
+
+.annotator-viewer .annotator-controls .annotator-delete {
+ background-position: 0 -75px;
+}
+
+.annotator-viewer .annotator-controls .annotator-link {
+ background-position: 0 -270px;
+}
+
+/* Annotator Editor
+-------------------------------------------------------------------- */
+
+.annotator-editor .annotator-item {
+ position: relative;
+}
+
+.annotator-editor .annotator-item label {
+ top: 0;
+ display: inline;
+ cursor: pointer;
+ font-size: 12px;
+}
+
+.annotator-editor .annotator-item input,
+.annotator-editor .annotator-item textarea {
+ display: block;
+ min-width: 100%;
+ padding: 10px 8px;
+ border: none;
+ margin: 0;
+ color: rgb(60, 60, 60);
+ background: none;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -o-box-sizing: border-box;
+ box-sizing: border-box;
+ resize: none;
+}
+
+.annotator-editor .annotator-item textarea::-webkit-scrollbar {
+ height: 8px;
+ width: 8px;
+}
+
+.annotator-editor .annotator-item textarea::-webkit-scrollbar-track-piece {
+ margin: 13px 0 3px;
+ background-color: #e5e5e5;
+ -webkit-border-radius: 4px;
+}
+
+.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:vertical {
+ height: 25px;
+ background-color: #ccc;
+ -webkit-border-radius: 4px;
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
+}
+
+.annotator-editor .annotator-item textarea::-webkit-scrollbar-thumb:horizontal {
+ width: 25px;
+ background-color: #ccc;
+ -webkit-border-radius: 4px;
+}
+
+.annotator-editor .annotator-item:first-child textarea {
+ min-height: 5.5em;
+ -webkit-border-radius: 5px 5px 0 0;
+ -moz-border-radius: 5px 5px 0 0;
+ -o-border-radius: 5px 5px 0 0;
+ border-radius: 5px 5px 0 0;
+}
+
+.annotator-editor .annotator-item input:focus,
+.annotator-editor .annotator-item textarea:focus{
+ background-color: rgb(243, 243, 243);
+ outline: none;
+}
+
+.annotator-editor .annotator-item input[type=radio],
+.annotator-editor .annotator-item input[type=checkbox] {
+ width: auto;
+ min-width: 0;
+ padding: 0;
+ display: inline;
+ margin: 0 4px 0 0;
+ cursor: pointer;
+}
+
+.annotator-editor .annotator-checkbox {
+ padding: 8px 6px;
+}
+
+.annotator-filter,
+.annotator-filter .annotator-filter-navigation button,
+.annotator-editor .annotator-controls {
+ text-align: right;
+ padding: 3px;
+ border-top: 1px solid rgb(212,212,212);
+ background-color: rgb(212, 212, 212);
+ background-image: -webkit-gradient(
+ linear, left top, left bottom,
+ from(rgb(245, 245, 245)),
+ color-stop(0.6, rgb(220, 220, 220)),
+ to(rgb(210, 210, 210))
+ );
+ background-image: -moz-linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(220, 220, 220) 60%,
+ rgb(210, 210, 210)
+ );
+ background-image: -webkit-linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(220, 220, 220) 60%,
+ rgb(210, 210, 210)
+ );
+ background-image: linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(220, 220, 220) 60%,
+ rgb(210, 210, 210)
+ );
+ -webkit-box-shadow:
+ inset 1px 0 0 rgba(255, 255, 255, 0.7),
+ inset -1px 0 0 rgba(255, 255, 255, 0.7),
+ inset 0 1px 0 rgba(255, 255, 255, 0.7);
+ -moz-box-shadow:
+ inset 1px 0 0 rgba(255, 255, 255, 0.7),
+ inset -1px 0 0 rgba(255, 255, 255, 0.7),
+ inset 0 1px 0 rgba(255, 255, 255, 0.7);
+ -o-box-shadow:
+ inset 1px 0 0 rgba(255, 255, 255, 0.7),
+ inset -1px 0 0 rgba(255, 255, 255, 0.7),
+ inset 0 1px 0 rgba(255, 255, 255, 0.7);
+ box-shadow:
+ inset 1px 0 0 rgba(255, 255, 255, 0.7),
+ inset -1px 0 0 rgba(255, 255, 255, 0.7),
+ inset 0 1px 0 rgba(255, 255, 255, 0.7);
+ -webkit-border-radius: 0 0 5px 5px;
+ -moz-border-radius: 0 0 5px 5px;
+ -o-border-radius: 0 0 5px 5px;
+ border-radius: 0 0 5px 5px;
+}
+
+.annotator-editor.annotator-invert-y .annotator-controls {
+ border-top: none;
+ border-bottom: 1px solid rgb(180, 180, 180);
+ -webkit-border-radius: 5px 5px 0 0;
+ -moz-border-radius: 5px 5px 0 0;
+ -o-border-radius: 5px 5px 0 0;
+ border-radius: 5px 5px 0 0;
+}
+
+.annotator-editor a,
+.annotator-filter .annotator-filter-property label {
+ position: relative;
+ display: inline-block;
+ padding: 0 6px 0 22px;
+ color: rgb(54, 54, 54);
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
+ text-decoration: none;
+ line-height: 24px;
+ font-size: 12px;
+ font-weight: bold;
+ border: 1px solid rgb(162, 162, 162);
+ background-color: rgb(212, 212, 212);
+ background-image: -webkit-gradient(
+ linear, left top, left bottom,
+ from(rgb(245, 245, 245)),
+ color-stop(0.5, rgb(210, 210, 210)),
+ color-stop(0.5, rgb(190, 190, 190)),
+ to(rgb(210, 210, 210))
+ );
+ background-image: -moz-linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(210, 210, 210) 50%,
+ rgb(190, 190, 190) 50%,
+ rgb(210, 210, 210)
+ );
+ background-image: -webkit-linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(210, 210, 210) 50%,
+ rgb(190, 190, 190) 50%,
+ rgb(210, 210, 210)
+ );
+ background-image: linear-gradient(
+ -90deg,
+ rgb(245, 245, 245),
+ rgb(210, 210, 210) 50%,
+ rgb(190, 190, 190) 50%,
+ rgb(210, 210, 210)
+ );
+ -webkit-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ -moz-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ -o-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -o-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.annotator-editor a::after {
+ position: absolute;
+ top: 50%;
+ left: 5px;
+ display: block;
+ content: "";
+ width: 15px;
+ height: 15px;
+ margin-top: -7px;
+ background-position: 0 -90px;
+}
+
+.annotator-editor a:hover,
+.annotator-editor a:focus,
+.annotator-editor a.annotator-focus,
+.annotator-filter .annotator-filter-active label,
+.annotator-filter .annotator-filter-navigation button:hover {
+ outline: none;
+ border-color: rgb(67, 90, 160);
+ background-color: rgb(56, 101, 249);
+ background-image: -webkit-gradient(
+ linear, left top, left bottom,
+ from(rgb(118, 145, 251)),
+ color-stop(0.5, rgb(80, 117, 251)),
+ color-stop(0.5, rgb(56, 101, 249)),
+ to(rgb(54, 101, 250))
+ );
+ background-image: -moz-linear-gradient(
+ -90deg,
+ rgb(118, 145, 251),
+ rgb(80, 117, 251) 50%,
+ rgb(56, 101, 249) 50%,
+ rgb(54, 101, 250)
+ );
+ background-image: -webkit-linear-gradient(
+ -90deg,
+ rgb(118, 145, 251),
+ rgb(80, 117, 251) 50%,
+ rgb(56, 101, 249) 50%,
+ rgb(54, 101, 250)
+ );
+ background-image: linear-gradient(
+ -90deg,
+ rgb(118, 145, 251),
+ rgb(80, 117, 251) 50%,
+ rgb(56, 101, 249) 50%,
+ rgb(54, 101, 250)
+ );
+ color: rgb(255, 255, 255);
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.42);
+}
+
+.annotator-editor a:hover::after,
+.annotator-editor a:focus::after {
+ margin-top: -8px;
+ background-position: 0 -105px;
+}
+
+.annotator-editor a:active,
+.annotator-filter .annotator-filter-navigation button:active {
+ border-color: rgb(112, 12, 73);
+ background-color: rgb(209, 46, 142);
+ background-image: -webkit-gradient(
+ linear, left top, left bottom,
+ from(rgb(252, 124, 202)),
+ color-stop(0.5, rgb(232, 93, 178)),
+ color-stop(0.5, rgb(209, 46, 142)),
+ to(rgb(255, 0, 156))
+ );
+ background-image: -moz-linear-gradient(
+ -90deg,
+ rgb(252, 124, 202),
+ rgb(232, 93, 178) 50%,
+ rgb(209, 46, 142) 50%,
+ rgb(255, 0, 156)
+ );
+ background-image: -webkit-linear-gradient(
+ -90deg,
+ rgb(252, 124, 202),
+ rgb(232, 93, 178) 50%,
+ rgb(209, 46, 142) 50%,
+ rgb(255, 0, 156)
+ );
+ background-image: linear-gradient(
+ -90deg,
+ rgb(252, 124, 202),
+ rgb(232, 93, 178) 50%,
+ rgb(209, 46, 142) 50%,
+ rgb(255, 0, 156)
+ );
+}
+
+.annotator-editor a.annotator-save::after {
+ background-position: 0 -120px;
+}
+
+.annotator-editor a.annotator-save:hover::after,
+.annotator-editor a.annotator-save:focus::after,
+.annotator-editor a.annotator-save.annotator-focus::after {
+ margin-top: -8px;
+ background-position: 0 -135px;
+}
+
+.annotator-editor .annotator-widget::after {
+ background-position: 0 -30px;
+}
+
+.annotator-editor.annotator-invert-y .annotator-widget .annotator-controls {
+ background-color: #f2f2f2;
+}
+
+.annotator-editor.annotator-invert-y .annotator-widget::after {
+ background-position: 0 -45px;
+ height: 11px;
+}
+
+.annotator-resize {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 12px;
+ height: 12px;
+ background-position: 2px -150px;
+}
+
+.annotator-invert-x .annotator-resize {
+ right: auto;
+ left: 0;
+ background-position: 0 -195px;
+}
+
+.annotator-invert-y .annotator-resize {
+ top: auto;
+ bottom: 0;
+ background-position: 2px -165px;
+}
+
+.annotator-invert-y.annotator-invert-x .annotator-resize {
+ background-position: 0 -180px;
+}
+
+/* Annotator Notification
+-------------------------------------------------------------------- */
+
+.annotator-notice {
+ color: #fff;
+ position: absolute;
+ position: fixed;
+ top: -54px;
+ left: 0;
+ width: 100%;
+ font-size: 14px;
+ line-height: 50px;
+ text-align: center;
+ background: black;
+ background: rgba(0, 0, 0, 0.9);
+ border-bottom: 4px solid #d4d4d4;
+ -webkit-transition: top 0.4s ease-out;
+ -moz-transition: top 0.4s ease-out;
+ -o-transition: top 0.4s ease-out;
+ transition: top 0.4s ease-out;
+}
+
+.ie6 .annotator-notice {
+ position: absolute;
+}
+
+.annotator-notice-success {
+ border-color: #3665f9;
+}
+
+.annotator-notice-error {
+ border-color: #ff7e00;
+}
+
+.annotator-notice p {
+ margin: 0;
+}
+
+.annotator-notice a {
+ color: #fff;
+}
+
+.annotator-notice-show {
+ top: 0;
+}
+
+/* Annotator Tags Plugin
+-------------------------------------------------------------------- */
+
+.annotator-tags {
+ margin-bottom: -2px;
+}
+
+.annotator-tags .annotator-tag {
+ display: inline-block;
+ padding: 0 8px;
+ margin-bottom: 2px;
+ line-height: 1.6;
+ font-weight: bold;
+ background-color: rgb(230, 230, 230);
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ -o-border-radius: 8px;
+ border-radius: 8px;
+}
+
+/* Annotator Filter Plugin
+-------------------------------------------------------------------- */
+
+.annotator-filter {
+ position: fixed;
+ top: 0;
+ right: 0;
+ left: 0;
+ text-align: left;
+ line-height: 0;
+ border: none;
+ border-bottom: 1px solid #878787;
+ padding-left: 10px;
+ padding-right: 10px;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ -o-border-radius: 0;
+ border-radius: 0;
+ -webkit-box-shadow:
+ inset 0 -1px 0 rgba(255, 255, 255, 0.3);
+ -moz-box-shadow:
+ inset 0 -1px 0 rgba(255, 255, 255, 0.3);
+ -o-box-shadow:
+ inset 0 -1px 0 rgba(255, 255, 255, 0.3);
+ box-shadow:
+ inset 0 -1px 0 rgba(255, 255, 255, 0.3);
+}
+
+.annotator-filter strong {
+ font-size: 12px;
+ font-weight: bold;
+ color: #3c3c3c;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
+ position: relative;
+ top: -9px;
+}
+
+
+.annotator-filter .annotator-filter-property,
+.annotator-filter .annotator-filter-navigation {
+ position: relative;
+ display: inline-block;
+ overflow: hidden;
+ line-height: 10px;
+ padding: 2px 0;
+ margin-right: 8px;
+}
+
+.annotator-filter .annotator-filter-property label,
+.annotator-filter .annotator-filter-navigation button {
+ text-align: left;
+ display: block;
+ float: left;
+ line-height: 20px;
+ -webkit-border-radius: 10px 0 0 10px;
+ -moz-border-radius: 10px 0 0 10px;
+ -o-border-radius: 10px 0 0 10px;
+ border-radius: 10px 0 0 10px;
+}
+
+.annotator-filter .annotator-filter-property label {
+ padding-left: 8px;
+}
+
+.annotator-filter .annotator-filter-property input {
+ display: block;
+ float: right;
+ -webkit-appearance: none;
+ background-color: #fff;
+ border: 1px solid #878787;
+ border-left: none;
+ padding: 2px 4px;
+ line-height: 16px;
+ min-height: 16px;
+ font-size: 12px;
+ width: 150px;
+ color: #333;
+ background-color: #f8f8f8;
+ -webkit-border-radius: 0 10px 10px 0;
+ -moz-border-radius: 0 10px 10px 0;
+ -o-border-radius: 0 10px 10px 0;
+ border-radius: 0 10px 10px 0;
+ -webkit-box-shadow:
+ inset 0 1px 1px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow:
+ inset 0 1px 1px rgba(0, 0, 0, 0.2);
+ -o-box-shadow:
+ inset 0 1px 1px rgba(0, 0, 0, 0.2);
+ box-shadow:
+ inset 0 1px 1px rgba(0, 0, 0, 0.2);
+
+}
+
+.annotator-filter .annotator-filter-property input:focus {
+ outline: none;
+ background-color: #fff;
+}
+
+.annotator-filter .annotator-filter-clear {
+ position: absolute;
+ right: 3px;
+ top: 6px;
+ border: none;
+ text-indent: -900em;
+ width: 15px;
+ height: 15px;
+ background-position: 0 -90px;
+ opacity: 0.4;
+}
+
+.annotator-filter .annotator-filter-clear:hover,
+.annotator-filter .annotator-filter-clear:focus {
+ opacity: 0.8;
+}
+
+.annotator-filter .annotator-filter-clear:active {
+ opacity: 1;
+}
+
+.annotator-filter .annotator-filter-navigation button {
+ border: 1px solid rgb(162, 162, 162);
+ padding: 0;
+ text-indent: -900px;
+ width: 20px;
+ min-height: 22px;
+ -webkit-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ -moz-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ -o-box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+ box-shadow:
+ inset 0 0 5px rgba(255, 255, 255, 0.2),
+ inset 0 0 1px rgba(255, 255, 255, 0.8);
+}
+
+.annotator-filter .annotator-filter-navigation button,
+.annotator-filter .annotator-filter-navigation button:hover,
+.annotator-filter .annotator-filter-navigation button:focus {
+ color: transparent;
+}
+
+.annotator-filter .annotator-filter-navigation button::after {
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ content: "";
+ display: block;
+ width: 9px;
+ height: 9px;
+ background-position: 0 -210px;
+}
+
+.annotator-filter .annotator-filter-navigation button:hover::after {
+ background-position: 0 -225px;
+}
+
+.annotator-filter .annotator-filter-navigation .annotator-filter-next {
+ -webkit-border-radius: 0 10px 10px 0;
+ -moz-border-radius: 0 10px 10px 0;
+ -o-border-radius: 0 10px 10px 0;
+ border-radius: 0 10px 10px 0;
+ border-left: none;
+}
+
+.annotator-filter .annotator-filter-navigation .annotator-filter-next::after {
+ left: auto;
+ right: 7px;
+ background-position: 0 -240px;
+}
+
+.annotator-filter .annotator-filter-navigation .annotator-filter-next:hover::after {
+ background-position: 0 -255px;
+}
+
+.annotator-hl-active {
+ background: rgba(255, 255, 10, 0.8);
+}
+
+.annotator-hl-filtered {
+ background-color: transparent;
+}
+
+/* FIXED HACK */
+
+.annotator-adder,
+.annotator-editor,
+.annotator-viewer
+{
+ position: fixed;
+}
diff --git a/dist/.DS_Store b/dist/.DS_Store
index 41f0825..08e4685 100644
Binary files a/dist/.DS_Store and b/dist/.DS_Store differ
diff --git a/dist/hooks/transculsions.min.js b/dist/hooks/transculsions.min.js
index cb8ed5e..4201d9b 100644
--- a/dist/hooks/transculsions.min.js
+++ b/dist/hooks/transculsions.min.js
@@ -1,2 +1,2 @@
-/*! FuturePress - v0.1.0 - 2013-03-02 */
+/*! FuturePress - v0.1.0 - 2013-03-04 */
FP.Hooks.register("beforeChapterDisplay").transculsions=function(e,t){var n=t.doc.querySelectorAll("[transclusion]"),r=Array.prototype.slice.call(n);r.forEach(function(e){function l(){u=i,a=s,u>t.colWidth&&(f=t.colWidth/u,u=t.colWidth,a*=f),r.width=u,r.height=a}var n=e.getAttribute("ref"),r=document.createElement("iframe"),i=e.getAttribute("width"),s=e.getAttribute("height"),o=e.parentNode,u=i,a=s,f;l(),t.book.listenUntil("book:resized","book:chapterDestroy",l),r.src=n,o.replaceChild(r,e)}),e&&e()};
\ No newline at end of file
diff --git a/dist/reader.min.js b/dist/reader.min.js
index 8f55e87..3a65c0b 100644
--- a/dist/reader.min.js
+++ b/dist/reader.min.js
@@ -1,2 +1,2 @@
-/*! FuturePress - v0.1.0 - 2013-03-02 */
+/*! FuturePress - v0.1.0 - 2013-03-04 */
var FPR=FPR||{};FPR.app={},FPR.app.init=function(e){"use strict";function s(n){var s=window.location.search.match(/book=(.*)/),n=n||(s?s[1]:"moby-dick");FP.core.crossBrowserColumnCss(),i=e(window).width(),i>550?e("#main").width(i-r):e("#main").width(i),a(),t=new FP.Book("area"),t.listen("book:metadataReady",o),t.listen("book:tocReady",u),t.listen("book:bookReady",l),t.listen("book:chapterReady",p),t.listen("book:online",c),t.listen("book:offline",h),t.start(n),e(function(){d()})}function o(){var n=t.getTitle(),r=t.getCreator(),i=e("#book-title"),s=e("#chapter-title"),o=e("#title-seperator");document.title=n+" – "+r,i.html(n),s.html(r),o.show()}function u(){var n=t.getTOC(),r=e("#toc"),i,s;r.empty(),s=f(n,1),r.append(s),i=e(".toc_link"),i.on("click",function(n){var r=e(this),i=r.data("url");e(".openChapter").removeClass("openChapter"),r.parents("li").addClass("openChapter"),t.useHash||(t.show(i),n.preventDefault())})}function a(){var n="";localStorage.getItem("fontSize")?n=localStorage.getItem("fontSize"):(n="medium",localStorage.setItem("fontSize",n));var r=e("#settingsPanel");r.append("");var i=e(" "),s=e("Extra Small Small Medium Large Extra Large ");i.find("h3").text("Font Size").after(s),r.find("ul").append(i);var o=e('input[name="fontSize"]');o.each(function(){e(this).attr("value")==n&&e(this).attr("checked","checked"),e(this).on("click",function(){localStorage.setItem("fontSize",e(this).attr("value")),t.iframe.contentDocument.location.reload(!0)})})}function f(t,n){var r=e(""),i=n==1?"chapter":"section";return t.forEach(function(t){var s,o=e(""),u=e(""+t.label+" ");o.append(u),t.subitems&&t.subitems.length&&(n++,s=f(t.subitems,n),o.append(s)),r.append(o)}),r}function l(){var t=e("#divider"),n=e("#loader");n.hide(),t.addClass("show")}function c(){var t=e("#store");n=!1,t.attr("src","img/save.png")}function h(){var t=e("#store");n=!0,t.attr("src","img/saved.png")}function p(t){var n=t.msg,r=e("#toc-"+n),i=e(".currentChapter");r.length&&(i.removeClass("currentChapter"),r.addClass("currentChapter"))}function d(){function y(){f.addClass("open"),u.addClass("closed"),c.attr("src","img/close.png")}function b(){a.css("pointer-events","visible"),f.removeClass("open"),u.removeClass("closed"),c.attr("src","img/menu-icon.png")}function w(){v.hide(),d.show()}function E(){d.hide(),v.show()}var s=e("#next"),o=e("#prev"),u=e("#main"),a=e("#area"),f=e("#sidebar"),l=e("#open"),c=l.find("img"),h=e("#network"),p=e("#setting"),d=e("#settingsPanel"),v=e("#toc"),m=e(window);m.on("resize",function(){i=e(window).width(),i>550?u.width(i-r):u.width(i)}),s.on("click",function(){t.nextPage()}),o.on("click",function(){t.prevPage()}),p.on("click",function(){d.is(":visible")?E():w()}),m.bind("touchy-swipe",function(e,n,r,i){(i.direction="left")&&t.nextPage(),(i.direction="right")&&t.prevPage()});var g=!1;e(document).keydown(function(e){if(g)return;if(e.keyCode==37)return o.trigger("click"),g=!0,setTimeout(function(){g=!1},100),!1;if(e.keyCode==39)return s.trigger("click"),g=!0,setTimeout(function(){g=!1},100),!1}),l.on("click",function(){f.hasClass("open")?b():y()}),h.on("click",function(){n=!n,t.fromStorage(n)})}var t,n=!1,r=0,i;return s}(jQuery),jQuery.fn.extend({clickOutside:function(e,t){var n=this;return jQuery(document).on("click.offer",function(r){if(t&&jQuery.inArray(r.target,t)>-1)return;if(jQuery.contains(n[0],r.target))return;jQuery(document).off("click.offer"),e(r,n)}),this}}),Modernizr.addTest("filesystem",function(){var e=Modernizr._domPrefixes;for(var t=-1,n=e.length;++t=this.spine.length)return console.log("Reached End of Book"),!1;if(e<0)return console.log("Reached Start of Book"),!1;localStorage.setItem("spinePos",e),this.spinePos=e,this.currentChapter&&this.tell("book:chapterDestroy",this.currentChapter.getID()),this.currentChapter=new FP.Chapter(this),this.currentChapter.afterLoaded=function(e){n.tell("book:chapterReady",e.getID()),t&&t(e)}},FP.Book.prototype.nextPage=function(){var e=this.currentChapter.nextPage();e||this.nextChapter()},FP.Book.prototype.prevPage=function(){var e=this.currentChapter.prevPage();e||this.prevChapter()},FP.Book.prototype.nextChapter=function(){this.spinePos++,this.displayChapter(this.spinePos)},FP.Book.prototype.prevChapter=function(){this.spinePos--,this.displayChapter(this.spinePos,function(e){e.goToChapterEnd()})},FP.Book.prototype.getTOC=function(){return this.toc},FP.Book.prototype.storeOffline=function(e){var t=FP.core.toArray(this.assets);FP.storage.batch(t,function(){this.stored=1,localStorage.setItem("stored",1),this.tell("book:stored"),e&&e()}.bind(this))},FP.Book.prototype.availableOffline=function(){return this.stored>0?!0:!1},FP.Book.prototype.fromStorage=function(e){if(this.contained)return;e?this.availableOffline?(this.online=!1,this.tell("book:offline")):this.storeOffline(function(){this.online=!1,this.tell("book:offline")}.bind(this)):(this.online=!0,this.tell("book:online"))},FP.Book.prototype.determineStorageMethod=function(e){var t="ram";e?t=e:(Modernizr.websqldatabase&&(t="websql"),Modernizr.indexeddb&&(t="indexedDB"),Modernizr.filesystem&&(t="filesystem")),FP.storage.storageMethod(t)},FP.Book.prototype.route=function(e,t){var n=window.location.hash.replace("#/","");return this.useHash&&n.length&&n!=this.prevLocation?(this.show(n,t),this.prevLocation=n,!0):!1},FP.Book.prototype.hideHashChanges=function(){this.useHash=!1},FP.Book.prototype.getHooks=function(){var e=this;plugTypes=FP.core.toArray(this.hooks),plugTypes.forEach(function(t){var n=t.ident;plugs=FP.core.toArray(FP.Hooks[n]),plugs.forEach(function(t){e.registerHook(n,t)})})},FP.Book.prototype.registerHook=function(e,t){var n=this;typeof this.hooks[e]!="undefined"?typeof t=="function"?this.hooks[e].push(t):Array.isArray(t)&&t.forEach(function(t){n.hooks[e].push(t)}):this.hooks[e]=[func]},FP.Book.prototype.triggerHooks=function(e,t,n){function s(){i--,i<=0&&t&&t()}var r,i;if(typeof this.hooks[e]=="undefined")return!1;r=this.hooks[e],i=r.length,r.forEach(function(e){e(s,n)})},FP.Chapter=function(e,t){return this.book=e,this.iframe=this.book.iframe,this.pos=t||this.book.spinePos,this.chapInfo=this.book.spine[this.pos],this.path=this.chapInfo.href,this.ID=this.chapInfo.id,this.chapterPos=1,this.leftPos=0,localStorage.setItem("chapterPos",this.chapterPos),this.book.registerHook("beforeChapterDisplay",[this.replaceLinks.bind(this),this.replaceResources.bind(this)]),this.load(),this},FP.Chapter.prototype.load=function(){var e=this.path;this.book.online&&!this.book.contained?this.setIframeSrc(e):this.loadFromStorage(e)},FP.Chapter.prototype.loadFromStorage=function(e){var t=FP.storage.get(e,this.setIframeSrc.bind(this))},FP.Chapter.prototype.setIframeSrc=function(e){var t=this;this.visible(!1),this.iframe.src=e,this.iframe.onload=function(){t.doc=t.iframe.contentDocument,t.bodyEl=t.doc.body,t.formatSpread(),t.afterLoaded(t),t.book.listen("book:resized",t.formatSpread,t)}},FP.Chapter.prototype.afterLoaded=function(e){},FP.Chapter.prototype.error=function(e){console.log("error",error)},FP.Chapter.prototype.formatSpread=function(){var e=2,t=800;this.colWidth&&(this.OldcolWidth=this.colWidth,this.OldspreadWidth=this.spreadWidth),this.elWidth=this.iframe.width,this.gap=this.gap||Math.ceil(this.elWidth/8),this.elWidth1?(this.chapterPos--,this.leftPos-=this.spreadWidth,this.setLeft(this.leftPos),localStorage.setItem("chapterPos",this.chapterPos),this.chapterPos):!1},FP.Chapter.prototype.chapterEnd=function(){this.page(this.displayedPages)},FP.Chapter.prototype.setLeft=function(e){this.bodyEl.style.marginLeft=-e+"px"},FP.Chapter.prototype.replaceLinks=function(e){var t=this.doc.querySelectorAll("[href]"),n=Array.prototype.slice.call(t),r=this;n.forEach(function(e){var t,n=e.getAttribute("href"),i=n.search("://"),s=n[0]=="#";i!=-1?e.setAttribute("target","_blank"):e.onclick=function(){r.book.useHash?window.location.hash="#/"+n:r.book.show(n)}}),e&&e()},FP.Chapter.prototype.replaceResources=function(e){var t,n,r;if(this.book.online&&!this.book.contained||FP.storage.getStorageType()=="filesystem")return e&&e(),!1;t=this.doc.querySelectorAll("[src]"),n=Array.prototype.slice.call(t),r=n.length,n.forEach(function(t){var n=t.getAttribute("src"),i=this.book.basePath+n;FP.storage.get(i,function(n){t.setAttribute("src",n),r--,r<=0&&e&&e()})}.bind(this))},FP.Chapter.prototype.getID=function(){return this.ID},FP.Chapter.prototype.page=function(e){return e>=1&&e<=this.displayedPages?(this.chapterPos=e,this.leftPos=this.spreadWidth*(e-1),this.setLeft(this.leftPos),localStorage.setItem("chapterPos",e),!0):!1},FP.Chapter.prototype.section=function(e){var t=this.doc.getElementById(e),n,r;t&&(n=this.leftPos+t.offsetLeft,r=Math.floor(n/this.spreadWidth)+1,this.page(r))},FP.Chapter.prototype.beforeDisplay=function(e){this.book.triggerHooks("beforeChapterDisplay",e.bind(this),this)};var FP=FP||{};FP.core={},FP.core.getEl=function(e){return document.getElementById(e)},FP.core.getEls=function(e){return document.getElementsByClassName(e)},FP.core.loadXML=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.overrideMimeType("text/xml"),n.onload=function(e){this.status==200&&t(this.responseXML)},n.send()},FP.core.loadFile=function(e,t){var n=new XMLHttpRequest;return this.succeeded=function(e){t&&t(e)},this.failed=function(e){console.log("Error:",e)},this.start=function(){var t=this;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){this.status==200&&t.succeeded(this.response)},n.onerror=function(e){t.failed(this.status)},n.send()},{start:this.start,succeeded:this.succeeded,failed:this.failed}},FP.core.crossBrowserColumnCss=function(){var e=function(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")};FP.core.columnAxis=Modernizr.prefixed("columnAxis")||"columnAxis",FP.core.columnGap=Modernizr.prefixed("columnGap")||"columnGap",FP.core.columnWidth=Modernizr.prefixed("columnWidth")||"columnWidth"},FP.core.toArray=function(e){var t=[];for(member in e){var n;e.hasOwnProperty(member)&&(n=e[member],n.ident=member,t.push(n))}return t},FP.core.dataURLToBlob=function(e){var t=";base64,";if(e.indexOf(t)==-1){var n=e.split(","),r=n[0].split(":")[1],i=n[1];return new Blob([i],{type:r})}var n=e.split(t),r=n[0].split(":")[1],i=window.atob(n[1]),s=i.length,o=new Uint8Array(s);for(var u=0;u=this.spine.length)return console.log("Reached End of Book"),!1;if(e<0)return console.log("Reached Start of Book"),!1;localStorage.setItem("spinePos",e),this.spinePos=e,this.currentChapter&&this.tell("book:chapterDestroy",this.currentChapter.getID()),this.currentChapter=new FP.Chapter(this),this.currentChapter.afterLoaded=function(e){n.tell("book:chapterReady",e.getID()),t&&t(e)}},FP.Book.prototype.nextPage=function(){var e=this.currentChapter.nextPage();e||this.nextChapter()},FP.Book.prototype.prevPage=function(){var e=this.currentChapter.prevPage();e||this.prevChapter()},FP.Book.prototype.nextChapter=function(){this.spinePos++,this.displayChapter(this.spinePos)},FP.Book.prototype.prevChapter=function(){this.spinePos--,this.displayChapter(this.spinePos,function(e){e.goToChapterEnd()})},FP.Book.prototype.getTOC=function(){return this.toc},FP.Book.prototype.storeOffline=function(e){var t=FP.core.toArray(this.assets);FP.storage.batch(t,function(){this.stored=1,localStorage.setItem("stored",1),this.tell("book:stored"),e&&e()}.bind(this))},FP.Book.prototype.availableOffline=function(){return this.stored>0?!0:!1},FP.Book.prototype.fromStorage=function(e){if(this.contained)return;e?this.availableOffline?(this.online=!1,this.tell("book:offline")):this.storeOffline(function(){this.online=!1,this.tell("book:offline")}.bind(this)):(this.online=!0,this.tell("book:online"))},FP.Book.prototype.determineStorageMethod=function(e){var t="ram";e?t=e:(Modernizr.websqldatabase&&(t="websql"),Modernizr.indexeddb&&(t="indexedDB"),Modernizr.filesystem&&(t="filesystem")),FP.storage.storageMethod(t)},FP.Book.prototype.route=function(e,t){var n=window.location.hash.replace("#/","");return this.useHash&&n.length&&n!=this.prevLocation?(this.show(n,t),this.prevLocation=n,!0):!1},FP.Book.prototype.hideHashChanges=function(){this.useHash=!1},FP.Book.prototype.getHooks=function(){var e=this;plugTypes=FP.core.toArray(this.hooks),plugTypes.forEach(function(t){var n=t.ident;plugs=FP.core.toArray(FP.Hooks[n]),plugs.forEach(function(t){e.registerHook(n,t)})})},FP.Book.prototype.registerHook=function(e,t){var n=this;typeof this.hooks[e]!="undefined"?typeof t=="function"?this.hooks[e].push(t):Array.isArray(t)&&t.forEach(function(t){n.hooks[e].push(t)}):this.hooks[e]=[func]},FP.Book.prototype.triggerHooks=function(e,t,n){function s(){i--,i<=0&&t&&t()}var r,i;if(typeof this.hooks[e]=="undefined")return!1;r=this.hooks[e],i=r.length,r.forEach(function(e){e(s,n)})},FP.Chapter=function(e,t){return this.book=e,this.iframe=this.book.iframe,this.pos=t||this.book.spinePos,this.chapInfo=this.book.spine[this.pos],this.path=this.chapInfo.href,this.ID=this.chapInfo.id,this.chapterPos=1,this.leftPos=0,localStorage.setItem("chapterPos",this.chapterPos),this.book.registerHook("beforeChapterDisplay",[this.replaceLinks.bind(this),this.replaceResources.bind(this)]),this.load(),this},FP.Chapter.prototype.load=function(){var e=this.path;this.book.online&&!this.book.contained?this.setIframeSrc(e):this.loadFromStorage(e)},FP.Chapter.prototype.loadFromStorage=function(e){var t=FP.storage.get(e,this.setIframeSrc.bind(this))},FP.Chapter.prototype.setIframeSrc=function(e){var t=this;this.visible(!1),this.iframe.src=e,this.iframe.onload=function(){t.doc=t.iframe.contentDocument,t.bodyEl=t.doc.body,t.formatSpread(),t.beforeDisplay(function(){t.book.tell("book:chapterDisplayed"),t.visible(!0)}),t.afterLoaded(t),t.book.listen("book:resized",t.formatSpread,t)}},FP.Chapter.prototype.afterLoaded=function(e){},FP.Chapter.prototype.error=function(e){console.log("error",error)},FP.Chapter.prototype.formatSpread=function(){var e=2,t=800;this.colWidth&&(this.OldcolWidth=this.colWidth,this.OldspreadWidth=this.spreadWidth),this.elWidth=this.iframe.width,this.gap=this.gap||Math.ceil(this.elWidth/8),this.elWidth1?(this.chapterPos--,this.leftPos-=this.spreadWidth,this.setLeft(this.leftPos),localStorage.setItem("chapterPos",this.chapterPos),this.chapterPos):!1},FP.Chapter.prototype.chapterEnd=function(){this.page(this.displayedPages)},FP.Chapter.prototype.setLeft=function(e){this.bodyEl.style.marginLeft=-e+"px"},FP.Chapter.prototype.replaceLinks=function(e){var t=this.doc.querySelectorAll("[href]"),n=Array.prototype.slice.call(t),r=this;n.forEach(function(e){var t,n=e.getAttribute("href"),i=n.search("://"),s=n[0]=="#";i!=-1?e.setAttribute("target","_blank"):e.onclick=function(){r.book.useHash?window.location.hash="#/"+n:r.book.show(n)}}),e&&e()},FP.Chapter.prototype.replaceResources=function(e){var t,n,r;if(this.book.online&&!this.book.contained||FP.storage.getStorageType()=="filesystem")return e&&e(),!1;t=this.doc.querySelectorAll("[src]"),n=Array.prototype.slice.call(t),r=n.length,n.forEach(function(t){var n=t.getAttribute("src"),i=this.book.basePath+n;FP.storage.get(i,function(n){t.setAttribute("src",n),r--,r<=0&&e&&e()})}.bind(this))},FP.Chapter.prototype.getID=function(){return this.ID},FP.Chapter.prototype.page=function(e){return e>=1&&e<=this.displayedPages?(this.chapterPos=e,this.leftPos=this.spreadWidth*(e-1),this.setLeft(this.leftPos),localStorage.setItem("chapterPos",e),!0):!1},FP.Chapter.prototype.section=function(e){var t=this.doc.getElementById(e),n,r;t&&(n=this.leftPos+t.offsetLeft,r=Math.floor(n/this.spreadWidth)+1,this.page(r))},FP.Chapter.prototype.beforeDisplay=function(e){this.book.triggerHooks("beforeChapterDisplay",e.bind(this),this)};var FP=FP||{};FP.core={},FP.core.getEl=function(e){return document.getElementById(e)},FP.core.getEls=function(e){return document.getElementsByClassName(e)},FP.core.loadXML=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.overrideMimeType("text/xml"),n.onload=function(e){this.status==200&&t(this.responseXML)},n.send()},FP.core.loadFile=function(e,t){var n=new XMLHttpRequest;return this.succeeded=function(e){t&&t(e)},this.failed=function(e){console.log("Error:",e)},this.start=function(){var t=this;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){this.status==200&&t.succeeded(this.response)},n.onerror=function(e){t.failed(this.status)},n.send()},{start:this.start,succeeded:this.succeeded,failed:this.failed}},FP.core.crossBrowserColumnCss=function(){var e=function(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")};FP.core.columnAxis=Modernizr.prefixed("columnAxis")||"columnAxis",FP.core.columnGap=Modernizr.prefixed("columnGap")||"columnGap",FP.core.columnWidth=Modernizr.prefixed("columnWidth")||"columnWidth"},FP.core.toArray=function(e){var t=[];for(member in e){var n;e.hasOwnProperty(member)&&(n=e[member],n.ident=member,t.push(n))}return t},FP.core.dataURLToBlob=function(e){var t=";base64,";if(e.indexOf(t)==-1){var n=e.split(","),r=n[0].split(":")[1],i=n[1];return new Blob([i],{type:r})}var n=e.split(t),r=n[0].split(":")[1],i=window.atob(n[1]),s=i.length,o=new Uint8Array(s);for(var u=0;u /g, '>').replace(/"/g, '"');
+ };
+
+ $.fn.escape = function(html) {
+ if (arguments.length) return this.html($.escape(html));
+ return this.html();
+ };
+
+ $.fn.reverse = []._reverse || [].reverse;
+
+ functions = ["log", "debug", "info", "warn", "exception", "assert", "dir", "dirxml", "trace", "group", "groupEnd", "groupCollapsed", "time", "timeEnd", "profile", "profileEnd", "count", "clear", "table", "error", "notifyFirebug", "firebug", "userObjects"];
+
+ if (typeof console !== "undefined" && console !== null) {
+ if (!(console.group != null)) {
+ console.group = function(name) {
+ return console.log("GROUP: ", name);
+ };
+ }
+ if (!(console.groupCollapsed != null)) console.groupCollapsed = console.group;
+ for (_i = 0, _len = functions.length; _i < _len; _i++) {
+ fn = functions[_i];
+ if (!(console[fn] != null)) {
+ console[fn] = function() {
+ return console.log(_t("Not implemented:") + (" console." + name));
+ };
+ }
+ }
+ } else {
+ this.console = {};
+ for (_j = 0, _len2 = functions.length; _j < _len2; _j++) {
+ fn = functions[_j];
+ this.console[fn] = function() {};
+ }
+ this.console['error'] = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return alert("ERROR: " + (args.join(', ')));
+ };
+ this.console['warn'] = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return alert("WARNING: " + (args.join(', ')));
+ };
+ }
+
+ Delegator = (function() {
+
+ Delegator.prototype.events = {};
+
+ Delegator.prototype.options = {};
+
+ Delegator.prototype.element = null;
+
+ function Delegator(element, options) {
+ this.options = $.extend(true, {}, this.options, options);
+ this.element = $(element);
+ this.on = this.subscribe;
+ this.addEvents();
+ }
+
+ Delegator.prototype.addEvents = function() {
+ var event, functionName, sel, selector, _k, _ref2, _ref3, _results;
+ _ref2 = this.events;
+ _results = [];
+ for (sel in _ref2) {
+ functionName = _ref2[sel];
+ _ref3 = sel.split(' '), selector = 2 <= _ref3.length ? __slice.call(_ref3, 0, _k = _ref3.length - 1) : (_k = 0, []), event = _ref3[_k++];
+ _results.push(this.addEvent(selector.join(' '), event, functionName));
+ }
+ return _results;
+ };
+
+ Delegator.prototype.addEvent = function(bindTo, event, functionName) {
+ var closure, isBlankSelector,
+ _this = this;
+ closure = function() {
+ return _this[functionName].apply(_this, arguments);
+ };
+ isBlankSelector = typeof bindTo === 'string' && bindTo.replace(/\s+/g, '') === '';
+ if (isBlankSelector) bindTo = this.element;
+ if (typeof bindTo === 'string') {
+ this.element.delegate(bindTo, event, closure);
+ } else {
+ if (this.isCustomEvent(event)) {
+ this.subscribe(event, closure);
+ } else {
+ $(bindTo).bind(event, closure);
+ }
+ }
+ return this;
+ };
+
+ Delegator.prototype.isCustomEvent = function(event) {
+ event = event.split('.')[0];
+ return $.inArray(event, Delegator.natives) === -1;
+ };
+
+ Delegator.prototype.publish = function() {
+ this.element.triggerHandler.apply(this.element, arguments);
+ return this;
+ };
+
+ Delegator.prototype.subscribe = function(event, callback) {
+ var closure;
+ closure = function() {
+ return callback.apply(this, [].slice.call(arguments, 1));
+ };
+ closure.guid = callback.guid = ($.guid += 1);
+ this.element.bind(event, closure);
+ return this;
+ };
+
+ Delegator.prototype.unsubscribe = function() {
+ this.element.unbind.apply(this.element, arguments);
+ return this;
+ };
+
+ return Delegator;
+
+ })();
+
+ Delegator.natives = (function() {
+ var key, specials, val;
+ specials = (function() {
+ var _ref2, _results;
+ _ref2 = jQuery.event.special;
+ _results = [];
+ for (key in _ref2) {
+ if (!__hasProp.call(_ref2, key)) continue;
+ val = _ref2[key];
+ _results.push(key);
+ }
+ return _results;
+ })();
+ return "blur focus focusin focusout load resize scroll unload click dblclick\nmousedown mouseup mousemove mouseover mouseout mouseenter mouseleave\nchange select submit keydown keypress keyup error".split(/[^a-z]+/).concat(specials);
+ })();
+
+ Range = {};
+
+ Range.sniff = function(r) {
+ if (r.commonAncestorContainer != null) {
+ return new Range.BrowserRange(r);
+ } else if (typeof r.start === "string") {
+ return new Range.SerializedRange(r);
+ } else if (r.start && typeof r.start === "object") {
+ return new Range.NormalizedRange(r);
+ } else {
+ console.error(_t("Could not sniff range type"));
+ return false;
+ }
+ };
+
+ Range.nodeFromXPath = function(xpath, root) {
+ var customResolver, evaluateXPath, namespace, node, segment;
+ if (root == null) root = document;
+ evaluateXPath = function(xp, nsResolver) {
+ if (nsResolver == null) nsResolver = null;
+ return document.evaluate('.' + xp, root, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
+ };
+ if (!$.isXMLDoc(document.documentElement)) {
+ return evaluateXPath(xpath);
+ } else {
+ customResolver = document.createNSResolver(document.ownerDocument === null ? document.documentElement : document.ownerDocument.documentElement);
+ node = evaluateXPath(xpath, customResolver);
+ if (!node) {
+ xpath = ((function() {
+ var _k, _len3, _ref2, _results;
+ _ref2 = xpath.split('/');
+ _results = [];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ segment = _ref2[_k];
+ if (segment && segment.indexOf(':') === -1) {
+ _results.push(segment.replace(/^([a-z]+)/, 'xhtml:$1'));
+ } else {
+ _results.push(segment);
+ }
+ }
+ return _results;
+ })()).join('/');
+ namespace = document.lookupNamespaceURI(null);
+ customResolver = function(ns) {
+ if (ns === 'xhtml') {
+ return namespace;
+ } else {
+ return document.documentElement.getAttribute('xmlns:' + ns);
+ }
+ };
+ node = evaluateXPath(xpath, customResolver);
+ }
+ return node;
+ }
+ };
+
+ Range.RangeError = (function(_super) {
+
+ __extends(RangeError, _super);
+
+ function RangeError(type, message, parent) {
+ this.type = type;
+ this.message = message;
+ this.parent = parent != null ? parent : null;
+ RangeError.__super__.constructor.call(this, this.message);
+ }
+
+ return RangeError;
+
+ })(Error);
+
+ Range.BrowserRange = (function() {
+
+ function BrowserRange(obj) {
+ this.commonAncestorContainer = obj.commonAncestorContainer;
+ this.startContainer = obj.startContainer;
+ this.startOffset = obj.startOffset;
+ this.endContainer = obj.endContainer;
+ this.endOffset = obj.endOffset;
+ }
+
+ BrowserRange.prototype.normalize = function(root) {
+ var it, node, nr, offset, p, r, _k, _len3, _ref2;
+ if (this.tainted) {
+ console.error(_t("You may only call normalize() once on a BrowserRange!"));
+ return false;
+ } else {
+ this.tainted = true;
+ }
+ r = {};
+ nr = {};
+ _ref2 = ['start', 'end'];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ p = _ref2[_k];
+ node = this[p + 'Container'];
+ offset = this[p + 'Offset'];
+ if (node.nodeType === 1) {
+ it = node.childNodes[offset];
+ node = it || node.childNodes[offset - 1];
+ if (node.nodeType === 1 && !node.firstChild) {
+ it = null;
+ node = node.previousSibling;
+ }
+ while (node.nodeType !== 3) {
+ node = node.firstChild;
+ }
+ offset = it ? 0 : node.nodeValue.length;
+ }
+ r[p] = node;
+ r[p + 'Offset'] = offset;
+ }
+ nr.start = r.startOffset > 0 ? r.start.splitText(r.startOffset) : r.start;
+ if (r.start === r.end) {
+ if ((r.endOffset - r.startOffset) < nr.start.nodeValue.length) {
+ nr.start.splitText(r.endOffset - r.startOffset);
+ }
+ nr.end = nr.start;
+ } else {
+ if (r.endOffset < r.end.nodeValue.length) r.end.splitText(r.endOffset);
+ nr.end = r.end;
+ }
+ nr.commonAncestor = this.commonAncestorContainer;
+ while (nr.commonAncestor.nodeType !== 1) {
+ nr.commonAncestor = nr.commonAncestor.parentNode;
+ }
+ return new Range.NormalizedRange(nr);
+ };
+
+ BrowserRange.prototype.serialize = function(root, ignoreSelector) {
+ return this.normalize(root).serialize(root, ignoreSelector);
+ };
+
+ return BrowserRange;
+
+ })();
+
+ Range.NormalizedRange = (function() {
+
+ function NormalizedRange(obj) {
+ this.commonAncestor = obj.commonAncestor;
+ this.start = obj.start;
+ this.end = obj.end;
+ }
+
+ NormalizedRange.prototype.normalize = function(root) {
+ return this;
+ };
+
+ NormalizedRange.prototype.limit = function(bounds) {
+ var nodes, parent, startParents, _k, _len3, _ref2;
+ nodes = $.grep(this.textNodes(), function(node) {
+ return node.parentNode === bounds || $.contains(bounds, node.parentNode);
+ });
+ if (!nodes.length) return null;
+ this.start = nodes[0];
+ this.end = nodes[nodes.length - 1];
+ startParents = $(this.start).parents();
+ _ref2 = $(this.end).parents();
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ parent = _ref2[_k];
+ if (startParents.index(parent) !== -1) {
+ this.commonAncestor = parent;
+ break;
+ }
+ }
+ return this;
+ };
+
+ NormalizedRange.prototype.serialize = function(root, ignoreSelector) {
+ var end, serialization, start;
+ serialization = function(node, isEnd) {
+ var n, nodes, offset, origParent, textNodes, xpath, _k, _len3;
+ if (ignoreSelector) {
+ origParent = $(node).parents(":not(" + ignoreSelector + ")").eq(0);
+ } else {
+ origParent = $(node).parent();
+ }
+ xpath = origParent.xpath(root)[0];
+ textNodes = origParent.textNodes();
+ nodes = textNodes.slice(0, textNodes.index(node));
+ offset = 0;
+ for (_k = 0, _len3 = nodes.length; _k < _len3; _k++) {
+ n = nodes[_k];
+ offset += n.nodeValue.length;
+ }
+ if (isEnd) {
+ return [xpath, offset + node.nodeValue.length];
+ } else {
+ return [xpath, offset];
+ }
+ };
+ start = serialization(this.start);
+ end = serialization(this.end, true);
+ return new Range.SerializedRange({
+ start: start[0],
+ end: end[0],
+ startOffset: start[1],
+ endOffset: end[1]
+ });
+ };
+
+ NormalizedRange.prototype.text = function() {
+ var node;
+ return ((function() {
+ var _k, _len3, _ref2, _results;
+ _ref2 = this.textNodes();
+ _results = [];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ node = _ref2[_k];
+ _results.push(node.nodeValue);
+ }
+ return _results;
+ }).call(this)).join('');
+ };
+
+ NormalizedRange.prototype.textNodes = function() {
+ var end, start, textNodes, _ref2;
+ textNodes = $(this.commonAncestor).textNodes();
+ _ref2 = [textNodes.index(this.start), textNodes.index(this.end)], start = _ref2[0], end = _ref2[1];
+ return $.makeArray(textNodes.slice(start, end + 1 || 9e9));
+ };
+
+ NormalizedRange.prototype.toRange = function() {
+ var range;
+ range = document.createRange();
+ range.setStartBefore(this.start);
+ range.setEndAfter(this.end);
+ return range;
+ };
+
+ return NormalizedRange;
+
+ })();
+
+ Range.SerializedRange = (function() {
+
+ function SerializedRange(obj) {
+ this.start = obj.start;
+ this.startOffset = obj.startOffset;
+ this.end = obj.end;
+ this.endOffset = obj.endOffset;
+ }
+
+ SerializedRange.prototype.normalize = function(root) {
+ var contains, length, node, p, range, tn, _k, _l, _len3, _len4, _ref2, _ref3;
+ range = {};
+ _ref2 = ['start', 'end'];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ p = _ref2[_k];
+ try {
+ node = Range.nodeFromXPath(this[p], root);
+ } catch (e) {
+ throw new Range.RangeError(p, ("Error while finding " + p + " node: " + this[p] + ": ") + e, e);
+ }
+ if (!node) {
+ throw new Range.RangeError(p, "Couldn't find " + p + " node: " + this[p]);
+ }
+ length = 0;
+ _ref3 = $(node).textNodes();
+ for (_l = 0, _len4 = _ref3.length; _l < _len4; _l++) {
+ tn = _ref3[_l];
+ if (length + tn.nodeValue.length >= this[p + 'Offset']) {
+ range[p + 'Container'] = tn;
+ range[p + 'Offset'] = this[p + 'Offset'] - length;
+ break;
+ } else {
+ length += tn.nodeValue.length;
+ }
+ }
+ if (!(range[p + 'Offset'] != null)) {
+ throw new Range.RangeError("" + p + "offset", "Couldn't find offset " + this[p + 'Offset'] + " in element " + this[p]);
+ }
+ }
+ contains = !(document.compareDocumentPosition != null) ? function(a, b) {
+ return a.contains(b);
+ } : function(a, b) {
+ return a.compareDocumentPosition(b) & 16;
+ };
+ $(range.startContainer).parents().each(function() {
+ if (contains(this, range.endContainer)) {
+ range.commonAncestorContainer = this;
+ return false;
+ }
+ });
+ return new Range.BrowserRange(range).normalize(root);
+ };
+
+ SerializedRange.prototype.serialize = function(root, ignoreSelector) {
+ return this.normalize(root).serialize(root, ignoreSelector);
+ };
+
+ SerializedRange.prototype.toObject = function() {
+ return {
+ start: this.start,
+ startOffset: this.startOffset,
+ end: this.end,
+ endOffset: this.endOffset
+ };
+ };
+
+ return SerializedRange;
+
+ })();
+
+ util = {
+ uuid: (function() {
+ var counter;
+ counter = 0;
+ return function() {
+ return counter++;
+ };
+ })(),
+ getGlobal: function() {
+ return (function() {
+ return this;
+ })();
+ },
+ maxZIndex: function($elements) {
+ var all, el;
+ all = (function() {
+ var _k, _len3, _results;
+ _results = [];
+ for (_k = 0, _len3 = $elements.length; _k < _len3; _k++) {
+ el = $elements[_k];
+ if ($(el).css('position') === 'static') {
+ _results.push(-1);
+ } else {
+ _results.push(parseInt($(el).css('z-index'), 10) || -1);
+ }
+ }
+ return _results;
+ })();
+ return Math.max.apply(Math, all);
+ },
+ mousePosition: function(e, offsetEl) {
+ var offset;
+ offset = $(offsetEl).offset();
+ return {
+ top: e.pageY,
+ left: e.pageX
+ };
+ },
+ preventEventDefault: function(event) {
+ return event != null ? typeof event.preventDefault === "function" ? event.preventDefault() : void 0 : void 0;
+ }
+ };
+
+ _Annotator = this.Annotator;
+
+ Annotator = (function(_super) {
+
+ __extends(Annotator, _super);
+
+ Annotator.prototype.events = {
+ ".annotator-adder button click": "onAdderClick",
+ ".annotator-adder button mousedown": "onAdderMousedown",
+ ".annotator-hl mouseover": "onHighlightMouseover",
+ ".annotator-hl mouseout": "startViewerHideTimer"
+ };
+
+ Annotator.prototype.html = {
+ adder: '' + _t('Annotate') + '
',
+ wrapper: '
'
+ };
+
+ Annotator.prototype.options = {
+ readOnly: false
+ };
+
+ Annotator.prototype.plugins = {};
+
+ Annotator.prototype.editor = null;
+
+ Annotator.prototype.viewer = null;
+
+ Annotator.prototype.selectedRanges = null;
+
+ Annotator.prototype.mouseIsDown = false;
+
+ Annotator.prototype.ignoreMouseup = false;
+
+ Annotator.prototype.viewerHideTimer = null;
+
+ function Annotator(element, options) {
+ this.onDeleteAnnotation = __bind(this.onDeleteAnnotation, this);
+ this.onEditAnnotation = __bind(this.onEditAnnotation, this);
+ this.onAdderClick = __bind(this.onAdderClick, this);
+ this.onAdderMousedown = __bind(this.onAdderMousedown, this);
+ this.onHighlightMouseover = __bind(this.onHighlightMouseover, this);
+ this.checkForEndSelection = __bind(this.checkForEndSelection, this);
+ this.checkForStartSelection = __bind(this.checkForStartSelection, this);
+ this.clearViewerHideTimer = __bind(this.clearViewerHideTimer, this);
+ this.startViewerHideTimer = __bind(this.startViewerHideTimer, this);
+ this.showViewer = __bind(this.showViewer, this);
+ this.onEditorSubmit = __bind(this.onEditorSubmit, this);
+ this.onEditorHide = __bind(this.onEditorHide, this);
+ this.showEditor = __bind(this.showEditor, this); Annotator.__super__.constructor.apply(this, arguments);
+ this.plugins = {};
+ if (!Annotator.supported()) return this;
+ if (!this.options.readOnly) this._setupDocumentEvents();
+ this._setupWrapper()._setupViewer()._setupEditor();
+ this._setupDynamicStyle();
+ this.adder = $(this.html.adder).appendTo(this.wrapper).hide();
+ }
+
+ Annotator.prototype._setupWrapper = function() {
+ this.wrapper = $(this.html.wrapper);
+ this.element.find('script').remove();
+ this.element.wrapInner(this.wrapper);
+ this.wrapper = this.element.find('.annotator-wrapper');
+ return this;
+ };
+
+ Annotator.prototype._setupViewer = function() {
+ var _this = this;
+ this.viewer = new Annotator.Viewer({
+ readOnly: this.options.readOnly
+ });
+ this.viewer.hide().on("edit", this.onEditAnnotation).on("delete", this.onDeleteAnnotation).addField({
+ load: function(field, annotation) {
+ if (annotation.text) {
+ $(field).escape(annotation.text);
+ } else {
+ $(field).html("" + (_t('No Comment')) + " ");
+ }
+ return _this.publish('annotationViewerTextField', [field, annotation]);
+ }
+ }).element.appendTo(this.wrapper).bind({
+ "mouseover": this.clearViewerHideTimer,
+ "mouseout": this.startViewerHideTimer
+ });
+ return this;
+ };
+
+ Annotator.prototype._setupEditor = function() {
+ this.editor = new Annotator.Editor();
+ this.editor.hide().on('hide', this.onEditorHide).on('save', this.onEditorSubmit).addField({
+ type: 'textarea',
+ label: _t('Comments') + '\u2026',
+ load: function(field, annotation) {
+ return $(field).find('textarea').val(annotation.text || '');
+ },
+ submit: function(field, annotation) {
+ return annotation.text = $(field).find('textarea').val();
+ }
+ });
+ this.editor.element.appendTo(this.wrapper);
+ return this;
+ };
+
+ Annotator.prototype._setupDocumentEvents = function() {
+ $(document).bind({
+ "mouseup": this.checkForEndSelection,
+ "mousedown": this.checkForStartSelection
+ });
+ return this;
+ };
+
+ Annotator.prototype._setupDynamicStyle = function() {
+ var max, sel, style, x;
+ style = $('#annotator-dynamic-style');
+ if (!style.length) {
+ style = $('').appendTo(document.head);
+ }
+ sel = '*' + ((function() {
+ var _k, _len3, _ref2, _results;
+ _ref2 = ['adder', 'outer', 'notice', 'filter'];
+ _results = [];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ x = _ref2[_k];
+ _results.push(":not(.annotator-" + x + ")");
+ }
+ return _results;
+ })()).join('');
+ max = util.maxZIndex($(document.body).find(sel));
+ max = Math.max(max, 1000);
+ style.text([".annotator-adder, .annotator-outer, .annotator-notice {", " z-index: " + (max + 20) + ";", "}", ".annotator-filter {", " z-index: " + (max + 10) + ";", "}"].join("\n"));
+ return this;
+ };
+
+ Annotator.prototype.getSelectedRanges = function() {
+ var browserRange, i, normedRange, r, ranges, rangesToIgnore, selection, _k, _len3;
+ selection = util.getGlobal().getSelection();
+ ranges = [];
+ rangesToIgnore = [];
+ if (!selection.isCollapsed) {
+ ranges = (function() {
+ var _ref2, _results;
+ _results = [];
+ for (i = 0, _ref2 = selection.rangeCount; 0 <= _ref2 ? i < _ref2 : i > _ref2; 0 <= _ref2 ? i++ : i--) {
+ r = selection.getRangeAt(i);
+ browserRange = new Range.BrowserRange(r);
+ normedRange = browserRange.normalize().limit(this.wrapper[0]);
+ if (normedRange === null) rangesToIgnore.push(r);
+ _results.push(normedRange);
+ }
+ return _results;
+ }).call(this);
+ selection.removeAllRanges();
+ }
+ for (_k = 0, _len3 = rangesToIgnore.length; _k < _len3; _k++) {
+ r = rangesToIgnore[_k];
+ selection.addRange(r);
+ }
+ return $.grep(ranges, function(range) {
+ if (range) selection.addRange(range.toRange());
+ return range;
+ });
+ };
+
+ Annotator.prototype.createAnnotation = function() {
+ var annotation;
+ annotation = {};
+ this.publish('beforeAnnotationCreated', [annotation]);
+ return annotation;
+ };
+
+ Annotator.prototype.setupAnnotation = function(annotation) {
+ var normed, normedRanges, r, root, _k, _l, _len3, _len4, _ref2;
+ root = this.wrapper[0];
+ annotation.ranges || (annotation.ranges = this.selectedRanges);
+ normedRanges = [];
+ _ref2 = annotation.ranges;
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ r = _ref2[_k];
+ try {
+ normedRanges.push(Range.sniff(r).normalize(root));
+ } catch (e) {
+ if (e instanceof Range.RangeError) {
+ this.publish('rangeNormalizeFail', [annotation, r, e]);
+ } else {
+ throw e;
+ }
+ }
+ }
+ annotation.quote = [];
+ annotation.ranges = [];
+ annotation.highlights = [];
+ for (_l = 0, _len4 = normedRanges.length; _l < _len4; _l++) {
+ normed = normedRanges[_l];
+ annotation.quote.push($.trim(normed.text()));
+ annotation.ranges.push(normed.serialize(this.wrapper[0], '.annotator-hl'));
+ $.merge(annotation.highlights, this.highlightRange(normed));
+ }
+ annotation.quote = annotation.quote.join(' / ');
+ $(annotation.highlights).data('annotation', annotation);
+ return annotation;
+ };
+
+ Annotator.prototype.updateAnnotation = function(annotation) {
+ this.publish('beforeAnnotationUpdated', [annotation]);
+ this.publish('annotationUpdated', [annotation]);
+ return annotation;
+ };
+
+ Annotator.prototype.deleteAnnotation = function(annotation) {
+ var h, _k, _len3, _ref2;
+ _ref2 = annotation.highlights;
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ h = _ref2[_k];
+ $(h).replaceWith(h.childNodes);
+ }
+ this.publish('annotationDeleted', [annotation]);
+ return annotation;
+ };
+
+ Annotator.prototype.loadAnnotations = function(annotations) {
+ var clone, loader,
+ _this = this;
+ if (annotations == null) annotations = [];
+ loader = function(annList) {
+ var n, now, _k, _len3;
+ if (annList == null) annList = [];
+ now = annList.splice(0, 10);
+ for (_k = 0, _len3 = now.length; _k < _len3; _k++) {
+ n = now[_k];
+ _this.setupAnnotation(n);
+ }
+ if (annList.length > 0) {
+ return setTimeout((function() {
+ return loader(annList);
+ }), 10);
+ } else {
+ return _this.publish('annotationsLoaded', [clone]);
+ }
+ };
+ clone = annotations.slice();
+ if (annotations.length) loader(annotations);
+ return this;
+ };
+
+ Annotator.prototype.dumpAnnotations = function() {
+ if (this.plugins['Store']) {
+ return this.plugins['Store'].dumpAnnotations();
+ } else {
+ return console.warn(_t("Can't dump annotations without Store plugin."));
+ }
+ };
+
+ Annotator.prototype.highlightRange = function(normedRange, cssClass) {
+ var hl, node, white, _k, _len3, _ref2, _results;
+ if (cssClass == null) cssClass = 'annotator-hl';
+ white = /^\s*$/;
+ hl = $(" ");
+ _ref2 = normedRange.textNodes();
+ _results = [];
+ for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
+ node = _ref2[_k];
+ if (!white.test(node.nodeValue)) {
+ _results.push($(node).wrapAll(hl).parent().show()[0]);
+ }
+ }
+ return _results;
+ };
+
+ Annotator.prototype.highlightRanges = function(normedRanges, cssClass) {
+ var highlights, r, _k, _len3;
+ if (cssClass == null) cssClass = 'annotator-hl';
+ highlights = [];
+ for (_k = 0, _len3 = normedRanges.length; _k < _len3; _k++) {
+ r = normedRanges[_k];
+ $.merge(highlights, this.highlightRange(r, cssClass));
+ }
+ return highlights;
+ };
+
+ Annotator.prototype.addPlugin = function(name, options) {
+ var klass, _base;
+ if (this.plugins[name]) {
+ console.error(_t("You cannot have more than one instance of any plugin."));
+ } else {
+ klass = Annotator.Plugin[name];
+ if (typeof klass === 'function') {
+ this.plugins[name] = new klass(this.element[0], options);
+ this.plugins[name].annotator = this;
+ if (typeof (_base = this.plugins[name]).pluginInit === "function") {
+ _base.pluginInit();
+ }
+ } else {
+ console.error(_t("Could not load ") + name + _t(" plugin. Have you included the appropriate