<?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 prefwindow [
	<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
	<!ENTITY % preferencesDTD SYSTEM "chrome://zotero/locale/preferences.dtd"> %preferencesDTD;
]>

<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/preferences.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://zotero/skin/preferences.css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/overlay.css"?>
<?xml-stylesheet href="chrome://zotero-platform-version/content/style.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/zotero-react-client.css"?>

<!--
	To add an observer for a preference change, add an appropriate case in
	the switch statement in Zotero.Prefs.observe().
-->
<prefwindow id="zotero-prefs"
		title="&zotero.preferences.title;"
		onload="Zotero_Preferences.init()"
		onunload="Zotero_Preferences.onUnload()"
		ondialoghelp="Zotero_Preferences.openHelpLink()"
		windowtype="zotero:pref"
		xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	
	<script src="chrome://zotero/content/include.js"></script>
	<script src="preferences.js"></script>
	<script src="preferences_general.js"></script>
	<script src="preferences_sync.js"></script>
	<script src="preferences_search.js"></script>
	<script src="preferences_export.js"></script>
	<script src="preferences_cite.js"></script>
	<script src="preferences_advanced.js"></script>
	
	<script src="chrome://zotero/content/charsetMenu.js"></script>
	<script>
	<![CDATA[
		var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
		observerService.notifyObservers(null, "charsetmenu-selected", "other");
	]]>
	</script>
	
	<!-- General -->
	<prefpane id="zotero-prefpane-general"
			label="&zotero.preferences.prefpane.general;"
			image="chrome://zotero/skin/prefs-general.png"
			onpaneload="Zotero_Preferences.General.init()"
			helpTopic="general">
		<preferences id="zotero-prefpane-general-preferences">
			<preference id="pref-automaticSnapshots" name="extensions.zotero.automaticSnapshots" type="bool"/>
			<preference id="pref-downloadAssociatedFiles" name="extensions.zotero.downloadAssociatedFiles" type="bool"/>
			<preference id="pref-autoRecognizeFiles" name="extensions.zotero.autoRecognizeFiles" type="bool"/>
			<preference id="pref-autoRenameFiles" name="extensions.zotero.autoRenameFiles" type="bool"/>
			<preference id="pref-autoRenameFilesLinked" name="extensions.zotero.autoRenameFiles.linked" type="bool"/>
			
			<preference id="pref-automaticTags" name="extensions.zotero.automaticTags" type="bool"/>
			<preference id="pref-trashAutoEmptyDays" name="extensions.zotero.trashAutoEmptyDays" type="int"/>
			
			<preference id="pref-groups-copyChildNotes" name="extensions.zotero.groups.copyChildNotes" type="bool"/>
			<preference id="pref-groups-copyChildFileAttachments" name="extensions.zotero.groups.copyChildFileAttachments" type="bool"/>
			<preference id="pref-groups-copyAnnotations" name="extensions.zotero.groups.copyAnnotations" type="bool"/>
			<preference id="pref-groups-copyChildLinks" name="extensions.zotero.groups.copyChildLinks" type="bool"/>
			<preference id="pref-groups-copyTags" name="extensions.zotero.groups.copyTags" type="bool"/>
		</preferences>
		
		<groupbox id="zotero-prefpane-file-handling-groupbox">
			<caption label="&zotero.preferences.fileHandling;"/>
			
			<checkbox id="automaticSnapshots-checkbox"
				label="&zotero.preferences.automaticSnapshots;"
				preference="pref-automaticSnapshots"/>
			<checkbox label="&zotero.preferences.downloadAssociatedFiles;" preference="pref-downloadAssociatedFiles"/>
			<checkbox label="&zotero.preferences.autoRecognizeFiles;" preference="pref-autoRecognizeFiles"/>
			<checkbox label="&zotero.preferences.autoRenameFiles;"
					preference="pref-autoRenameFiles"
					oncommand="Zotero_Preferences.General.updateAutoRenameFilesUI()"/>
			<checkbox id="rename-linked-files" class="indented-pref"
					label="&zotero.preferences.autoRenameFiles.renameLinked;"
					preference="pref-autoRenameFilesLinked"
					oncommand="Zotero_Preferences.General.updateAutoRenameFilesUI()"/>
			
			<hbox align="center">
				<label value="&zotero.preferences.fileHandler.openPDFsUsing;" control="file-handler-pdf"/>
				<menulist id="fileHandler-pdf" class="fileHandler-menu">
					<menupopup>
						<menuitem id="fileHandler-internal"
								oncommand="Zotero_Preferences.General.setFileHandler('pdf', '')"/>
						<menuitem label="&zotero.preferences.fileHandler.systemDefault;"
								oncommand="Zotero_Preferences.General.setFileHandler('pdf', 'system')"/>
						<menuitem id="fileHandler-custom"/>
						<menuitem label="&zotero.preferences.custom;"
								oncommand="Zotero_Preferences.General.chooseFileHandler('pdf')"/>
					</menupopup>
				</menulist>
			</hbox>
		</groupbox>
		
		<groupbox id="zotero-prefpane-miscellaneous-groupbox">
			<caption label="&zotero.preferences.miscellaneous;"/>
			
			<checkbox label="&zotero.preferences.automaticTags;" preference="pref-automaticTags"/>
			<hbox align="center">
				<label value="&zotero.preferences.trashAutoEmptyDaysPre;"/>
				<textbox size="2" preference="pref-trashAutoEmptyDays"/>
				<label value="&zotero.preferences.trashAutoEmptyDaysPost;"/>
			</hbox>
		</groupbox>
		
		<groupbox>
			<caption label="&zotero.preferences.groups;"/>
			
			<label value="&zotero.preferences.groups.whenCopyingInclude;"/>
			<vbox style="margin-left: 2em">
				<checkbox label="&zotero.preferences.groups.childNotes;" preference="pref-groups-copyChildNotes"/>
				<checkbox label="&zotero.preferences.groups.childFiles;" preference="pref-groups-copyChildFileAttachments"/>
				<checkbox label="&zotero.preferences.groups.annotations;" preference="pref-groups-copyAnnotations"/>
				<checkbox label="&zotero.preferences.groups.childLinks;" preference="pref-groups-copyChildLinks"/>
				<checkbox label="&zotero.preferences.groups.tags;" preference="pref-groups-copyTags"/>
			</vbox>
		</groupbox>
		
		<separator/>
		<separator/>
	</prefpane>
	
	<!-- Sync -->
	<prefpane id="zotero-prefpane-sync"
			label="&zotero.preferences.prefpane.sync;"
			image="chrome://zotero/skin/prefs-sync.png"
			src="chrome://zotero/content/preferences/preferences_sync.xul"
			onpaneload="Zotero_Preferences.Sync.init()"
			helpTopic="sync">
		<preferences>
			<preference id="pref-sync-autosync" name="extensions.zotero.sync.autoSync" type="bool"/>
			<preference id="pref-sync-username" name="extensions.zotero.sync.server.username" type="unichar" instantApply="true"/>
			<preference id="pref-sync-fulltext-enabled" name="extensions.zotero.sync.fulltext.enabled" type="bool"/>
			<preference id="pref-storage-enabled" name="extensions.zotero.sync.storage.enabled" type="bool"/>
			<preference id="pref-storage-protocol" name="extensions.zotero.sync.storage.protocol" type="string"/>
			<preference id="pref-storage-scheme" name="extensions.zotero.sync.storage.scheme" type="string" instantApply="true"/>
			<preference id="pref-storage-url" name="extensions.zotero.sync.storage.url" type="string"/>
			<preference id="pref-storage-username" name="extensions.zotero.sync.storage.username" type="string"/>
			<preference id="pref-storage-downloadMode-personal" name="extensions.zotero.sync.storage.downloadMode.personal" type="string"/>
			<preference id="pref-storage-downloadMode-groups" name="extensions.zotero.sync.storage.downloadMode.groups" type="string"/>
			<preference id="pref-storage-groups-enabled" name="extensions.zotero.sync.storage.groups.enabled" type="bool"/>
		</preferences>
		
		<tabbox>
			<tabs>
				<tab label="&zotero.preferences.settings;"/>
				<tab id="sync-reset-tab" label="&zotero.preferences.sync.reset;" disabled="true"/>
			</tabs>
			
			<tabpanels>
				<tabpanel orient="vertical">
					<vbox id="sync-unauthorized">
						<groupbox>
							<caption label="&zotero.preferences.sync.syncServer;"/>

							<hbox>
								<grid>
									<columns>
										<column/>
										<column/>
									</columns>

									<rows>
										<row>
											<label value="&zotero.preferences.sync.username;"/>
											<textbox id="sync-username-textbox"
												preference="pref-sync-username"
												onblur="Zotero_Preferences.Sync.trimUsername()"
												oninput="Zotero_Preferences.Sync.credentialsChange(event)"
												onchange="Zotero_Preferences.Sync.credentialsChange(event)"
												onkeypress="Zotero_Preferences.Sync.credentialsKeyPress(event)"/>
										</row>
										<row>
											<label value="&zotero.preferences.sync.password;"/>
											<textbox id="sync-password" type="password"
												oninput="Zotero_Preferences.Sync.credentialsChange(event)"
												onchange="Zotero_Preferences.Sync.credentialsChange(event)"
												onkeypress="Zotero_Preferences.Sync.credentialsKeyPress(event)"/>
										</row>
										<row>
											<box/>
											<hbox align="baseline">
												<button id="sync-auth-button"
													label="&zotero.preferences.sync.setUpSync;"
													oncommand="Zotero_Preferences.Sync.linkAccount(event)"
													disabled="true"/>
												<label id="sync-status-indicator"/>
											</hbox>
										</row>
									</rows>
								</grid>
								<vbox style="width:2em"/>
								<vbox>
									<label class="zotero-text-link" value="&zotero.preferences.sync.createAccount;" href="http://zotero.org/user/register"/>
									<separator class="thin"/>
									<label class="zotero-text-link" value="&zotero.preferences.sync.lostPassword;" href="http://zotero.org/user/lostpassword"/>
									<separator class="thin"/>
									<label class="zotero-text-link" value="&zotero.preferences.sync.about;" href="http://www.zotero.org/support/sync"/>
								</vbox>
							</hbox>
						</groupbox>
					</vbox>

					<vbox id="sync-authorized" hidden="true">
						<groupbox>
							<caption label="&zotero.preferences.sync.syncServer;"/>

							<grid>
								<columns>
									<column/>
									<column/>
								</columns>

								<rows>
									<row>
										<label value="&zotero.preferences.sync.username;"/>
										<hbox>
											<label id="sync-username" value="Username"/>
											<button label="&zotero.preferences.sync.unlinkAccount;"
													oncommand="Zotero_Preferences.Sync.unlinkAccount()"/>
										</hbox>
									</row>
									<row>
										<box/>
										<box>
											<button id="sync-libraries-button" label="&zotero.preferences.sync.librariesToSync.button;"
													oncommand="Zotero_Preferences.Sync.showLibrariesToSyncDialog()"/>
										</box>
									</row>
									<row>
										<box/>
										<checkbox label="&zotero.preferences.sync.syncAutomatically;"
												  preference="pref-sync-autosync"/>
									</row>
									<row>
										<box/>
										<checkbox label="&zotero.preferences.sync.syncFullTextContent;"
												preference="pref-sync-fulltext-enabled"
												tooltiptext="&zotero.preferences.sync.syncFullTextContent.desc;"/>
									</row>
									<row>
										<box/>
										<label class="zotero-text-link" value="&zotero.preferences.sync.about;" href="http://www.zotero.org/support/sync"/>
									</row>
								</rows>
							</grid>

						</groupbox>

						<groupbox id="storage-settings">
							<caption label="&zotero.preferences.sync.fileSyncing;"/>

							<!-- My Library -->
							<hbox>
								<checkbox label="&zotero.preferences.sync.fileSyncing.myLibrary;"
										preference="pref-storage-enabled"
										oncommand="Zotero_Preferences.Sync.onStorageSettingsChange()"/>
								<menulist id="storage-protocol" class="storage-personal"
										style="margin-left: .5em"
										preference="pref-storage-protocol"
										oncommand="Zotero_Preferences.Sync.onStorageSettingsChange()">
									<menupopup>
										<menuitem label="Zotero" value="zotero"/>
										<menuitem label="WebDAV" value="webdav"/>
									</menupopup>
								</menulist>
							</hbox>

							<stack id="storage-webdav-settings" style="margin-top: .5em; margin-bottom: .8em; border: 1px gray solid; border-radius: 3px">
							<!-- Background shading -->
							<box style="background: black; opacity:.03"/>

							<grid style="padding: .7em .4em .7em 0">
								<columns>
									<column/>
									<column flex="1"/>
								</columns>

								<rows>
									<row>
										<label value="&zotero.preferences.sync.fileSyncing.url;"/>
										<hbox>
											<menulist id="storage-url-prefix"
													preference="pref-storage-scheme"
													onsynctopreference="Zotero_Preferences.Sync.unverifyStorageServer()"
													style="padding: 0; width: 7em">
												<menupopup>
													<menuitem label="https" value="https" style="padding: 0"/>
													<menuitem label="http" value="http" style="padding: 0"/>
												</menupopup>
											</menulist>
											<label value="://"/>
											<textbox id="storage-url" flex="1"
												preference="pref-storage-url"
												onkeypress="Zotero_Preferences.Sync.onStorageSettingsKeyPress(event)"
												onchange="Zotero_Preferences.Sync.onStorageSettingsChange()"/>
											<label value="/zotero/"/>
										</hbox>
									</row>
									<row>
										<label value="&zotero.preferences.sync.username;"/>
										<hbox>
											<textbox id="storage-username"
												preference="pref-storage-username"
												onkeypress="Zotero_Preferences.Sync.onStorageSettingsKeyPress(event)"
												onchange="Zotero_Preferences.Sync.onStorageSettingsChange()"/>
										</hbox>
									</row>
									<row>
										<label value="&zotero.preferences.sync.password;"/>
										<hbox>
											<textbox id="storage-password" flex="0" type="password"
												onkeypress="Zotero_Preferences.Sync.onStorageSettingsKeyPress(event)"
												onchange="Zotero_Preferences.Sync.onStorageSettingsChange()"/>
										</hbox>
									</row>
									<row>
										<box/>
										<hbox>
											<button id="storage-verify" label="&zotero.preferences.sync.fileSyncing.verifyServer;"
												oncommand="Zotero_Preferences.Sync.verifyStorageServer()"/>
											<button id="storage-abort" label="Stop" hidden="true"/>
											<progressmeter id="storage-progress" hidden="true"
												mode="undetermined"/>
										</hbox>
									</row>
								</rows>
							</grid>

							</stack>

							<hbox class="storage-settings-download-options" align="center">
								<label value="&zotero.preferences.sync.fileSyncing.download;"/>
								<menulist id="storage-user-download-mode"
										class="storage-mode"
										preference="pref-storage-downloadMode-personal"
										style="margin-left: 0">
									<menupopup>
										<menuitem label="&zotero.preferences.sync.fileSyncing.download.onDemand;" value="on-demand"/>
										<menuitem label="&zotero.preferences.sync.fileSyncing.download.atSyncTime;" value="on-sync"/>
									</menupopup>
								</menulist>
							</hbox>

							<separator id="storage-separator" class="thin"/>

							<!-- Group Libraries -->
							<checkbox label="&zotero.preferences.sync.fileSyncing.groups;"
									preference="pref-storage-groups-enabled"
										oncommand="Zotero_Preferences.Sync.updateStorageSettingsGroupsUI()"/>

							<hbox class="storage-settings-download-options" align="center">
								<label value="&zotero.preferences.sync.fileSyncing.download;"/>
								<menulist id="storage-groups-download-mode"
										class="storage-mode"
										preference="pref-storage-downloadMode-groups"
										style="margin-left: 0">
									<menupopup>
										<menuitem label="&zotero.preferences.sync.fileSyncing.download.onDemand;" value="on-demand"/>
										<menuitem label="&zotero.preferences.sync.fileSyncing.download.atSyncTime;" value="on-sync"/>
									</menupopup>
								</menulist>
							</hbox>

							<separator class="thin"/>

							<vbox id="storage-terms">
								<hbox style="margin-top: .4em; display: block" align="center">
									<label>&zotero.preferences.sync.fileSyncing.tos1;</label>
									<label class="zotero-text-link" href="https://www.zotero.org/support/terms/terms_of_service" value="&zotero.preferences.sync.fileSyncing.tos2;"/>
									<label>&zotero.preferences.period;</label>
								</hbox>
							</vbox>
						</groupbox>
					</vbox>
				</tabpanel>

				<tabpanel id="sync-reset" orient="vertical">
					<!-- This doesn't wrap without an explicit width, for some reason -->
					<description id="reset-sync-warning" width="45em">&zotero.preferences.sync.reset.warning1;<label style="margin-left: 0; margin-right: 0" class="zotero-text-link" href="http://zotero.org/support/kb/sync_reset_options">&zotero.preferences.sync.reset.warning2;</label>&zotero.preferences.sync.reset.warning3;</description>
					
					<div id="sync-reset-form" xmlns="http://www.w3.org/1999/xhtml">
						<div id="sync-reset-library-menu-container">
							<label>Library: <select id="sync-reset-library-menu"/></label>
						</div>
						
						<ul id="sync-reset-list">
							<!--<li>
								<p>&zotero.preferences.sync.reset.restoreFromServer;</p>
								<p>&zotero.preferences.sync.reset.restoreFromServer.desc;</p>
							</li>-->
							
							<li id="restore-to-server">
								<label>
									<input name="sync-reset-radiogroup" value="restore-to-server" type="radio"/>
									<span class="sync-reset-option-name">&zotero.preferences.sync.reset.restoreToServer;</span>
									<span class="sync-reset-option-desc">&zotero.preferences.sync.reset.restoreToServer.desc;</span>
								</label>
							</li>
							
							<!--<li>
								<h2>&zotero.preferences.sync.reset.resetDataSyncHistory;</h2>
								<description>&zotero.preferences.sync.reset.resetDataSyncHistory.desc;</p>
							</li>-->
							
							<li id="reset-file-sync-history">
								<label>
									<input name="sync-reset-radiogroup" value="reset-file-sync-history" type="radio"/>
									<span class="sync-reset-option-name">&zotero.preferences.sync.reset.resetFileSyncHistory;</span>
									<span class="sync-reset-option-desc">&zotero.preferences.sync.reset.resetFileSyncHistory.desc;</span>
								</label>
							</li>
						</ul>
						
						<button id="sync-reset-button"
							disabled="disabled"
							onclick="Zotero_Preferences.Sync.reset()">&zotero.preferences.sync.reset.button;</button>
					</div>
				</tabpanel>
			</tabpanels>
		</tabbox>
		
		<separator/>
		<separator/>
	</prefpane>
	
	<!-- Search -->
	<prefpane id="zotero-prefpane-search"
			label="&zotero.preferences.prefpane.search;"
			image="chrome://zotero/skin/prefs-search.png"
			onpaneload="Zotero_Preferences.Search.init()"
			helpTopic="search">
		<preferences>
			<preference id="pref-fulltext-textMaxLength" name="extensions.zotero.fulltext.textMaxLength" type="int"/>
			<preference id="pref-fulltext-pdfmaxpages" name="extensions.zotero.fulltext.pdfMaxPages" type="int"/>
		</preferences>
		
		<groupbox>
			<caption label="&zotero.preferences.search.fulltextCache;"/>
			
			<hbox>
				<button id="fulltext-rebuildIndex" flex="1" oncommand="Zotero_Preferences.Search.rebuildIndexPrompt()"/>
				<button id="fulltext-clearIndex" flex="1" oncommand="Zotero_Preferences.Search.clearIndexPrompt()"/>
			</hbox>
			
			<separator/>
			
			<hbox align="center">
				<label value="&zotero.preferences.fulltext.textMaxLength;"/>
				<textbox size="10" preference="pref-fulltext-textMaxLength"/>
				<label value="(&zotero.preferences.default; 500000)"/>
			</hbox>

			<separator class="thin"/>

			<hbox align="center">
				<label value="&zotero.preferences.fulltext.pdfMaxPages;"/>
				<textbox size="5" preference="pref-fulltext-pdfmaxpages"/>
				<label value="(&zotero.preferences.default; 100)"/>
			</hbox>
		</groupbox>
		
		<groupbox id="fulltext-stats">
			<caption label="&zotero.preferences.search.indexStats;"/>
			
			<grid>
				<columns>
					<column/>
					<column/>
				</columns>
				
				<rows>
					<row id="fulltext-stats-indexed">
						<label value="&zotero.preferences.search.indexStats.indexed;"/>
						<label/>
					</row>
					<row id="fulltext-stats-partial">
						<label value="&zotero.preferences.search.indexStats.partial;"/>
						<label/>
					</row>
					<row id="fulltext-stats-unindexed">
						<label value="&zotero.preferences.search.indexStats.unindexed;"/>
						<label/>
					</row>
					<row id="fulltext-stats-words">
						<label value="&zotero.preferences.search.indexStats.words;"/>
						<label/>
					</row>
				</rows>
			</grid>
		</groupbox>
		
		<separator/>
		<separator/>
	</prefpane>
	
	<!-- Export -->
	<prefpane id="zotero-prefpane-export"
			label="&zotero.preferences.prefpane.export;"
			image="chrome://zotero/skin/prefs-export.png"
			onpaneload="Zotero_Preferences.Export.init()"
			helpTopic="export">
		<preferences>
			<preference id="pref-quickCopy-setting" name="extensions.zotero.export.quickCopy.setting" type="string"/>
			<preference id="pref-quickCopy-dragLimit" name="extensions.zotero.export.quickCopy.dragLimit" type="int"/>
			<preference id="pref-quickCopy-locale" name="extensions.zotero.export.quickCopy.locale" type="string"/>
			<preference id="pref-noteQuickCopy-setting" name="extensions.zotero.export.noteQuickCopy.setting" type="string"/>
			<preference id="pref-import-charset" name="extensions.zotero.import.charset" type="string"/>
		</preferences>
		
		<groupbox id="zotero-prefpane-export-groupbox">
			<caption label="&zotero.preferences.quickCopy.caption;"/>
			
			<label id="quickCopy-instructions"/>
			<separator class="thin"/>
			<label id="quickCopy-citationInstructions"/>
			
			<separator/>
			
			<label value="&zotero.preferences.quickCopy.itemFormat;" control="quickCopy-menu"/>
			<menulist id="zotero-quickCopy-menu" label="&zotero.general.loading;"/>
			
			<hbox align="center">
				<label id="zotero-quickCopy-locale-menu-label" value="&zotero.bibliography.locale.label;" control="zotero-quickCopy-locale-menu"/>
				<menulist id="zotero-quickCopy-locale-menu" oncommand="Zotero_Preferences.Export._lastSelectedLocale = this.value"/>
				
				<separator orient="vertical" width="15px"/>
				
				<checkbox id="zotero-quickCopy-copyAsHTML" label="&zotero.preferences.quickCopy.copyAsHTML;"
					oncommand="Zotero_Preferences.Export.onCopyAsHTMLChange(this.checked)"/>
			</hbox>
			
			<separator/>
			
			<label value="&zotero.preferences.quickCopy.noteFormat;" control="zotero-noteQuickCopy-menu"/>
			<menulist id="zotero-noteQuickCopy-menu" label="&zotero.general.loading;"/>
			
			<separator/>
			
			<label value="&zotero.preferences.quickCopy.siteEditor.setings;" control="quickCopy-siteSettings"/>
			<hbox class="virtualized-table-container" flex="1" height="120px">
				<html:div id="quickCopy-siteSettings"/>
			</hbox>
			<separator class="thin"/>
			<hbox>
				<button disabled="true" id="quickCopy-edit" label="&zotero.general.edit;"
					onclick="Zotero_Preferences.Export.showQuickCopySiteEditor(true)"/>
				<spacer flex="1"/>
				<button disabled="true" id="quickCopy-delete" label="-" onclick="Zotero_Preferences.Export.deleteSelectedQuickCopySite()"/>
				<button label="+"
					onclick="Zotero_Preferences.Export.showQuickCopySiteEditor()"/>
			</hbox>
			
			<hbox align="center">
				<label value="&zotero.preferences.quickCopy.dragLimit;"/>
				<textbox preference="pref-quickCopy-dragLimit" size="3"/>
				<label value="&zotero.preferences.items;" flex="1"/>
			</hbox>
		</groupbox>
		
		<groupbox>
			<caption label="&zotero.preferences.charset;"/>
			
			<hbox align="center">
				<label value="&zotero.preferences.charset.importCharset;:" control="zotero-import-charsetMenu"/>
				<menulist id="zotero-import-charsetMenu" preference="pref-import-charset"/>
			</hbox>
		</groupbox>
	</prefpane>
	
	<!-- Cite -->
	<prefpane id="zotero-prefpane-cite"
			label="&zotero.preferences.prefpane.cite;"
			image="chrome://zotero/skin/prefs-styles.png"
			onpaneload="Zotero_Preferences.Cite.init()"
			helpTopic="cite">
		<preferences id="zotero-preferences-cite">
			<preference id="pref-cite-useClassicAddCitationDialog" name="extensions.zotero.integration.useClassicAddCitationDialog" type="bool"/>
			<preference id="pref-cite-citePaperJournalArticleURL" name="extensions.zotero.export.citePaperJournalArticleURL" type="bool"/>
		</preferences>
		
		<tabbox>
			<tabs>
				<tab id="styles-tab" label="&zotero.preferences.cite.styles;"/>
				<tab id="wordProcessors-tab" label="&zotero.preferences.cite.wordProcessors;"/>
			</tabs>
			<tabpanels>
				<tabpanel orient="vertical" id="styles">
					<groupbox flex="1">
						<caption label="&zotero.preferences.cite.styles.styleManager;"/>
						
						<hbox class="virtualized-table-container" flex="1" height="300px">
							<html:div id="styleManager"/>
						</hbox>
						<separator class="thin"/>
						<hbox align="center" flex="1" height="40">
							<label class="zotero-text-link"
									value="&zotero.preferences.export.getAdditionalStyles;" flex="1"
									onclick="Zotero_Preferences.Cite.openStylesPage(); event.preventDefault()"/>
							<button disabled="true" id="styleManager-delete" label="-"
								oncommand="Zotero_Preferences.Cite.deleteStyle()"/>
							<button label="+" oncommand="Zotero_Preferences.Cite.addStyle()"/>
						</hbox>
					</groupbox>
					
					<groupbox>
						<caption label="&zotero.preferences.citationOptions.caption;"/>
						
						<checkbox label="&zotero.preferences.export.citePaperJournalArticleURL;" preference="pref-cite-citePaperJournalArticleURL"/>
						<!-- This doesn't wrap without an explicit width, for some reason -->
						<label id="export-citePaperJournalArticleURL" width="45em">
							&zotero.preferences.export.citePaperJournalArticleURL.description;
						</label>
					</groupbox>
					
					<groupbox>
						<caption label="&zotero.general.tools;"/>
						
						<hbox>
							<button id="openCSLEdit"
								label="&zotero.preferences.styleEditor;"
								oncommand="Zotero_Preferences.openInViewer('chrome://zotero/content/tools/csledit.xhtml', true)"/>
							<button id="openCSLPreview"
								label="&zotero.preferences.stylePreview;"
								oncommand="Zotero_Preferences.openInViewer('chrome://zotero/content/tools/cslpreview.xul', true)"/>
						</hbox>
					</groupbox>
				</tabpanel>
				<tabpanel orient="vertical" id="wordProcessors">
					<vbox id="wordProcessors-somePluginsDisabled" hidden="true">
						<label style="font-weight: bold; margin-top: 1em; text-align: center">Some word processor plugins are disabled.</label>
						<hbox pack="center" style="margin-bottom: 2em">
							<button id="wordProcessors-enablePlugins"
								label="Enable Plugins and Restart Zotero"
								oncommand="Zotero_Preferences.Cite.enableWordPlugins()"/>
						</hbox>
					</vbox>
					<checkbox label="&zotero.preferences.cite.wordProcessors.useClassicAddCitationDialog;" preference="pref-cite-useClassicAddCitationDialog"/>
				</tabpanel>
			</tabpanels>
		</tabbox>
	</prefpane>
	
	<!-- Advanced -->
	<prefpane id="zotero-prefpane-advanced"
			label="&zotero.preferences.prefpane.advanced;"
			image="chrome://zotero/skin/prefs-advanced.png"
			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>
	</prefpane>
</prefwindow>
