diff options
author | Rogan Creswick <creswick@galois.com> | 2012-03-30 17:07:02 -0700 |
---|---|---|
committer | Rogan Creswick <creswick@galois.com> | 2012-03-30 17:07:02 -0700 |
commit | f6ab6622aab00fe7c2f4c3dc41f786ebbe0f0d73 (patch) | |
tree | 870111038542cd27153e1396ebdc063573249689 /tools/addon-sdk-1.4/examples/annotator/data/widget |
initial revision
Diffstat (limited to 'tools/addon-sdk-1.4/examples/annotator/data/widget')
-rw-r--r-- | tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-off.png | bin | 0 -> 1740 bytes | |||
-rw-r--r-- | tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-on.png | bin | 0 -> 2054 bytes | |||
-rw-r--r-- | tools/addon-sdk-1.4/examples/annotator/data/widget/widget.js | 13 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-off.png b/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-off.png Binary files differnew file mode 100644 index 0000000..b14d961 --- /dev/null +++ b/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-off.png diff --git a/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-on.png b/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-on.png Binary files differnew file mode 100644 index 0000000..71a609f --- /dev/null +++ b/tools/addon-sdk-1.4/examples/annotator/data/widget/pencil-on.png diff --git a/tools/addon-sdk-1.4/examples/annotator/data/widget/widget.js b/tools/addon-sdk-1.4/examples/annotator/data/widget/widget.js new file mode 100644 index 0000000..f9714db --- /dev/null +++ b/tools/addon-sdk-1.4/examples/annotator/data/widget/widget.js @@ -0,0 +1,13 @@ +/* +Listen for left and right click events and send the corresponding message +to the content script. +*/ + +this.addEventListener('click', function(event) { + if(event.button == 0 && event.shiftKey == false) + self.port.emit('left-click'); + + if(event.button == 2 || (event.button == 0 && event.shiftKey == true)) + self.port.emit('right-click'); + event.preventDefault(); +}, true); |