<?xml version="1.0"?>
<!--
    ***** BEGIN LICENSE BLOCK *****
    
    Copyright © 2006–2013 Center for History and New Media
                     George Mason University, Fairfax, Virginia, USA
                     http://zotero.org
    
    This file is part of Zotero.
    
    Zotero is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    Zotero is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
    
    You should have received a copy of the GNU Affero General Public License
    along with Zotero.  If not, see <http://www.gnu.org/licenses/>.
    
    ***** END LICENSE BLOCK *****
-->
<!DOCTYPE window [
	<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd">
	%zoteroDTD;
	<!ENTITY % preferencesDTD SYSTEM "chrome://zotero/locale/preferences.dtd">
	%preferencesDTD;
]>

<overlay id="zotero-prefpane-advanced-overlay"
		xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
		xmlns:html="http://www.w3.org/1999/xhtml">
	
	<prefpane id="zotero-prefpane-advanced"
			onpaneload="Zotero_Preferences.Advanced.init()"
			helpTopic="advanced">
		<preferences>
			<preference id="pref-automaticScraperUpdates" name="extensions.zotero.automaticScraperUpdates" type="bool"/>
			<preference id="pref-reportTranslationFailure" name="extensions.zotero.reportTranslationFailure" type="bool"/>
			
			<preference id="pref-baseAttachmentPath" name="extensions.zotero.baseAttachmentPath" type="string"/>
			<preference id="pref-useDataDir" name="extensions.zotero.useDataDir" type="bool"/>
			<preference id="pref-dataDir" name="extensions.zotero.dataDir" type="string"/>
			<preference id="pref-debug-output-enableAfterRestart" name="extensions.zotero.debug.store" type="bool"/>
			<preference id="pref-openURL-resolver" name="extensions.zotero.openURL.resolver" type="string"/>
			<preference id="pref-openURL-version" name="extensions.zotero.openURL.version" type="string"/>
			
			<preference id="pref-keys-saveToZotero" name="extensions.zotero.keys.saveToZotero" type="string"/>
			<preference id="pref-keys-library" name="extensions.zotero.keys.library" type="string"/>
			<preference id="pref-keys-quicksearch" name="extensions.zotero.keys.quicksearch" type="string"/>
			<preference id="pref-keys-newItem" name="extensions.zotero.keys.newItem" type="string"/>
			<preference id="pref-keys-newNote" name="extensions.zotero.keys.newNote" type="string"/>
			<preference id="pref-keys-toggleRead" name="extensions.zotero.keys.toggleRead" type="string"/>
			<preference id="pref-keys-toggleAllRead" name="extensions.zotero.keys.toggleAllRead" type="string"/>
			<preference id="pref-keys-copySelectedItemCitationsToClipboard" name="extensions.zotero.keys.copySelectedItemCitationsToClipboard" type="string"/>
			<preference id="pref-keys-copySelectedItemsToClipboard" name="extensions.zotero.keys.copySelectedItemsToClipboard" type="string"/>

			<preference id="pref-feeds-sortAscending" name="extensions.zotero.feeds.sortAscending" type="bool"/>
		</preferences>
		
		<tabbox id="zotero-prefpane-advanced-tabs">
			<tabs>
				<tab label="&zotero.preferences.prefpane.general;"/>
				<tab label="&zotero.preferences.advanced.filesAndFolders;"/>
				<tab label="&zotero.preferences.advanced.keys;"/>
				<tab label="&zotero.preferences.feeds;"/> 
			</tabs>
			
			<tabpanels id="zotero-prefpane-advanced-tabpanels">
				<tabpanel id="zotero-prefpane-advanced-general-tab" orient="vertical">
					<groupbox id="zotero-prefpane-advanced-miscellaneous">
						<caption label="&zotero.preferences.miscellaneous;"/>
						
						<hbox align="center">
							<checkbox label="&zotero.preferences.autoUpdate;" preference="pref-automaticScraperUpdates"/>
							<button id="updateButton" style="margin-top:0" label="&zotero.preferences.updateNow;"
								oncommand="Zotero_Preferences.Advanced.updateTranslators()"/>
						</hbox>
						
						<checkbox label="&zotero.preferences.reportTranslationFailure;" preference="pref-reportTranslationFailure"/>
						
						<hbox align="center">
							<label value="&zotero.bibliography.locale.label;"/>
							<menulist id="locale-menu"
									onblur="if (!Zotero.isMac) Zotero_Preferences.Advanced.onLocaleChange()">
								<menupopup onpopuphidden="Zotero_Preferences.Advanced.onLocaleChange()"/>
							</menulist>
						</hbox>
					</groupbox>
					
					<groupbox>
						<caption label="OpenURL"/>
						
						<hbox>
							<menulist id="openurl-menu">
								<menupopup
										id="openurl-primary-popup"
										onpopupshowing="Zotero_Preferences.Advanced.handleOpenURLPopupShowing(event)"
										oncommand="Zotero_Preferences.Advanced.handleOpenURLSelected(event)">
									<menuitem label="&zotero.preferences.openurl.choose;"/>
								</menupopup>
							</menulist>
						</hbox>
						
						<hbox align="center">
							<label value="&zotero.preferences.openurl.server;"/>
							<textbox id="openURLServerField" flex="1"
								oninput="Zotero_Preferences.Advanced.onOpenURLCustomized();"
								preference="pref-openURL-resolver"
							/>
						</hbox>
					
						<hbox align="center">
							<label value="&zotero.preferences.openurl.version;" control="openURLVersionMenu"/>
							<menulist id="openURLVersionMenu"
									oncommand="Zotero_Preferences.Advanced.onOpenURLCustomized();"
									preference="pref-openURL-version">
								<menupopup>
									<menuitem label="0.1" value="0.1"/>
									<menuitem label="1.0" value="1.0"/>
								</menupopup>
							</menulist>
						</hbox>
					</groupbox>
					
					<groupbox id="zotero-prefpane-advanced-advancedConfiguration">
						<caption label="&zotero.preferences.advanced.advancedConfiguration;"/>
						
						<hbox id="zotero-prefpane-advanced-openbuttons" align="center" style="display: block">
							<button id="config-editor"
								label="&zotero.preferences.configEditor;"
								oncommand="Zotero_Preferences.openInViewer('about:config')"/>
							<button id="memory-info"
								label="Memory Info"
								oncommand="Zotero_Preferences.openInViewer('about:memory')"
								hidden="true"/>
						</hbox>
					</groupbox>
				</tabpanel>
				
				<tabpanel orient="vertical">
					<groupbox>
						<caption label="&zotero.preferences.attachmentBaseDir.caption;"/>
						
						<!-- This doesn't wrap without an explicit width -->
						<vbox>
							<description width="45em">&zotero.preferences.attachmentBaseDir.message;</description>
						</vbox>
						
						<hbox align="center">
							<label value="&zotero.preferences.attachmentBaseDir.basePath;"/>
							<filefield id="baseAttachmentPath"
								preference="pref-baseAttachmentPath"
								onsyncfrompreference="Zotero_Preferences.Attachment_Base_Directory.updateUI()"
								preference-editable="true"
								readonly="true"
								flex="1"
								tabindex="-1"/>
							<button id="baseAttachmentPathButton"
								label="&zotero.preferences.attachmentBaseDir.selectBasePath;"
								oncommand="Zotero_Preferences.Attachment_Base_Directory.choosePath()"/>
						</hbox>
						
						<hbox>
							<button id="resetBasePath"
								label="&zotero.preferences.attachmentBaseDir.resetBasePath;"
								oncommand="Zotero_Preferences.Attachment_Base_Directory.clearPath()"/>
						</hbox>
						
					</groupbox>
					
					<groupbox>
						<caption label="&zotero.preferences.dataDir;"/>
						
						<radiogroup id="data-dir"
								preference="pref-useDataDir"
								onsyncfrompreference="return Zotero_Preferences.Advanced.onDataDirLoad()"
								onsynctopreference="Zotero_Preferences.Advanced.onDataDirUpdate(event);">
							<radio id="default-data-dir" label="&zotero.preferences.dataDir.useProfile;" value="false"/>
							<hbox>
								<radio label="&zotero.preferences.dataDir.custom;" value="true"/>
								<textbox id="data-dir-path" preference="pref-dataDir"
									onsyncfrompreference="return Zotero_Preferences.Advanced.getDataDirPath();"
									readonly="true" flex="1"/>
								<button label="&zotero.preferences.dataDir.choose;"
									oncommand="return Zotero_Preferences.Advanced.chooseDataDir(event)"/>
							</hbox>
						</radiogroup>
						
						<vbox id="command-line-data-dir" hidden="true">
							<description id="command-line-data-dir-path"/>
							<label value="&zotero.preferences.dataDir.viaCommandLine;"/>
						</vbox>
						
						<hbox>
							<button label="&zotero.preferences.dataDir.reveal;"
								oncommand="Zotero.DataDirectory.reveal()"/>
							<button id="migrate-data-dir" label="&zotero.preferences.dataDir.migrate;"
								oncommand="Zotero_Preferences.Advanced.migrateDataDirectory()" hidden="true"/>
						</hbox>
					</groupbox>
					
					<groupbox>
						<caption label="&zotero.preferences.dbMaintenance;"/>
						
						<hbox style="display: block">
							<button label="&zotero.preferences.dbMaintenance.integrityCheck;"
								oncommand="Zotero_Preferences.Advanced.runIntegrityCheck(this)"/>
							<button id="reset-translators-button"
								label="&zotero.preferences.dbMaintenance.resetTranslators;"
								oncommand="Zotero_Preferences.Advanced.resetTranslators()"/>
							<button id="reset-styles-button"
								label="&zotero.preferences.dbMaintenance.resetStyles;"
								oncommand="Zotero_Preferences.Advanced.resetStyles()"/>
						</hbox>
					</groupbox>
				</tabpanel>
			
				<tabpanel id="zotero-prefpane-advanced-keys-tab" orient="vertical">
				
					<grid id="zotero-keys-grid">
						<columns>
							<column flex="1"/>
							<column/>
							<column/>
						</columns>
			
						<rows id="zotero-keys-rows">
							<row id="zotero-keys-new-item">
								<label value="&zotero.preferences.keys.newItem;" control="textbox-newItem"/>
								<label class="modifier"/>
								<textbox id="textbox-newItem" maxlength="1" size="1" preference="pref-keys-newItem"/>
							</row>
				
							<row>
								<label value="&zotero.preferences.keys.newNote;" control="textbox-newNote"/>
								<label class="modifier"/>
								<textbox id="textbox-newNote" maxlength="1" size="1" preference="pref-keys-newNote"/>
							</row>
				
							<row id="zotero-keys-focus-libraries-pane">
								<label value="&zotero.preferences.keys.focusLibrariesPane;" control="textbox-library"/>
								<label class="modifier"/>
								<textbox id="textbox-library" maxlength="1" size="1" preference="pref-keys-library"/>
							</row>
				
							<row>
								<label value="&zotero.preferences.keys.quicksearch;" control="textbox-quicksearch"/>
								<label class="modifier"/>
								<textbox id="textbox-quicksearch" maxlength="1" size="1" preference="pref-keys-quicksearch"/>
							</row>
				
							<row>
								<label value="&zotero.preferences.keys.copySelectedItemCitationsToClipboard;" control="textbox-copySelectedItemCitationsToClipboard"/>
								<label class="modifier"/>
								<textbox id="textbox-copySelectedItemCitationsToClipboard" maxlength="1" size="1"
										preference="pref-keys-copySelectedItemCitationsToClipboard"
										onchange="if (Zotero_Preferences.Export) { Zotero_Preferences.Export.updateQuickCopyInstructions(); }"/>
							</row>
							
							<row>
								<label value="&zotero.preferences.keys.copySelectedItemsToClipboard;" control="textbox-copySelectedItemsToClipboard"/>
								<label class="modifier"/>
								<textbox id="textbox-copySelectedItemsToClipboard" maxlength="1" size="1"
										preference="pref-keys-copySelectedItemsToClipboard"
										onchange="if (Zotero_Preferences.Export) { Zotero_Preferences.Export.updateQuickCopyInstructions(); }"/>
							</row>
							
							<row>
								<label value="&zotero.preferences.keys.toggleAllRead;" control="textbox-toggleAllRead"/>
								<label class="modifier"/>
								<textbox id="textbox-toggleAllRead" maxlength="1" size="1" preference="pref-keys-toggleAllRead"/>
							</row>
						</rows>
					</grid>
					
					<label class="statusLine" value="&zotero.preferences.keys.changesTakeEffect;"/>
					
					<separator/>				
				</tabpanel>
				<tabpanel id="zotero-prefpane-advanced-feeds-tab" orient="vertical">
					<groupbox>
						<hbox>
							<hbox align="center">
								<label value="&zotero.preferences.feeds.sorting.label;"/>
								<menulist id="feed-sort" preference="pref-feeds-sortAscending">
									<menupopup>
										<menuitem label="&zotero.preferences.feeds.sorting.newest;" value="false"/>
										<menuitem label="&zotero.preferences.feeds.sorting.oldest;" value="true"/>
									</menupopup>
								</menulist>
							</hbox>
						</hbox>
					</groupbox>
					
					<groupbox id="zotero-prefpane-advanced-feeds-feedDefaults">
						<caption label="&zotero.preferences.feeds.feedDefaults;"/>
						<hbox>
							<hbox align="center">
								<label value="&zotero.feedSettings.refresh.label1;"/>
								<html:input class="html-input" type="number" min="1" step="1" size="3" data-preference="feeds.defaultTTL"/>
								<label value="&zotero.feedSettings.refresh.label2;"/>
							</hbox>
						</hbox>
						<hbox>
							<hbox align="center">
								<label value="&zotero.feedSettings.cleanupReadAfter.label1;"/>
								<html:input class="html-input" type="number" min="1" step="1" size="2" data-preference="feeds.defaultCleanupUnreadAfter"/>
								<label value="&zotero.feedSettings.cleanupReadAfter.label2;"/>
							</hbox>
						</hbox>
						<hbox>
							<hbox align="center">
								<label value="&zotero.feedSettings.cleanupUnreadAfter.label1;"/>
								<html:input class="html-input" type="number" min="1" step="1" size="2" data-preference="feeds.defaultCleanupReadAfter"/>
								<label value="&zotero.feedSettings.cleanupUnreadAfter.label2;"/>
							</hbox>
						</hbox>
					</groupbox>
				</tabpanel>
			</tabpanels>
		</tabbox>
		
		<separator/>
		<separator/>
		<separator/>
	</prefpane>
	
	<script src="preferences_advanced.js" type="application/javascript"/>
</overlay>
