Skip to content
This repository
Browse code

Annotator release v1.0.0rc

  • Loading branch information...
commit 9b2e0191fb09c2125f31ff8b0e31e9b42996b9c4 1 parent 24ce151
Aron Carroll authored March 11, 2011
1  pkg/annotator.auth.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var createDateFromISO8601;var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};createDateFromISO8601=function(string){var d,date,offset,regexp,time,_ref;regexp="([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";d=string.match(new RegExp(regexp));offset=0;date=new Date(d[1],0,1);if(d[3]){date.setMonth(d[3]-1)}if(d[5]){date.setDate(d[5])}if(d[7]){date.setHours(d[7])}if(d[8]){date.setMinutes(d[8])}if(d[10]){date.setSeconds(d[10])}if(d[12]){date.setMilliseconds(Number("0."+d[12])*1000)}if(d[14]){offset=(Number(d[16])*60)+Number(d[17]);offset*=(_ref=d[15]==="-")!=null?_ref:{1:-1}}offset-=date.getTimezoneOffset();time=Number(date)+(offset*60*1000);date.setTime(Number(time));return date};Annotator.Plugin.Auth=(function(){__extends(Auth,Annotator.Plugin);Auth.prototype.options={token:null,tokenUrl:"/auth/token",autoFetch:true};function Auth(element,options){this.haveValidToken=__bind(this.haveValidToken,this);Auth.__super__.constructor.apply(this,arguments);this.element.data("annotator:auth",this);this.waitingForToken=[];if(this.options.token){this.setToken(this.options.token)}else{this.requestToken()}}Auth.prototype.requestToken=function(){this.requestInProgress=true;return $.getJSON(this.options.tokenUrl,__bind(function(data,status,xhr){if(status!=="success"){return console.error("Couldn't get auth token: "+status,xhr)}else{this.setToken(data);return this.requestInProgress=false}},this))};Auth.prototype.setToken=function(token){var _results;this.token=token;if(this.haveValidToken()){if(this.options.autoFetch){this.refreshTimeout=setTimeout((__bind(function(){return this.requestToken()},this)),(this.timeToExpiry()-2)*1000)}this.updateHeaders();_results=[];while(this.waitingForToken.length>0){_results.push(this.waitingForToken.pop().apply())}return _results}else{console.warn("Didn't get a valid token.");if(this.options.autoFetch){console.warn("Getting a new token in 10s.");return setTimeout((__bind(function(){return this.requestToken()},this)),10*1000)}}};Auth.prototype.haveValidToken=function(){var allFields;allFields=this.token&&this.token.authToken&&this.token.authTokenIssueTime&&this.token.authTokenTTL&&this.token.accountId&&this.token.userId;return allFields&&this.timeToExpiry()>0};Auth.prototype.timeToExpiry=function(){var expiry,issue,now,timeToExpiry;now=new Date().getTime()/1000;issue=createDateFromISO8601(this.token.authTokenIssueTime).getTime()/1000;expiry=issue+this.token.authTokenTTL;timeToExpiry=expiry-now;if(timeToExpiry>0){return timeToExpiry}else{return 0}};Auth.prototype.updateHeaders=function(){var current;current=this.element.data("annotator:headers");return this.element.data("annotator:headers",$.extend(current,{"x-annotator-auth-token":this.token.authToken,"x-annotator-auth-token-issue-time":this.token.authTokenIssueTime,"x-annotator-auth-token-ttl":this.token.authTokenTTL,"x-annotator-account-id":this.token.accountId,"x-annotator-user-id":this.token.userId}))};Auth.prototype.withToken=function(callback){if(!(callback!=null)){return}if(this.haveValidToken()){return callback()}else{this.waitingForToken.push(callback);if(!this.requestInProgress){return this.requestToken()}}};return Auth})()}).call(this);
1  pkg/annotator.markdown.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};Annotator.Plugin.Markdown=(function(){__extends(Markdown,Annotator.Plugin);Markdown.prototype.events={annotationViewerTextField:"updateTextField"};function Markdown(element,options){this.updateTextField=__bind(this.updateTextField,this);if((typeof Showdown!="undefined"&&Showdown!==null?Showdown.converter:void 0)!=null){Markdown.__super__.constructor.apply(this,arguments);this.converter=new Showdown.converter()}else{console.error("To use the Markdown plugin, you must include Showdown into the page first.")}}Markdown.prototype.updateTextField=function(field,annotation){var text;text=Annotator.$.escape(annotation.text||"");return $(field).html(this.convert(text))};Markdown.prototype.convert=function(text){return this.converter.makeHtml(text)};return Markdown})()}).call(this);
1  pkg/annotator.min.css
... ...
@@ -0,0 +1 @@
  1
+.annotator-notice,.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:#909090}.annotator-adder{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAA3CAYAAADuQbOpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2Jl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YTCxXsK9XmyWIQSn+4KMWEYLOhRCjRfWd4yAL9q3FIfP5twpHB9MoQy41ZiuB0QpCUFkqUPThQbqGItd9iyOE1frW4ujkCv0d5ou5pKBAMjio5IPMoS7INHMypjdUZldpZhOSUHLk8sVc9x2OAP3CdYX3JQ6lgaG45z2IYIGVcjK+PrCRYH+uBiSU/9ZMqBAE63UcwZMNLTtIg4L6XsWxYuR89v/VV3dCE7HkOjTAikmQ/2FWXmaEQCFWkEJNWyMlUyj3GGDF7gmOLpAplHu8pzj8ZAqn6LUgUnCTwbMULgBQ8AiTA9NpVHQnoTS4yW7H0c2EkiUZ6WxqNXoUhxZCyQbvWgkmo0So9aXAwLBXSKVgxbodxz0gVSe31BM4IiFVxMRSIJeoAEjuXM6X31NSqZCryzjuJalUyNVlHJGSqkvEkiEXZPy0UsZW7Ml4qovk6hKO3iCVArm6hKMrpOoysUK4RbmpbK+7vwjcYtg4epNUYbjFsHF0lVSag3eNqQktpLwvikJqQtOM834oAakATTi6g1D+8n8CDADkHvNxLFOPmwAAAABJRU5ErkJggg==');background-repeat:no-repeat}.annotator-resize,.annotator-widget::after,.annotator-editor a::after,.annotator-viewer .annotator-controls button{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAADwCAYAAAANQjTeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJ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OmWRTClJMLq0MJb8UcF+1yzg6wC2bTRMZeNWLryPhKI7Oy3NQfoxhmbOB7ZlNLI+ZHKPtfsIDvIDrKD7CA7yA6yg/7HQP8WYAA5Qc6oPxW+XgAAAABJRU5ErkJggg==');background-repeat:no-repeat}.annotator-hl{background:rgba(255,255,10,0.3)}.annotator-wrapper{position:relative}.annotator-adder,.annotator-outer,.annotator-notice{z-index:9999}.annotator-adder,.annotator-outer,.annotator-widget,.annotator-notice{position:absolute;font-size:10px;line-height:1}.annotator-hide{display:none;visibility:hidden}.annotator-adder{margin-top:-41px;margin-left:-25px;width:50px;height:55px;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-outer{width:0;height:0}.annotator-widget{margin:0;padding:0;bottom:8px;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)}.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 div{padding:6px 6px}.annotator-viewer .annotator-item ol,.annotator-viewer .annotator-item ul{padding:4px 16px}.annotator-viewer div:first-of-type,.annotator-editor .annotator-item:first-child textarea{padding-top:12px;padding-bottom:12px;color:#3c3c3c;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 .2s ease-in;-moz-transition:opacity .2s ease-in;-o-transition:opacity .2s ease-in;transition:opacity .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{cursor:pointer;display:inline-block;width:13px;height:13px;margin-left:2px;border:none;opacity:.2;text-indent:-900em;background-color:transparent;outline:none}.annotator-viewer .annotator-controls button:hover,.annotator-viewer .annotator-controls button:focus{opacity:.9}.annotator-viewer .annotator-controls button: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-editor .annotator-item{position:relative}.annotator-editor .annotator-item label{top:0;display:inline;cursor:pointer}.annotator-editor .annotator-item input,.annotator-editor .annotator-item textarea{display:block;min-width:100%;padding:10px 8px;border:none;margin:0;color:#3c3c3c;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:#f3f3f3;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-editor .annotator-controls{text-align:right;padding:3px;border-top:1px solid #d4d4d4;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(0.6,#dcdcdc),to(#d2d2d2));background-image:-moz-linear-gradient(-90deg,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:-webkit-linear-gradient(-90deg,#f5f5f5,#dcdcdc 60%,#d2d2d2);background-image:linear-gradient(-90deg,#f5f5f5,#dcdcdc 60%,#d2d2d2);-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-invert-y .annotator-controls{border-top:none;border-bottom:1px solid #b4b4b4;-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{position:relative;display:inline-block;padding:0 6px 0 22px;color:#363636;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 #a2a2a2;background-color:#d4d4d4;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),color-stop(0.5,#d2d2d2),color-stop(0.5,#bebebe),to(#d2d2d2));background-image:-moz-linear-gradient(-90deg,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:-webkit-linear-gradient(-90deg,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);background-image:linear-gradient(-90deg,#f5f5f5,#d2d2d2 50%,#bebebe 50%,#d2d2d2);-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{outline:none;border-color:#435aa0;background-color:#3865f9;background-image:-webkit-gradient(linear,left top,left bottom,from(#7691fb),color-stop(0.5,#5075fb),color-stop(0.5,#3865f9),to(#3665fa));background-image:-moz-linear-gradient(-90deg,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:-webkit-linear-gradient(-90deg,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);background-image:linear-gradient(-90deg,#7691fb,#5075fb 50%,#3865f9 50%,#3665fa);color:#fff;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{border-color:#700c49;background-color:#d12e8e;background-image:-webkit-gradient(linear,left top,left bottom,from(#fc7cca),color-stop(0.5,#e85db2),color-stop(0.5,#d12e8e),to(#ff009c));background-image:-moz-linear-gradient(-90deg,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:-webkit-linear-gradient(-90deg,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c);background-image:linear-gradient(-90deg,#fc7cca,#e85db2 50%,#d12e8e 50%,#ff009c)}.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::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-notice{position:absolute;position:fixed;top:-40px;width:100%;line-height:40px;font-size:12px}.annotator-notice{color:#fff;position:absolute;position:fixed;top:-54px;left:0;width:100%;font-size:14px;line-height:50px;text-align:center;background-color:#000;background-color:rgba(0,0,0,0.9);border-bottom:4px solid #d4d4d4;-webkit-transition:top .4s ease-out;-moz-transition:top .4s ease-out;-o-transition:top .4s ease-out;transition:top .4s ease-out}.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{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:#e6e6e6;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;border-radius:8px}
1  pkg/annotator.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var $,Annotator,Delegator,Range,fn,functions,util,_Annotator,_i,_j,_len,_len2,_ref;var __slice=Array.prototype.slice,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};if(!(typeof jQuery!="undefined"&&jQuery!==null?(_ref=jQuery.fn)!=null?_ref.jquery:void 0:void 0)){console.error("Annotator requires jQuery: have you included lib/vendor/jquery.js?")}if(!(JSON&&JSON.parse&&JSON.stringify)){console.error("Annotator requires a JSON implementation: have you included lib/vendor/json2.js?")}$=jQuery.sub();$.flatten=function(array){var flatten;flatten=function(ary){var el,flat,_i,_len;flat=[];for(_i=0,_len=ary.length;_i<_len;_i++){el=ary[_i];flat=flat.concat(el&&$.isArray(el)?flatten(el):el)}return flat};return flatten(array)};$.plugin=function(name,object){return jQuery.fn[name]=function(options){var args;args=Array.prototype.slice.call(arguments,1);return this.each(function(){var instance;instance=$.data(this,name);if(instance){return options&&instance[options].apply(instance,args)}else{instance=new object(this,options);return $.data(this,name,instance)}})}};$.fn.textNodes=function(){var getTextNodes;getTextNodes=function(node){var n,_i,_len,_ref,_results;if(node&&node.nodeType!==3){_ref=$(node).contents().get();_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){n=_ref[_i];_results.push(getTextNodes(n))}return _results}else{return node}};return this.map(function(){return $.flatten(getTextNodes(this))})};$.fn.xpath=function(relativeRoot){var jq;jq=this.map(function(){var elem,idx,path;path="";elem=this;while(elem&&elem.nodeType===1&&elem!==relativeRoot){idx=$(elem.parentNode).children(elem.tagName).index(elem)+1;idx=idx>1?"["+idx+"]":"";path="/"+elem.tagName.toLowerCase()+idx+path;elem=elem.parentNode}return path});return jq.get()};$.escape=function(html){return html.replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};$.fn.escape=function(html){if(arguments.length){return this.html($.escape(html))}return this.html()};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("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,_i,_ref,_ref2,_results;_ref=this.events;_results=[];for(sel in _ref){functionName=_ref[sel];_ref2=sel.split(" "),selector=2<=_ref2.length?__slice.call(_ref2,0,_i=_ref2.length-1):(_i=0,[]),event=_ref2[_i++];_results.push(this.addEvent(selector.join(" "),event,functionName))}return _results};Delegator.prototype.addEvent=function(bindTo,event,functionName){var closure,isBlankSelector;closure=__bind(function(){return this[functionName].apply(this,arguments)},this);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){var natives;natives="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]+/);event=event.split(".")[0];return $.inArray(event,natives)===-1};Delegator.prototype.publish=function(){this.element.trigger.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})();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("Couldn't not sniff range type");return false}}}};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,_i,_len,_ref;if(this.tainted){console.error("You may only call normalize() once on a BrowserRange!");return false}else{this.tainted=true}r={};nr={};_ref=["start","end"];for(_i=0,_len=_ref.length;_i<_len;_i++){p=_ref[_i];node=this[p+"Container"];offset=this[p+"Offset"];if(node.nodeType===1){it=node.childNodes[offset];node=it||node.childNodes[offset-1];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,_i,_len,_ref;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();_ref=$(this.end).parents();for(_i=0,_len=_ref.length;_i<_len;_i++){parent=_ref[_i];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,_i,_len;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(_i=0,_len=nodes.length;_i<_len;_i++){n=nodes[_i];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 _i,_len,_ref,_results;_ref=this.textNodes();_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];_results.push(node.nodeValue)}return _results}).call(this)).join("")};NormalizedRange.prototype.textNodes=function(){var end,start,textNodes,_ref;textNodes=$(this.commonAncestor).textNodes();_ref=[textNodes.index(this.start),textNodes.index(this.end)],start=_ref[0],end=_ref[1];return $.makeArray(textNodes.slice(start,(end+1)||9000000000))};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 cacXPath,common,endAncestry,i,length,nodeFromXPath,p,parentXPath,range,startAncestry,tn,_i,_j,_len,_len2,_ref,_ref2,_ref3;nodeFromXPath=function(xpath){return document.evaluate(xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue};parentXPath=$(root).xpath()[0];startAncestry=this.start.split("/");endAncestry=this.end.split("/");common=[];range={};for(i=0,_ref=startAncestry.length;(0<=_ref?i<_ref:i>_ref);(0<=_ref?i+=1:i-=1)){if(startAncestry[i]===endAncestry[i]){common.push(startAncestry[i])}else{break}}cacXPath=parentXPath+common.join("/");range.commonAncestorContainer=nodeFromXPath(cacXPath);if(!range.commonAncestorContainer){console.error("Error deserializing range: can't find XPath '"+cacXPath+"'. Is this the right document?");return null}_ref2=["start","end"];for(_i=0,_len=_ref2.length;_i<_len;_i++){p=_ref2[_i];length=0;_ref3=$(nodeFromXPath(parentXPath+this[p])).textNodes();for(_j=0,_len2=_ref3.length;_j<_len2;_j++){tn=_ref3[_j];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}}}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={getGlobal:function(){return(function(){return this})()},mousePosition:function(e,offsetEl){var offset;offset=$(offsetEl).offset();return{top:e.pageY-offset.top,left:e.pageX-offset.left}}};_Annotator=this.Annotator;Annotator=(function(){__extends(Annotator,Delegator);Annotator.prototype.events={".annotator-adder button click":"onAdderClick",".annotator-adder button mousedown":"onAdderMousedown",".annotator-hl mouseover":"onHighlightMouseover",".annotator-hl mouseout":"startViewerHideTimer"};Annotator.prototype.html={hl:'<span class="annotator-hl"></span>',adder:'<div class="annotator-adder"><button>Annotate</button></div>',wrapper:'<div class="annotator-wrapper"></div>'};Annotator.prototype.options={};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);var name,src,_ref;if(!Annotator.supported()){return this}Annotator.__super__.constructor.apply(this,arguments);this.plugins={};this._setupDocumentEvents()._setupWrapper()._setupViewer()._setupEditor();_ref=this.html;for(name in _ref){src=_ref[name];if(name!=="wrapper"){this[name]=$(src).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(){this.viewer=new Annotator.Viewer();this.viewer.hide().on("edit",this.onEditAnnotation).on("delete",this.onDeleteAnnotation).addField({load:__bind(function(field,annotation){$(field).escape(annotation.text||"");return this.publish("annotationViewerTextField",[field,annotation])},this)}).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:"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.getSelectedRanges=function(){var browserRange,i,ranges,selection;selection=util.getGlobal().getSelection();ranges=[];if(!selection.isCollapsed){ranges=(function(){var _ref,_results;_results=[];for(i=0,_ref=selection.rangeCount;(0<=_ref?i<_ref:i>_ref);(0<=_ref?i+=1:i-=1)){browserRange=new Range.BrowserRange(selection.getRangeAt(i));_results.push(browserRange.normalize().limit(this.wrapper[0]))}return _results}).call(this)}return $.grep(ranges,function(range){return range})};Annotator.prototype.createAnnotation=function(){var annotation;annotation={};this.publish("beforeAnnotationCreated",[annotation]);return annotation};Annotator.prototype.setupAnnotation=function(annotation,fireEvents){var normed,normedRanges,r,sniffed,_i,_len;if(fireEvents==null){fireEvents=true}annotation.ranges||(annotation.ranges=this.selectedRanges);normedRanges=(function(){var _i,_len,_ref,_results;_ref=annotation.ranges;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){r=_ref[_i];sniffed=Range.sniff(r);_results.push(sniffed.normalize(this.wrapper[0]))}return _results}).call(this);normedRanges=$.grep(normedRanges,function(range){return range!==null});annotation.quote=[];annotation.ranges=[];annotation.highlights=[];for(_i=0,_len=normedRanges.length;_i<_len;_i++){normed=normedRanges[_i];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);if(fireEvents){this.publish("annotationCreated",[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,_i,_len,_ref;_ref=annotation.highlights;for(_i=0,_len=_ref.length;_i<_len;_i++){h=_ref[_i];$(h).replaceWith(h.childNodes)}this.publish("annotationDeleted",[annotation]);return annotation};Annotator.prototype.loadAnnotations=function(annotations){var loader,results;if(annotations==null){annotations=[]}results=[];loader=__bind(function(annList){var n,now,_i,_len;if(annList==null){annList=[]}now=annList.splice(0,10);for(_i=0,_len=now.length;_i<_len;_i++){n=now[_i];this.setupAnnotation(n,false)}if(annList.length>0){return setTimeout((function(){return loader(annList)}),100)}},this);if(annotations.length){loader(annotations)}return this};Annotator.prototype.dumpAnnotations=function(){if(this.plugins.Store){return this.plugins.Store.dumpAnnotations()}else{return console.warn("Can't dump annotations without Store plugin.")}};Annotator.prototype.highlightRange=function(normedRange){var elemList,node,wrapper;return elemList=(function(){var _i,_len,_ref,_results;_ref=normedRange.textNodes();_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){node=_ref[_i];wrapper=this.hl.clone().show();_results.push($(node).wrap(wrapper).parent().get(0))}return _results}).call(this)};Annotator.prototype.addPlugin=function(name,options){var klass,_base;if(this.plugins[name]){console.error("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("Could not load "+name+" plugin. Have you included the appropriate <script> tag?")}}return this};Annotator.prototype.showEditor=function(annotation,location){this.editor.element.css(location);this.editor.load(annotation);return this};Annotator.prototype.onEditorHide=function(){this.publish("annotationEditorHidden",[this.editor]);return this.ignoreMouseup=false};Annotator.prototype.onEditorSubmit=function(annotation){this.publish("annotationEditorSubmit",[this.editor,annotation]);if(annotation.ranges===void 0){return this.setupAnnotation(annotation)}else{return this.updateAnnotation(annotation)}};Annotator.prototype.showViewer=function(annotations,location){this.viewer.element.css(location);this.viewer.load(annotations);return this.publish("annotationViewerShown",[this.viewer,annotations])};Annotator.prototype.startViewerHideTimer=function(){if(!this.viewerHideTimer){return this.viewerHideTimer=setTimeout((function(ann){return ann.viewer.hide()}),250,this)}};Annotator.prototype.clearViewerHideTimer=function(){clearTimeout(this.viewerHideTimer);return this.viewerHideTimer=false};Annotator.prototype.checkForStartSelection=function(event){if(!(event&&this.isAnnotator(event.target))){this.startViewerHideTimer();return this.mouseIsDown=true}};Annotator.prototype.checkForEndSelection=function(event){var container,range,_i,_len,_ref;this.mouseIsDown=false;if(this.ignoreMouseup){return}this.selectedRanges=this.getSelectedRanges();_ref=this.selectedRanges;for(_i=0,_len=_ref.length;_i<_len;_i++){range=_ref[_i];container=range.commonAncestor;if(this.isAnnotator(container)){return}}if(event&&this.selectedRanges.length){return this.adder.css(util.mousePosition(event,this.wrapper[0])).show()}else{return this.adder.hide()}};Annotator.prototype.isAnnotator=function(element){return !!$(element).parents().andSelf().filter("[class^=annotator-]").not(this.wrapper).length};Annotator.prototype.onHighlightMouseover=function(event){var annotations;this.clearViewerHideTimer();if(this.mouseIsDown||this.viewer.isShown()){return false}annotations=$(event.target).parents(".annotator-hl").andSelf().map(function(){return $(this).data("annotation")});return this.showViewer($.makeArray(annotations),util.mousePosition(event,this.wrapper[0]))};Annotator.prototype.onAdderMousedown=function(event){if(event!=null){event.preventDefault()}return this.ignoreMouseup=true};Annotator.prototype.onAdderClick=function(event){var position;if(event!=null){event.preventDefault()}position=this.adder.position();this.adder.hide();return this.showEditor(this.createAnnotation(),position)};Annotator.prototype.onEditAnnotation=function(annotation){var offset;offset=this.viewer.element.position();this.viewer.hide();return this.showEditor(annotation,offset)};Annotator.prototype.onDeleteAnnotation=function(annotation){this.viewer.hide();return this.deleteAnnotation(annotation)};return Annotator})();Annotator.Plugin=(function(){__extends(Plugin,Delegator);function Plugin(element,options){Plugin.__super__.constructor.apply(this,arguments)}Plugin.prototype.pluginInit=function(){};return Plugin})();Annotator.$=$;Annotator.supported=function(){return(function(){return !!this.getSelection})()};Annotator.noConflict=function(){util.getGlobal().Annotator=_Annotator;return this};$.plugin("annotator",Annotator);this.Annotator=Annotator;Annotator.Widget=(function(){__extends(Widget,Delegator);Widget.prototype.classes={hide:"annotator-hide",invert:{x:"annotator-invert-x",y:"annotator-invert-y"}};function Widget(element,options){Widget.__super__.constructor.apply(this,arguments);this.classes=$.extend({},Annotator.Widget.prototype.classes,this.classes)}Widget.prototype.checkOrientation=function(){var current,offset,viewport,widget,window;this.resetOrientation();window=$(util.getGlobal());widget=this.element.children(":first");offset=widget.offset();viewport={top:window.scrollTop(),right:window.width()+window.scrollLeft()};current={top:offset.top,right:offset.left+widget.width()};if((current.top-viewport.top)<0){this.invertY()}if((current.right-viewport.right)>0){this.invertX()}return this};Widget.prototype.resetOrientation=function(){this.element.removeClass(this.classes.invert.x).removeClass(this.classes.invert.y);return this};Widget.prototype.invertX=function(){this.element.addClass(this.classes.invert.x);return this};Widget.prototype.invertY=function(){this.element.addClass(this.classes.invert.y);return this};return Widget})();Annotator.Editor=(function(){__extends(Editor,Annotator.Widget);Editor.prototype.events={"form submit":"submit",".annotator-save click":"submit",".annotator-cancel click":"hide",".annotator-cancel mouseover":"onCancelButtonMouseover","textarea keydown":"processKeypress"};Editor.prototype.classes={hide:"annotator-hide",focus:"annotator-focus"};Editor.prototype.html='<div class="annotator-outer annotator-editor">\n  <form class="annotator-widget">\n    <ul class="annotator-listing"></ul>\n    <div class="annotator-controls">\n      <a href="#cancel" class="annotator-cancel">Cancel</a>\n      <a href="#save" class="annotator-save annotator-focus">Save</a>\n    </div>\n    <span class="annotator-resize"></span>\n  </form>\n<div>';Editor.prototype.options={};function Editor(options){this.onCancelButtonMouseover=__bind(this.onCancelButtonMouseover,this);this.processKeypress=__bind(this.processKeypress,this);this.submit=__bind(this.submit,this);this.load=__bind(this.load,this);this.hide=__bind(this.hide,this);this.show=__bind(this.show,this);Editor.__super__.constructor.call(this,$(this.html)[0],options);this.fields=[];this.annotation={};this.setupDragabbles()}Editor.prototype.show=function(event){if(event!=null){event.preventDefault()}this.element.removeClass(this.classes.hide);this.element.find(".annotator-save").addClass(this.classes.focus);this.element.find(":input:first").focus();return this.checkOrientation().publish("show")};Editor.prototype.hide=function(event){if(event!=null){event.preventDefault()}this.element.addClass(this.classes.hide);return this.publish("hide")};Editor.prototype.load=function(annotation){var field,_i,_len,_ref;this.annotation=annotation;this.publish("load",[this.annotation]);_ref=this.fields;for(_i=0,_len=_ref.length;_i<_len;_i++){field=_ref[_i];field.load(field.element,this.annotation)}return this.show()};Editor.prototype.submit=function(event){var field,_i,_len,_ref;if(event!=null){event.preventDefault()}_ref=this.fields;for(_i=0,_len=_ref.length;_i<_len;_i++){field=_ref[_i];field.submit(field.element,this.annotation)}this.publish("save",[this.annotation]);return this.hide()};Editor.prototype.addField=function(options){var element,field,input;field=$.extend({id:"annotator-field-"+(new Date()).getTime(),type:"input",label:"",load:function(){},submit:function(){}},options);input=null;element=$('<li class="annotator-item" />');field.element=element[0];switch(field.type){case"textarea":input=$("<textarea />");break;case"input":case"checkbox":input=$("<input />")}element.append(input);input.attr({id:field.id,placeholder:field.label});if(field.type==="checkbox"){input[0].type="checkbox";element.addClass("annotator-checkbox");element.append($("<label />",{"for":field.id,html:field.label}))}this.element.find("ul:first").append(element);this.fields.push(field);return field.element};Editor.prototype.checkOrientation=function(){var controls,flipFields,list;Editor.__super__.checkOrientation.apply(this,arguments);list=this.element.find("ul");controls=this.element.find(".annotator-controls");flipFields=function(){return list.children().each(function(){return $(this).parent().prepend(this)})};if(this.element.hasClass(this.classes.invert.y)&&list.is(":first-child")){controls.insertBefore(list);flipFields()}else{if(controls.is(":first-child")){controls.insertAfter(list);flipFields()}}return this};Editor.prototype.processKeypress=function(event){if(event.keyCode===27){return this.hide()}else{if(event.keyCode===13&&!event.shiftKey){return this.submit()}}};Editor.prototype.onCancelButtonMouseover=function(){return this.element.find("."+this.classes.focus).removeClass(this.classes.focus)};Editor.prototype.setupDragabbles=function(){var classes,controls,editor,mousedown,onMousedown,onMousemove,onMouseup,resize,textarea,throttle;mousedown=null;classes=this.classes;editor=this.element;textarea=null;resize=editor.find(".annotator-resize");controls=editor.find(".annotator-controls");throttle=false;onMousedown=function(event){if(event.target===this){mousedown={element:this,top:event.pageY,left:event.pageX};textarea=editor.find("textarea:first");$(window).bind({"mouseup.annotator-editor-resize":onMouseup,"mousemove.annotator-editor-resize":onMousemove});return event.preventDefault()}};onMouseup=function(){mousedown=null;return $(window).unbind(".annotator-editor-resize")};onMousemove=__bind(function(event){var diff,directionX,directionY,height,width;if(mousedown&&throttle===false){diff={top:event.pageY-mousedown.top,left:event.pageX-mousedown.left};if(mousedown.element===resize[0]){height=textarea.outerHeight();width=textarea.outerWidth();directionX=editor.hasClass(classes.invert.x)?-1:1;directionY=editor.hasClass(classes.invert.y)?1:-1;textarea.height(height+(diff.top*directionY));textarea.width(width+(diff.left*directionX));if(textarea.outerHeight()!==height){mousedown.top=event.pageY}if(textarea.outerWidth()!==width){mousedown.left=event.pageX}}else{if(mousedown.element===controls[0]){editor.css({top:parseInt(editor.css("top"),10)+diff.top,left:parseInt(editor.css("left"),10)+diff.left});mousedown.top=event.pageY;mousedown.left=event.pageX}}throttle=true;return setTimeout(function(){return throttle=false},1000/60)}},this);resize.bind("mousedown",onMousedown);return controls.bind("mousedown",onMousedown)};return Editor})();Annotator.Viewer=(function(){__extends(Viewer,Annotator.Widget);Viewer.prototype.events={".annotator-edit click":"onEditClick",".annotator-delete click":"onDeleteClick"};Viewer.prototype.classes={hide:"annotator-hide",showControls:"annotator-visible"};Viewer.prototype.html={element:'<div class="annotator-outer annotator-viewer">\n  <ul class="annotator-widget annotator-listing"></ul>\n</div>',item:'<li class="annotator-annotation annotator-item">\n  <span class="annotator-controls">\n    <button class="annotator-edit">Edit</button>\n    <button class="annotator-delete">Delete</button>\n  </span>\n</li>'};function Viewer(options){this.onDeleteClick=__bind(this.onDeleteClick,this);this.onEditClick=__bind(this.onEditClick,this);this.load=__bind(this.load,this);this.hide=__bind(this.hide,this);this.show=__bind(this.show,this);Viewer.__super__.constructor.call(this,$(this.html.element)[0],options);this.item=$(this.html.item)[0];this.fields=[];this.annotations=[]}Viewer.prototype.show=function(event){var controls;if(event!=null){event.preventDefault()}controls=this.element.find(".annotator-controls").addClass(this.classes.showControls);setTimeout((__bind(function(){return controls.removeClass(this.classes.showControls)},this)),500);this.element.removeClass(this.classes.hide);return this.checkOrientation().publish("show")};Viewer.prototype.isShown=function(){return !this.element.hasClass(this.classes.hide)};Viewer.prototype.hide=function(event){if(event!=null){event.preventDefault()}this.element.addClass(this.classes.hide);return this.publish("hide")};Viewer.prototype.load=function(annotations){var annotation,controller,controls,del,edit,element,field,item,list,_i,_j,_len,_len2,_ref,_ref2;this.annotations=annotations||[];list=this.element.find("ul:first").empty();_ref=this.annotations;for(_i=0,_len=_ref.length;_i<_len;_i++){annotation=_ref[_i];item=$(this.item).clone().appendTo(list).data("annotation",annotation);controls=item.find(".annotator-controls");edit=controls.find(".annotator-edit");del=controls.find(".annotator-delete");controller={showEdit:function(){return edit.removeAttr("disabled")},hideEdit:function(){return edit.attr("disabled","disabled")},showDelete:function(){return del.removeAttr("disabled")},hideDelete:function(){return del.attr("disabled","disabled")}};_ref2=this.fields;for(_j=0,_len2=_ref2.length;_j<_len2;_j++){field=_ref2[_j];element=$(field.element).clone().appendTo(item)[0];field.load(element,annotation,controller)}}this.publish("load",[this.annotations]);return this.show()};Viewer.prototype.addField=function(options){var field;field=$.extend({load:function(){}},options);field.element=$("<div />")[0];this.fields.push(field);field.element;return this};Viewer.prototype.onEditClick=function(event){return this.onButtonClick(event,"edit")};Viewer.prototype.onDeleteClick=function(event){return this.onButtonClick(event,"delete")};Viewer.prototype.onButtonClick=function(event,type){var item;item=$(event.target).parents(".annotator-annotation");return this.publish(type,[item.data("annotation")])};return Viewer})();Annotator=Annotator||{};Annotator.Notification=(function(){__extends(Notification,Delegator);Notification.prototype.events={click:"hide"};Notification.prototype.options={html:"<div class='annotator-notice'></div>",classes:{show:"annotator-notice-show",info:"annotator-notice-info",success:"annotator-notice-success",error:"annotator-notice-error"}};function Notification(options){this.hide=__bind(this.hide,this);this.show=__bind(this.show,this);Notification.__super__.constructor.call(this,$(this.options.html).appendTo(document.body)[0],options)}Notification.prototype.show=function(message,status){if(status==null){status=Annotator.Notification.INFO}$(this.element).addClass(this.options.classes.show).addClass(this.options.classes[status]).escape(message||"");setTimeout(this.hide,5000);return this};Notification.prototype.hide=function(){$(this.element).removeClass(this.options.classes.show);return this};return Notification})();Annotator.Notification.INFO="show";Annotator.Notification.SUCCESS="success";Annotator.Notification.ERROR="error";$(function(){var notification;notification=new Annotator.Notification;Annotator.showNotification=notification.show;return Annotator.hideNotification=notification.hide})}).call(this);
1  pkg/annotator.permissions.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};Annotator.Plugin.Permissions=(function(){__extends(Permissions,Annotator.Plugin);Permissions.prototype.events={beforeAnnotationCreated:"addFieldsToAnnotation"};Permissions.prototype.options={showViewPermissionsCheckbox:true,showEditPermissionsCheckbox:true,userId:function(user){return user},userString:function(user){return user},userAuthorize:function(user,token){return this.userId(user)===token},user:"",permissions:{read:[],update:[],"delete":[],admin:[]}};function Permissions(element,options){this.updateViewer=__bind(this.updateViewer,this);this.updateAnnotationPermissions=__bind(this.updateAnnotationPermissions,this);this.updatePermissionsField=__bind(this.updatePermissionsField,this);this.addFieldsToAnnotation=__bind(this.addFieldsToAnnotation,this);Permissions.__super__.constructor.apply(this,arguments);if(this.options.user){this.setUser(this.options.user);delete this.options.user}}Permissions.prototype.pluginInit=function(){var createCallback,self;if(!Annotator.supported()){return}self=this;createCallback=function(method,type){return function(field,annotation){return self[method].call(self,type,field,annotation)}};if(this.options.showViewPermissionsCheckbox===true){this.annotator.editor.addField({type:"checkbox",label:"Allow anyone to <strong>view</strong> this annotation",load:createCallback("updatePermissionsField","read"),submit:createCallback("updateAnnotationPermissions","read")})}if(this.options.showEditPermissionsCheckbox===true){this.annotator.editor.addField({type:"checkbox",label:"Allow anyone to <strong>edit</strong> this annotation",load:createCallback("updatePermissionsField","update"),submit:createCallback("updateAnnotationPermissions","update")})}return this.annotator.viewer.addField({load:this.updateViewer})};Permissions.prototype.setUser=function(user){return this.user=user};Permissions.prototype.addFieldsToAnnotation=function(annotation){if(annotation){annotation.permissions=this.options.permissions;if(this.user){return annotation.user=this.user}}};Permissions.prototype.authorize=function(action,annotation,user){var token,tokens,_i,_len;if(user===void 0){user=this.user}if(annotation.permissions){tokens=annotation.permissions[action]||[];if(tokens.length===0){return true}for(_i=0,_len=tokens.length;_i<_len;_i++){token=tokens[_i];if(this.options.userAuthorize.call(this.options,user,token)){return true}}return false}else{if(annotation.user){return user&&this.options.userId(user)===annotation.user}}return true};Permissions.prototype.updatePermissionsField=function(action,field,annotation){var dummy,input;field=$(field).show();input=field.find("input").removeAttr("disabled");if(!this.authorize("admin",annotation)){field.hide()}if(this.authorize(action,annotation||{},null)){input.attr("checked","checked");dummy={permissions:this.options.permissions};if(this.authorize(action,dummy,null)){return input.attr("disabled","disabled")}}else{return input.removeAttr("checked")}};Permissions.prototype.updateAnnotationPermissions=function(type,field,annotation){var dataKey,permissions;if(!annotation.permissions){annotation.permissions=this.options.permissions}dataKey=type+"-permissions";if($(field).find("input").is(":checked")){$.data(annotation,dataKey,annotation.permissions[type]);return annotation.permissions[type]=[]}else{permissions=$.data(annotation,dataKey);if(permissions){return annotation.permissions[type]=permissions}}};Permissions.prototype.updateViewer=function(field,annotation,controls){var user,username;field=$(field);username=this.options.userString(annotation.user);if(annotation.user&&username&&typeof username==="string"){user=Annotator.$.escape(this.options.userString(annotation.user));field.html(user).addClass("annotator-user")}else{field.remove()}if(annotation.permissions){if(!this.authorize("update",annotation)){controls.hideEdit()}if(!this.authorize("delete",annotation)){return controls.hideDelete()}}else{if(annotation.user&&!this.authorize(null,annotation)){controls.hideEdit();return controls.hideDelete()}}};return Permissions})()}).call(this);
1  pkg/annotator.store.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child},__indexOf=Array.prototype.indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(this[i]===item){return i}}return -1};Annotator.Plugin.Store=(function(){__extends(Store,Annotator.Plugin);Store.prototype.events={annotationCreated:"annotationCreated",annotationDeleted:"annotationDeleted",annotationUpdated:"annotationUpdated"};Store.prototype.options={prefix:"/store",autoFetch:true,annotationData:{},loadFromSearch:false,urls:{create:"/annotations",read:"/annotations/:id",update:"/annotations/:id",destroy:"/annotations/:id",search:"/search"}};function Store(element,options){this._onError=__bind(this._onError,this);this._onBeforeSend=__bind(this._onBeforeSend,this);this._onLoadAnnotationsFromSearch=__bind(this._onLoadAnnotationsFromSearch,this);this._onLoadAnnotations=__bind(this._onLoadAnnotations,this);this._getAnnotations=__bind(this._getAnnotations,this);Store.__super__.constructor.apply(this,arguments);this.annotations=[]}Store.prototype.pluginInit=function(){var auth;if(!Annotator.supported()){return}auth=this.element.data("annotator:auth");if(auth){return auth.withToken(this._getAnnotations)}else{return this._getAnnotations()}};Store.prototype._getAnnotations=function(){if(this.options.loadFromSearch){return this.loadAnnotationsFromSearch(this.options.loadFromSearch)}else{return this.loadAnnotations()}};Store.prototype.annotationCreated=function(annotation){if(__indexOf.call(this.annotations,annotation)<0){this.registerAnnotation(annotation);return this._apiRequest("create",annotation,__bind(function(data){if(!(data.id!=null)){console.warn("Warning: No ID returned from server for annotation ",annotation)}return this.updateAnnotation(annotation,data)},this))}else{return this.updateAnnotation(annotation,{})}};Store.prototype.annotationUpdated=function(annotation){if(__indexOf.call(this.annotations,annotation)>=0){return this._apiRequest("update",annotation,(__bind(function(){return this.updateAnnotation(annotation)},this)))}};Store.prototype.annotationDeleted=function(annotation){if(__indexOf.call(this.annotations,annotation)>=0){return this._apiRequest("destroy",annotation,(__bind(function(){return this.unregisterAnnotation(annotation)},this)))}};Store.prototype.registerAnnotation=function(annotation){return this.annotations.push(annotation)};Store.prototype.unregisterAnnotation=function(annotation){return this.annotations.splice(this.annotations.indexOf(annotation),1)};Store.prototype.updateAnnotation=function(annotation,data){if(__indexOf.call(this.annotations,annotation)<0){console.error("Trying to update unregistered annotation!")}else{$.extend(annotation,data)}return $(annotation.highlights).data("annotation",annotation)};Store.prototype.loadAnnotations=function(){return this._apiRequest("read",null,this._onLoadAnnotations)};Store.prototype._onLoadAnnotations=function(data){if(data==null){data=[]}this.annotations=data;return this.annotator.loadAnnotations(data.slice())};Store.prototype.loadAnnotationsFromSearch=function(searchOptions){return this._apiRequest("search",searchOptions,this._onLoadAnnotationsFromSearch)};Store.prototype._onLoadAnnotationsFromSearch=function(data){if(data==null){data={}}return this._onLoadAnnotations(data.rows||[])};Store.prototype.dumpAnnotations=function(){var ann,_i,_len,_ref,_results;_ref=this.annotations;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){ann=_ref[_i];_results.push(JSON.parse(this._dataFor(ann)))}return _results};Store.prototype._apiRequest=function(action,obj,onSuccess){var id,options,request,url;id=obj&&obj.id;url=this._urlFor(action,id);options=this._apiRequestOptions(action,obj,onSuccess);request=$.ajax(url,options);request._id=id;request._action=action;return request};Store.prototype._apiRequestOptions=function(action,obj,onSuccess){var opts;opts={type:this._methodFor(action),beforeSend:this._onBeforeSend,dataType:"json",success:onSuccess||function(){},error:this._onError};if(action==="search"){opts=$.extend(opts,{data:obj})}else{opts=$.extend(opts,{data:obj&&this._dataFor(obj),contentType:"application/json; charset=utf-8"})}return opts};Store.prototype._urlFor=function(action,id){var replaceWith,url;replaceWith=id!=null?"/"+id:"";url=this.options.prefix||"/";url+=this.options.urls[action];url=url.replace(/\/:id/,replaceWith);return url};Store.prototype._methodFor=function(action){var table;table={create:"POST",read:"GET",update:"PUT",destroy:"DELETE",search:"GET"};return table[action]};Store.prototype._dataFor=function(annotation){var data,highlights;highlights=annotation.highlights;delete annotation.highlights;$.extend(annotation,this.options.annotationData);data=JSON.stringify(annotation);if(highlights){annotation.highlights=highlights}return data};Store.prototype._onBeforeSend=function(xhr){var headers,key,val,_results;headers=this.element.data("annotator:headers");if(headers){_results=[];for(key in headers){val=headers[key];_results.push(xhr.setRequestHeader(key,val))}return _results}};Store.prototype._onError=function(xhr){var action,message;action=xhr._action;message="Sorry we could not "+action+" this annotation";if(xhr._action==="search"){message="Sorry we could not search the store for annotations"}else{if(xhr._action==="read"&&!xhr._id){message="Sorry we could not "+action+" the annotations from the store"}}switch(xhr.status){case 401:message="Sorry you are not allowed to "+action+" this annotation";break;case 404:message="Sorry we could not connect to the annotations store";break;case 500:message="Sorry something went wrong with the annotation store"}Annotator.showNotification(message,Annotator.Notification.ERROR);return console.error("API request failed: '"+xhr.status+"'")};return Store})()}).call(this);
1  pkg/annotator.tags.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};Annotator.Plugin.Tags=(function(){function Tags(){this.setAnnotationTags=__bind(this.setAnnotationTags,this);this.updateField=__bind(this.updateField,this);Tags.__super__.constructor.apply(this,arguments)}__extends(Tags,Annotator.Plugin);Tags.prototype.field=null;Tags.prototype.input=null;Tags.prototype.pluginInit=function(){if(!Annotator.supported()){return}this.field=this.annotator.editor.addField({label:"Add some tags here\u2026",load:this.updateField,submit:this.setAnnotationTags});this.annotator.viewer.addField({load:this.updateViewer});return this.input=$(this.field).find(":input")};Tags.prototype.parseTags=function(string){var tags;string=$.trim(string);tags=[];if(string){tags=string.split(/\s+/)}return tags};Tags.prototype.stringifyTags=function(array){return array.join(" ")};Tags.prototype.updateField=function(field,annotation){var value;value="";if(annotation.tags){value=this.stringifyTags(annotation.tags)}return this.input.val(value)};Tags.prototype.setAnnotationTags=function(field,annotation){return annotation.tags=this.parseTags(this.input.val())};Tags.prototype.updateViewer=function(field,annotation){field=$(field);if(annotation.tags&&$.isArray(annotation.tags)&&annotation.tags.length){return field.addClass("annotator-tags").html(function(){var string;return string=$.map(annotation.tags,function(tag){return'<span class="annotator-tag">'+Annotator.$.escape(tag)+"</span>"}).join(" ")})}else{return field.remove()}};return Tags})()}).call(this);
1  pkg/annotator.unsupported.min.js
... ...
@@ -0,0 +1 @@
  1
+(function(){var __hasProp=Object.prototype.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key)){child[key]=parent[key]}}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child},__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};Annotator.Plugin.Unsupported=(function(){function Unsupported(){Unsupported.__super__.constructor.apply(this,arguments)}__extends(Unsupported,Annotator.Plugin);Unsupported.prototype.options={message:"Sorry your current browser does not support the Annotator"};Unsupported.prototype.pluginInit=function(){if(!Annotator.supported()){return $(__bind(function(){return Annotator.showNotification(this.options.message)},this))}};return Unsupported})()}).call(this);

0 notes on commit 9b2e019

Please sign in to comment.
Something went wrong with that request. Please try again.