Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | function onLoad() |
michael@0 | 6 | { |
michael@0 | 7 | protectedAuthThread = window.arguments[0].QueryInterface(Components.interfaces.nsIProtectedAuthThread); |
michael@0 | 8 | |
michael@0 | 9 | if (!protectedAuthThread) |
michael@0 | 10 | { |
michael@0 | 11 | window.close(); |
michael@0 | 12 | return; |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | try |
michael@0 | 16 | { |
michael@0 | 17 | var tokenName = protectedAuthThread.getTokenName(); |
michael@0 | 18 | |
michael@0 | 19 | var tag = document.getElementById("tokenName"); |
michael@0 | 20 | tag.setAttribute("value",tokenName); |
michael@0 | 21 | |
michael@0 | 22 | setCursor("wait"); |
michael@0 | 23 | |
michael@0 | 24 | var obs = { |
michael@0 | 25 | observe : function protectedAuthListenerObserve(subject, topic, data) { |
michael@0 | 26 | if (topic == "operation-completed") |
michael@0 | 27 | window.close(); |
michael@0 | 28 | } |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | protectedAuthThread.login(obs); |
michael@0 | 32 | |
michael@0 | 33 | } catch (exception) |
michael@0 | 34 | { |
michael@0 | 35 | window.close(); |
michael@0 | 36 | return; |
michael@0 | 37 | } |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | function onClose() |
michael@0 | 41 | { |
michael@0 | 42 | setCursor("default"); |
michael@0 | 43 | } |