some required groundwork for pink for his nsbeta3+ bug 39326

This commit is contained in:
ben%netscape.com 2000-07-31 20:26:08 +00:00
Родитель bee90dec17
Коммит 6089e32761
1 изменённых файлов: 12 добавлений и 17 удалений

Просмотреть файл

@ -95,6 +95,7 @@ var personalToolbarObserver = {
var uri = aEvent.target.id; var uri = aEvent.target.id;
//if (!isBookmark(uri)) //if (!isBookmark(uri))
// return; // return;
var title = aEvent.target.value; var title = aEvent.target.value;
var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>";
@ -107,7 +108,7 @@ var personalToolbarObserver = {
return flavourList; return flavourList;
}, },
onDrop: function (aEvent, aData) onDrop: function (aEvent, aData, aDragSession)
{ {
// temporary // temporary
if (!isPToolbarDNDEnabled()) if (!isPToolbarDNDEnabled())
@ -147,7 +148,7 @@ var personalToolbarObserver = {
rdfContainer.InsertElementAt(elementRes, newIndex, true); rdfContainer.InsertElementAt(elementRes, newIndex, true);
}, },
onDragOver: function (aEvent, aFlavour) onDragOver: function (aEvent, aFlavour, aDragSession)
{ {
// temporary // temporary
if (!isPToolbarDNDEnabled()) if (!isPToolbarDNDEnabled())
@ -175,6 +176,7 @@ var contentAreaDNDObserver = {
{ {
var htmlstring = null; var htmlstring = null;
var textstring = null; var textstring = null;
var isLink = false;
var domselection = window._content.getSelection(); var domselection = window._content.getSelection();
if (domselection && !domselection.isCollapsed && if (domselection && !domselection.isCollapsed &&
domselection.containsNode(aEvent.target,false)) domselection.containsNode(aEvent.target,false))
@ -197,6 +199,7 @@ var contentAreaDNDObserver = {
htmlstring = "<img src=\"" + textstring + "\">"; htmlstring = "<img src=\"" + textstring + "\">";
break; break;
case 'A': case 'A':
isLink = true;
if (aEvent.target.href) if (aEvent.target.href)
{ {
textstring = aEvent.target.getAttribute("href"); textstring = aEvent.target.getAttribute("href");
@ -224,12 +227,13 @@ var contentAreaDNDObserver = {
var flavourList = { }; var flavourList = { };
flavourList["text/html"] = { width: 2, data: htmlstring }; flavourList["text/html"] = { width: 2, data: htmlstring };
flavourList["text/x-moz-url"] = { width: 2, data: textstring + " " + "( TEMP TITLE )" }; if (isLink)
flavourList["text/x-moz-url"] = { width: 2, data: textstring + " " + "( TEMP TITLE )" };
flavourList["text/unicode"] = { width: 2, data: textstring }; flavourList["text/unicode"] = { width: 2, data: textstring };
return flavourList; return flavourList;
}, },
onDrop: function (aEvent, aData) onDrop: function (aEvent, aData, aDragSession)
{ {
var aData = aData.length ? aData[0] : aData; var aData = aData.length ? aData[0] : aData;
var url = retrieveURLFromData(aData); var url = retrieveURLFromData(aData);
@ -282,7 +286,7 @@ var proxyIconDNDObserver = {
}; };
var homeButtonObserver = { var homeButtonObserver = {
onDrop: function (aEvent, aData) onDrop: function (aEvent, aData, aDragSession)
{ {
var aData = aData.length ? aData[0] : aData; var aData = aData.length ? aData[0] : aData;
var url = retrieveURLFromData(aData); var url = retrieveURLFromData(aData);
@ -301,16 +305,7 @@ var homeButtonObserver = {
var checkMsg = bundle.GetStringFromName("dontremindme"); var checkMsg = bundle.GetStringFromName("dontremindme");
var okButton = bundle.GetStringFromName("droponhomeokbutton"); var okButton = bundle.GetStringFromName("droponhomeokbutton");
var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil! var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil!
/*
block.SetInt(2, 2);
block.SetString(0, bundle.GetStringFromName("droponhomemsg"));
block.SetString(3, bundle.GetStringFromName("droponhometitle"));
block.SetString(2, "chrome://navigator/skin/home.gif");
block.SetString(1, bundle.GetStringFromName("dontremindme"));
block.SetInt(1, 1); // checkbox is checked
block.SetString(8, bundle.GetStringFromName("droponhomeokbutton"));
*/
commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg, commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg,
okButton, null, null, null, null, null, { }, { }, okButton, null, null, null, null, null, { }, { },
iconURL, checkValue, 2, 0, null, pressedVal); iconURL, checkValue, 2, 0, null, pressedVal);
@ -327,7 +322,7 @@ var homeButtonObserver = {
} }
}, },
onDragOver: function (aEvent, aFlavour) onDragOver: function (aEvent, aFlavour, aDragSession)
{ {
var homeButton = aEvent.target; var homeButton = aEvent.target;
// preliminary attribute name for now // preliminary attribute name for now
@ -337,7 +332,7 @@ var homeButtonObserver = {
statusTextFld.setAttribute("value", bundle.GetStringFromName("droponhomebutton")); statusTextFld.setAttribute("value", bundle.GetStringFromName("droponhomebutton"));
}, },
onDragExit: function () onDragExit: function (aEvent, aDragSession)
{ {
var homeButton = document.getElementById("homebutton"); var homeButton = document.getElementById("homebutton");
homeButton.removeAttribute("home-dragover"); homeButton.removeAttribute("home-dragover");