Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

394 lines
14 KiB

  1. <HTML id=dlgOrganizeFavorites STYLE="font-family: MS Shell Dlg; font-size: 8pt; width: 41.2em; height: 31.0em">
  2. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  3. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  4. <head>
  5. <style>
  6. .button {color: BUTTONTEXT; font-size: 8pt}
  7. .info {font-size: 8pt; color: WINDOWTEXT}
  8. .btext {color: BUTTONTEXT}
  9. LI {line-height:10pt}
  10. A {text-decoration: none; color: WINDOWTEXT}
  11. </style>
  12. <TITLE id=txtTitleOrgFavsDialog>
  13. Organize Favorites
  14. </TITLE>
  15. <script>
  16. #define IDH_ORG_FAVORITES_MOVE 50006 // was 0x3050
  17. #define IDH_ORG_FAVORITES_RENAME 50007 // was 0x3051
  18. #define IDH_ORG_FAVORITES_DELETE 50008 // was 0x3052
  19. #define IDH_ORG_FAVORITES_CLOSE 50010 // was 0x3054
  20. #define IDH_ORGFAVS_NEW_FOLDER 50484
  21. #define IDH_ORGFAVS_SYNCHRO 50486
  22. #define IDH_ORGFAVS_PROPERTIES 50489
  23. #define IDH_ORGFAVS_LIST 50490
  24. window.onerror = HandleError;
  25. var g_strUrl; //the currently selected url
  26. var g_rgUrlsToSynch = new Array(0); //list of urls to synch on close, urls are used as indices
  27. var g_fSubscriptionsEnabled;
  28. var g_dxEllipses = 0;
  29. var g_dxEllipsesBold = 0;
  30. var L_Ellipses_Text = "..."; //an ellipses
  31. function callHelp(elm)
  32. {
  33. if (null != elm.helpid)
  34. {
  35. window.showHelp(elm.helpfile, "" + parseInt(elm.helpid), "popup");
  36. }
  37. else
  38. {
  39. if ("BODY" != elm.tagName)
  40. {
  41. callHelp(elm.parentElement);
  42. }
  43. }
  44. }
  45. document.onhelp = new Function("callHelp(window.event.srcElement)");
  46. function documentMouseUp()
  47. {
  48. // displays popup help when right mouse button clicked
  49. if (window.event.button == 2)
  50. {
  51. callHelp(window.event.srcElement);
  52. }
  53. }
  54. document.onmouseup = new Function("documentMouseUp()");
  55. //+-------------------------------------------------------------------
  56. //
  57. // Synopsis: Turns off error messages in dialogs
  58. //
  59. // Arguments: none
  60. //
  61. // returns: true (tells browser not to handle message)
  62. //
  63. //--------------------------------------------------------------------
  64. function HandleError(message, url, line)
  65. {
  66. //#ifdef IE5_40989
  67. var L_Dialog_ErrorMessage = "An error has occured in this dialog.";
  68. var L_ErrorNumber_Text = "Error: ";
  69. var str = L_Dialog_ErrorMessage + "\n\n"
  70. + L_ErrorNumber_Text + line + "\n"
  71. + message;
  72. alert (str);
  73. window.close();
  74. //#endif
  75. return true;
  76. }
  77. function BodyOnKeyPress(nCode)
  78. {
  79. if (nCode == 27) //ESC
  80. {
  81. window.close();
  82. return;
  83. }
  84. }
  85. function MeasureText(strText, fBold, widthMaximum)
  86. {
  87. // if text is not clipped, do nothing
  88. // get the width of the ellipses
  89. // get the ratio of width of div to length of text to determine initial cutoff point
  90. // from cutoff point, cut off up to 30 additional chars one char at a time
  91. // alert("MeasureText: " + strText + " widthMaximum: " + widthMaximum);
  92. if (spanMeasure.offsetWidth < widthMaximum)
  93. return strText;
  94. var dxEllipses = (fBold ? g_dxEllipsesBold : g_dxEllipses);
  95. var iCutoff = strText.length * (widthMaximum / (spanMeasure.offsetWidth + dxEllipses));
  96. if (fBold)
  97. {
  98. spanMeasure.innerHTML = "<B>" + strText.substring(0, iCutoff - 1) + L_Ellipses_Text + "</B>"
  99. iCutoff += 3;
  100. }
  101. else
  102. spanMeasure.innerHTML = strText.substring(0, iCutoff - 1) + L_Ellipses_Text; //iCutoff??
  103. for (cExtraCutoff = 1; (spanMeasure.offsetWidth > widthMaximum) && (cExtraCutoff < 30); cExtraCutoff++)
  104. {
  105. spanMeasure.innerHTML = spanMeasure.innerHTML.substring(0, iCutoff-cExtraCutoff) + L_Ellipses_Text + (fBold ? "</B>" : "");
  106. }
  107. // alert(spanMeasure.innerHTML + " " + spanMeasure.offsetWidth + ":::" + cExtraCutoff);
  108. return spanMeasure.innerHTML;
  109. }
  110. function OnSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline)
  111. {
  112. //hack to get escape from nsc
  113. if (cItems == -1)
  114. {
  115. BodyOnKeyPress(27);
  116. return;
  117. }
  118. //nothing selected
  119. if (cItems == 0)
  120. {
  121. textProperties.innerHTML = "";
  122. return;
  123. }
  124. g_strUrl = strUrl;
  125. if (g_dxEllipses == 0)
  126. {
  127. spanMeasure.innerHTML = L_Ellipses_Text;
  128. g_dxEllipses = spanMeasure.offsetWidth;
  129. spanMeasure.innerHTML = "<B>" + L_Ellipses_Text + "</B>";
  130. g_dxEllipsesBold = spanMeasure.offsetWidth;
  131. }
  132. spanMeasure.innerHTML = "<B>" + strName + "</B>";
  133. strNameShort = MeasureText(spanMeasure.innerText, true, textProperties.offsetWidth - 4);
  134. spanMeasure.innerHTML = strUrl;
  135. strUrlShort = MeasureText(spanMeasure.innerText, false, textProperties.offsetWidth - 4);
  136. //so the span doesn't take up space and make the dialog scrollable
  137. spanMeasure.innerHTML = "";
  138. // these have to be defined here, because the loc tools break on the "var re = /'/g" below
  139. var L_FavoritesFolder_Text = "Favorites Folder"; //Favorites folder
  140. var L_ModifiedColon_Text = "Modified:"; //Last modified date of directory, followed by a colon
  141. //if it is not a folder
  142. if (cVisits != -1)
  143. {
  144. var strOffline = "";
  145. var L_MakeAvailableOffline_Text = "Make available <U>o</U>ffline"; //Make available offline
  146. var L_MakeAvailableOfflineAccesskey_Text = "o"; //this must be the single character that is underlined above
  147. var L_Properties_Text = "<U>P</U>roperties"; //Properties button for make available offline
  148. var L_PropertiesAccesskey_Text = "p"; //this must be the single character that is underlined above
  149. if (g_fSubscriptionsEnabled && (strUrl.substring(0,4) == "http") )
  150. {
  151. strOffline = "<input type=checkbox align=";
  152. if(document.dir == "rtl")
  153. {
  154. strOffline +="right";
  155. }
  156. else
  157. {
  158. strOffline +="left";
  159. }
  160. strOffline +=" TABINDEX=5 ACCESSKEY=" + L_MakeAvailableOfflineAccesskey_Text + " id=chkOffline "
  161. if (fAvailableOffline != 0)
  162. strOffline += "CHECKED"
  163. strOffline += " onclick='ToggleOffline(this)' helpid=50486 helpfile='iexplore.hlp'><LABEL FOR=chkOffline TABINDEX=-1>" + L_MakeAvailableOffline_Text + "</LABEL>";
  164. strOffline += "<BR><BR><BUTTON id=btnProperties TABINDEX=6 style='visibility: "
  165. if (fAvailableOffline != 0)
  166. strOffline += "visible"
  167. else
  168. strOffline += "hidden"
  169. strOffline += "' class=button ACCESSKEY=" + L_PropertiesAccesskey_Text + " onclick='Properties()' helpid=50489 helpfile='iexplore.hlp'>" + L_Properties_Text + "</BUTTON><BR>";
  170. }
  171. var L_TimesVisited_Text = "times visited: "; //number of times the favorite has been visited
  172. var L_LastVisited_Text = "last visited: "; //date the favorite was last visited
  173. var L_LastVisitedNeedsLineBreak_Text = ""; //localizers, add a <BR> here if the last visited string + the date is too wide to fit the dialog. this will put the time and date on a new line.
  174. //hack so that single quotes don't confuse innerHTML
  175. var strTemp = strName + "\n" + strUrl;
  176. var re = /'/g;
  177. strTemp = strTemp.replace(re, "�");
  178. #ifndef UNIX
  179. textProperties.innerHTML = "<A TITLE='" + strTemp +"'><B>" + strNameShort + "</B><BR>" + strUrlShort + "</A><BR>" + L_TimesVisited_Text + cVisits + "<BR>" + L_LastVisited_Text + L_LastVisitedNeedsLineBreak_Text + strDate + "<BR>" + strOffline;
  180. #else
  181. textProperties.innerHTML = "<A TITLE='" + strTemp +"'><B>" + strNameShort + "</B><BR>" + strUrlShort + "</A><BR>" + L_TimesVisited_Text + cVisits + "<BR>" + L_LastVisited_Text + L_LastVisitedNeedsLineBreak_Text + strDate;
  182. #endif
  183. }
  184. else
  185. {
  186. textProperties.innerHTML = "<B>" + strNameShort + "</B><BR>" + L_FavoritesFolder_Text + "<BR><BR>" +
  187. "<B>" + L_ModifiedColon_Text + "</B><BR>" + strDate;
  188. }
  189. //do this here so the default size is correct
  190. tdProperties.noWrap=true;
  191. textProperties.noWrap=true;
  192. }
  193. function EnableButtons()
  194. {
  195. #ifndef UNIX
  196. g_fSubscriptionsEnabled = nsc.SubscriptionsEnabled;
  197. #else
  198. g_fSubscriptionsEnabled = false;
  199. #endif
  200. var pszInitialDir = window.dialogArguments;
  201. if (pszInitialDir && (pszInitialDir.length > 0))
  202. {
  203. nsc.SetRoot(pszInitialDir);
  204. }
  205. tdNsc.blur();
  206. tdNewFolder.focus();
  207. }
  208. function ToggleOffline(chkOffline)
  209. {
  210. #ifndef UNIX
  211. if (chkOffline.checked)
  212. {
  213. //if it fails to create a subscription, clear the check box
  214. if (!nsc.CreateSubscriptionForSelection())
  215. chkOffline.checked = false;
  216. else
  217. {
  218. g_rgUrlsToSynch[g_strUrl] = true;
  219. }
  220. }
  221. else
  222. {
  223. if (!nsc.DeleteSubscriptionForSelection())
  224. chkOffline.checked = true;
  225. else
  226. delete g_rgUrlsToSynch[g_strUrl];
  227. }
  228. btnProperties.style.visibility = (chkOffline.checked ? "visible" : "hidden");
  229. #endif
  230. }
  231. function BuildSynchList()
  232. {
  233. window.returnValue = "";
  234. #ifndef UNIX
  235. for (strUrl in g_rgUrlsToSynch)
  236. {
  237. window.returnValue += strUrl + "\0";
  238. }
  239. #endif
  240. }
  241. function Properties()
  242. {
  243. nsc.InvokeContextMenuCommand("properties");
  244. }
  245. function OnResize()
  246. {
  247. //HACK until trident fixes dynamic properties
  248. document.recalc(true);
  249. }
  250. function TdNscWidth()
  251. {
  252. return Math.max(0, document.body.offsetWidth - tableButtons.offsetWidth - (tableMain.border * 3) - (2 * parseInt(tdNsc.style.borderWidth)) - 6); //6 was enough
  253. }
  254. function TdPropertiesHeight()
  255. {
  256. return Math.max(0, document.body.offsetHeight - (tableMain.border * 2) - tdProperties.offsetTop - tdDone.offsetHeight - 8);
  257. }
  258. </script>
  259. </HEAD>
  260. <body style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; background: threedface; align: center"
  261. scroll="no" onkeydown="BodyOnKeyPress(event.keyCode)" onkeypress="BodyOnKeyPress(event.keyCode)" onload="EnableButtons()" onunload="BuildSynchList()" onresize="OnResize()">
  262. #ifdef DAVEMI_DEBUGONLY
  263. <input type=text id=text1></input><input type=button onclick="eval(text1.value)"></input>
  264. #endif
  265. <table id=tableMain cols=3 border=10 bordercolor=THREEDFACE>
  266. <TR id=mainrow>
  267. <TD valign=top id=infotext class=info>
  268. To create a new folder, click on the Create Folder button. To rename or delete an item, select the item and click Rename or Delete.
  269. </TD>
  270. <TD id=tdColSpacing width=0>
  271. </TD>
  272. <TD id=tdNscHolder rowspan=3 height=100%>
  273. <TABLE cols=1 width=100% height=100%>
  274. <TD id=tdNsc style="height:100%; border:2px inset WINDOW;">
  275. <object id=nsc TABINDEX=10 title="Favorites list" accesskey="t"
  276. style="background:window; HEIGHT=100%; WIDTH=100%"
  277. CLASSID='clsid:55136805-B2DE-11D1-B9F2-00A0C98BC547'
  278. onkeypress="BodyOnKeyPress(event.keyCode)"
  279. helpid=IDH_ORGFAVS_LIST
  280. helpfile="iexplore.hlp">
  281. </OBJECT>
  282. </TD>
  283. </TABLE>
  284. </TD>
  285. </TR>
  286. <TR id=rowButtons>
  287. <TD>
  288. <table id=tableButtons cols=2 width=200>
  289. <tr height=20>
  290. <TD align=center width=50%>
  291. <BUTTON id=tdNewFolder TABINDEX=1 style="width: 9em;" ACCESSKEY=c class=button onclick="nsc.NewFolder(); event.returnValue = false" helpid=IDH_ORGFAVS_NEW_FOLDER helpfile="iexplore.hlp">
  292. <U>C</U>reate Folder
  293. </BUTTON>
  294. </TD>
  295. <TD align=center width=50%>
  296. <BUTTON id=tdRename TABINDEX=2 style="width: 9em;" ACCESSKEY=r class=button onclick="nsc.InvokeContextMenuCommand('rename'); event.returnValue = false" helpid=IDH_ORG_FAVORITES_RENAME helpfile="iexplore.hlp">
  297. <U>R</U>ename
  298. </BUTTON>
  299. </TD>
  300. </tr>
  301. <tr height=20>
  302. <td width=50% align=center>
  303. <BUTTON id=tdMoveTo TABINDEX=3 style="width: 9em;" ACCESSKEY=m class=button onclick="nsc.MoveSelectionTo(); event.returnValue = false" helpid=IDH_ORG_FAVORITES_MOVE helpfile="iexplore.hlp">
  304. <U>M</U>ove to Folder...
  305. </BUTTON>
  306. </td>
  307. <td width=50% align=center>
  308. <BUTTON id=tdDelete TABINDEX=4 style="width: 9em;" ACCESSKEY=d class=button onclick="nsc.InvokeContextMenuCommand('delete'); event.returnValue = false" helpid=IDH_ORG_FAVORITES_DELETE helpfile="iexplore.hlp">
  309. <U>D</U>elete
  310. </BUTTON>
  311. </td>
  312. </tr>
  313. </table>
  314. </TD>
  315. </TR>
  316. <TR id=rowProperties vAlign=top style="padding-left:1px; padding-right:0px">
  317. <TD id=tdProperties style="border-width:2px; margin-left:5px; margin-top:5px; margin-right:5px;" vAlign=top>
  318. <DIV id=textProperties class=info style="border-width:2px; border-style:groove; border-color:window; width:100%; height:expression(Math.max(0, tdProperties.offsetHeight - (2 * parseInt(tdProperties.style.borderWidth)))); overflow:hidden; nowrap:true; position:absolute;">
  319. Select a Favorite to view its properties or to make it available for offline viewing.
  320. </DIV>
  321. </TD>
  322. </TR>
  323. <TR id=rowCloseButton>
  324. <TD id= cellCloseButton colspan=3 align=right>
  325. <BUTTON id=tdDone TABINDEX=11 style="width: 9em;" ACCESSKEY=l class=button onclick="window.close();" helpid=IDH_ORG_FAVORITES_CLOSE helpfile="iexplore.hlp">
  326. C<U>l</U>ose
  327. </BUTTON>
  328. </TD>
  329. </TR>
  330. </table>
  331. <SPAN id=spanMeasure style="visibility:hidden;" class=info></SPAN>
  332. <script defer for=nsc event="FavoritesSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline)">
  333. OnSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline);
  334. </script>
  335. <script defer>
  336. //expressions are asynchronous, so wait to hook them up
  337. tdNscHolder.style.setExpression("width", "TdNscWidth()");
  338. rowProperties.style.setExpression("height", "TdPropertiesHeight()");
  339. </script>
  340. </BODY>
  341. </HTML>