enhanced the layout of code diff view
This commit is contained in:
parent
c9494d78b2
commit
812d52c687
@ -28,12 +28,20 @@ if ($revision1 <= 0)
|
||||
{
|
||||
$revreq = '';
|
||||
$revreqroot = '';
|
||||
|
||||
$dualrevreq = '';
|
||||
$dualrevreqroot = '';
|
||||
|
||||
$history_path = "/code/history/{$project->id}/{$hex_headpath}";
|
||||
}
|
||||
else
|
||||
{
|
||||
$revreq = "/{$file['created_rev']}";
|
||||
$revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq;
|
||||
|
||||
$dualrevreq = "/{$file['created_rev']}/{$file['against']['created_rev']}";
|
||||
$dualrevreqroot = '/' . $this->converter->AsciiToHex ('.') . $dualrevreq;
|
||||
|
||||
if ($hex_headpath == '') $revtrailer = $revreqroot;
|
||||
else $revtrailer = "/{$hex_headpath}{$revreq}";
|
||||
$history_path = "/code/history/{$project->id}{$revtrailer}";
|
||||
@ -98,7 +106,7 @@ $(function() {
|
||||
return false;
|
||||
});
|
||||
$("#code_diff_diff_button").button().click (function() {
|
||||
$(location).attr ('href', codepot_merge_path("<?php print site_url(); ?>", '<?php print "/code/{$altdiff_view}/{$project->id}/${hex_headpath}{$revreq}"; ?>'));
|
||||
$(location).attr ('href', codepot_merge_path("<?php print site_url(); ?>", '<?php print "/code/{$altdiff_view}/{$project->id}/${hex_headpath}{$dualrevreq}"; ?>'));
|
||||
return false;
|
||||
});
|
||||
$("#code_diff_history_button").button().click (function() {
|
||||
@ -120,7 +128,7 @@ $(function() {
|
||||
return false;
|
||||
});
|
||||
$("#code_diff_diff_against_button").button().click (function() {
|
||||
$(location).attr ('href', codepot_merge_path("<?php print site_url(); ?>", '<?php print "/code/{$altdiff_view}/{$project->id}/${hex_headpath}{$revreq}"; ?>'));
|
||||
$(location).attr ('href', codepot_merge_path("<?php print site_url(); ?>", '<?php print "/code/{$altdiff_view}/{$project->id}/${hex_headpath}{$dualrevreq}"; ?>'));
|
||||
return false;
|
||||
});
|
||||
$("#code_diff_history_against_button").button().click (function() {
|
||||
@ -352,12 +360,12 @@ $this->load->view (
|
||||
stristr($http_user_agent, 'Opera') === FALSE);
|
||||
if (!$is_msie) $is_msie = (preg_match ("/^Mozilla.+\(Windows.+\) like Gecko$/", $http_user_agent) !== FALSE);
|
||||
|
||||
print '<div style="width: 100%; overflow: hidden;" id="code_diff_result_fullview">';
|
||||
print '<div style="width: 100%; overflow: hidden;" id="code_diff_full_code_view">';
|
||||
|
||||
//
|
||||
// SHOW THE OLD FILE
|
||||
//
|
||||
print ("<div style='float:left; width: 50%; margin: 0; padding: 0;'>");
|
||||
print ('<div id="code_diff_old_code_view">');
|
||||
|
||||
print '<div class="navigator">';
|
||||
|
||||
@ -382,8 +390,7 @@ $this->load->view (
|
||||
print anchor ($nextanc, '<i class="fa fa-arrow-circle-right"></i>');
|
||||
print "</div>"; // navigator
|
||||
|
||||
//print "<pre class='prettyprint lang-{$fileext}' style='width: 100%;' id='code_diff_result_fulldiffold'>";
|
||||
print '<pre style="width: 100%;" id="code_diff_result_fulldiffold" class="line-numbered">';
|
||||
print '<pre id="code_diff_old_code" class="line-numbered">';
|
||||
|
||||
print '<span class="line-number-block">';
|
||||
$actual_line_no = 1;
|
||||
@ -462,7 +469,7 @@ $this->load->view (
|
||||
//
|
||||
// SHOW THE NEW FILE
|
||||
//
|
||||
print ("<div style='float:left; width: 50%; margin: 0; padding: 0;'>");
|
||||
print ('<div id="code_diff_new_code_view">');
|
||||
|
||||
print '<div class="navigator">';
|
||||
|
||||
@ -486,8 +493,7 @@ $this->load->view (
|
||||
print anchor ($nextanc, '<i class="fa fa-arrow-circle-right"></i>');
|
||||
print "</div>"; // navigator
|
||||
|
||||
//print "<pre class='prettyprint lang-{$fileext}' style='width: 100%;' id='code_diff_result_fulldiffnew'>";
|
||||
print '<pre style="width: 100%;" id="code_diff_result_fulldiffnew" class="line-numbered">';
|
||||
print '<pre id="code_diff_new_code" class="line-numbered">';
|
||||
|
||||
print '<span class="line-number-block">';
|
||||
$actual_line_no = 1;
|
||||
|
@ -17,7 +17,7 @@
|
||||
#code_file_result_code,
|
||||
#code_blame_result_code_container {
|
||||
border: none;
|
||||
line-height: 1.3em;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
#code_blame_result_code_author {
|
||||
@ -36,19 +36,6 @@
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#code_diff_metadata_container {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#code_diff_metadata,
|
||||
#code_diff_metadata_against {
|
||||
width: 50%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#code_folder_metadata_header,
|
||||
#code_file_metadata_header,
|
||||
#code_blame_metadata_header,
|
||||
@ -114,6 +101,11 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_metadata_body,
|
||||
#code_diff_metadata_against_body {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#code_folder_metadata_body ul,
|
||||
#code_file_metadata_body ul,
|
||||
#code_blame_metadata_body ul {
|
||||
@ -204,7 +196,7 @@
|
||||
-o-tab-size: 5;
|
||||
|
||||
font-size: 1em;
|
||||
line-height: 1.3em;
|
||||
line-height: 1.2em;
|
||||
|
||||
position: absolute !important;
|
||||
/*top: 300;
|
||||
@ -251,7 +243,7 @@
|
||||
* project source revision view
|
||||
*-----------------------------------------------*/
|
||||
#code_revision_metadata_text {
|
||||
line-height: 1.3em;
|
||||
line-height: 1.2em;
|
||||
padding: 0 0.2em 0 0.2em;
|
||||
}
|
||||
|
||||
@ -332,95 +324,66 @@
|
||||
/*-----------------------------------------------
|
||||
* project source diff view
|
||||
*-----------------------------------------------*/
|
||||
#code_diff_result_table {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td pre {
|
||||
background-color: inherit;
|
||||
border: 0;
|
||||
#code_diff_metadata_container {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td.diff {
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
#code_diff_metadata,
|
||||
#code_diff_metadata_against {
|
||||
width: 50%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0.1em;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td.diffrow {
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td.diffadded {
|
||||
border:1px solid #cdf0cd;
|
||||
background-color:#ddffdd;
|
||||
background-image:url(images/bullet_add.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position: 2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td.diffdeleted {
|
||||
border:1px solid #e8d4bc;
|
||||
background-color:#f8e4cc;
|
||||
background-image:url(images/bullet_delete.png);
|
||||
background-position: 2px 50%;
|
||||
background-repeat:no-repeat;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_table tr.diff td.diffchanged {
|
||||
border:1px solid #f0f0bc;
|
||||
background-color:#ffffcc;
|
||||
background-image:url(images/bullet_yellow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position: 2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_fulldiffold {
|
||||
#code_diff_old_code,
|
||||
#code_diff_new_code {
|
||||
border: none;
|
||||
/*padding-left: 10px;
|
||||
background: #F8F8FA;*/
|
||||
padding-left: 1px;
|
||||
line-height: 1.3em;
|
||||
float; left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.2em;
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#code_diff_result_fulldiffnew {
|
||||
border: none;
|
||||
/*padding-left: 10px;*/
|
||||
background: #FEF8F8;
|
||||
padding-left: 1px;
|
||||
line-height: 1.3em;
|
||||
#code_diff_old_code_view,
|
||||
#code_diff_new_code_view {
|
||||
width: 50%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0.1em;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .navigator {
|
||||
#code_diff_full_code_view .navigator {
|
||||
padding: 0.5em 0.8em 0.5em 0.8em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
color: #1C94C4;
|
||||
background-color: #E5ECF9;
|
||||
white-space: nowrap;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diff {
|
||||
#code_diff_full_code_view .diff {
|
||||
background-position: 2px 50%;
|
||||
padding: 0;
|
||||
padding-left:15px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
#code_diff_result_fullview .diffadded {
|
||||
#code_diff_full_code_view .diffadded {
|
||||
border:1px solid #cdf0cd;
|
||||
background-color:#ddffdd;
|
||||
background-image:url(images/bullet_add.png);
|
||||
@ -432,7 +395,7 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diffdeleted {
|
||||
#code_diff_full_code_view .diffdeleted {
|
||||
border:1px solid #e8d4bc;
|
||||
background-color:#f8e4cc;
|
||||
background-image:url(images/bullet_delete.png);
|
||||
@ -444,7 +407,7 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diffchanged {
|
||||
#code_diff_full_code_view .diffchanged {
|
||||
border:1px solid #f0f0bc;
|
||||
background-color:#ffffcc;
|
||||
background-image:url(images/bullet_yellow.png);
|
||||
@ -456,16 +419,16 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diffchangedold {
|
||||
#code_diff_full_code_view .diffchangedold {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diffchangednew {
|
||||
#code_diff_full_code_view .diffchangednew {
|
||||
/*background-color:#ffff00;*/
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#code_diff_result_fullview .diffrow {
|
||||
#code_diff_full_code_view .diffrow {
|
||||
font-size: 1.2em;
|
||||
padding: 0.2em 0.2em 0.2em 0.2em;
|
||||
font-weight: bold;
|
||||
|
Loading…
Reference in New Issue
Block a user