diff --git a/.gitignore b/.gitignore index e31cba3..1b4a3c9 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ RESTClient.tmproj #ignore test scripts *.test.js *.xpi + +content/test.html diff --git a/content/js/jquery.hotkeys.js b/content/js/jquery.hotkeys.js index 853deb6..b95f5b7 100644 --- a/content/js/jquery.hotkeys.js +++ b/content/js/jquery.hotkeys.js @@ -44,7 +44,8 @@ handleObj.handler = function( event ) { // Don't fire in text-accepting inputs that we didn't directly bind to if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || - event.target.type === "text" || event.target.type === "password") ) { + event.target.type === "text" || event.target.type === "password" + || event.target.type === "url") ) { return; } diff --git a/content/js/restclient.oauth2.js b/content/js/restclient.oauth2.js new file mode 100644 index 0000000..8974276 --- /dev/null +++ b/content/js/restclient.oauth2.js @@ -0,0 +1,32 @@ +/* ***** BEGIN LICENSE BLOCK ***** +Copyright (c) 2007-2012, Chao ZHOU (chao@zhou.fr). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ***** END LICENSE BLOCK ***** */ + +"use strict"; +restclient.oauth2 = { + +}; \ No newline at end of file diff --git a/content/js/restclient.oauth2.template.js b/content/js/restclient.oauth2.template.js new file mode 100644 index 0000000..af42a5f --- /dev/null +++ b/content/js/restclient.oauth2.template.js @@ -0,0 +1,53 @@ +/* ***** BEGIN LICENSE BLOCK ***** +Copyright (c) 2007-2012, Chao ZHOU (chao@zhou.fr). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ***** END LICENSE BLOCK ***** */ + +"use strict"; +restclient.oauth2 = restclient.oauth2 || {}; +restclient.oauth2.templates = { + "Google": { + "authorization_endpoint": "https://accounts.google.com/o/oauth2/auth", + "redirection_endpoint": "http://www.google.com/robots.txt", + "token_endpoint": "https://accounts.google.com/o/oauth2/token", + "token_method": "POST", + "response_type": "code" + }, + "Github": { + "authorization_endpoint": "https://github.com/login/oauth/authorize", + "redirection_endpoint": "https://github.com/robots.txt", + "token_endpoint": "https://github.com/login/oauth/access_token", + "token_method": "POST", + "response_type": "code" + }, + "Facebook": { + "authorization_endpoint": "https://www.facebook.com/dialog/oauth", + "redirection_endpoint": "http://www.facebook.com/robots.txt", + "token_endpoint": "https://graph.facebook.com/oauth/access_token", + "token_method": "GET", + "response_type": "code" + } +} \ No newline at end of file diff --git a/content/js/restclient.oauth2.ui.js b/content/js/restclient.oauth2.ui.js new file mode 100644 index 0000000..4efeb38 --- /dev/null +++ b/content/js/restclient.oauth2.ui.js @@ -0,0 +1,37 @@ +/* ***** BEGIN LICENSE BLOCK ***** +Copyright (c) 2007-2012, Chao ZHOU (chao@zhou.fr). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ***** END LICENSE BLOCK ***** */ + +"use strict"; +restclient.oauth2 = restclient.oauth2 || {}; +restclient.oauth2.ui = { + init: function() { + + } +} + +window.addEventListener("load", function () { restclient.oauth2.ui.init(); }, false); \ No newline at end of file diff --git a/content/restclient.html b/content/restclient.html index 0c0c45a..35ce486 100644 --- a/content/restclient.html +++ b/content/restclient.html @@ -31,7 +31,8 @@ Authorization