added the Enstyle/Destyle anchor into the code view

This commit is contained in:
hyung-hwan 2014-06-09 14:06:07 +00:00
parent 8d5b631e7e
commit a6d9332f37
4 changed files with 48 additions and 1 deletions

View File

@ -18,11 +18,13 @@ $lang['Created on'] = 'Created on';
$lang['Date'] = 'Date';
$lang['Delete'] = 'Delete';
$lang['Description'] = 'Description';
$lang['Destyle'] = 'Destyle';
$lang['Details'] = 'Details';
$lang['Difference'] = 'Diff';
$lang['Directory'] = 'Directory';
$lang['Download'] = 'Download';
$lang['Edit'] = 'Edit';
$lang['Enstyle'] = 'Enstyle';
$lang['Error'] = 'Error';
$lang['File'] = 'File';
$lang['Files'] = 'Files';

View File

@ -16,11 +16,13 @@ $lang['Created on'] = 'Waktu dibuat';
$lang['Date'] = 'Date';
$lang['Delete'] = 'Hapus';
$lang['Description'] = 'Penjelasan';
$lang['Destyle'] = 'Destyle';
$lang['Details'] = 'Detail';
$lang['Difference'] = 'Beda';
$lang['Directory'] = 'Direktori';
$lang['Download'] = 'Download';
$lang['Edit'] = 'Rubah';
$lang['Enstyle'] = 'Enstyle';
$lang['Error'] = 'Error';
$lang['File'] = 'File';
$lang['Files'] = 'File';

View File

@ -18,11 +18,13 @@ $lang['Created on'] = '최초생성시간';
$lang['Date'] = '날짜';
$lang['Delete'] = '삭제';
$lang['Description'] = '설명';
$lang['Destyle'] = '모양새제거';
$lang['Details'] = '상세내역';
$lang['Difference'] = '차이점';
$lang['Directory'] = '디렉토리';
$lang['Download'] = '내려받음';
$lang['Edit'] = '수정';
$lang['Enstyle'] = '모양새내기';
$lang['Error'] = '오류';
$lang['File'] = '파일';
$lang['Files'] = '파일';

View File

@ -48,12 +48,39 @@ $(function () {
}
});
});
function renderCode()
{
$("#code_file_mainarea_result_raw").html ($("#code_file_mainarea_result_pre").html())
prettyPrint ();
}
var showing_raw_code = false;
function showRawCode()
{
if (showing_raw_code)
{
$("#code_file_style_anchor").text("<?=$this->lang->line('Destyle')?>");
$("#code_file_mainarea_result_pre").removeClass("prettyprinted");
prettyPrint();
}
else
{
$("#code_file_style_anchor").text("<?=$this->lang->line('Enstyle')?>");
$("#code_file_mainarea_result_pre").html($("#code_file_mainarea_result_raw").html());
}
showing_raw_code = !showing_raw_code;
}
</script>
<title><?=htmlspecialchars($project->name)?></title>
</head>
<body onload="prettyPrint()">
<body onload="renderCode()">
<div class="content" id="code_file_content">
@ -164,6 +191,14 @@ $this->load->view (
print anchor (
"code/fetch/{$project->id}/${xpar}{$revreq}",
$this->lang->line('Download'));
print ' | ';
print anchor (
"code/file/{$project->id}/${xpar}{$revreq}",
$this->lang->line('Destyle'),
array('id' => 'code_file_style_anchor',
'onClick' => 'showRawCode(); return false;')
);
?>
</div> <!-- code_file_mainarea_menu -->
@ -228,6 +263,12 @@ if (array_key_exists('properties', $file) && count($file['properties']) > 0)
</pre>
</div> <!-- code_file_mainarea_result_info -->
<div style="display:none">
<pre id="code_file_mainarea_result_raw">
</pre>
</div>
</div> <!-- code_file_mainarea_result -->
</div> <!-- code_file_mainarea -->