removed the default parameter to a javascript function for unsupporting browsers

This commit is contained in:
hyung-hwan 2016-01-16 14:12:37 +00:00
parent 0398f36f72
commit 1e6abb86e4
16 changed files with 52 additions and 30 deletions

View File

@ -5,6 +5,7 @@ $lang['All'] = 'All';
$lang['Apply'] = 'Apply'; $lang['Apply'] = 'Apply';
$lang['Attachment'] = 'Attachment'; $lang['Attachment'] = 'Attachment';
$lang['Attachments'] = 'Attachments'; $lang['Attachments'] = 'Attachments';
$lang['Back'] = 'Back';
$lang['Blame'] = 'Blame'; $lang['Blame'] = 'Blame';
$lang['Blank'] = 'Blank'; $lang['Blank'] = 'Blank';
$lang['Cancel'] = 'Cancel'; $lang['Cancel'] = 'Cancel';
@ -135,4 +136,5 @@ $lang['MSG_SIGNIN_FAILURE'] = 'Cannot sign in';
$lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = 'You have to be a member of the %s project to perform this task'; $lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = 'You have to be a member of the %s project to perform this task';
$lang['MSG_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete'; $lang['MSG_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete';
$lang['MSG_DISCARD_CHANGES?'] = 'Do you want to discard chagnes?';
?> ?>

View File

@ -5,6 +5,7 @@ $lang['All'] = 'Semua';
$lang['Apply'] = 'Menterapkan'; $lang['Apply'] = 'Menterapkan';
$lang['Attachment'] = 'Attachment'; $lang['Attachment'] = 'Attachment';
$lang['Attachments'] = 'Attachments'; $lang['Attachments'] = 'Attachments';
$lang['Back'] = 'Back';
$lang['Blame'] = 'Menyalahkan'; $lang['Blame'] = 'Menyalahkan';
$lang['Blank'] = 'Kosong'; $lang['Blank'] = 'Kosong';
$lang['Cancel'] = 'Membatalkan'; $lang['Cancel'] = 'Membatalkan';
@ -132,4 +133,6 @@ $lang['MSG_SIGNIN_FAILURE'] = 'Cannot sign in';
$lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = 'You have to be a member of the %s project to perform this task'; $lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = 'You have to be a member of the %s project to perform this task';
$lang['MSG_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete'; $lang['MSG_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete';
$lang['MSG_DISCARD_CHANGES?'] = 'Do you want to discard chagnes?';
?> ?>

View File

@ -5,6 +5,7 @@ $lang['All'] = '모두';
$lang['Apply'] = '적용'; $lang['Apply'] = '적용';
$lang['Attachment'] = '첨부'; $lang['Attachment'] = '첨부';
$lang['Attachments'] = '첨부'; $lang['Attachments'] = '첨부';
$lang['Back'] = '뒤로';
$lang['Blame'] = '책임전가'; $lang['Blame'] = '책임전가';
$lang['Blank'] = '공백'; $lang['Blank'] = '공백';
$lang['Cancel'] = '취소'; $lang['Cancel'] = '취소';
@ -135,5 +136,6 @@ $lang['MSG_SIGNIN_FAILURE'] = '로그인할 수 없습니다';
$lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = '이 작업을 수행하려면 %s 프로젝트의 멤버가 되어야 합니다'; $lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = '이 작업을 수행하려면 %s 프로젝트의 멤버가 되어야 합니다';
$lang['MSG_FORM_INPUT_INCOMPLETE'] = '입력이 완전하지 않습니다'; $lang['MSG_FORM_INPUT_INCOMPLETE'] = '입력이 완전하지 않습니다';
$lang['MSG_DISCARD_CHANGES?'] = '변경된 내용을 버리겠습니까?';
?> ?>

View File

@ -82,7 +82,7 @@ function set_editor_changed (changed)
if (changed) if (changed)
{ {
$(window).on ("beforeunload", function () { $(window).on ("beforeunload", function () {
return 'Do you want to discard changes?'; return '<?php print $this->lang->line('MSG_DISCARD_CHANGES?'); ?>';
}); });
} }
else else

View File

@ -201,26 +201,27 @@ function show_loc_by_file_graph (response)
function render_readme() function render_readme()
{ {
<?php <?php
// if the readme file name ends with '.wiki', perform wiki formatting and pretty printing // if the readme file name ends with '.wc', perform wiki formatting and pretty printing
if (strlen($readme_text) > 0 && (substr_compare($readme_file, '.wiki', -5) === 0 || if (strlen($readme_text) > 0 && substr_compare($readme_file, '.wc', -3) === 0):
substr_compare($readme_file, '.wc', -3) === 0)):
?> ?>
creole_render_wiki ( creole_render_wiki (
"code_folder_readme_text", "code_folder_readme_text",
"code_folder_readme", "code_folder_readme",
codepot_merge_path("<?php print site_url(); ?>", "/wiki/show/<?php print $project->id?>/"), codepot_merge_path("<?php print site_url(); ?>", "/wiki/show/<?php print $project->id?>/"),
codepot_merge_path("<?php print site_url(); ?>", "/wiki/attachment0/<?php print $project->id?>/") codepot_merge_path("<?php print site_url(); ?>", "/wiki/attachment0/<?php print $project->id?>/"),
false
); );
prettyPrint(); prettyPrint();
<?php <?php
// if the readme file name ends with '.wiki', perform markdown formatting // if the readme file name ends with '.md', perform markdown formatting
elseif (strlen($readme_text) > 0 && substr_compare($readme_file, '.md', -3) === 0): elseif (strlen($readme_text) > 0 && substr_compare($readme_file, '.md', -3) === 0):
?> ?>
showdown_render_wiki ( showdown_render_wiki (
"code_folder_readme_text", "code_folder_readme_text",
"code_folder_readme", "code_folder_readme",
codepot_merge_path("<?php print site_url(); ?>", "/wiki/show/<?php print $project->id?>/"), codepot_merge_path("<?php print site_url(); ?>", "/wiki/show/<?php print $project->id?>/"),
codepot_merge_path("<?php print site_url(); ?>", "/wiki/attachment0/<?php print $project->id?>/") codepot_merge_path("<?php print site_url(); ?>", "/wiki/attachment0/<?php print $project->id?>/"),
false
); );
prettyPrint(); prettyPrint();
<?php endif; ?> <?php endif; ?>

View File

@ -69,7 +69,8 @@ function preview_new_review_comment (input_text)
input_text, input_text,
"code_revision_new_review_comment_preview", "code_revision_new_review_comment_preview",
"<?php print $creole_base; ?>", "<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/" "<?php print $creole_file_base; ?>/",
true
); );
prettyPrint (); prettyPrint ();
@ -81,7 +82,8 @@ function preview_edit_review_comment (input_text, no)
input_text, input_text,
"code_revision_edit_review_comment_preview_" + no, "code_revision_edit_review_comment_preview_" + no,
"<?php print $creole_base; ?>", "<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/" "<?php print $creole_file_base; ?>/",
true
); );
prettyPrint (); prettyPrint ();
@ -484,7 +486,8 @@ function render_wiki()
"code_revision_mainarea_review_comment_text_" + (i + 1) , "code_revision_mainarea_review_comment_text_" + (i + 1) ,
"code_revision_mainarea_review_comment_" + (i + 1), "code_revision_mainarea_review_comment_" + (i + 1),
"<?php print $creole_base; ?>", "<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/" "<?php print $creole_file_base; ?>/",
false
); );
<?php <?php

View File

@ -54,7 +54,8 @@ function render_wiki()
"file_show_wiki_text", "file_show_wiki_text",
"file_show_wiki", "file_show_wiki",
"<?php print $creole_base; ?>", "<?php print $creole_base; ?>",
"<?php print $creole_file_base; ?>/" "<?php print $creole_file_base; ?>/",
false
); );
prettyPrint (); prettyPrint ();

View File

@ -1117,7 +1117,8 @@ function render_wiki()
"issue_show_description_pre", "issue_show_description_pre",
"issue_show_description", "issue_show_description",
"<?php print $creole_base?>", "<?php print $creole_base?>",
"<?php print $creole_file_base?>" "<?php print $creole_file_base?>",
false
); );
<?php <?php
@ -1128,8 +1129,7 @@ function render_wiki()
print "creole_render_wiki ( print "creole_render_wiki (
'issue_show_changes_comment_pre_{$xxx}', 'issue_show_changes_comment_pre_{$xxx}',
'issue_show_changes_comment_{$xxx}', 'issue_show_changes_comment_{$xxx}',
'{$creole_base}', '{$creole_base}', '{$creole_file_base}', false);";
'{$creole_file_base}');";
} }
} }
?> ?>

View File

@ -32,7 +32,8 @@ function render_wiki()
"project_home_result_wiki_text", "project_home_result_wiki_text",
"project_home_result_wiki", "project_home_result_wiki",
"<?php print site_url()?>/wiki/show/<?php print $project->id?>/", "<?php print site_url()?>/wiki/show/<?php print $project->id?>/",
"<?php print site_url()?>/wiki/attachment0/<?php print $project->id?>/" "<?php print site_url()?>/wiki/attachment0/<?php print $project->id?>/",
false
); );
prettyPrint (); prettyPrint ();

View File

@ -31,7 +31,8 @@ function render_wiki()
"site_home_result_wiki_text", "site_home_result_wiki_text",
"site_home_result_wiki", "site_home_result_wiki",
"<?php print site_url()?>/site/wiki/", "<?php print site_url()?>/site/wiki/",
"<?php print site_url()?>/site/image/" "<?php print site_url()?>/site/image/",
false
); );
prettyPrint (); prettyPrint ();

View File

@ -28,7 +28,8 @@ function render_wiki()
"site_show_result_wiki_text", "site_show_result_wiki_text",
"site_show_result_wiki", "site_show_result_wiki",
"<?php print site_url()?>/site/wiki/", "<?php print site_url()?>/site/wiki/",
"<?php print site_url()?>/site/image/" "<?php print site_url()?>/site/image/",
false
); );
prettyPrint (); prettyPrint ();

View File

@ -82,8 +82,10 @@ function preview_text (input_text)
previewing_text = false; previewing_text = false;
$("#wiki_edit_text_preview").empty(); $("#wiki_edit_text_preview").empty();
$("#wiki_edit_text_area").show(); $("#wiki_edit_text_area").show();
$("#wiki_edit_text_show").hide(); $("#wiki_edit_text_preview").hide();
$("#wiki_edit_preview_button").button("option", "label", "<?php print $this->lang->line('Preview'); ?>"); $("#wiki_edit_preview_button").button("option", "label", "<?php print $this->lang->line('Preview'); ?>");
$("#wiki_edit_save_button").button("enable");
$("#wiki_edit_exit_button").button("enable");
} }
else else
{ {
@ -92,7 +94,9 @@ function preview_text (input_text)
$("#wiki_edit_text_preview").show(); $("#wiki_edit_text_preview").show();
$("#wiki_edit_text_area").hide(); $("#wiki_edit_text_area").hide();
$("#wiki_edit_preview_button").button("option", "label", "<?php print $this->lang->line('Edit'); ?>"); $("#wiki_edit_preview_button").button("option", "label", "<?php print $this->lang->line('Back'); ?>");
$("#wiki_edit_save_button").button("disable");
$("#wiki_edit_exit_button").button("disable");
if ($('#wiki_edit_doctype').val() == 'M') if ($('#wiki_edit_doctype').val() == 'M')
{ {
@ -403,11 +407,12 @@ $(function () {
var wiki_new_text = $('#wiki_edit_text_area').val(); var wiki_new_text = $('#wiki_edit_text_area').val();
if (wiki_original_text != wiki_new_text) if (wiki_original_text != wiki_new_text)
{ {
return 'Do you want to discard changes?'; return '<?php print $this->lang->line('MSG_DISCARD_CHANGES?'); ?>';
} }
// return null; // this line caused firefox to show the default message. // return null; // this line caused firefox to show the default message.
}); });
$('#wiki_edit_text_preview').hide();
$(window).resize(resize_text_editor); $(window).resize(resize_text_editor);
resize_text_editor (); resize_text_editor ();
}); });
@ -502,7 +507,7 @@ $this->load->view (
</div> </div>
<div id="wiki_edit_result" class="codepot-relative-container-view"> <div id="wiki_edit_result" class="codepot-relative-container-view">
<div id='wiki_edit_text_preview' class='codepot-styled-text-view'></div> <div id='wiki_edit_text_preview' class='codepot-styled-text-preview'></div>
<textarea id='wiki_edit_text_area' style='resize: none;'></textarea> <textarea id='wiki_edit_text_area' style='resize: none;'></textarea>
</div> <!-- wiki_edit_result --> </div> <!-- wiki_edit_result -->

View File

@ -397,7 +397,7 @@ $(function () {
var ed = wiki_text_editor.serialize(); var ed = wiki_text_editor.serialize();
if (wiki_original_text != ed.wiki_edit_text_editor.value) if (wiki_original_text != ed.wiki_edit_text_editor.value)
{ {
return 'Do you want to discard changes?'; return '<?php print $this->lang->line('MSG_DISCARD_CHANGES?'); ?>';
} }
// return null; // this line caused firefox to show the default message. // return null; // this line caused firefox to show the default message.
}); });

View File

@ -81,14 +81,16 @@ function render_wiki()
"wiki_show_wiki_text", "wiki_show_wiki_text",
"wiki_show_wiki", "wiki_show_wiki",
"<?php print site_url()?>/wiki/show/<?php print $project->id?>/", "<?php print site_url()?>/wiki/show/<?php print $project->id?>/",
"<?php print site_url()?>/wiki/attachment/<?php print $project->id?>/<?php print $hex_wikiname?>/" "<?php print site_url()?>/wiki/attachment/<?php print $project->id?>/<?php print $hex_wikiname?>/",
false
); );
<?php else: ?> <?php else: ?>
creole_render_wiki ( creole_render_wiki (
"wiki_show_wiki_text", "wiki_show_wiki_text",
"wiki_show_wiki", "wiki_show_wiki",
"<?php print site_url()?>/wiki/show/<?php print $project->id?>/", "<?php print site_url()?>/wiki/show/<?php print $project->id?>/",
"<?php print site_url()?>/wiki/attachment/<?php print $project->id?>/<?php print $hex_wikiname?>/" "<?php print site_url()?>/wiki/attachment/<?php print $project->id?>/<?php print $hex_wikiname?>/",
false
); );
<?php endif; ?> <?php endif; ?>

View File

@ -558,7 +558,7 @@ Parse.Simple.Creole.prototype = new Parse.Simple.Base();
Parse.Simple.Creole.prototype.constructor = Parse.Simple.Creole; Parse.Simple.Creole.prototype.constructor = Parse.Simple.Creole;
function creole_render_wiki_with_input_text (input_text, outputid, linkbase, imgbase, raw = false) function creole_render_wiki_with_input_text (input_text, outputid, linkbase, imgbase, raw)
{ {
function decodeEntities(str) function decodeEntities(str)
{ {
@ -588,7 +588,7 @@ function creole_render_wiki_with_input_text (input_text, outputid, linkbase, img
creole.parse (output, xinput); creole.parse (output, xinput);
} }
function creole_render_wiki (inputid, outputid, linkbase, imgbase, raw = false) function creole_render_wiki (inputid, outputid, linkbase, imgbase, raw)
{ {
var input = document.getElementById(inputid); var input = document.getElementById(inputid);
return creole_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw); return creole_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw);

View File

@ -2510,7 +2510,7 @@ if (typeof module !== 'undefined' && module.exports) {
//# sourceMappingURL=showdown.js.map //# sourceMappingURL=showdown.js.map
function showdown_render_wiki_with_input_text (input_text, outputid, linkbase, imgbase, raw = false) function showdown_render_wiki_with_input_text (input_text, outputid, linkbase, imgbase, raw)
{ {
var sd = new showdown.Converter ({ var sd = new showdown.Converter ({
omitExtraWLInCodeBlocks: false, omitExtraWLInCodeBlocks: false,
@ -2542,8 +2542,8 @@ function showdown_render_wiki_with_input_text (input_text, outputid, linkbase, i
output.innerHTML = sd.makeHtml(xinput); output.innerHTML = sd.makeHtml(xinput);
} }
function showdown_render_wiki (inputid, outputid, linkbase, imgbase, raw = false) function showdown_render_wiki (inputid, outputid, linkbase, imgbase, raw)
{ {
var input = document.getElementById(inputid); var input = document.getElementById(inputid);
return showdown_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw); return showdown_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw);
} }