diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index 8893136d..feee77bc 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -5,6 +5,7 @@ $lang['All'] = 'All'; $lang['Apply'] = 'Apply'; $lang['Attachment'] = 'Attachment'; $lang['Attachments'] = 'Attachments'; +$lang['Back'] = 'Back'; $lang['Blame'] = 'Blame'; $lang['Blank'] = 'Blank'; $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_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete'; +$lang['MSG_DISCARD_CHANGES?'] = 'Do you want to discard chagnes?'; ?> diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index 612d4d63..6a087e70 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -5,6 +5,7 @@ $lang['All'] = 'Semua'; $lang['Apply'] = 'Menterapkan'; $lang['Attachment'] = 'Attachment'; $lang['Attachments'] = 'Attachments'; +$lang['Back'] = 'Back'; $lang['Blame'] = 'Menyalahkan'; $lang['Blank'] = 'Kosong'; $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_FORM_INPUT_INCOMPLETE'] = 'Your input is incomplete'; +$lang['MSG_DISCARD_CHANGES?'] = 'Do you want to discard chagnes?'; + ?> diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index c6fd2f75..84f23aa8 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -5,6 +5,7 @@ $lang['All'] = '모두'; $lang['Apply'] = '적용'; $lang['Attachment'] = '첨부'; $lang['Attachments'] = '첨부'; +$lang['Back'] = '뒤로'; $lang['Blame'] = '책임전가'; $lang['Blank'] = '공백'; $lang['Cancel'] = '취소'; @@ -135,5 +136,6 @@ $lang['MSG_SIGNIN_FAILURE'] = '로그인할 수 없습니다'; $lang['MSG_PROJECT_MEMBERSHIP_REQUIRED'] = '이 작업을 수행하려면 %s 프로젝트의 멤버가 되어야 합니다'; $lang['MSG_FORM_INPUT_INCOMPLETE'] = '입력이 완전하지 않습니다'; +$lang['MSG_DISCARD_CHANGES?'] = '변경된 내용을 버리겠습니까?'; ?> diff --git a/codepot/src/codepot/views/code_edit.php b/codepot/src/codepot/views/code_edit.php index 85e9f3b6..cd7d17bc 100644 --- a/codepot/src/codepot/views/code_edit.php +++ b/codepot/src/codepot/views/code_edit.php @@ -82,7 +82,7 @@ function set_editor_changed (changed) if (changed) { $(window).on ("beforeunload", function () { - return 'Do you want to discard changes?'; + return 'lang->line('MSG_DISCARD_CHANGES?'); ?>'; }); } else diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index deee742b..10ca64c3 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -201,26 +201,27 @@ function show_loc_by_file_graph (response) function render_readme() { 0 && (substr_compare($readme_file, '.wiki', -5) === 0 || - substr_compare($readme_file, '.wc', -3) === 0)): + // if the readme file name ends with '.wc', perform wiki formatting and pretty printing + if (strlen($readme_text) > 0 && substr_compare($readme_file, '.wc', -3) === 0): ?> creole_render_wiki ( "code_folder_readme_text", "code_folder_readme", codepot_merge_path("", "/wiki/show/id?>/"), - codepot_merge_path("", "/wiki/attachment0/id?>/") + codepot_merge_path("", "/wiki/attachment0/id?>/"), + false ); prettyPrint(); 0 && substr_compare($readme_file, '.md', -3) === 0): ?> showdown_render_wiki ( "code_folder_readme_text", "code_folder_readme", codepot_merge_path("", "/wiki/show/id?>/"), - codepot_merge_path("", "/wiki/attachment0/id?>/") + codepot_merge_path("", "/wiki/attachment0/id?>/"), + false ); prettyPrint(); diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 41f44c01..6ed39669 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -69,7 +69,8 @@ function preview_new_review_comment (input_text) input_text, "code_revision_new_review_comment_preview", "", - "/" + "/", + true ); prettyPrint (); @@ -81,7 +82,8 @@ function preview_edit_review_comment (input_text, no) input_text, "code_revision_edit_review_comment_preview_" + no, "", - "/" + "/", + true ); prettyPrint (); @@ -484,7 +486,8 @@ function render_wiki() "code_revision_mainarea_review_comment_text_" + (i + 1) , "code_revision_mainarea_review_comment_" + (i + 1), "", - "/" + "/", + false ); ", - "/" + "/", + false ); prettyPrint (); diff --git a/codepot/src/codepot/views/issue_show.php b/codepot/src/codepot/views/issue_show.php index af8f2ac3..ec0fcca7 100644 --- a/codepot/src/codepot/views/issue_show.php +++ b/codepot/src/codepot/views/issue_show.php @@ -1117,7 +1117,8 @@ function render_wiki() "issue_show_description_pre", "issue_show_description", "", - "" + "", + false ); diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index 7b7cbde6..b059b405 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -32,7 +32,8 @@ function render_wiki() "project_home_result_wiki_text", "project_home_result_wiki", "/wiki/show/id?>/", - "/wiki/attachment0/id?>/" + "/wiki/attachment0/id?>/", + false ); prettyPrint (); diff --git a/codepot/src/codepot/views/site_home.php b/codepot/src/codepot/views/site_home.php index 1357bf55..c30a2d8e 100644 --- a/codepot/src/codepot/views/site_home.php +++ b/codepot/src/codepot/views/site_home.php @@ -31,7 +31,8 @@ function render_wiki() "site_home_result_wiki_text", "site_home_result_wiki", "/site/wiki/", - "/site/image/" + "/site/image/", + false ); prettyPrint (); diff --git a/codepot/src/codepot/views/site_show.php b/codepot/src/codepot/views/site_show.php index fc50bbab..9999e52a 100644 --- a/codepot/src/codepot/views/site_show.php +++ b/codepot/src/codepot/views/site_show.php @@ -28,7 +28,8 @@ function render_wiki() "site_show_result_wiki_text", "site_show_result_wiki", "/site/wiki/", - "/site/image/" + "/site/image/", + false ); prettyPrint (); diff --git a/codepot/src/codepot/views/wiki_edit.php b/codepot/src/codepot/views/wiki_edit.php index e02bf549..0e261e0d 100644 --- a/codepot/src/codepot/views/wiki_edit.php +++ b/codepot/src/codepot/views/wiki_edit.php @@ -82,8 +82,10 @@ function preview_text (input_text) previewing_text = false; $("#wiki_edit_text_preview").empty(); $("#wiki_edit_text_area").show(); - $("#wiki_edit_text_show").hide(); + $("#wiki_edit_text_preview").hide(); $("#wiki_edit_preview_button").button("option", "label", "lang->line('Preview'); ?>"); + $("#wiki_edit_save_button").button("enable"); + $("#wiki_edit_exit_button").button("enable"); } else { @@ -92,7 +94,9 @@ function preview_text (input_text) $("#wiki_edit_text_preview").show(); $("#wiki_edit_text_area").hide(); - $("#wiki_edit_preview_button").button("option", "label", "lang->line('Edit'); ?>"); + $("#wiki_edit_preview_button").button("option", "label", "lang->line('Back'); ?>"); + $("#wiki_edit_save_button").button("disable"); + $("#wiki_edit_exit_button").button("disable"); if ($('#wiki_edit_doctype').val() == 'M') { @@ -403,11 +407,12 @@ $(function () { var wiki_new_text = $('#wiki_edit_text_area').val(); if (wiki_original_text != wiki_new_text) { - return 'Do you want to discard changes?'; + return 'lang->line('MSG_DISCARD_CHANGES?'); ?>'; } // return null; // this line caused firefox to show the default message. }); + $('#wiki_edit_text_preview').hide(); $(window).resize(resize_text_editor); resize_text_editor (); }); @@ -502,7 +507,7 @@ $this->load->view (
-
+
diff --git a/codepot/src/codepot/views/wiki_editx.php b/codepot/src/codepot/views/wiki_editx.php index 24aa39cb..eac45776 100644 --- a/codepot/src/codepot/views/wiki_editx.php +++ b/codepot/src/codepot/views/wiki_editx.php @@ -397,7 +397,7 @@ $(function () { var ed = wiki_text_editor.serialize(); if (wiki_original_text != ed.wiki_edit_text_editor.value) { - return 'Do you want to discard changes?'; + return 'lang->line('MSG_DISCARD_CHANGES?'); ?>'; } // return null; // this line caused firefox to show the default message. }); diff --git a/codepot/src/codepot/views/wiki_show.php b/codepot/src/codepot/views/wiki_show.php index f00149b9..c04839bd 100644 --- a/codepot/src/codepot/views/wiki_show.php +++ b/codepot/src/codepot/views/wiki_show.php @@ -81,14 +81,16 @@ function render_wiki() "wiki_show_wiki_text", "wiki_show_wiki", "/wiki/show/id?>/", - "/wiki/attachment/id?>//" + "/wiki/attachment/id?>//", + false ); creole_render_wiki ( "wiki_show_wiki_text", "wiki_show_wiki", "/wiki/show/id?>/", - "/wiki/attachment/id?>//" + "/wiki/attachment/id?>//", + false ); diff --git a/codepot/src/js/creole.js b/codepot/src/js/creole.js index 92b61ca2..f5239216 100644 --- a/codepot/src/js/creole.js +++ b/codepot/src/js/creole.js @@ -558,7 +558,7 @@ Parse.Simple.Creole.prototype = new Parse.Simple.Base(); 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) { @@ -588,7 +588,7 @@ function creole_render_wiki_with_input_text (input_text, outputid, linkbase, img 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); return creole_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw); diff --git a/codepot/src/js/showdown.js b/codepot/src/js/showdown.js index 0fe20047..4ef154dc 100644 --- a/codepot/src/js/showdown.js +++ b/codepot/src/js/showdown.js @@ -2510,7 +2510,7 @@ if (typeof module !== 'undefined' && module.exports) { //# 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 ({ omitExtraWLInCodeBlocks: false, @@ -2542,8 +2542,8 @@ function showdown_render_wiki_with_input_text (input_text, outputid, linkbase, i 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); - return showdown_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw); + var input = document.getElementById(inputid); + return showdown_render_wiki_with_input_text (input.innerHTML, outputid, linkbase, imgbase, raw); }