зеркало из https://github.com/mozilla/gecko-dev.git
Send Link and Send Page in Manage Bookmarks do nothing, and some history polish (73904). r=hewitt sr=ben
This commit is contained in:
Родитель
a9a31475a9
Коммит
3e8c1d5338
|
@ -292,4 +292,26 @@ var fileButton = {
|
|||
}
|
||||
};
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
// requires mailNavigatorOverlay.xul
|
||||
function sendBookmarksLink()
|
||||
{
|
||||
var selectedItem = document.getElementById('bookmarksTree').selectedItems[0];
|
||||
sendLink(LITERAL(gBookmarksShell.db, selectedItem, NC_NS + 'URL'),
|
||||
LITERAL(gBookmarksShell.db, selectedItem, NC_NS + 'Name'));
|
||||
}
|
||||
|
||||
function updateSendLinkItem()
|
||||
{
|
||||
var menuitem = document.getElementById("menu_sendLink");
|
||||
if (menuitem) {
|
||||
var selectedItems = document.getElementById("bookmarksTree").selectedItems;
|
||||
var command = document.getElementById("Browser:SendLink");
|
||||
if (selectedItems.length == 1 && selectedItems[0].getAttribute("type") != NC_NS + "Folder")
|
||||
command.removeAttribute("disabled");
|
||||
else
|
||||
command.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
|
|
@ -90,6 +90,7 @@
|
|||
<command id="cmd_newNavigator"/>
|
||||
<command id="cmd_newEditor"/>
|
||||
<command id="cmd_close" oncommand="close()"/>
|
||||
<command id="Browser:SendLink" oncommand="sendBookmarksLink();"/>
|
||||
<command id="cmd_quit"/>
|
||||
<!-- Edit Menu -->
|
||||
<command id="cmd_undo"/>
|
||||
|
@ -129,7 +130,7 @@
|
|||
<toolbox id="bookmarks-toolbox">
|
||||
<menubar id="main-menubar" grippy="false">
|
||||
<menu id="menu_File">
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menupopup id="menu_FilePopup" onpopupshowing="updateSendLinkItem();">
|
||||
<menuitem label="&command.newBookmark.label;"
|
||||
accesskey="&command.newBookmark.accesskey;"
|
||||
observes="cmd_newbookmark"/>
|
||||
|
@ -152,6 +153,7 @@
|
|||
<menuitem observes="cmd_properties" key="bm_key_properties"
|
||||
label="&command.properties.label;"
|
||||
accesskey="&command.properties.accesskey;" />
|
||||
<menuitem id="menu_sendPage" hidden="true"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
@ -404,3 +406,4 @@
|
|||
|
||||
</window>
|
||||
|
||||
|
||||
|
|
|
@ -21,12 +21,17 @@
|
|||
* Ben Goodger <ben@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
var gOKButton;
|
||||
var gSearchField;
|
||||
function Startup()
|
||||
{
|
||||
doSetOKCancel(find);
|
||||
var bundle = document.getElementById("bookmarksBundle");
|
||||
document.getElementById("ok").label = bundle.getString("search_button_label");
|
||||
document.getElementById("searchField").focus();
|
||||
gOKButton = document.getElementById("ok");
|
||||
gOKButton.label = bundle.getString("search_button_label");
|
||||
gOKButton.disabled = true;
|
||||
gSearchField = document.getElementById("searchField");
|
||||
gSearchField.focus();
|
||||
}
|
||||
|
||||
function find()
|
||||
|
@ -35,11 +40,10 @@ function find()
|
|||
// rooted on the URI.
|
||||
var match = document.getElementById("matchList");
|
||||
var method = document.getElementById("methodList");
|
||||
var field = document.getElementById("searchField");
|
||||
var searchURI = "find:datasource=rdf:bookmarks"
|
||||
searchURI += "&match=" + match.selectedItem.value;
|
||||
searchURI += "&method=" + method.selectedItem.value;
|
||||
searchURI += "&text=" + escape(field.value);
|
||||
searchURI += "&text=" + escape(gSearchField.value);
|
||||
var bmWindow = findMostRecentWindow("bookmarks:searchresults", "chrome://communicator/content/bookmarks/bookmarks.xul", searchURI);
|
||||
|
||||
// Update the root of the tree if we're using an existing search window.
|
||||
|
@ -61,3 +65,7 @@ function findMostRecentWindow(aType, aURI, aParam)
|
|||
"", "chrome,all,dialog=no", aParam);
|
||||
}
|
||||
|
||||
function doEnabling()
|
||||
{
|
||||
gOKButton.disabled = !gSearchField.value;
|
||||
}
|
|
@ -67,7 +67,8 @@
|
|||
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<textbox id="searchField" onkeypress="if (event.keyCode == 13) find();" flex="1"/>
|
||||
<textbox id="searchField" flex="1"
|
||||
oninput="doEnabling();" onkeypress="if (event.keyCode == 13) find();"/>
|
||||
</hbox>
|
||||
|
||||
<separator/>
|
||||
|
|
|
@ -21,12 +21,17 @@
|
|||
* Ben Goodger <ben@netscape.com> (Original Author)
|
||||
*/
|
||||
|
||||
var gOKButton;
|
||||
var gSearchField;
|
||||
function Startup()
|
||||
{
|
||||
doSetOKCancel(find);
|
||||
var bundle = document.getElementById("historyBundle");
|
||||
document.getElementById("ok").label = bundle.getString("search_button_label");
|
||||
document.getElementById("searchField").focus();
|
||||
gOKButton = document.getElementById("ok");
|
||||
gOKButton.label = bundle.getString("search_button_label");
|
||||
gOKButton.disabled = true;
|
||||
gSearchField = document.getElementById("searchField");
|
||||
gSearchField.focus();
|
||||
}
|
||||
|
||||
function find()
|
||||
|
@ -35,11 +40,10 @@ function find()
|
|||
// rooted on the URI.
|
||||
var match = document.getElementById("matchList");
|
||||
var method = document.getElementById("methodList");
|
||||
var field = document.getElementById("searchField");
|
||||
var searchURI = "find:datasource=history"
|
||||
searchURI += "&match=" + match.selectedItem.value;
|
||||
searchURI += "&method=" + method.selectedItem.value;
|
||||
searchURI += "&text=" + escape(field.value);
|
||||
searchURI += "&text=" + escape(gSearchField.value);
|
||||
var hstWindow = findMostRecentWindow("history:searchresults", "chrome://communicator/content/history/history.xul", searchURI);
|
||||
|
||||
// Update the root of the tree if we're using an existing search window.
|
||||
|
@ -61,3 +65,7 @@ function findMostRecentWindow(aType, aURI, aParam)
|
|||
"", "chrome,all,dialog=no", aParam);
|
||||
}
|
||||
|
||||
function doEnabling()
|
||||
{
|
||||
gOKButton.disabled = !gSearchField.value;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,8 @@
|
|||
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<textbox id="searchField" onkeypress="if (event.keyCode == 13) find();" flex="1"/>
|
||||
<textbox id="searchField" onkeypress="if (event.keyCode == 13) find();" flex="1"
|
||||
oninput="doEnabling();"/>
|
||||
</hbox>
|
||||
|
||||
<separator/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче