<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://dustmeselectors/locale/dustmeselectors.dtd">

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
	id="dms-viewselectors"
	style="padding:12px;" 
	title="&dms.view.title;" 
	onunload="opener.DustMeSelectors_tools.saveDialogProps(this, 'viewselectors');">
	
	<hbox style="margin-bottom:10px;">
		<label control="dms-hostsindexmenu" value="&dms.view.viewmenu;"/>
		<menulist id="dms-hostsindexmenu" flex="1" style="min-height:1.9em;" 
			oncommand="opener.DustMeSelectors_browser
				.viewSavedDataForHost(this.selectedItem.getAttribute('value'), true);">
			<menupopup/>
		</menulist>
		<progressmeter id="dms-viewprogress" mode="undetermined"
			flex="1" hidden="true"/>
	</hbox>
	
	<tabbox id="dms-viewtabbrowser" flex="1">
		<hbox>
			<tabs id="dms-viewtabs" onselect="try
						{
							opener.DustMeSelectors_browser
								.tabSelect(document.getElementById('dms-hostsindexmenu')
								.selectedItem.getAttribute('value'));
						} catch(err) {}">
				<tab id="dms-viewtab-selectors" label="&dms.view.tab.selectors;" 
					accesskey="&dms.view.tab.accesskey.selectors;"/>
				<tab id="dms-viewtab-used" label="&dms.view.tab.used;" 
					accesskey="&dms.view.tab.accesskey.used;"/>
				<tab id="dms-viewtab-spider" label="&dms.view.tab.spider;" 
					accesskey="&dms.view.tab.accesskey.spider;"/>
			</tabs>
		</hbox>
		<tabpanels flex="1" style="padding:0;border:none;">
			
			<browser id="dms-viewselectorsbrowser"  
				src="viewdata.xhtml"  
				contextmenu="dms-viewselectorscontext"/>
			<popup id="dms-viewselectorscontext">
				<menuitem disabled="true" id="dms-viewselectorscontext-mark" 
					accesskey="&dms.view.context.accesskey.markused;" 
					oncommand="opener.DustMeSelectors_browser.markSelector('selectors');"/>
				<menuseparator/>
				<menuitem label="&dms.view.context.restore;" disabled="true" 
					id="dms-viewselectorscontext-restore" 
					accesskey="&dms.view.context.accesskey.restore;" 
					oncommand="opener.DustMeSelectors_browser.restoreMarkedSelectors('selectors');"/>
			</popup>
		
			<browser id="dms-viewusedbrowser"  
				src="viewdata.xhtml"  
				contextmenu="dms-viewusedcontext"/>
			<popup id="dms-viewusedcontext">
				<menuitem disabled="true" id="dms-viewusedcontext-mark" 
					accesskey="&dms.view.context.accesskey.markunused;" 
					oncommand="opener.DustMeSelectors_browser.markSelector('used');"/>
				<menuseparator/>
				<menuitem label="&dms.view.context.restore;" disabled="true" 
					id="dms-viewusedcontext-restore" 
					accesskey="&dms.view.context.accesskey.restore;" 
					oncommand="opener.DustMeSelectors_browser.restoreMarkedSelectors('used');"/>
			</popup>
			
			<browser id="dms-viewlogbrowser" src="viewdata.xhtml"/>
			
		</tabpanels>
	</tabbox>
	
	<description id="dms-viewsummary" style="margin:5px 0 0 0;"/>
	
	<hbox style="margin:10px 0 0 0;">
		<button id="dms-viewactions-save" label="&dms.view.save;" 
			accesskey="&dms.view.accesskey.save;"
			oncommand="opener.DustMeSelectors_filesystem.saveAsCSV(document);"/>
		
		<button id="dms-viewactions-clear" label="&dms.view.clear;" 
			accesskey="&dms.view.accesskey.clear;"
			oncommand="try { opener.DustMeSelectors_browser.clearSavedSelectorsForSelectedHost(window); }
				catch(err) { document.getElementById('dms-viewactions-save').setAttribute('disabled', true); }"/>
		
		<spacer flex="1"/>
		
		<button id="dms-viewactions-okay" label="&dms.view.okay;" 
			accesskey="&dms.view.accesskey.okay;" oncommand="window.close();"/>
	</hbox>
	
</window>