!import
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is Mozilla Mail Code.
16 *
17 * The Initial Developer of the Original Code is
18 * The Mozilla Foundation.
19 * Portions created by the Initial Developer are Copyright (C) 2004
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Scott MacGregor <mscott@mozilla.org>
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
onLoad
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
39 function onLoad()
40 {
41 var feedLocationEl = document.getElementById('feedLocation');
42 var rssAccountMenuItem = document.getElementById('rssAccountMenuItem');
43
44 if (window.arguments[0].feedLocation)
45 feedLocationEl.value = window.arguments[0].feedLocation;
46
47 // root the location picker to the news & blogs server
48 document.getElementById('selectFolder').setAttribute('ref', window.arguments[0].serverURI);
49
50 document.getElementById('selectFolder').selectedIndex = -1;
51 SetFolderPicker(window.arguments[0].folderURI ? window.arguments[0].folderURI : window.arguments[0].serverURI, 'selectFolder');
52
53 rssAccountMenuItem.label = window.arguments[0].serverPrettyName;
54 rssAccountMenuItem.value = window.arguments[0].serverURI;
55
56 // set quick mode value
57 document.getElementById('quickMode').checked = window.arguments[0].quickMode;
58
59 if (!window.arguments[0].newFeed)
60 {
61 // if we are editing an existing feed, disable the top level account
62 rssAccountMenuItem.setAttribute('disabled', 'true');
63 feedLocationEl.setAttribute('readonly', true);
64 feedLocationEl.setAttribute('context', 'copyUrlPopup');
65 }
66 else
67 feedLocationEl.setAttribute('context', 'pasteUrlPopup');
68 }
69
onOk
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
70 function onOk()
71 {
72 var feedLocation = document.getElementById('feedLocation').value;
73 // trim leading and trailing white space from the url
74 feedLocation = feedLocation.replace( /^\s+/, "").replace( /\s+$/, "");
75
76 window.arguments[0].feedLocation = feedLocation;
77 window.arguments[0].folderURI = document.getElementById('selectFolder').getAttribute("uri");
78 window.arguments[0].quickMode = document.getElementById('quickMode').checked;
79 window.arguments[0].result = true;
80
81 return true;
82 }
83
PickedMsgFolder
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
84 function PickedMsgFolder(selection,pickerID)
85 {
86 SetFolderPicker(selection.value, pickerID);
87 }
88
SetFolderPicker
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
89 function SetFolderPicker(uri,pickerID)
90 {
91 var picker = document.getElementById(pickerID);
92 var msgfolder = GetMsgFolderFromUri(uri, true);
93 if (!msgfolder)
94 return;
95
96 picker.setAttribute("label",msgfolder.name);
97 picker.setAttribute("uri",uri);
98 }
99
100 // CopyWebsiteAddress takes the website address title button, extracts
101 // the website address we stored in there and copies it to the clipboard
CopyWebsiteAddress
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
102 function CopyWebsiteAddress(websiteAddressNode)
103 {
104 if (websiteAddressNode)
105 {
106 var websiteAddress = websiteAddressNode.value;
107 var contractid = "@mozilla.org/widget/clipboardhelper;1";
108 var iid = Components.interfaces.nsIClipboardHelper;
109 var clipboard = Components.classes[contractid].getService(iid);
110 clipboard.copyString(websiteAddress);
111 }
112 }