Skip to content

Commit

Permalink
Added a simple "unsupported" plugin that displays a notification if t…
Browse files Browse the repository at this point in the history
…he current browser does not support the Annotator
  • Loading branch information
aron committed Feb 20, 2011
1 parent 8fe5bc5 commit 995fba3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<script src="lib/plugin/user.js"></script>
<script src="lib/plugin/auth.js"></script>
<script src="lib/plugin/tags.js"></script>
<script src="lib/plugin/unsupported.js"></script>

<link rel="stylesheet" type="text/css" href="css/annotator.css">
</head>
Expand Down Expand Up @@ -61,6 +62,7 @@ <h3>Header Level 3</h3>

devAnnotator = new Annotator(elem)
//.addPlugin('Auth')
.addPlugin('Unsupported')
.addPlugin('Tags')
//.addPlugin('User')
.addPlugin('Store', {
Expand Down
10 changes: 10 additions & 0 deletions src/plugin/unsupported.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Annotator.Plugin.Unsupported extends Annotator.Plugin
options:
message: "Sorry your current browser does not support the Annotator"

pluginInit: ->
unless Annotator.supported()
$(=>
# On document load display notification.
Annotator.showNotification(@options.message)
)

0 comments on commit 995fba3

Please sign in to comment.