From b4e58e51760fa67a8406f1a8eebb35a9e3630b3c Mon Sep 17 00:00:00 2001 From: Vikas Saurabh Date: Tue, 29 Apr 2014 07:44:50 +0530 Subject: [PATCH] Fixes #13. Min FF version is upped to 29 now (new API for toolbar button is availabled from FF29 onwards) --- README.md | 3 ++- .../assets/{qrIcon.png => qr-button-16.png} | Bin data/toolbar/assets/qr-button-32.png | Bin 0 -> 1245 bytes data/toolbar/widget.css | 3 --- data/toolbar/widget.html | 9 ------- data/toolbar/widget.js | 5 ---- lib/main.js | 23 +++++++++--------- 7 files changed, 14 insertions(+), 29 deletions(-) rename data/toolbar/assets/{qrIcon.png => qr-button-16.png} (100%) create mode 100644 data/toolbar/assets/qr-button-32.png delete mode 100644 data/toolbar/widget.css delete mode 100644 data/toolbar/widget.html delete mode 100644 data/toolbar/widget.js diff --git a/README.md b/README.md index 4a83034..3a39a01 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Credits: * QR code generator by Kazuhiko Arase * rendering qr code generated from above on html5 canvas by Amanuel Tewolde * JS based utf8 encoding from http://www.webtoolkit.info/javascript-utf8.html -* toolbar icon: http://www.iconfinder.com/icondetails/25689/16/barcode_2d_icon +* 16x16px icon: http://www.iconfinder.com/icondetails/25689/16/barcode_2d_icon +* 32x32px icon: https://www.iconfinder.com/icons/174693/code_qr_icon#size=32 (author page: http://icons8.com/) * Local file save javascript from https://github.com/eligrey/FileSaver.js * Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome * Copied some styles from Twitter's Bootstrap project :) - http://twitter.github.io/bootstrap/ diff --git a/data/toolbar/assets/qrIcon.png b/data/toolbar/assets/qr-button-16.png similarity index 100% rename from data/toolbar/assets/qrIcon.png rename to data/toolbar/assets/qr-button-16.png diff --git a/data/toolbar/assets/qr-button-32.png b/data/toolbar/assets/qr-button-32.png new file mode 100644 index 0000000000000000000000000000000000000000..26dc7222e4cbe7852b6da2941ad9313f99778422 GIT binary patch literal 1245 zcmV<31S0#1P)sRs4{2+RTQRz$C!lvck;HN;&`#LO2KzMbW9Tv9YTE37}OCC~23O?Os5@AATIz zUc$D`?7E}{1X``uC@|^-3?R?*DPREsGaHh02G~|oUoj-ef2^hfa?Cb&H z;Qhwx%Cc--r{IZ+iRrtTcNCbdTeo%`vuk{Oe5zCMJ>(jI&2M_gF_k3AfIFUTwOXT% zMq@?2Uf=J!Tap^Uvp_fV89nJq_y@2GcpLZ$_zqYv=}|NL(9Hgnv=aC%P17NOBuU

N+_EE2Jg>D3YwJtA78Uy-(%fJ@bZvdVGp7yLCl=QXhj{`#(TN z=lLPLY(MZq6s2h@@9DiE1dHSNo5E;jN8Pr03EwR+KMy$Ohl>4`G)-k@XF~|)r$rw3 zg+lkh-@w0hAc~?>-csiZeNkR(wb~6o=S5<+fX9IGQml`Fzl$WS)oM3NF%CFp4(O6J z4V(s0wN!Q@&1SO^$8oU*C(E`F!YbfhUtTq{nxrRyOOnjYl;`;u?RNWffUah<+1u%Z zCnhGQ&CKFBejPt4_`VjB=lSDN6b<f$v>+IEtcSU}K)=@0;0^lCGQC=EAQ`;DnhCRUhW< zctJ<=u6NT3Yy|MxaU(Fp{Dg#={W3N-_Gt*=7O+7Qzgmo{Cf%*0cL@3UAHPpk~e|Xj@x2pKbEkIwqRR%fV|UC3cM<5u&gk%VM#lH z=`>CIo#-)1ZvaJEMpCbt{p{EWUy7HNgv=L|8GtOyo&kvC*s?5BcX#)i5JGWM+K!vd zvTR!vMVBS@NV - - - - - - - - \ No newline at end of file diff --git a/data/toolbar/widget.js b/data/toolbar/widget.js deleted file mode 100644 index d41ec9c..0000000 --- a/data/toolbar/widget.js +++ /dev/null @@ -1,5 +0,0 @@ -var show_qr_button = document.getElementById("show-qr-button"); -show_qr_button.onclick = function() -{ - self.port.emit("showQR"); -} \ No newline at end of file diff --git a/lib/main.js b/lib/main.js index 0b3df1d..3e94d70 100644 --- a/lib/main.js +++ b/lib/main.js @@ -4,17 +4,18 @@ var { Hotkey } = require("sdk/hotkeys"); var data = require("sdk/self").data; var prefs = require("sdk/simple-prefs"); -var toolbarWidget = require("sdk/widget").Widget( -{ - id: "qrIcon", - label: "Show QR", - icon: data.url("toolbar/assets/qrIcon.png"), - contentURL: data.url("toolbar/widget.html"), - contentScriptFile: data.url("toolbar/widget.js") -}); -toolbarWidget.port.on("showQR", function() -{ - findAndSendQRText(); +var {ActionButton} = require("sdk/ui/button/action"); + +var button = ActionButton({ + id: "qr-button", + label: "Show QR", + icon: { + "16": data.url("toolbar/assets/qr-button-16.png"), + "32": data.url("toolbar/assets/qr-button-32.png") + }, + onClick: function(state) { + findAndSendQRText(); + } }); exports.main = function(options, callbacks)