comparison chrome/content/done.xul @ 0:c14d52a3b2fe

initial import
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 11 Aug 2008 20:34:21 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c14d52a3b2fe
1 <?xml version="1.0"?>
2
3 <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
4
5 <dialog buttons="accept" id="tinyurl-done-window"
6 title="TinyUrl Done"
7 onload="tinyurl_done_load();"
8 onblur="tinyurl_autohide()"
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 style="background: #FFC;">
11 <script>
12 <![CDATA[
13 var args = null;
14
15 function tinyurl_done_load(){
16 if(window.arguments.length > 0){
17 args = new Array();
18 args['tinyUrl'] = window.arguments[0];
19 args['realUrl'] = window.arguments[1];
20 args['title'] = (window.arguments.length > 2) ? window.arguments[2] : null;
21
22 document.getElementById("tinyurl-label").appendChild(document.createTextNode(args['tinyUrl']));
23
24 window.focus();
25 }
26 }
27
28 function tinyurl_done_openSave(){
29 if(opener != null && args != null){
30 opener.tinyurl_saved_add(args['tinyUrl'], args['realUrl'], args['title']);
31 }
32 }
33
34 function tinyurl_done_goto(){
35 if(args['tinyUrl'] == null){
36 alert("An error occurred");
37 }
38
39 if(opener){
40 opener.gBrowser.selectedTab = opener.gBrowser.addTab(args['tinyUrl']);
41 }
42 else{
43 window.open(args['tinyUrl']);
44 }
45
46 self.close();
47 }
48
49 function tinyurl_autohide(){
50 var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
51
52 if(oPrefs.prefHasUserValue("tinyurl.confirmation.hide") && oPrefs.getBoolPref("tinyurl.confirmation.hide"))
53 setTimeout("self.close()", 100);
54 }
55 ]]>
56 </script>
57 <vbox style="font-weight: bold; padding: 10px text-align: center;" flex="1" align="center" pack="center">
58 <description id="tinyurl-label"></description>
59 <description style="font-weight: normal;">has been copied to your clipboard.</description>
60 <spacer height="7" />
61 <hbox>
62 <button label="Close" oncommand="self.close()" tabindex="0" dlgtype="accept" />
63 <button label="Goto" oncommand="tinyurl_done_goto();" tabindex="1" style="font-size: x-small; font-weight: normal;" />
64 <button label="Save" tabindex="2" oncommand="tinyurl_done_openSave()" style="font-size: x-small; font-weight: normal;" />
65 </hbox>
66 <spacer height="7" />
67 </vbox>
68 </dialog>