openannotation / annotator Goto Github PK
View Code? Open in Web Editor NEWAnnotation tools for the web. Select text, images, or (nearly) anything else, and add your notes.
Home Page: http://annotatorjs.org
License: Other
Annotation tools for the web. Select text, images, or (nearly) anything else, and add your notes.
Home Page: http://annotatorjs.org
License: Other
Rename User plugin to Permissions and add support for permissions.
The user
object is the current user viewing the page. The permissions
object will be assigned to each annotation on creation. Each action takes an array of user IDs. An empty array []
means anyone can perform the action.
annotator.addPlugin('Permissions', {
user: { id: 'Alice', name: 'Alice' },
permissions: {
'read': [], // Anyone can read this.
'update': ['Alice'], // Array of user IDs
'delete': ['Alice'],
'admin': ['Alice', 'Bob'] // Alice and Bob can change these permissions.
}
});
More notes:
https://gist.github.com/51ed6f3d812b32723c70#file_annotator_%2322.md
Currently Delegator#element
and Tags#tags
are DOM elements. Annotator#wrapper
and Annotator#dom.*
are jQuery instances. These should ideally be consistent.
I'd argue for using jQuery instances in all cases as this is a) a jQuery plugin and b) it's cleaner to get a the DOM element from the jQuery wrapper that to regularly create new instances of jQuery.
Workflow:
Questions:
A special method that loads all the plugins into the page with some default configuration. The should still be override able.
Cost: 1.5h
Currently the viewer will remain until the mouse moves away.
If you set up bookmarklet to have a default of allowing everyone to read the checkbox cannot be unchecked in the UI.
This should likely be the current window location. This will then allow the store to return annotations specific to the requested page.
The other option would be to use the Referrer
header rather than submitting this as part of the annotation data.
Generally for use with Internet Explorer, should display a notification explaining that the plugin is not supported by the browser.
Documentation required
<p><b>foo</b>bar</p>
if i select "bar" with annotator, the note will not appear.
Currently if the range provided when creating the instance is not part of the document calling normalize() will log Error deserializing range: ...
but continue to try and create a range. This will cause a TypeError
to be thrown when it cannot find the node value of the non existent elements.
Instead the SerializedRange#normalize()
method should return null
(in the same way as document.getElementById()
) and should be checked for by the implementor and skipped.
A toolbar that would appear at the top of the window and allow annotations to be filtered by metadata such as author, tag & date.
User object should be a hash of form:
# clients can set any attributes
# username field would be used by our User plugin
# id by convention is a unique identifier (at least per Consumer) for the user
user = {
'id': 'myid' #
'username': # for display purposes client side ...
# may be used if no username ... (could just overload username?)
'ip_address':
}
Quote field should be the text that was highlighted.
(Is this possible? What about invalid HTML? Alternative is to do simple snippet -- e.g. first 190 characters)
Copied over from https://github.com/nickstenning/annotator/issues#issue/20
IE9 now supports text range: http://blogs.msdn.com/b/ie/archive/2010/05/11/dom-range.aspx
We should therefore test with IE9
Copied over from https://github.com/nickstenning/annotator/issues#issue/9
When making a selection that begins inside and ends outside the element to which the annotator is bound, we currently won't detect the mouseup event. Should listen for mouseup anywhere and then determine whether any of the selection lies inside our element.
If you try to define a userID function as per https://github.com/okfn/annotator/wiki/Permissions-Plugin and access user object it won't be defined. Need to fix this or document that one must check that user is defined before attempting to use.
Add a checkbox to the annotation window that when checked flags the annotation as globally editable.
Step to reproduce.
There will be no tags field in the edit window.
Tags field will now appear.
I am experiencing a bug whereby, in Firefox4, I cannot edit and save an annotation more than once. To reproduce, do the following:
This seem to affect the current version of the annotator (v1.0.0rc3) used both through the Open Shakespeare installation and the bookmarklet (user agent: "Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1").
Review documentation and choose a documentation library
TomDoc seems like a suitable library for working with CoffeeScript
I want to print out in dead tree form the document with annotations.
Primary options for rendering:
When the bookmarklet is injected into some sites (such as a http://www.alistapart.com/) the sites styles conflict with the annotator.
Hopefully this can be resolved by thoroughly defining all possible styles on key elements like anchors and form elements and then applying !important
elements to the generated bookmarklet CSS.
However a more forceful approach such as Cleanslate might be required
It seems unnecessary to have to call this in every subclass that uses the events object. If no events exist Delegator#addEvents()
will simply do nothing.
This will remove the Annotator from the global scope and return it from the function. window.Annotator
will be re-set to it's previous value. This is useful for the bookmarklet where we do not know the environment the source is to be loaded into.
Current design proposal http://cl.ly/4lXC
Issues:
The annotator currently adds numerous plugins onto the global jQuery object as well as extending both the Array & Date prototypes. Also in the global scope are the Annotator, Delegator and Range objects.
Ideally a plugin that is to be included in an unknown webpage (especially in the context of a bookmarklet) should have little to no impact on the host environment. To resolve this only jQuery.fn.annotator() should be exported. Other plugins & functions can then be converted to local helper functions within application closure or added to a utils
object. If Range and Delegator need to be accessible outside of the main closure perhaps an annotator
namespace object should be created.
Another alternative for the jQuery plugins could be to use jQuery.sub() to create a local copy of jQuery. However this is only supported in jQuery 1.5+.
See how annotator performs with 100, 1000 or 10000 annotations on a page.
Also what about having 20 annotations in the same place (this is more of a UI issue).
As per https://github.com/okfn/annotator/wiki/Authentication the header field for the account has changed from x-annotator-account-key to x-annotator-account-id
List development dependencies in a package.json
file. At the moment we're using the README to track development dependencies. With a CommonJS package specification, installing development deps would be as simple as:
$ npm install .
The viewer and editor should always appear fully on the screen. i.e flip the editor upside down or to the right if necessary.
We risk running into rather amusing (but not particularly helpful) issues unless we prevent annotating the annotator UI itself. At the moment it's perfectly possible to select the text in the annotator UI and annotate it.
Tag v1.0 release. If we are concerned this is not v1.0 we could call this v1.0rc.
Work will be done in this separate repo: https://github.com/okfn/annotator-wordpress
Outstanding questions:
For the future (?):
Currently the Store plugin knows about the auth plugin.
auth = @element.data('annotator:auth')
if auth
auth.withToken(getAnnotations)
else
getAnnotations()
A cleaner way to so this might be for the implementor to set the autoFetch
option to false
when using the Auth plugin. Then call Store.loadAnnotations() when the token has been received:
annotator
.addPlugin('Store': {autoFetch: false})
.addPlugin('Auth', { withToken: function () {
annotator.plugins['Store'].loadAnnotations();
}})
This should provide useful notification to the user if an error occurs while communicating with the store. Examples being.
A sidebar theme where annotations are shown next to text in a sidebar rather than on hover.
Also discussed was displaying the annotations alongside the article in the browser. Similar to Docco.
2 main options for how this looks/works:
Remove dependency on ruby/rake. Notably there are NPM packages providing Node bindings to the YUI compressor
http://search.npmjs.org/#/yui-cli
http://search.npmjs.org/#/yui-compressor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.