зеркало из https://github.com/mozilla/pjs.git
showmod
This commit is contained in:
Родитель
3b76a80554
Коммит
d64f9cd185
|
@ -431,7 +431,6 @@ function UpdateHistory(event)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function savePage( url ) {
|
||||
// Default is to save current page.
|
||||
if ( !url ) {
|
||||
|
@ -1231,6 +1230,47 @@ function BrowserEditBookmarks()
|
|||
|
||||
}
|
||||
|
||||
function readFromClipboard()
|
||||
{
|
||||
// Get clipboard.
|
||||
var clipboard = Components
|
||||
.classes["component://netscape/widget/clipboard"]
|
||||
.getService ( Components.interfaces.nsIClipboard );
|
||||
// Create tranferable that will transfer the text.
|
||||
var trans = Components
|
||||
.classes["component://netscape/widget/transferable"]
|
||||
.createInstance( Components.interfaces.nsITransferable );
|
||||
if ( !clipboard || !trans )
|
||||
return;
|
||||
|
||||
trans.addDataFlavor( "text/plain" );
|
||||
clipboard.getData(trans);
|
||||
|
||||
var data = new Object();
|
||||
var dataLen = new Object();
|
||||
trans.getTransferData("text/plain", data, dataLen);
|
||||
var url = null;
|
||||
if (data)
|
||||
{
|
||||
data = data.value.QueryInterface(Components.interfaces
|
||||
.nsISupportsString);
|
||||
url = data.data.substring(0, dataLen.value);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
function browserLoadClipboardURL()
|
||||
{
|
||||
var url = readFromClipboard();
|
||||
dump ("URL on clipboard: '" + url + "'; length = " + url.length + "\n");
|
||||
if (url.length > 0)
|
||||
{
|
||||
var urlBar = document.getElementById("urlbar");
|
||||
urlBar.value = url;
|
||||
BrowserLoadURL();
|
||||
}
|
||||
}
|
||||
|
||||
function OpenMessenger()
|
||||
{
|
||||
window.open("chrome://messenger/content/", "_blank", "chrome,menubar,toolbar,resizable");
|
||||
|
|
|
@ -412,6 +412,7 @@ Contributor(s): ______________________________________. -->
|
|||
<splitter id="sidebar-splitter" chromeclass="extrachrome" />
|
||||
|
||||
<box id="appcontent" align="vertical" flex="100%"
|
||||
onclick="if (event.button==2) browserLoadClipboardURL();"
|
||||
ondragover="return DragOverContentArea(event);"
|
||||
ondragdrop="return DropOnContentArea(event);">
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче