2000-01-25 07:14:02 +03:00
|
|
|
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2000-05-28 10:19:53 +04:00
|
|
|
* - Kevin Puetz (puetzk@iastate.edu)
|
2000-06-01 07:58:07 +04:00
|
|
|
* - Ben Goodger <ben@netscape.com>
|
2000-01-25 07:14:02 +03:00
|
|
|
*/
|
2000-06-05 06:00:24 +04:00
|
|
|
/*
|
|
|
|
var personalToolbarObserver = {
|
|
|
|
onDragStart: function (aEvent)
|
|
|
|
{
|
|
|
|
var personalToolbar = document.getElementById("PersonalToolbar");
|
|
|
|
if (aEvent.target == personalToolbar)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
var childWithDatabase = document.getElementById("innermostBox");
|
|
|
|
if (!childWithDatabase)
|
|
|
|
{
|
|
|
|
event.preventBubble();
|
|
|
|
return;
|
|
|
|
}
|
2000-01-25 07:14:02 +03:00
|
|
|
|
2000-06-05 06:00:24 +04:00
|
|
|
var uri = aEvent.target.id;
|
|
|
|
var flavourList = { };
|
|
|
|
flavourList["moz/toolbaritem"] = { width: 2, data: uri };
|
|
|
|
flavourList["text/unicode"] = { width: 2, data: uri };
|
|
|
|
},
|
2000-01-25 07:14:02 +03:00
|
|
|
|
2000-06-05 06:00:24 +04:00
|
|
|
};
|
2000-01-25 07:14:02 +03:00
|
|
|
|
|
|
|
var id = event.target.getAttribute("id");
|
|
|
|
genData.data = id;
|
2000-02-02 01:26:21 +03:00
|
|
|
genTextData.data = id;
|
2000-01-25 07:14:02 +03:00
|
|
|
|
|
|
|
dump("ID: " + id + "\n");
|
|
|
|
|
|
|
|
var database = childWithDatabase.database;
|
|
|
|
var rdf =
|
|
|
|
Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);
|
|
|
|
if ((!rdf) || (!database)) return(false);
|
|
|
|
|
|
|
|
// make sure its a bookmark, bookmark separator, or bookmark folder
|
|
|
|
var src = rdf.GetResource(id, true);
|
|
|
|
var prop = rdf.GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", true);
|
|
|
|
var target = database.GetTarget(src, prop, true);
|
2000-06-05 06:00:24 +04:00
|
|
|
*/
|
2000-01-25 07:14:02 +03:00
|
|
|
/*
|
|
|
|
pinkerton
|
|
|
|
this doesn't work anymore (target is null), not sure why.
|
|
|
|
if (target) target = target.QueryInterface(Components.interfaces.nsIRDFResource);
|
|
|
|
if (target) target = target.Value;
|
|
|
|
if ((!target) || (target == "")) {dump("BAD\n"); return(false);}
|
|
|
|
|
|
|
|
dump("Type: '" + target + "'\n");
|
|
|
|
|
|
|
|
if ((target != "http://home.netscape.com/NC-rdf#BookmarkSeparator") &&
|
|
|
|
(target != "http://home.netscape.com/NC-rdf#Bookmark") &&
|
|
|
|
(target != "http://home.netscape.com/NC-rdf#Folder")) return(false);
|
|
|
|
*/
|
2000-06-05 06:00:24 +04:00
|
|
|
/*
|
2000-01-25 07:14:02 +03:00
|
|
|
trans.setTransferData ( "moz/toolbaritem", genData, id.length*2 ); // double byte data (len*2)
|
2000-02-02 01:26:21 +03:00
|
|
|
trans.setTransferData ( "text/unicode", genTextData, id.length*2 ); // double byte data
|
2000-01-25 07:14:02 +03:00
|
|
|
var transArray =
|
|
|
|
Components.classes["component://netscape/supports-array"].createInstance(Components.interfaces.nsISupportsArray);
|
|
|
|
if ( transArray ) {
|
|
|
|
// put it into the transferable as an |nsISupports|
|
|
|
|
var genTrans = trans.QueryInterface(Components.interfaces.nsISupports);
|
|
|
|
transArray.AppendElement(genTrans);
|
|
|
|
var nsIDragService = Components.interfaces.nsIDragService;
|
2000-05-09 03:29:32 +04:00
|
|
|
dragService.invokeDragSession ( event.target, transArray, null, nsIDragService.DRAGDROP_ACTION_COPY +
|
2000-01-25 07:14:02 +03:00
|
|
|
nsIDragService.DRAGDROP_ACTION_MOVE );
|
|
|
|
dragStarted = true;
|
|
|
|
}
|
|
|
|
} // if data object
|
|
|
|
} // if transferable
|
|
|
|
} // if drag service
|
|
|
|
|
|
|
|
if ( dragStarted ) // don't propagate the event if a drag has begun
|
|
|
|
event.preventBubble();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} // BeginDragPersonalToolbar
|
2000-06-05 06:00:24 +04:00
|
|
|
*/
|
2000-01-25 07:14:02 +03:00
|
|
|
|
|
|
|
function DropPersonalToolbar ( event )
|
|
|
|
{
|
|
|
|
if ( !gDragDropEnabled )
|
|
|
|
return;
|
|
|
|
|
|
|
|
var dropAccepted = false;
|
|
|
|
|
|
|
|
var dragService =
|
|
|
|
Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);
|
|
|
|
if ( dragService ) {
|
|
|
|
var dragSession = dragService.getCurrentSession();
|
|
|
|
if ( dragSession ) {
|
|
|
|
var trans =
|
|
|
|
Components.classes["component://netscape/widget/transferable"].createInstance(Components.interfaces.nsITransferable);
|
|
|
|
if ( trans ) {
|
|
|
|
|
|
|
|
// get references to various services/resources once up-front
|
|
|
|
var personalToolbarRes = null;
|
|
|
|
|
|
|
|
var rdf =
|
|
|
|
Components.classes["component://netscape/rdf/rdf-service"].getService(Components.interfaces.nsIRDFService);
|
|
|
|
if (rdf)
|
|
|
|
personalToolbarRes = rdf.GetResource("NC:PersonalToolbarFolder");
|
|
|
|
|
|
|
|
var rdfc =
|
|
|
|
Components.classes["component://netscape/rdf/container"].getService(Components.interfaces.nsIRDFContainer);
|
|
|
|
if ( !rdfc ) return false;
|
|
|
|
|
|
|
|
trans.addDataFlavor("moz/toolbaritem");
|
|
|
|
for ( var i = 0; i < dragSession.numDropItems; ++i ) {
|
|
|
|
dragSession.getData ( trans, i );
|
|
|
|
var dataObj = new Object();
|
|
|
|
var bestFlavor = new Object();
|
|
|
|
var len = new Object();
|
|
|
|
trans.getAnyTransferData ( bestFlavor, dataObj, len );
|
|
|
|
if ( dataObj ) dataObj = dataObj.value.QueryInterface(Components.interfaces.nsISupportsWString);
|
|
|
|
if ( dataObj ) {
|
|
|
|
|
|
|
|
// remember len is in bytes, not chars
|
|
|
|
var id = dataObj.data.substring(0, len.value / 2);
|
|
|
|
dump("ID: '" + id + "'\n");
|
|
|
|
|
|
|
|
var objectRes = rdf.GetResource(id, true);
|
|
|
|
|
|
|
|
dragSession.canDrop = true;
|
|
|
|
dropAccepted = true;
|
|
|
|
|
|
|
|
var boxWithDatabase = document.getElementById("innermostBox");
|
|
|
|
var database = boxWithDatabase.database;
|
|
|
|
if (database && rdf && rdfc && personalToolbarRes && objectRes)
|
|
|
|
{
|
|
|
|
|
|
|
|
rdfc.Init(database, personalToolbarRes);
|
|
|
|
|
|
|
|
// Note: RDF Sequences are one-based, not zero-based
|
|
|
|
|
|
|
|
// XXX figure out the REAL index to insert at;
|
|
|
|
// for the moment, insert it as the first element (pos=1)
|
|
|
|
var newIndex = 1;
|
|
|
|
|
|
|
|
var currentIndex = rdfc.IndexOf(objectRes);
|
|
|
|
if (currentIndex > 0)
|
|
|
|
{
|
|
|
|
dump("Element '" + id + "' was at position # " + currentIndex + "\n");
|
|
|
|
rdfc.RemoveElement(objectRes, true);
|
|
|
|
dump("Element '" + id + "' removed from position # " + currentIndex + "\n");
|
|
|
|
}
|
|
|
|
rdfc.InsertElementAt(objectRes, newIndex, true);
|
|
|
|
dump("Element '" + id + "' re-inserted at new position # " + newIndex + ".\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} // foreach drag item
|
|
|
|
|
|
|
|
} // if transferable
|
|
|
|
} // if dragsession
|
|
|
|
} // if dragservice
|
|
|
|
|
|
|
|
if ( dropAccepted ) // don't propagate the event if we did the drop
|
|
|
|
event.preventBubble();
|
|
|
|
|
|
|
|
} // DropPersonalToolbar
|
|
|
|
|
|
|
|
|
|
|
|
function DragOverPersonalToolbar ( event )
|
|
|
|
{
|
2000-06-01 07:58:07 +04:00
|
|
|
if ( 1 )
|
2000-01-25 07:14:02 +03:00
|
|
|
return;
|
|
|
|
|
|
|
|
var validFlavor = false;
|
|
|
|
var dragSession = null;
|
|
|
|
|
|
|
|
var dragService =
|
|
|
|
Components.classes["component://netscape/widget/dragservice"].getService(Components.interfaces.nsIDragService);
|
|
|
|
if ( dragService ) {
|
|
|
|
dragSession = dragService.getCurrentSession();
|
|
|
|
if ( dragSession ) {
|
|
|
|
if ( dragSession.isDataFlavorSupported("moz/toolbaritem") )
|
|
|
|
validFlavor = true;
|
2000-02-02 01:26:21 +03:00
|
|
|
else if ( dragSession.isDataFlavorSupported("text/unicode") )
|
2000-01-25 07:14:02 +03:00
|
|
|
validFlavor = true;
|
|
|
|
//XXX other flavors here...
|
|
|
|
|
|
|
|
// touch the attribute to trigger the repaint with the drop feedback.
|
|
|
|
if ( validFlavor ) {
|
|
|
|
//XXX this is really slow and likes to refresh N times per second.
|
|
|
|
var toolbar = document.getElementById("PersonalToolbar");
|
|
|
|
toolbar.setAttribute ( "dd-triggerrepaint", 0 );
|
|
|
|
dragSession.canDrop = true;
|
|
|
|
event.preventBubble();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // DragOverPersonalToolbar
|
|
|
|
|
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
var contentAreaDNDObserver = {
|
|
|
|
onDragStart: function (aEvent)
|
|
|
|
{
|
|
|
|
var htmlstring = null;
|
|
|
|
var textstring = null;
|
|
|
|
var domselection = window.content.getSelection();
|
|
|
|
if (domselection && !domselection.isCollapsed &&
|
2000-06-01 20:06:06 +04:00
|
|
|
domselection.containsNode(aEvent.target,false))
|
2000-04-20 18:00:15 +04:00
|
|
|
{
|
2000-06-01 07:58:07 +04:00
|
|
|
// the window has a selection so we should grab that rather than looking for specific elements
|
|
|
|
htmlstring = domselection.toString("text/html", 128+256, 0);
|
|
|
|
textstring = domselection.toString("text/plain", 0, 0);
|
2000-04-20 18:00:15 +04:00
|
|
|
}
|
2000-06-01 07:58:07 +04:00
|
|
|
else
|
2000-05-03 17:27:57 +04:00
|
|
|
{
|
2000-06-01 07:58:07 +04:00
|
|
|
switch (aEvent.target.nodeName) // switch (aEvent.target.localName)
|
|
|
|
{
|
|
|
|
case 'AREA':
|
|
|
|
case 'IMG':
|
|
|
|
var imgsrc = aEvent.target.getAttribute("src");
|
|
|
|
var baseurl = window.content.location.href;
|
|
|
|
// need to do some stuff with the window.content.location here (path?)
|
|
|
|
// to get base URL for image.
|
|
|
|
textstring = imgsrc;
|
|
|
|
htmlstring = "<img src=\"" + textstring + "\">";
|
|
|
|
break;
|
|
|
|
case 'A':
|
|
|
|
if (aEvent.target.href)
|
|
|
|
{
|
|
|
|
textstring = aEvent.target.getAttribute("href");
|
|
|
|
htmlstring = "<a href=\"" + textstring + "\">" + textstring + "</a>";
|
|
|
|
}
|
|
|
|
else if (aEvent.target.name)
|
|
|
|
{
|
|
|
|
textstring = aEvent.target.getAttribute("name");
|
|
|
|
htmlstring = "<a name=\"" + textstring + "\">" + textstring + "</a>"
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case '#text':
|
|
|
|
case 'LI':
|
|
|
|
case 'OL':
|
|
|
|
case 'DD':
|
|
|
|
textstring = enclosingLink(aEvent.target);
|
|
|
|
if (textstring != "")
|
|
|
|
htmlstring = "<a href=\"" + textstring + "\">" + textstring + "</a>";
|
|
|
|
else
|
2000-06-02 09:28:11 +04:00
|
|
|
throw Components.results.NS_ERROR_FAILURE;
|
2000-06-01 07:58:07 +04:00
|
|
|
break;
|
|
|
|
}
|
2000-05-03 17:27:57 +04:00
|
|
|
}
|
2000-05-19 00:30:01 +04:00
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
var flavourList = { };
|
|
|
|
flavourList["text/html"] = { width: 2, data: htmlstring };
|
|
|
|
flavourList["text/unicode"] = { width: 2, data: textstring };
|
|
|
|
return flavourList;
|
|
|
|
},
|
2000-01-25 07:14:02 +03:00
|
|
|
|
2000-06-02 11:10:47 +04:00
|
|
|
onDrop: function (aEvent, aData)
|
2000-06-01 07:58:07 +04:00
|
|
|
{
|
|
|
|
var aData = aData.length ? aData[0] : aData;
|
|
|
|
var url = retrieveURLFromData(aData);
|
2000-06-07 17:03:35 +04:00
|
|
|
if (url.length == 0)
|
|
|
|
return;
|
|
|
|
// valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out
|
|
|
|
var urlstr = url.toString();
|
|
|
|
if ( urlstr.indexOf(" ", 0) != -1 )
|
|
|
|
return;
|
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
var urlBar = document.getElementById("urlbar");
|
|
|
|
urlBar.value = url;
|
|
|
|
BrowserLoadURL();
|
|
|
|
},
|
|
|
|
|
|
|
|
getSupportedFlavours: function ()
|
|
|
|
{
|
|
|
|
var flavourList = { };
|
|
|
|
//flavourList["moz/toolbaritem"] = { width: 2 };
|
|
|
|
flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" };
|
|
|
|
flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" };
|
|
|
|
return flavourList;
|
|
|
|
},
|
|
|
|
};
|
2000-01-25 07:14:02 +03:00
|
|
|
|
|
|
|
//
|
|
|
|
// DragProxyIcon
|
|
|
|
//
|
|
|
|
// Called when the user is starting a drag from the proxy icon next to the URL bar. Basically
|
|
|
|
// just gets the url from the url bar and places the data (as plain text) in the drag service.
|
|
|
|
//
|
|
|
|
// This is by no means the final implementation, just another example of what you can do with
|
|
|
|
// JS. Much still left to do here.
|
|
|
|
//
|
2000-04-19 02:06:25 +04:00
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
var proxyIconDNDObserver = {
|
|
|
|
onDragStart: function ()
|
|
|
|
{
|
|
|
|
var urlBar = document.getElementById("urlbar");
|
|
|
|
var flavourList = { };
|
|
|
|
flavourList["text/unicode"] = { width: 2, data: urlBar.value };
|
|
|
|
flavourList["text/x-moz-url"] = { width: 2, data: urlBar.value };
|
|
|
|
var htmlString = "<a href=\"" + urlBar.value + "\">" + urlBar.value + "</a>";
|
|
|
|
flavourList["text/html"] = { width: 2, data: htmlString };
|
|
|
|
return flavourList;
|
|
|
|
}
|
|
|
|
};
|
2000-04-19 02:06:25 +04:00
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
var homeButtonObserver = {
|
2000-06-02 11:10:47 +04:00
|
|
|
onDrop: function (aEvent, aData)
|
2000-06-01 07:58:07 +04:00
|
|
|
{
|
|
|
|
var aData = aData.length ? aData[0] : aData;
|
|
|
|
var url = retrieveURLFromData(aData);
|
2000-06-01 10:36:18 +04:00
|
|
|
var showDialog = nsPreferences.getBoolPref("browser.homepage.enable_home_button_drop", false);
|
2000-06-03 06:31:40 +04:00
|
|
|
var setHomepage;
|
2000-06-05 06:02:45 +04:00
|
|
|
if (showDialog)
|
2000-06-01 10:12:28 +04:00
|
|
|
{
|
|
|
|
var commonDialogService = nsJSComponentManager.getService("component://netscape/appshell/commonDialogs",
|
|
|
|
"nsICommonDialogs");
|
2000-06-05 06:00:24 +04:00
|
|
|
var block = nsJSComponentManager.createInstanceByID("c01ad085-4915-11d3-b7a0-85cf-55c3523c",
|
|
|
|
"nsIDialogParamBlock");
|
2000-06-05 06:02:45 +04:00
|
|
|
var checkValue = { value: true };
|
2000-06-03 06:31:40 +04:00
|
|
|
var pressedVal = { };
|
2000-06-01 10:12:28 +04:00
|
|
|
var promptTitle = bundle.GetStringFromName("droponhometitle");
|
2000-06-03 06:31:40 +04:00
|
|
|
var promptMsg = bundle.GetStringFromName("droponhomemsg");
|
|
|
|
var checkMsg = bundle.GetStringFromName("dontremindme");
|
|
|
|
var okButton = bundle.GetStringFromName("droponhomeokbutton");
|
|
|
|
var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil!
|
2000-06-05 06:00:24 +04:00
|
|
|
/*
|
|
|
|
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"));
|
|
|
|
|
|
|
|
*/
|
2000-06-03 06:31:40 +04:00
|
|
|
commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg,
|
|
|
|
okButton, null, null, null, null, null, { }, { },
|
|
|
|
iconURL, checkValue, 2, 0, null, pressedVal);
|
2000-06-01 10:36:18 +04:00
|
|
|
nsPreferences.setBoolPref("browser.homepage.enable_home_button_drop", checkValue.value);
|
2000-06-03 06:31:40 +04:00
|
|
|
|
2000-06-03 06:40:33 +04:00
|
|
|
setHomepage = pressedVal.value == 0 ? true : false;
|
2000-06-01 10:12:28 +04:00
|
|
|
}
|
|
|
|
else
|
2000-06-03 06:31:40 +04:00
|
|
|
setHomepage = true;
|
2000-06-01 10:12:28 +04:00
|
|
|
if (setHomepage)
|
2000-06-01 10:36:18 +04:00
|
|
|
nsPreferences.setUnicharPref("browser.startup.homepage", url);
|
2000-06-01 07:58:07 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
onDragOver: function (aEvent, aFlavour)
|
|
|
|
{
|
|
|
|
var homeButton = aEvent.target;
|
|
|
|
// preliminary attribute name for now
|
|
|
|
homeButton.setAttribute("home-dragover","true");
|
|
|
|
var statusTextFld = document.getElementById("statusbar-display");
|
|
|
|
gStatus = gStatus ? gStatus : statusTextFld.value;
|
|
|
|
statusTextFld.setAttribute("value", bundle.GetStringFromName("droponhomebutton"));
|
|
|
|
},
|
|
|
|
|
|
|
|
onDragExit: function ()
|
|
|
|
{
|
|
|
|
var homeButton = document.getElementById("homebutton");
|
|
|
|
homeButton.removeAttribute("home-dragover");
|
|
|
|
statusTextFld.setAttribute("value", gStatus);
|
|
|
|
gStatus = null;
|
|
|
|
},
|
|
|
|
|
|
|
|
onDragStart: function ()
|
|
|
|
{
|
2000-06-01 10:36:18 +04:00
|
|
|
var homepage = nsPreferences.copyUnicharPref("browser.startup.homepage", "about:blank");
|
2000-06-01 07:58:07 +04:00
|
|
|
var flavourList = { };
|
|
|
|
flavourList["text/unicode"] = { width: 2, data: homepage };
|
|
|
|
flavourList["text/x-moz-url"] = { width: 2, data: homepage };
|
|
|
|
var htmlString = "<a href=\"" + homepage + "\">" + homepage + "</a>";
|
|
|
|
flavourList["text/html"] = { width: 2, data: htmlString };
|
|
|
|
return flavourList;
|
|
|
|
},
|
2000-04-19 02:06:25 +04:00
|
|
|
|
2000-06-01 07:58:07 +04:00
|
|
|
getSupportedFlavours: function ()
|
|
|
|
{
|
|
|
|
var flavourList = { };
|
|
|
|
//flavourList["moz/toolbaritem"] = { width: 2 };
|
|
|
|
flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" };
|
|
|
|
flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" };
|
|
|
|
return flavourList;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
function retrieveURLFromData (aData)
|
|
|
|
{
|
|
|
|
switch (aData.flavour)
|
|
|
|
{
|
|
|
|
case "text/unicode":
|
2000-06-02 11:10:47 +04:00
|
|
|
return aData.data.data; // XXX this is busted.
|
2000-06-01 07:58:07 +04:00
|
|
|
break;
|
|
|
|
case "application/x-moz-file":
|
|
|
|
var dataObj = aData.data.data.QueryInterface(Components.interfaces.nsIFile);
|
|
|
|
if (dataObj)
|
|
|
|
{
|
|
|
|
var fileURL = nsJSComponentManager.createInstance("component://netscape/network/standard-url",
|
|
|
|
"nsIFileURL");
|
|
|
|
fileURL.file = dataObj;
|
|
|
|
return fileURL.spec;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|