Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
10 var dialogParams;
12 function onLoad()
13 {
14 dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
15 var selectElement = document.getElementById("tokens");
16 var aCount = dialogParams.GetInt(0);
17 for (var i=0; i < aCount; i++) {
18 var menuItemNode = document.createElement("menuitem");
19 var token = dialogParams.GetString(i);
20 menuItemNode.setAttribute("value", token);
21 menuItemNode.setAttribute("label", token);
22 selectElement.firstChild.appendChild(menuItemNode);
23 if (i == 0) {
24 selectElement.selectedItem = menuItemNode;
25 }
26 }
27 }
29 function doOK()
30 {
31 var tokenList = document.getElementById("tokens");
32 var token = tokenList.value;
33 dialogParams.SetInt(0,1);
34 dialogParams.SetString(0, token);
35 return true;
36 }
38 function doCancel()
39 {
40 dialogParams.SetInt(0,0);
41 return true;
42 }