From 995fba32644b4e3abb7bd9b6344a2131006f3e90 Mon Sep 17 00:00:00 2001 From: Aron Carroll Date: Sun, 20 Feb 2011 18:23:30 +0000 Subject: [PATCH] Added a simple "unsupported" plugin that displays a notification if the current browser does not support the Annotator --- dev.html | 2 ++ src/plugin/unsupported.coffee | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/plugin/unsupported.coffee diff --git a/dev.html b/dev.html index ac9d0bff5..ea0f71c41 100644 --- a/dev.html +++ b/dev.html @@ -17,6 +17,7 @@ + @@ -61,6 +62,7 @@

Header Level 3

devAnnotator = new Annotator(elem) //.addPlugin('Auth') + .addPlugin('Unsupported') .addPlugin('Tags') //.addPlugin('User') .addPlugin('Store', { diff --git a/src/plugin/unsupported.coffee b/src/plugin/unsupported.coffee new file mode 100644 index 000000000..34287f020 --- /dev/null +++ b/src/plugin/unsupported.coffee @@ -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) + )