diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 4e3f0b60..954a8e42 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -93,7 +93,6 @@ var work_in_progress = false; - $(function() { $("#code_revision_history_button").button().click (function() { @@ -102,83 +101,6 @@ $(function() { }); - $('#code_revision_edit_revision_tag_form').dialog ( - { - title: 'lang->line('Tag');?>', - resizable: true, - autoOpen: false, - width: 'auto', - height: 'auto', - modal: true, - buttons: { - - 'lang->line('OK')?>': function () { - if (work_in_progress) return; - - if (!!window.FormData) - { - // FormData is supported - work_in_progress = true; - - var form_data = new FormData(); - - form_data.append ('code_edit_revision_tag', $('#code_revision_edit_revision_tag').val()); - - $('#code_revision_edit_revision_tag_form').dialog('disable'); - $.ajax({ - url: codepot_merge_path('', 'id}/{$revreq}"; ?>'), - type: 'POST', - data: form_data, - mimeType: 'multipart/form-data', - contentType: false, - processData: false, - cache: false, - - success: function (data, textStatus, jqXHR) { - work_in_progress = false; - $('#code_revision_edit_revision_tag_form').dialog('enable'); - $('#code_revision_edit_revision_tag_form').dialog('close'); - if (data == 'ok') - { - // refresh the page to the head revision - $(location).attr ('href', codepot_merge_path('', 'id}/{$hex_headpath}{$revreq}"; ?>')); - } - else - { - show_alert ('
' + codepot_htmlspecialchars(data) + '
', "lang->line('Error')?>"); - } - }, - - error: function (jqXHR, textStatus, errorThrown) { - work_in_progress = false; - $('#code_revision_edit_revision_tag_form').dialog('enable'); - $('#code_revision_edit_revision_tag_form').dialog('close'); - var errmsg = ''; - if (errmsg == '' && errorThrown != null) errmsg = errorThrown; - if (errmsg == '' && textStatus != null) errmsg = textStatus; - if (errmsg == '') errmsg = 'Unknown error'; - show_alert ('Failed - ' + errmsg, "lang->line('Error')?>"); - } - }); - } - else - { - show_alert ('
NOT SUPPORTED
', "lang->line('Error')?>"); - } - }, - 'lang->line('Cancel')?>': function () { - if (work_in_progress) return; - $('#code_revision_edit_revision_tag_form').dialog('close'); - } - }, - - beforeClose: function() { - // if importing is in progress, prevent dialog closing - return !work_in_progress; - } - } - ); - $('#code_revision_edit_revision_message_form').dialog ( { title: 'lang->line('Message');?>', @@ -272,6 +194,83 @@ $(function() { +$('#code_revision_edit_revision_tag_form').dialog ( + { + title: 'lang->line('Tag');?>', + resizable: true, + autoOpen: false, + width: 'auto', + height: 'auto', + modal: true, + buttons: { + + 'lang->line('OK')?>': function () { + if (work_in_progress) return; + + if (!!window.FormData) + { + // FormData is supported + work_in_progress = true; + + var form_data = new FormData(); + + form_data.append ('code_edit_revision_tag', $('#code_revision_edit_revision_tag').val()); + + $('#code_revision_edit_revision_tag_form').dialog('disable'); + $.ajax({ + url: codepot_merge_path('', 'id}/{$revreq}"; ?>'), + type: 'POST', + data: form_data, + mimeType: 'multipart/form-data', + contentType: false, + processData: false, + cache: false, + + success: function (data, textStatus, jqXHR) { + work_in_progress = false; + $('#code_revision_edit_revision_tag_form').dialog('enable'); + $('#code_revision_edit_revision_tag_form').dialog('close'); + if (data == 'ok') + { + // refresh the page to the head revision + $(location).attr ('href', codepot_merge_path('', 'id}/{$hex_headpath}{$revreq}"; ?>')); + } + else + { + show_alert ('
' + codepot_htmlspecialchars(data) + '
', "lang->line('Error')?>"); + } + }, + + error: function (jqXHR, textStatus, errorThrown) { + work_in_progress = false; + $('#code_revision_edit_revision_tag_form').dialog('enable'); + $('#code_revision_edit_revision_tag_form').dialog('close'); + var errmsg = ''; + if (errmsg == '' && errorThrown != null) errmsg = errorThrown; + if (errmsg == '' && textStatus != null) errmsg = textStatus; + if (errmsg == '') errmsg = 'Unknown error'; + show_alert ('Failed - ' + errmsg, "lang->line('Error')?>"); + } + }); + } + else + { + show_alert ('
NOT SUPPORTED
', "lang->line('Error')?>"); + } + }, + 'lang->line('Cancel')?>': function () { + if (work_in_progress) return; + $('#code_revision_edit_revision_tag_form').dialog('close'); + } + }, + + beforeClose: function() { + // if importing is in progress, prevent dialog closing + return !work_in_progress; + } + } + ); + $('#code_revision_new_review_comment_tabs').tabs (); $('#code_revision_new_review_comment_tabs').bind ('tabsshow', function (event, ui) { if (ui.index == 1) preview_new_review_comment ($('#code_revision_new_review_comment').val());