updated the code file view to use the title-band class partially
This commit is contained in:
		| @ -37,17 +37,17 @@ var base_return_anchor = codepot_merge_path('<?php print site_url() ?>', '<?php | |||||||
|  |  | ||||||
| function resize_editor() | function resize_editor() | ||||||
| { | { | ||||||
| 	var infostrip = $("#code_edit_mainarea_infostrip"); | 	var titleband = $("#code_edit_mainarea_title_band"); | ||||||
| 	var code = $("#code_edit_mainarea_result_code"); | 	var code = $("#code_edit_mainarea_result_code"); | ||||||
| 	var footer = $("#codepot_footer"); | 	var footer = $("#codepot_footer"); | ||||||
|  |  | ||||||
| 	var ioff = infostrip.offset(); | 	var ioff = titleband.offset(); | ||||||
| 	var foff = footer.offset(); | 	var foff = footer.offset(); | ||||||
|  |  | ||||||
| 	ioff.top += infostrip.outerHeight() + 5; | 	ioff.top += titleband.outerHeight() + 5; | ||||||
| 	code.offset (ioff); | 	code.offset (ioff); | ||||||
| 	code.innerHeight (foff.top - ioff.top - 5); | 	code.innerHeight (foff.top - ioff.top - 5); | ||||||
| 	code.innerWidth (infostrip.innerWidth()); | 	code.innerWidth (titleband.innerWidth()); | ||||||
| } | } | ||||||
|  |  | ||||||
| function show_alert (outputMsg, titleMsg)  | function show_alert (outputMsg, titleMsg)  | ||||||
| @ -266,6 +266,7 @@ $this->load->view ( | |||||||
|  |  | ||||||
| <div class="mainarea" id="code_edit_mainarea"> | <div class="mainarea" id="code_edit_mainarea"> | ||||||
|  |  | ||||||
|  | <div class="title-band" id="code_edit_mainarea_title_band"> | ||||||
| 	<div class="title" id="code_edit_mainarea_title"> | 	<div class="title" id="code_edit_mainarea_title"> | ||||||
| 	<?php | 	<?php | ||||||
| 		print anchor ( | 		print anchor ( | ||||||
| @ -294,8 +295,7 @@ $this->load->view ( | |||||||
| 	?> | 	?> | ||||||
| 	</div> <!-- code_edit_mainarea_title --> | 	</div> <!-- code_edit_mainarea_title --> | ||||||
|  |  | ||||||
| <div class="infostrip" id="code_edit_mainarea_infostrip"> | 	<div class="actions"> | ||||||
|  |  | ||||||
| 	<?php  | 	<?php  | ||||||
| 		/* Saving file work on the head only. so the links here don't include the given revision anymore */ | 		/* Saving file work on the head only. so the links here don't include the given revision anymore */ | ||||||
| 		print '<select id="code_edit_mainarea_mode"></select>'; | 		print '<select id="code_edit_mainarea_mode"></select>'; | ||||||
| @ -304,7 +304,8 @@ $this->load->view ( | |||||||
| 		print ' '; | 		print ' '; | ||||||
| 		print anchor ("code/${caller}/{$project->id}/{$hex_headpath}{$revreq}", $this->lang->line('Return'), 'id="code_edit_mainarea_return_button"'); | 		print anchor ("code/${caller}/{$project->id}/{$hex_headpath}{$revreq}", $this->lang->line('Return'), 'id="code_edit_mainarea_return_button"'); | ||||||
| 	?> | 	?> | ||||||
|  | 	</div> | ||||||
|  | 	<div style="clear: both;"></div> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <div class="result" id="code_edit_mainarea_result"> | <div class="result" id="code_edit_mainarea_result"> | ||||||
|  | |||||||
| @ -34,23 +34,23 @@ $(function () { | |||||||
| 		print '$("#code_file_mainarea_result_info").hide();'; | 		print '$("#code_file_mainarea_result_info").hide();'; | ||||||
| 	?> | 	?> | ||||||
|  |  | ||||||
| 	if ($("#code_file_mainarea_result_info").is(":visible")) | 	//if ($("#code_file_mainarea_result_info").is(":visible")) | ||||||
| 		btn_label = "<?php print $this->lang->line('Hide metadata')?>"; | 	//	btn_label = "<?php print $this->lang->line('Hide metadata')?>"; | ||||||
| 	else | 	//else | ||||||
| 		btn_label = "<?php print $this->lang->line('Show metadata')?>"; | 	//	btn_label = "<?php print $this->lang->line('Show metadata')?>"; | ||||||
|  |  | ||||||
| 	btn = $("#code_file_mainarea_metadata_button").button({"label": btn_label}).click (function () { | 	btn = $("#code_file_mainarea_metadata_button").button().click (function () { | ||||||
| 		if ($("#code_file_mainarea_result_info").is(":visible")) | 		if ($("#code_file_mainarea_result_info").is(":visible")) | ||||||
| 		{ | 		{ | ||||||
| 			$("#code_file_mainarea_result_info").hide("blind",{},200); | 			$("#code_file_mainarea_result_info").hide("blind",{},200); | ||||||
| 			$("#code_file_mainarea_metadata_button").button( | 			//$("#code_file_mainarea_metadata_button").button( | ||||||
| 				"option", "label", "<?php print $this->lang->line('Show metadata')?>"); | 			//	"option", "label", "<?php print $this->lang->line('Show metadata')?>"); | ||||||
| 		} | 		} | ||||||
| 		else | 		else | ||||||
| 		{ | 		{ | ||||||
| 			$("#code_file_mainarea_result_info").show("blind",{},200); | 			$("#code_file_mainarea_result_info").show("blind",{},200); | ||||||
| 			$("#code_file_mainarea_metadata_button").button( | 			//$("#code_file_mainarea_metadata_button").button( | ||||||
| 				"option", "label", "<?php print $this->lang->line('Hide metadata')?>"); | 			//	"option", "label", "<?php print $this->lang->line('Hide metadata')?>"); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		return false; // prevent the default behavior | 		return false; // prevent the default behavior | ||||||
| @ -124,6 +124,7 @@ $this->load->view ( | |||||||
|  |  | ||||||
| <div class="mainarea" id="code_file_mainarea"> | <div class="mainarea" id="code_file_mainarea"> | ||||||
|  |  | ||||||
|  | <div class="title-band" id="code_file_mainarea_title_band"> | ||||||
| 	<div class="title" id="code_file_mainarea_title"> | 	<div class="title" id="code_file_mainarea_title"> | ||||||
| 	<?php | 	<?php | ||||||
| 		if ($revision <= 0) | 		if ($revision <= 0) | ||||||
| @ -163,6 +164,47 @@ $this->load->view ( | |||||||
| 	?> | 	?> | ||||||
| 	</div> <!-- code_file_mainarea_title --> | 	</div> <!-- code_file_mainarea_title --> | ||||||
|  |  | ||||||
|  | 	<div class="actions"> | ||||||
|  | 	<?php  | ||||||
|  | 		print anchor ("code/file/{$project->id}/${xpar}/{$file['prev_rev']}", '<i class="fa fa-arrow-circle-left"></i>'); | ||||||
|  | 		print ' '; | ||||||
|  |  | ||||||
|  | 		// anchor to the revision history at the root directory | ||||||
|  | 		print anchor ( | ||||||
|  | 			//"code/revision/{$project->id}/!/{$file['created_rev']}", | ||||||
|  | 			"code/revision/{$project->id}/${xpar}/{$file['created_rev']}", | ||||||
|  | 			sprintf("%s %s", $this->lang->line('Revision'), $file['created_rev']) | ||||||
|  | 		); | ||||||
|  |  | ||||||
|  | 		if (!empty($file['created_tag'])) | ||||||
|  | 		{ | ||||||
|  | 			print ' '; | ||||||
|  | 			print ('<span class="left_arrow_indicator">'); | ||||||
|  | 			print htmlspecialchars($file['created_tag']); | ||||||
|  | 			print ('</span>'); | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		print ' '; | ||||||
|  | 		print anchor ("code/file/{$project->id}/${xpar}/{$file['next_rev']}", '<i class="fa fa-arrow-circle-right"></i>'); | ||||||
|  |  | ||||||
|  | 		print ' | '; | ||||||
|  | 		printf ('%s: %s', $this->lang->line('Size'), $file['size']); | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 		if ((isset($login['id']) && $login['id'] != '')) | ||||||
|  | 		{ | ||||||
|  | 			print ' '; | ||||||
|  | 			print anchor ("code/edit/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Edit'), 'id="code_file_mainarea_edit_button"'); | ||||||
|  | 		} | ||||||
|  | 	?> | ||||||
|  |  | ||||||
|  | 	<a id="code_file_mainarea_metadata_button" href='#'><?php print $this->lang->line('Metadata')?></a> | ||||||
|  |  | ||||||
|  | 	</div> | ||||||
|  |  | ||||||
|  | 	<div style="clear: both;"></div> | ||||||
|  | </div> | ||||||
|  |  | ||||||
| <div class="menu" id="code_file_mainarea_menu"> | <div class="menu" id="code_file_mainarea_menu"> | ||||||
| <?php | <?php | ||||||
| 	$xpar = $this->converter->AsciiToHex ($headpath); | 	$xpar = $this->converter->AsciiToHex ($headpath); | ||||||
| @ -213,44 +255,6 @@ $this->load->view ( | |||||||
| ?> | ?> | ||||||
| </div> <!-- code_file_mainarea_menu --> | </div> <!-- code_file_mainarea_menu --> | ||||||
|  |  | ||||||
| <div class="infostrip" id="code_file_mainarea_infostrip"> |  | ||||||
|  |  | ||||||
| 	<?php  |  | ||||||
| 		print anchor ("code/file/{$project->id}/${xpar}/{$file['prev_rev']}", '<i class="fa fa-arrow-circle-left"></i>'); |  | ||||||
| 		print ' '; |  | ||||||
|  |  | ||||||
| 		// anchor to the revision history at the root directory |  | ||||||
| 		print anchor ( |  | ||||||
| 			//"code/revision/{$project->id}/!/{$file['created_rev']}", |  | ||||||
| 			"code/revision/{$project->id}/${xpar}/{$file['created_rev']}", |  | ||||||
| 			sprintf("%s %s", $this->lang->line('Revision'), $file['created_rev']) |  | ||||||
| 		); |  | ||||||
|  |  | ||||||
| 		if (!empty($file['created_tag'])) |  | ||||||
| 		{ |  | ||||||
| 			print ' '; |  | ||||||
| 			print ('<span class="left_arrow_indicator">'); |  | ||||||
| 			print htmlspecialchars($file['created_tag']); |  | ||||||
| 			print ('</span>'); |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		print ' '; |  | ||||||
| 		print anchor ("code/file/{$project->id}/${xpar}/{$file['next_rev']}", '<i class="fa fa-arrow-circle-right"></i>'); |  | ||||||
|  |  | ||||||
| 		print ' | '; |  | ||||||
| 		printf ('%s: %s', $this->lang->line('Size'), $file['size']); |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 		if ((isset($login['id']) && $login['id'] != '')) |  | ||||||
| 		{ |  | ||||||
| 			print ' '; |  | ||||||
| 			print anchor ("code/edit/{$project->id}/{$xpar}{$revreq}", $this->lang->line('Edit'), 'id="code_file_mainarea_edit_button"'); |  | ||||||
| 		} |  | ||||||
| 	?> |  | ||||||
|  |  | ||||||
| 	<a id="code_file_mainarea_metadata_button" href='#'><?php print $this->lang->line('Metadata')?></a> |  | ||||||
| 	 |  | ||||||
| </div> |  | ||||||
|  |  | ||||||
| <div style="display:none"> | <div style="display:none"> | ||||||
| <pre id="code_file_mainarea_result_raw"> | <pre id="code_file_mainarea_result_raw"> | ||||||
| @ -375,7 +379,6 @@ if (array_key_exists('properties', $file) && count($file['properties']) > 0) | |||||||
| 		$graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$xpar}{$revreq}"); | 		$graph_url = codepot_merge_path (site_url(), "/code/graph/cloc-file/{$project->id}/{$xpar}{$revreq}"); | ||||||
| 		print "<img src='{$graph_url}' id='code_file_mainarea_result_info_locgraph' />"; | 		print "<img src='{$graph_url}' id='code_file_mainarea_result_info_locgraph' />"; | ||||||
| 	?> | 	?> | ||||||
|  |  | ||||||
| </div> <!-- code_file_mainarea_result_info --> | </div> <!-- code_file_mainarea_result_info --> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user