Closes #172, add preference for EndNote MIME type stealing feature

Addresses #169, add OpenURL interface hooks
Addresses #170, Put "Link" option before "Import" in drop-down menu

Fixes some advanced search flaws (there are still bugs)
This commit is contained in:
David Norton 2006-08-09 15:44:11 +00:00
parent 8d5f1e62b6
commit 6877d33e61
14 changed files with 101 additions and 46 deletions

View File

@ -35,24 +35,21 @@
var conditions = this.search.getSearchConditions();
if(conditions.length)
{
for(var i = 0, len = conditions.length; i<len; i++)
{
this.addCondition(i);
}
}
this.addCondition(i);
]]>
</setter>
</property>
<method name="onAddClicked">
<body>
<![CDATA[
this.search.addCondition("itemType","is","1");
this.addCondition();
this.addCondition(this.search.addCondition("itemType","is","1"));
]]>
</body>
</method>
<method name="addCondition">
<parameter name="id"/>
<body>
<![CDATA[
var conditionsBox = this.id('conditions');
@ -61,7 +58,7 @@
conditionsBox.appendChild(condition);
condition.initWithParentAndConditionID(this, conditionsBox.childNodes.length-1);
condition.initWithParentAndConditionID(this, id);
conditionsBox.childNodes[0].id('remove').hidden = (conditionsBox.childNodes.length == 1);
]]>
@ -81,6 +78,20 @@
]]>
</body>
</method>
<method name="save">
<body>
<![CDATA[
var conditionsBox = this.id('conditions');
if(conditionsBox.hasChildNodes())
for(var i = 0, len=conditionsBox.childNodes.length; i < len; i++)
conditionsBox.childNodes[i].updateSearch();
this.search.save();
]]>
</body>
</method>
<method name="id">
<parameter name="id"/>
<body>
@ -104,7 +115,7 @@
</xul:menulist>
<xul:label value="of the following:"/>
</xul:caption>
<xul:vbox id="conditions" style="overflow: auto;"/>
<xul:vbox id="conditions"/>
</xul:groupbox>
</content>
</binding>
@ -214,7 +225,7 @@
<xul:menulist id="conditionsmenu" oncommand="this.parentNode.parentNode.onConditionSelected();">
<xul:menupopup/>
</xul:menulist>
<xul:menulist id="operatorsmenu" oncommand="this.parentNode.parentNode.updateSearch();">
<xul:menulist id="operatorsmenu">
<xul:menupopup>
<xul:menuitem label="is" value="is"/>
<xul:menuitem label="isNot" value="isNot"/>
@ -222,7 +233,7 @@
<xul:menuitem label="doesNotContain" value="doesNotContain"/>
</xul:menupopup>
</xul:menulist>
<xul:textbox id="valuefield" type="timed" timeout="1000" flex="1" oncommand="this.parentNode.parentNode.updateSearch();"/>
<xul:textbox id="valuefield" flex="1"/>
<xul:toolbarbutton id="remove" class="clicky" label="-" oncommand="this.parentNode.parentNode.onRemoveClicked();"/>
<xul:toolbarbutton id="add" class="clicky" label="+" oncommand="this.parentNode.parentNode.onAddClicked();"/>
</xul:hbox>

View File

@ -37,6 +37,7 @@ ScholarItemPane = new function()
this.viewItem = viewItem;
this.loadPane = loadPane;
this.changeTypeTo = changeTypeTo;
this.onOpenURLClick = onOpenURLClick;
this.addCreatorRow = addCreatorRow;
this.removeCreator = removeCreator;
this.showEditor = showEditor;
@ -263,6 +264,11 @@ ScholarItemPane = new function()
}
}
function onOpenURLClick()
{
window.open(Scholar.OpenURL.resolve(_itemBeingEdited));
}
function addDynamicRow(label, value, beforeElement)
{
var row = document.createElement("row");

View File

@ -29,9 +29,12 @@
<popupset>
<popup id="creatorTypeMenu" position="after_start" oncommand="ScholarItemPane.modifyCreator(document.popupNode.getAttribute('fieldname').split('-')[1],'typeID',event.explicitOriginalTarget.getAttribute('typeid'));"/>
</popupset>
<menulist id="editpane-type-menu" oncommand="ScholarItemPane.changeTypeTo(this.value)">
<menupopup/>
</menulist>
<hbox align="center">
<menulist id="editpane-type-menu" oncommand="ScholarItemPane.changeTypeTo(this.value)" flex="1">
<menupopup/>
</menulist>
<toolbarbutton id="tb-openurl" tooltiptext="&toolbar.openurl.label;" oncommand="ScholarItemPane.onOpenURLClick();"/>
</hbox>
<grid flex="1">
<columns>
<column/>
@ -58,10 +61,10 @@
<label id="editpane-files-label"/>
<button id="tb-item-files-add" type="menu" label="&item.add;">
<menupopup>
<menuitem class="menuitem-iconic" id="tb-item-files-file" label="&toolbar.file.add;" oncommand="ScholarItemPane.addFileFromDialog();"/>
<menuitem class="menuitem-iconic" id="tb-item-files-link" label="&toolbar.file.linked;" oncommand="ScholarItemPane.addFileFromDialog(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-files-snapshot" label="&toolbar.file.snapshot;" oncommand="ScholarItemPane.addFileFromPage();"/>
<menuitem class="menuitem-iconic" id="tb-item-files-file" label="&toolbar.file.add;" oncommand="ScholarItemPane.addFileFromDialog();"/>
<menuitem class="menuitem-iconic" id="tb-item-files-web-link" label="&toolbar.file.weblink;" oncommand="ScholarItemPane.addFileFromPage(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-files-snapshot" label="&toolbar.file.snapshot;" oncommand="ScholarItemPane.addFileFromPage();"/>
</menupopup>
</button>
</hbox>

View File

@ -186,7 +186,6 @@ var ScholarPane = new function()
itemsView.unregister();
document.getElementById('tb-search').value = "";
document.getElementById('scholar-search-options').hidden = true;
if(collectionsView.selection.count == 1 && collectionsView.selection.currentIndex != -1)
{
@ -313,10 +312,6 @@ var ScholarPane = new function()
searchVal = document.getElementById('tb-search').value;
itemsView.searchText(searchVal);
//do something about granularity
//document.getElementById('scholar-search-options').getElementsByAttribute('checked','true')[0].label
document.getElementById('scholar-search-options').hidden = searchVal == "";
document.getElementById('tb-search-cancel').hidden = searchVal == "";
}

View File

@ -103,10 +103,10 @@
</toolbarbutton>
<toolbarbutton id="tb-file-add" type="menu" tooltiptext="&toolbar.file.standalone;">
<menupopup>
<menuitem label="&toolbar.file.add;" oncommand="ScholarPane.addFileFromDialog();"/>
<menuitem label="&toolbar.file.linked;" oncommand="ScholarPane.addFileFromDialog(true);"/>
<menuitem label="&toolbar.file.snapshot;" oncommand="ScholarPane.addFileFromPage();"/>
<menuitem label="&toolbar.file.add;" oncommand="ScholarPane.addFileFromDialog();"/>
<menuitem label="&toolbar.file.weblink;" oncommand="ScholarPane.addFileFromPage(true);"/>
<menuitem label="&toolbar.file.snapshot;" oncommand="ScholarPane.addFileFromPage();"/>
</menupopup>
</toolbarbutton>
<toolbarbutton id="tb-note-add" tooltiptext="&toolbar.note.standalone;" oncommand="ScholarPane.newNote();"/>
@ -116,17 +116,6 @@
<toolbarbutton id="tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
</textbox>
</toolbar>
<hbox id="scholar-search-options" hidden="true">
<hbox>
<toolbarbutton type="checkbox" label="Entire Item" checked="true" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
<toolbarbutton type="checkbox" label="Info" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
<toolbarbutton type="checkbox" label="Notes" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
<toolbarbutton type="checkbox" label="Files" onclick="var b = this.parentNode.getElementsByAttribute('checked','true'); b[0].checked = false;" command="cmd_scholar_search"/>
</hbox>
<spacer flex="1"/>
<toolbarbutton label="Save"/>
<toolbarbutton label="+"/>
</hbox>
<tree
id="items-tree" context="scholar-itemmenu"
ondblclick="ScholarPane.onDoubleClick(event, this);"

View File

@ -20,6 +20,9 @@
var autoUpdateBox;
var positionMenu;
var parseEndnoteBox;
var openURLServerField;
var openURLVersionMenu;
/*
To add a new preference:
@ -41,11 +44,26 @@ function init()
positionMenu = document.getElementById('positionMenu');
positionMenu.selectedIndex = Scholar.Prefs.get('scholarPaneOnTop') ? 0 : 1;
parseEndnoteBox = document.getElementById('parseEndnoteBox');
parseEndnoteBox.checked = Scholar.Prefs.get('parseEndNoteMIMETypes');
openURLServerField = document.getElementById('openURLServerField');
openURLServerField.value = Scholar.Prefs.get('openURL.resolver');
openURLVersionMenu = document.getElementById('openURLVersionMenu');
openURLVersionMenu.value = Scholar.Prefs.get('openURL.version');
}
function accept()
{
Scholar.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked)
Scholar.Prefs.set('scholarPaneOnTop', positionMenu.selectedIndex == 0)
Scholar.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked);
Scholar.Prefs.set('scholarPaneOnTop', positionMenu.selectedIndex == 0);
if(Scholar.Prefs.get('parseEndNoteMIMETypes') != parseEndnoteBox.checked)
{
Scholar.Prefs.set('parseEndNoteMIMETypes', parseEndnoteBox.checked);
Scholar.Ingester.MIMEHandler.init();
}
Scholar.Prefs.set('openURL.resolver', openURLServerField.value);
Scholar.Prefs.set('openURL.version', openURLVersionMenu.value);
}

View File

@ -31,16 +31,37 @@
<dialogheader id="header" title="&scholar.name;" description="&scholar.preferences.title;"/>
<checkbox id="autoUpdateBox" label="&scholar.preferences.autoUpdate.label;"/>
<hbox>
<label value="Display Scholar:" control="positionMenu"/>
<hbox align="center">
<label value="&scholar.preferences.position.label;" control="positionMenu"/>
<menulist id="positionMenu">
<menupopup>
<menuitem label="Above browser content"/>
<menuitem label="Below browser content"/>
<menuitem label="&scholar.preferences.position.above;"/>
<menuitem label="&scholar.preferences.position.below;"/>
</menupopup>
</menulist>
<label value="&scholar.preferences.position.browser;"/>
</hbox>
<checkbox id="autoUpdateBox" label="&scholar.preferences.autoUpdate.label;"/>
<checkbox id="parseEndnoteBox" label="&scholar.preferences.parseEndnote.label;"/>
<groupbox>
<caption label="&scholar.preferences.openurl.caption;"/>
<hbox align="center">
<label value="&scholar.preferences.openurl.server;"/>
<textbox id="openURLServerField" flex="1"/>
</hbox>
<hbox align="center">
<label value="&scholar.preferences.openurl.version;"/>
<menulist id="openURLVersionMenu">
<menupopup>
<menuitem label="0.1" value="0.1"/>
<menuitem label="1.0" value="1.0"/>
</menupopup>
</menulist>
</hbox>
</groupbox>
</dialog>

View File

@ -39,6 +39,6 @@ function doUnload()
function doAccept()
{
document.getElementById('search-box').search.setName(document.getElementById('search-name').value);
document.getElementById('search-box').search.save();
document.getElementById('search-box').save();
io.dataOut = true;
}

View File

@ -27,8 +27,6 @@
id="scholar-search-dialog"
title="Search"
orient="vertical"
width="600" flex="1"
persist="width height screenX screenY"
buttons="cancel,accept"
ondialogaccept="doAccept();"
onload="doLoad();"

View File

@ -1,3 +1,11 @@
<!ENTITY scholar.name "Scholar">
<!ENTITY scholar.preferences.title "Scholar Preferences">
<!ENTITY scholar.preferences.autoUpdate.label "Automatically check for updated scrapers">
<!ENTITY scholar.preferences.position.label "Display Scholar">
<!ENTITY scholar.preferences.position.above "above">
<!ENTITY scholar.preferences.position.below "below">
<!ENTITY scholar.preferences.position.browser "browser content">
<!ENTITY scholar.preferences.parseEndnote.label "Use Scholar for downloaded EndNote files">
<!ENTITY scholar.preferences.openurl.caption "OpenURL">
<!ENTITY scholar.preferences.openurl.server "Resolver:">
<!ENTITY scholar.preferences.openurl.version "Version:">

View File

@ -29,6 +29,7 @@
<!ENTITY toolbar.createBibCollection.label "Create Bibliography From Project...">
<!ENTITY toolbar.search.label "Search:">
<!ENTITY toolbar.fullscreen.tooltip "Toggle Fullscreen Mode">
<!ENTITY toolbar.openurl.label "Find in your library's catalog">
<!ENTITY item.add "Add">

View File

@ -148,6 +148,11 @@
list-style-image: url('chrome://scholar/skin/search-cancel-active.png');
}
#tb-openurl
{
list-style-image: url('chrome://scholar/skin/toolbar-openurl.png');
}
#scholar-view-item vbox
{
overflow: auto;

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 679 B