зеркало из 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_newNavigator"/>
|
||||||
<command id="cmd_newEditor"/>
|
<command id="cmd_newEditor"/>
|
||||||
<command id="cmd_close" oncommand="close()"/>
|
<command id="cmd_close" oncommand="close()"/>
|
||||||
|
<command id="Browser:SendLink" oncommand="sendBookmarksLink();"/>
|
||||||
<command id="cmd_quit"/>
|
<command id="cmd_quit"/>
|
||||||
<!-- Edit Menu -->
|
<!-- Edit Menu -->
|
||||||
<command id="cmd_undo"/>
|
<command id="cmd_undo"/>
|
||||||
|
@ -129,7 +130,7 @@
|
||||||
<toolbox id="bookmarks-toolbox">
|
<toolbox id="bookmarks-toolbox">
|
||||||
<menubar id="main-menubar" grippy="false">
|
<menubar id="main-menubar" grippy="false">
|
||||||
<menu id="menu_File">
|
<menu id="menu_File">
|
||||||
<menupopup id="menu_FilePopup">
|
<menupopup id="menu_FilePopup" onpopupshowing="updateSendLinkItem();">
|
||||||
<menuitem label="&command.newBookmark.label;"
|
<menuitem label="&command.newBookmark.label;"
|
||||||
accesskey="&command.newBookmark.accesskey;"
|
accesskey="&command.newBookmark.accesskey;"
|
||||||
observes="cmd_newbookmark"/>
|
observes="cmd_newbookmark"/>
|
||||||
|
@ -152,6 +153,7 @@
|
||||||
<menuitem observes="cmd_properties" key="bm_key_properties"
|
<menuitem observes="cmd_properties" key="bm_key_properties"
|
||||||
label="&command.properties.label;"
|
label="&command.properties.label;"
|
||||||
accesskey="&command.properties.accesskey;" />
|
accesskey="&command.properties.accesskey;" />
|
||||||
|
<menuitem id="menu_sendPage" hidden="true"/>
|
||||||
<menuseparator/>
|
<menuseparator/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -404,3 +406,4 @@
|
||||||
|
|
||||||
</window>
|
</window>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,17 @@
|
||||||
* Ben Goodger <ben@netscape.com> (Original Author)
|
* Ben Goodger <ben@netscape.com> (Original Author)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var gOKButton;
|
||||||
|
var gSearchField;
|
||||||
function Startup()
|
function Startup()
|
||||||
{
|
{
|
||||||
doSetOKCancel(find);
|
doSetOKCancel(find);
|
||||||
var bundle = document.getElementById("bookmarksBundle");
|
var bundle = document.getElementById("bookmarksBundle");
|
||||||
document.getElementById("ok").label = bundle.getString("search_button_label");
|
gOKButton = document.getElementById("ok");
|
||||||
document.getElementById("searchField").focus();
|
gOKButton.label = bundle.getString("search_button_label");
|
||||||
|
gOKButton.disabled = true;
|
||||||
|
gSearchField = document.getElementById("searchField");
|
||||||
|
gSearchField.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function find()
|
function find()
|
||||||
|
@ -35,11 +40,10 @@ function find()
|
||||||
// rooted on the URI.
|
// rooted on the URI.
|
||||||
var match = document.getElementById("matchList");
|
var match = document.getElementById("matchList");
|
||||||
var method = document.getElementById("methodList");
|
var method = document.getElementById("methodList");
|
||||||
var field = document.getElementById("searchField");
|
|
||||||
var searchURI = "find:datasource=rdf:bookmarks"
|
var searchURI = "find:datasource=rdf:bookmarks"
|
||||||
searchURI += "&match=" + match.selectedItem.value;
|
searchURI += "&match=" + match.selectedItem.value;
|
||||||
searchURI += "&method=" + method.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);
|
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.
|
// 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);
|
"", "chrome,all,dialog=no", aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doEnabling()
|
||||||
|
{
|
||||||
|
gOKButton.disabled = !gSearchField.value;
|
||||||
|
}
|
|
@ -67,7 +67,8 @@
|
||||||
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menulist>
|
</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>
|
</hbox>
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
|
@ -21,12 +21,17 @@
|
||||||
* Ben Goodger <ben@netscape.com> (Original Author)
|
* Ben Goodger <ben@netscape.com> (Original Author)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var gOKButton;
|
||||||
|
var gSearchField;
|
||||||
function Startup()
|
function Startup()
|
||||||
{
|
{
|
||||||
doSetOKCancel(find);
|
doSetOKCancel(find);
|
||||||
var bundle = document.getElementById("historyBundle");
|
var bundle = document.getElementById("historyBundle");
|
||||||
document.getElementById("ok").label = bundle.getString("search_button_label");
|
gOKButton = document.getElementById("ok");
|
||||||
document.getElementById("searchField").focus();
|
gOKButton.label = bundle.getString("search_button_label");
|
||||||
|
gOKButton.disabled = true;
|
||||||
|
gSearchField = document.getElementById("searchField");
|
||||||
|
gSearchField.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function find()
|
function find()
|
||||||
|
@ -35,11 +40,10 @@ function find()
|
||||||
// rooted on the URI.
|
// rooted on the URI.
|
||||||
var match = document.getElementById("matchList");
|
var match = document.getElementById("matchList");
|
||||||
var method = document.getElementById("methodList");
|
var method = document.getElementById("methodList");
|
||||||
var field = document.getElementById("searchField");
|
|
||||||
var searchURI = "find:datasource=history"
|
var searchURI = "find:datasource=history"
|
||||||
searchURI += "&match=" + match.selectedItem.value;
|
searchURI += "&match=" + match.selectedItem.value;
|
||||||
searchURI += "&method=" + method.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);
|
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.
|
// 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);
|
"", "chrome,all,dialog=no", aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doEnabling()
|
||||||
|
{
|
||||||
|
gOKButton.disabled = !gSearchField.value;
|
||||||
|
}
|
||||||
|
|
|
@ -62,7 +62,8 @@
|
||||||
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
<menuitem value="doesntcontain" label="&search.doesntcontain.label;"/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menulist>
|
</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>
|
</hbox>
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче