Windows2000/private/shell/shdocvw/orgfav.dlg
2020-09-30 17:12:32 +02:00

379 lines
12 KiB
Plaintext
Raw Blame History

<HTML id=dlgOrganizeFavorites STYLE="font-family: MS Shell Dlg; font-size: 8pt; width: 41.2em; height: 31.0em">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<style>
.button {color: BUTTONTEXT; font-size: 8pt}
.info {font-size: 8pt; color: WINDOWTEXT}
.btext {color: BUTTONTEXT}
LI {line-height:10pt}
A {text-decoration: none; color: WINDOWTEXT}
</style>
<TITLE id=txtTitleOrgFavsDialog>
Organize Favorites
</TITLE>
<script>
#define IDH_ORG_FAVORITES_MOVE 50006 // was 0x3050
#define IDH_ORG_FAVORITES_RENAME 50007 // was 0x3051
#define IDH_ORG_FAVORITES_DELETE 50008 // was 0x3052
#define IDH_ORG_FAVORITES_CLOSE 50010 // was 0x3054
#define IDH_ORGFAVS_NEW_FOLDER 50484
#define IDH_ORGFAVS_SYNCHRO 50486
#define IDH_ORGFAVS_PROPERTIES 50489
#define IDH_ORGFAVS_LIST 50490
window.onerror = HandleError;
var g_strUrl; //the currently selected url
var g_rgUrlsToSynch = new Array(0); //list of urls to synch on close, urls are used as indices
var g_fSubscriptionsEnabled;
var g_dxEllipses = 0;
var g_dxEllipsesBold = 0;
var L_Ellipses_Text = "..."; //an ellipses
function callHelp(elm)
{
if (null != elm.helpid)
{
window.showHelp(elm.helpfile, "" + parseInt(elm.helpid), "popup");
}
else
{
if ("BODY" != elm.tagName)
{
callHelp(elm.parentElement);
}
}
}
document.onhelp = new Function("callHelp(window.event.srcElement)");
function documentMouseUp()
{
// displays popup help when right mouse button clicked
if (window.event.button == 2)
{
callHelp(window.event.srcElement);
}
}
document.onmouseup = new Function("documentMouseUp()");
//+-------------------------------------------------------------------
//
// Synopsis: Turns off error messages in dialogs
//
// Arguments: none
//
// returns: true (tells browser not to handle message)
//
//--------------------------------------------------------------------
function HandleError(message, url, line)
{
//#ifdef IE5_40989
var L_Dialog_ErrorMessage = "An error has occured in this dialog.";
var L_ErrorNumber_Text = "Error: ";
var str = L_Dialog_ErrorMessage + "\n\n"
+ L_ErrorNumber_Text + line + "\n"
+ message;
alert (str);
window.close();
//#endif
return true;
}
function BodyOnKeyPress(nCode)
{
if (nCode == 27) //ESC
{
window.close();
return;
}
}
function MeasureText(strText, fBold, widthMaximum)
{
// if text is not clipped, do nothing
// get the width of the ellipses
// get the ratio of width of div to length of text to determine initial cutoff point
// from cutoff point, cut off up to 30 additional chars one char at a time
// alert("MeasureText: " + strText + " widthMaximum: " + widthMaximum);
if (spanMeasure.offsetWidth < widthMaximum)
return strText;
var dxEllipses = (fBold ? g_dxEllipsesBold : g_dxEllipses);
var iCutoff = strText.length * (widthMaximum / (spanMeasure.offsetWidth + dxEllipses));
if (fBold)
{
spanMeasure.innerHTML = "<B>" + strText.substring(0, iCutoff - 1) + L_Ellipses_Text + "</B>"
iCutoff += 3;
}
else
spanMeasure.innerHTML = strText.substring(0, iCutoff - 1) + L_Ellipses_Text; //iCutoff??
for (cExtraCutoff = 1; (spanMeasure.offsetWidth > widthMaximum) && (cExtraCutoff < 30); cExtraCutoff++)
{
spanMeasure.innerHTML = spanMeasure.innerHTML.substring(0, iCutoff-cExtraCutoff) + L_Ellipses_Text + (fBold ? "</B>" : "");
}
// alert(spanMeasure.innerHTML + " " + spanMeasure.offsetWidth + ":::" + cExtraCutoff);
return spanMeasure.innerHTML;
}
function OnSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline)
{
//hack to get escape from nsc
if (cItems == -1)
{
BodyOnKeyPress(27);
return;
}
//nothing selected
if (cItems == 0)
{
textProperties.innerHTML = "";
return;
}
g_strUrl = strUrl;
if (g_dxEllipses == 0)
{
spanMeasure.innerHTML = L_Ellipses_Text;
g_dxEllipses = spanMeasure.offsetWidth;
spanMeasure.innerHTML = "<B>" + L_Ellipses_Text + "</B>";
g_dxEllipsesBold = spanMeasure.offsetWidth;
}
spanMeasure.innerHTML = "<B>" + strName + "</B>";
strNameShort = MeasureText(spanMeasure.innerText, true, textProperties.offsetWidth - 4);
spanMeasure.innerHTML = strUrl;
strUrlShort = MeasureText(spanMeasure.innerText, false, textProperties.offsetWidth - 4);
//so the span doesn't take up space and make the dialog scrollable
spanMeasure.innerHTML = "";
// these have to be defined here, because the loc tools break on the "var re = /'/g" below
var L_FavoritesFolder_Text = "Favorites Folder"; //Favorites folder
var L_ModifiedColon_Text = "Modified:"; //Last modified date of directory, followed by a colon
//if it is not a folder
if (cVisits != -1)
{
var strOffline = "";
var L_MakeAvailableOffline_Text = "Make available <U>o</U>ffline"; //Make available offline
var L_MakeAvailableOfflineAccesskey_Text = "o"; //this must be the single character that is underlined above
var L_Properties_Text = "<U>P</U>roperties"; //Properties button for make available offline
var L_PropertiesAccesskey_Text = "p"; //this must be the single character that is underlined above
if (g_fSubscriptionsEnabled && (strUrl.substring(0,4) == "http") )
{
strOffline = "<input type=checkbox align=left TABINDEX=5 ACCESSKEY=" + L_MakeAvailableOfflineAccesskey_Text + " id=chkOffline "
if (fAvailableOffline != 0)
strOffline += "CHECKED"
strOffline += " onclick='ToggleOffline(this)' helpid=50486 helpfile='iexplore.hlp'><LABEL FOR=chkOffline TABINDEX=-1>" + L_MakeAvailableOffline_Text + "</LABEL>";
strOffline += "<BR><BR><BUTTON id=btnProperties TABINDEX=6 style='visibility: "
if (fAvailableOffline != 0)
strOffline += "visible"
else
strOffline += "hidden"
strOffline += "' class=button ACCESSKEY=" + L_PropertiesAccesskey_Text + " onclick='Properties()' helpid=50489 helpfile='iexplore.hlp'>" + L_Properties_Text + "</BUTTON><BR>";
}
var L_TimesVisited_Text = "times visited: "; //number of times the favorite has been visited
var L_LastVisited_Text = "last visited: "; //date the favorite was last visited
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.
//hack so that single quotes don't confuse innerHTML
var strTemp = strName + "\n" + strUrl;
var re = /'/g;
strTemp = strTemp.replace(re, "<22>");
#ifndef UNIX
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;
#else
textProperties.innerHTML = "<A TITLE='" + strTemp +"'><B>" + strNameShort + "</B><BR>" + strUrlShort + "</A><BR>" + L_TimesVisited_Text + cVisits + "<BR>" + L_LastVisited_Text + L_LastVisitedNeedsLineBreak_Text + strDate;
#endif
}
else
{
textProperties.innerHTML = "<B>" + strNameShort + "</B><BR>" + L_FavoritesFolder_Text + "<BR><BR>" +
"<B>" + L_ModifiedColon_Text + "</B><BR>" + strDate;
}
//do this here so the default size is correct
tdProperties.noWrap=true;
textProperties.noWrap=true;
}
function EnableButtons()
{
#ifndef UNIX
g_fSubscriptionsEnabled = nsc.FOfflinePackInstalled;
#else
g_fSubscriptionsEnabled = false;
#endif
var pszInitialDir = window.dialogArguments;
if (pszInitialDir && (pszInitialDir.length > 0))
{
nsc.SetRoot(pszInitialDir);
}
tdNsc.blur();
tdNewFolder.focus();
}
function ToggleOffline(chkOffline)
{
#ifndef UNIX
if (chkOffline.checked)
{
//if it fails to create a subscription, clear the check box
if (!nsc.CreateSubscriptionForSelection())
chkOffline.checked = false;
else
{
g_rgUrlsToSynch[g_strUrl] = true;
}
}
else
{
if (!nsc.DeleteSubscriptionForSelection())
chkOffline.checked = true;
else
delete g_rgUrlsToSynch[g_strUrl];
}
btnProperties.style.visibility = (chkOffline.checked ? "visible" : "hidden");
#endif
}
function BuildSynchList()
{
window.returnValue = "";
#ifndef UNIX
for (strUrl in g_rgUrlsToSynch)
{
window.returnValue += strUrl + "\0";
}
#endif
}
function Properties()
{
nsc.InvokeContextMenuCommand("properties");
}
function OnResize()
{
//HACK until trident fixes dynamic properties
document.recalc(true);
}
function TdNscWidth()
{
return Math.max(0, document.body.offsetWidth - tableButtons.offsetWidth - (tableMain.border * 3) - (2 * parseInt(tdNsc.style.borderWidth)) - 6); //6 was enough
}
function TdPropertiesHeight()
{
return Math.max(0, document.body.offsetHeight - (tableMain.border * 2) - tdProperties.offsetTop - tdDone.offsetHeight - 8);
}
</script>
</HEAD>
<body style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; background: threedface; align: center"
scroll="no" onkeydown="BodyOnKeyPress(event.keyCode)" onkeypress="BodyOnKeyPress(event.keyCode)" onload="EnableButtons()" onunload="BuildSynchList()" onresize="OnResize()">
#ifdef DAVEMI_DEBUGONLY
<input type=text id=text1></input><input type=button onclick="eval(text1.value)"></input>
#endif
<table id=tableMain cols=3 border=10 bordercolor=THREEDFACE>
<TR id=mainrow>
<TD valign=top id=infotext class=info>
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.
</TD>
<TD id=tdColSpacing width=0>
</TD>
<TD id=tdNscHolder rowspan=3>
<TABLE cols=1 width=100% height=100%>
<TD id=tdNsc style="border:2px inset WINDOW;">
<object id=nsc TABINDEX=10 title="Favorites list" accesskey="t" CLASSID='clsid:55136805-B2DE-11D1-B9F2-00A0C98BC547' onkeypress="BodyOnKeyPress(event.keyCode)" HEIGHT=100% WIDTH=100% helpid=IDH_ORGFAVS_LIST helpfile="iexplore.hlp"></OBJECT>
</TD>
</TABLE>
</TD>
</TR>
<TR id=rowButtons>
<TD>
<table id=tableButtons cols=2 width=200>
<tr height=20>
<TD align=center width=50%>
<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">
<U>C</U>reate Folder
</BUTTON>
</TD>
<TD align=center width=50%>
<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">
<U>R</U>ename
</BUTTON>
</TD>
</tr>
<tr height=20>
<td width=50% align=center>
<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">
<U>M</U>ove to Folder...
</BUTTON>
</td>
<td width=50% align=center>
<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">
<U>D</U>elete
</BUTTON>
</td>
</tr>
</table>
</TD>
</TR>
<TR id=rowProperties vAlign=top style="padding-left:1px;">
<TD id=tdProperties style="border-width:2px; margin-left:5px; margin-top:5px; margin-right:5px;" vAlign=top>
<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;">
Select a Favorite to view its properties or to make it available for offline viewing.
</DIV>
</TD>
</TR>
<TR id=rowCloseButton>
<TD colspan=3 align=right>
<BUTTON id=tdDone TABINDEX=11 style="width: 9em;" ACCESSKEY=l class=button onclick="window.close();" helpid=IDH_ORG_FAVORITES_CLOSE helpfile="iexplore.hlp">
C<U>l</U>ose
</BUTTON>
</TD>
</TR>
</table>
<SPAN id=spanMeasure style="visibility:hidden;" class=info></SPAN>
<script defer for=nsc event="FavoritesSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline)">
OnSelectionChange(cItems, hItem, strName, strUrl, cVisits, strDate, fAvailableOffline);
</script>
<script defer>
//expressions are asynchronous, so wait to hook them up
tdNscHolder.style.setExpression("width", "TdNscWidth()");
rowProperties.style.setExpression("height", "TdPropertiesHeight()");
</script>
</BODY>
</HTML>