<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE page [
	<!ENTITY % localLocale SYSTEM "chrome://feedbar/locale/locale.dtd">
	%localLocale;
	<!ENTITY % backupLocale SYSTEM "chrome://feedbar-default-locale/content/locale.dtd">
	%backupLocale;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"	orient="vertical" xmlns:html="http://www.w3.org/1999/xhtml">
	<stringbundleset id="stringbundleset">
		<stringbundle id="feedbar-backup-string-bundle" src="chrome://feedbar-default-locale/content/locale.properties" />
		<stringbundle id="feedbar-string-bundle" src="chrome://feedbar/locale/locale.properties" />
	</stringbundleset>
	<script type="application/x-javascript" src="chrome://feedbar/content/sidebar.js"></script>
	<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"></script>
	<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"></script>
	<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"></script>
	<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"></script>
	<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"></script>
	<script type="application/x-javascript">
		<![CDATA[
		
		Components.utils.import("resource://feedbar-modules/treeview.js"); 
		Components.utils.import("resource://feedbar-modules/feed-getter.js"); 
		
		window.addEventListener("load", function (event) { FEEDSIDEBAR.load(); }, false);
		window.addEventListener("unload", function (event) { FEEDSIDEBAR.unload(); }, false);
		
		function handleBrowserClick(event) {  
			// Only react to left mouse clicks  
			if (event.button != 0)  
				return;  

			// Default action on link clicks is to go to this link, cancel it  
			event.preventDefault();  

			if (event.target instanceof HTMLAnchorElement && event.target.href)  {
				addTab(event.target.href);
			}
		}
		
		function addTab(url) {
			var browser = window.parent.gBrowser;

			var theTab = browser.addTab(url);
			browser.selectedTab = theTab;
		}
		
		]]>
	</script>
	<commandset id="mainCommandSet">
		<command id="open-all-in-tabs" oncommand="FEEDBAR.openAll();" tooltiptext="&feedbar.openAllInTabs;" />
		<command id="mark-all-as-read" oncommand="FEEDBAR.markAllAsRead();" tooltiptext="&feedbar.markAllAsRead;" />
		<command id="mark-all-as-unread" oncommand="FEEDBAR.markAllAsUnread();" tooltiptext="&feedbar.markAllAsUnread;" />
		<command id="stop-update" oncommand="FEED_GETTER.stopUpdate();" tooltiptext="&feedbar.stopFeedUpdate;" />
		<command id="force-reload" oncommand="FEED_GETTER.updateAllFeeds();" tooltiptext="&feedbar.reloadFeeds;" />
		<command id="set-reload-interval" oncommand="FEED_GETTER.setUpdateFrequency(event.target.getAttribute('value')); event.stopPropagation();" />
		<command id="update-period" oncommand="FEED_GETTER.setDisplayPeriod(event.target.getAttribute('value')); event.stopPropagation();" />
		<command id="sort" oncommand="var srt = event.target.getAttribute('value'); FEEDBAR.sort(srt, true); FEEDSIDEBAR.checkSortItem(srt); event.stopPropagation();" />
	</commandset>
	<popupset id="mainPopupSet">
		<menupopup id="feedbarContextMenu" onpopupshowing="return FEEDSIDEBAR.contextMenu.customize(this);">
			<menuitem option="open" label="&feedbar.open;" oncommand="FEEDBAR.openItem();" />
			<menuitem option="openInTab" label="&feedbar.openInTab;" oncommand="FEEDBAR.openInTab();" />
			<menuseparator />
			<menuitem option="openAllInTabs" label="&feedbar.openAllInTabs;" oncommand="FEEDBAR.openAll();" />
			<menuitem option="openFeedInTabs" label="&feedbar.openFeedInTabs;" oncommand="FEEDBAR.openFeed();" />
			<menuseparator />
			<menuitem option="markAsRead" label="&feedbar.markAsRead;" oncommand="FEEDBAR.markAsRead();" />
			<menuitem option="markAsUnread" label="&feedbar.markAsUnread;" oncommand="FEEDBAR.markAsUnread();" />
			<menuitem option="markFeedAsRead" label="&feedbar.markFeedAsRead;" oncommand="FEEDBAR.markAsRead();" />
			<menuitem option="markFeedAsUnread" label="&feedbar.markFeedAsUnread;" oncommand="FEEDBAR.markAsUnread();" />
			<menuitem option="markAllAsRead" label="&feedbar.markAllAsRead;" oncommand="FEEDBAR.markAllAsRead();" />
			<menuitem option="markAllAsUnread" label="&feedbar.markAllAsUnread;" oncommand="FEEDBAR.markAllAsUnread();" />
			<menuseparator />
			<menuitem option="copyTitle" label="&feedbar.copyTitle;" oncommand="FEEDBAR.copyTitle();" />
			<menuitem option="copyLink" label="&feedbar.copyLink;" oncommand="FEEDBAR.copyLink();" />
			<menuseparator />
			<menu option="sortBy" label="&feedbar.sortBy;">
				<menupopup id="sort-context-menu" command="sort">
					<menuitem type="radio" name="cm-frequency" value="default" label="&feedbar.sort.default;" />
					<menuitem type="radio" name="cm-frequency" value="name" label="&feedbar.sort.name;" />
					<menuitem type="radio" name="cm-frequency" value="updated" label="&feedbar.sort.updated;" />
				</menupopup>
			</menu>
			<menuseparator />
			<menuitem option="unsubscribe" label="&feedbar.unsubscribe;" oncommand="var id = FEEDBAR.unsubscribe(); FEED_GETTER.removeAFeed(id);" />
			<menuitem option="options" label="&feedbar.options;" oncommand="FEEDSIDEBAR.options();" />
		</menupopup>
	</popupset>
	<vbox flex="1">
		<toolbox id="navigator-toolbox" class="toolbox-top">
			<toolbar id="nav-bar" iconsize="small" class="toolbar-primary chromeclass-toolbar">
				<toolbarbutton id="new-window-button" style="margin-top: 6px;" class="toolbarbutton-1 chromeclass-toolbar-additional" command="open-all-in-tabs" />
				<toolbarbutton id="cut-button"  style="margin-top: 6px;" class="toolbarbutton-1 chromeclass-toolbar-additional" command="mark-all-as-read" />
				<toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional" type="menu" orient="horizontal" tooltiptext="&feedbar.showLastTooltip;">
					<menupopup id="period-menu" command="update-period">
						<menuitem type="radio" name="period" value="0" label="&feedbar.showAllItems;" />
						<menuitem type="radio" name="period" value="1" label="&feedbar.showLastDay;" />
						<menuitem type="radio" name="period" value="2" label="&feedbar.showLastDaysPre;2&feedbar.showLastDaysPost;" />
						<menuitem type="radio" name="period" value="3" label="&feedbar.showLastDaysPre;3&feedbar.showLastDaysPost;" />
						<menuitem type="radio" name="period" value="4" label="&feedbar.showLastDaysPre;4&feedbar.showLastDaysPost;" />
						<menuitem type="radio" name="period" value="5" label="&feedbar.showLastDaysPre;5&feedbar.showLastDaysPost;" />
						<menuitem type="radio" name="period" value="6" label="&feedbar.showLastDaysPre;6&feedbar.showLastDaysPost;" />
						<menuitem type="radio" name="period" value="7" label="&feedbar.showLastWeek;" />
						<menuitem type="radio" name="period" value="14" label="&feedbar.showLastWeeksPre;2&feedbar.showLastWeeksPost;" />
						<menuitem type="radio" name="period" value="30" label="&feedbar.showLastMonth;" />
					</menupopup>
				</toolbarbutton>
				<toolbarbutton id="stop-button" style="margin-top: 6px;" class="toolbarbutton-1 chromeclass-toolbar-additional" command="stop-update" disabled="true" />
				<toolbarbutton id="reload-button" style="margin-top: 3px;" class="toolbarbutton-1 chromeclass-toolbar-additional" type="menu-button" command="force-reload">
					<menupopup id="frequency-menu" command="set-reload-interval">
						<menuitem type="radio" name="frequency" value="10" label="10 &feedbar.minutes;" />
						<menuitem type="radio" name="frequency" value="20" label="20 &feedbar.minutes;" />
						<menuitem type="radio" name="frequency" value="30" label="30 &feedbar.minutes;" />
						<menuitem type="radio" name="frequency" value="45" label="45 &feedbar.minutes;" />
						<menuitem type="radio" name="frequency" value="60" label="1 &feedbar.hour;" />
						<menuitem type="radio" name="frequency" value="120" label="2 &feedbar.hours;" />
						<menuitem type="radio" name="frequency" value="180" label="3 &feedbar.hours;" />
						<menuitem type="radio" name="frequency" value="240" label="4 &feedbar.hours;" />
						<menuitem type="radio" name="frequency" value="300" label="5 &feedbar.hours;" />
						<menuitem type="radio" name="frequency" value="0" label="&feedbar.updatesDisabled;" />
					</menupopup>
				</toolbarbutton>
				<toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional" orient="horizontal" type="menu" tooltiptext="&feedbar.sortBy;">
					<menupopup id="sort-menu" command="sort">
						<menuitem type="radio" name="frequency" value="default" label="&feedbar.sort.default;" />
						<menuitem type="radio" name="frequency" value="name" label="&feedbar.sort.name;" />
						<menuitem type="radio" name="frequency" value="updated" label="&feedbar.sort.updated;" />
					</menupopup>
				</toolbarbutton>
				<spacer flex="1" />
				<toolbarbutton id="search-toggle" checked="false" persist="checked" oncommand="document.getElementById('search-bar').collapsed = !document.getElementById('search-bar').collapsed; this.checked = !document.getElementById('search-bar').collapsed;" />
			</toolbar>
			<toolbar id="search-bar" persist="collapsed">
				<textbox id="search-box" type="search" flex="1" oncommand="FEEDSIDEBAR.onSearchInput(this.value);" />
				<toolbarbutton id="all-toggle" tooltiptext="&feedbar.showAll.tooltip;" label="&feedbar.showAllItemsButtonLabel;" checked="false" persist="checked" oncommand="FEEDSIDEBAR.prefs.setBoolPref('hideReadItems', this.checked);" />
			</toolbar>
		</toolbox>
		<vbox flex="1">
			<notificationbox id="sidebar-notify" flex="5" persist="state height">
				<tree
					id="feed_tree"
					flex="1"
					class="plain"
					seltype="single"
					onclick="FEEDBAR.onTreeClick(event);"
					onkeypress="FEEDBAR.onKeyPress(event);"
					onselect="FEEDSIDEBAR.itemSelect(event);"
					ondblclick="FEEDBAR.onTreeDblClick(event);"
					hidecolumnpicker="true"
					context="feedbarContextMenu">
					<treecols>
						<treecol id="feedbar_tree_namecol" flex="1" primary="true" hideheader="true"/>
					</treecols>   
					<treechildren id="feedbar_tree_container"/>	 
				</tree>
			</notificationbox>
			<splitter id="preview-splitter" persist="state" collapsed="true" />
			<vbox id="feedbar-preview" flex="1" style="overflow: auto;" persist="state height" collapsed="true">
				<hbox align="center">
					<image id="feedbarTooltipImage"/>
					<vbox flex="1">
						<description id="feedbarTooltipFeedName" crop="end" />
						<description id="feedbarTooltipName" crop="end" onclick="FEEDBAR.handlePreviewNameClick({ which: event.which, detail : 2, ctrlKey : event.ctrlKey, metaKey : event.metaKey }, this.url);" style="cursor: pointer;" />
						<description id="feedbarTooltipURL" crop="end" onclick="FEEDBAR.onTreeClick({ which: event.which, detail : 2, ctrlKey : event.ctrlKey, metaKey : event.metaKey }, this.url);" style="cursor: pointer;"/>
					</vbox>
					<vbox pack="start" align="start">
						<toolbarbutton id="close-preview" class="tabs-closebutton" oncommand="FEEDBAR.markAsRead(true); FEEDSIDEBAR.hidePreview(); FEEDBAR.selectNone();" tooltiptext="&feedbar.preview.markAsRead;" />
					</vbox>
				</hbox>
				<groupbox id="feedbarTooltipSummaryGroupbox" flex="1">
					<iframe flex="1" id="content-frame" onclick="handleBrowserClick(event);" src="data:text/html,%3Chtml%3E%3Chead%3E%3Cstyle%20type%3D%22text%2Fcss%22%3Ebody%20*%2C%20body%20%7Bfont-size%3A%209pt%3Bfont-family%3A%20arial%2C%20sans-serif%3B%7D%3C%2Fstyle%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E" disablehistory="true" type="content"></iframe>
				</groupbox>
			</vbox>
			<hbox id="feed-sidebar-statusbar">
				<statusbarpanel pack="end" align="center" flex="1" style="padding-top: 4px;" id="feedbar-loading-text-container" onclick="FEED_GETTER.killCurrentRequest();">
					<description id="feedbar-loading-text" value="" onclick="if (this.getAttribute('url')) { addTab(this.getAttribute('url')); }" />
				</statusbarpanel>
			</hbox>
		</vbox>
	</vbox>
</page>