<% var i = 0; %>

<select id="view" onchange="devTools.setupCopyButton(); devTools.updateEditor();">
	<% if (devTools.orgMap) { %>
		<optgroup label="{{++i|escape}}. Source Files (for top level navigation and panel locations)">
	<% } else if (devTools.mode == 'zenarioO') { %>
		<optgroup label="{{++i|escape}}. Source Files (for this panel)">
	<% } else { %>
		<optgroup label="{{++i|escape}}. Source Files">
	<% } %>
	
	<% for (var file in m.files) { %>
		<option
			value="{{file|escape}}"
			{{file == m.selectedFile? ' selected="selected"' : ''}}
		>{{ m.files[file] |escape}}</option>
	<% } %>
	</optgroup>
	
	<optgroup label="{{++i|escape}}. Combined Source">
		<option value="combined" {{'combined' == m.selectedFile? ' selected="selected"' : ''}}>Combined source files (static)</option>
	</optgroup>
	
	<% if (devTools.orgMap) { %>
		<optgroup label="{{++i|escape}}. Current">
			<option value="orgmap" {{'orgmap' == m.selectedFile? ' selected="selected"' : ''}}>Current value (dynamic)</option>
		</optgroup>
	<% } else { %>
		<% if (m.query_ids || m.query_full_select) { %>
			<optgroup label="{{++i|escape}}. Queries">
				<% if (m.query_ids && m.query_full_select) { %>
					<option value="query_ids" {{'query_ids' == m.selectedFile? ' selected="selected"' : ''}}>Looking for matching ids and sorting them</option>
					<option value="query_full_select" {{'query_full_select' == m.selectedFile? ' selected="selected"' : ''}}>Getting the full details of rows on the current page</option>
				
				<% } else if (m.query_ids) { %>
					<option value="query_ids" {{'query_ids' == m.selectedFile? ' selected="selected"' : ''}}>Looking for matching ids and sorting them (no results were found)</option>
				
				<% } else if (m.query_select_count) { %>
					<option value="query_select_count" {{'query_select_count' == m.selectedFile? ' selected="selected"' : ''}}>Doing a select count to work out the number of pages</option>
					<option value="query_full_select" {{'query_full_select' == m.selectedFile? ' selected="selected"' : ''}}>Getting the full details of all rows on the current page</option>
				<% } else { %>
					<option value="query_full_select" {{'query_full_select' == m.selectedFile? ' selected="selected"' : ''}}>Getting the full details of all rows in the correctly sorted order</option>
				<% } %>
			</optgroup>
		<% } %>
		<optgroup label="{{++i|escape}}. Current">
			<option value="current" {{'current' == m.selectedFile? ' selected="selected"' : ''}}>Current value (dynamic)</option>

			<% if (devTools.mode != 'zenarioSlot') { %>
				<option value="visible" {{'visible' == m.selectedFile? ' selected="selected"' : ''}}>Current value, excluding objects that are hidden</option>
			<% } %>
			
			<% if (sourceLib.__lastFormHTML) { %>
				<option value="form_html" {{'form_html' == m.selectedFile? ' selected="selected"' : ''}}>HTML for the current view</option>
			<% } %>
		</optgroup>
	<% } %>
</select>

<input id="copyFilePath" type="button" value="Copy" />

<div class="asterisk_explination">
	Files marked with a * contain the currently selected element or property.
</div>
