📄 edit.html.tmpl
字号:
#------------------------------------------------------------------------# Compiled template generated by the Template Toolkit version 2.13#------------------------------------------------------------------------Template::Document->new({ METADATA => { 'modtime' => '1095975946', 'name' => 'attachment/edit.html.tmpl', }, BLOCK => sub { my $context = shift || die "template sub called without context\n"; my $stash = $context->stash; my $output = ''; my $error; eval { BLOCK: { $output .= "\n"; $output .= "\n"; #line 23 "template\en\default\attachment\edit.html.tmpl" $output .= $context->process('global/variables.none.tmpl'); $output .= "\n\n"; #line 25 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('title', do { my $output = ''; $output .= "Edit Attachment #"; #line 25 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get('attachid'); $output .= " for "; #line 25 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['terms', 0, 'Bug', 0]); $output .= " #"; #line 25 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get('bugid'); $output; }); #line 26 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('h1', do { my $output = ''; $output .= "Edit Attachment #"; #line 25 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get('attachid'); $output .= " for\n "; #line 0 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['GetBugLink', [ $stash->get('bugid'), ($stash->get(['terms', 0, 'Bug', 0]) . " " . $stash->get('bugid')) ]]); $output; }); #line 26 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('h2', do { my $output = ''; #line 26 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get('bugsummary'); &$filter($output); }; $output; }); $output .= "\n"; #line 29 "template\en\default\attachment\edit.html.tmpl" $output .= $context->process('global/header.html.tmpl', { 'title' => $stash->get('title'), 'h1' => $stash->get('h1'), 'h2' => $stash->get('h2'), 'style' => ' table.attachment_info th { text-align: right; vertical-align: top; } table.attachment_info td { text-align: left; vertical-align: top; } #noview { text-align: left; vertical-align: middle; } table#flags th, table#flags td { font-size: small; vertical-align: baseline; text-align: left; } ' }); $output .= "\n\n<script type=\"application/x-javascript\" language=\"JavaScript\">\n <!--\n var prev_mode = 'raw';\n var current_mode = 'raw';\n var has_edited = 0;\n var has_viewed_as_diff = 0;\n function editAsComment()\n {\n // Get the content of the document as a string.\n var viewFrame = document.getElementById('viewFrame');\n var aSerializer = new XMLSerializer();\n var contentDocument = viewFrame.contentDocument;\n var theContent = aSerializer.serializeToString(contentDocument);\n\n // If this is a plaintext document, remove cruft that Mozilla adds\n // because it treats it as an HTML document with a big PRE section.\n // http://bugzilla.mozilla.org/show_bug.cgi?id=86012\n var contentType = '"; #line 59 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $filter = $context->filter('js') || $context->throw($context->error); $output .= $stash->get('contenttype'); &$filter($output); }; $output .= "';\n if ( contentType == 'text/plain' )\n {\n theContent = theContent.replace( /^<html><head\\/?><body><pre>/i , \"\" );\n theContent = theContent.replace( /<\\/pre><\\/body><\\/html>\$/i , \"\" );\n theContent = theContent.replace( /</gi , \"<\" );\n theContent = theContent.replace( />/gi , \">\" );\n theContent = theContent.replace( /&/gi , \"&\" );\n }\n\n // Add mail-style quote indicators (>) to the beginning of each line.\n // \".*\\n\" matches lines that end with a newline, while \".+\" matches\n // the rare situation in which the last line of a file does not end\n // with a newline.\n theContent = theContent.replace( /(.*\\n|.+)/g , \">\$1\" );\n\n switchToMode('edit');\n\n // Copy the contents of the diff into the textarea\n var editFrame = document.getElementById('editFrame');\n editFrame.value = theContent;\n editFrame.value += \"\\n\\n\";\n\n has_edited = 1;\n }\n function undoEditAsComment()\n {\n switchToMode(prev_mode);\n }\n function redoEditAsComment()\n {\n switchToMode('edit');\n }"; #line 107 "template\en\default\attachment\edit.html.tmpl" if ($stash->get('patchviewerinstalled')) { $output .= "\n function viewDiff()\n {\n switchToMode('diff');\n\n // If we have not viewed as diff before, set the view diff frame URL\n if (!has_viewed_as_diff) {\n var viewDiffFrame = document.getElementById('viewDiffFrame');\n viewDiffFrame.src =\n 'attachment.cgi?id="; #line 102 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get('attachid'); $output .= "&action=diff&headers=0';\n has_viewed_as_diff = 1;\n }\n }"; } $output .= "\n function viewRaw()\n {\n switchToMode('raw');\n }\n\n function switchToMode(mode)\n {\n if (mode == current_mode) {\n alert('switched to same mode! This should not happen.');\n return;\n }\n\n // Switch out of current mode\n if (current_mode == 'edit') {\n hideElementById('editFrame');\n hideElementById('undoEditButton');\n } else if (current_mode == 'raw') {\n hideElementById('viewFrame');"; #line 130 "template\en\default\attachment\edit.html.tmpl" if ($stash->get('patchviewerinstalled')) { $output .= "\n hideElementById('viewDiffButton');"; } $output .= "\n hideElementById(has_edited ? 'redoEditButton' : 'editButton');\n hideElementById('smallCommentFrame');\n } else if (current_mode == 'diff') {"; #line 138 "template\en\default\attachment\edit.html.tmpl" if ($stash->get('patchviewerinstalled')) { $output .= "\n hideElementById('viewDiffFrame');"; } $output .= "\n hideElementById('viewRawButton');\n hideElementById(has_edited ? 'redoEditButton' : 'editButton');\n hideElementById('smallCommentFrame');\n }\n\n // Switch into new mode\n if (mode == 'edit') {\n showElementById('editFrame');\n showElementById('undoEditButton');\n } else if (mode == 'raw') {\n showElementById('viewFrame');"; #line 154 "template\en\default\attachment\edit.html.tmpl" if ($stash->get('patchviewerinstalled')) { $output .= "\n showElementById('viewDiffButton');"; } $output .= "\n showElementById(has_edited ? 'redoEditButton' : 'editButton');\n showElementById('smallCommentFrame');\n } else if (mode == 'diff') {"; #line 162 "template\en\default\attachment\edit.html.tmpl" if ($stash->get('patchviewerinstalled')) { $output .= "\n showElementById('viewDiffFrame');"; } $output .= "\n showElementById('viewRawButton');\n showElementById(has_edited ? 'redoEditButton' : 'editButton');\n showElementById('smallCommentFrame');\n }\n\n prev_mode = current_mode;\n current_mode = mode;\n }\n\n function hideElementById(id)\n {\n var elm = document.getElementById(id);\n if (elm) {\n elm.style.display = 'none';\n }\n }\n\n function showElementById(id, val)\n {\n var elm = document.getElementById(id);\n if (elm) {\n if (!val) val = 'inline';\n elm.style.display = val;\n }\n }\n\n function normalizeComments()\n {\n // Remove the unused comment field from the document so its contents\n // do not get transmitted back to the server.\n\n var small = document.getElementById('smallCommentFrame');\n var big = document.getElementById('editFrame');\n if ( small.style.display == 'none' )\n {\n small.parentNode.removeChild(small);\n }\n if ( big.style.display == 'none' )\n {\n big.parentNode.removeChild(big);\n }\n }\n //-->\n</script>\n\n<form method=\"post\" action=\"attachment.cgi\" onsubmit=\"normalizeComments();\">\n <input type=\"hidden\" name=\"id\" value=\""; #line 209 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get('attachid'); $output .= "\">\n <input type=\"hidden\" name=\"action\" value=\"update\">\n <input type=\"hidden\" name=\"contenttypemethod\" value=\"manual\">\n\n <table class=\"attachment_info\" width=\"100%\">\n\n <tr>\n <td width=\"25%\">\n <small>\n <b>Description:</b><br>\n <textarea rows=\"3\" cols=\"25\" name=\"description\" wrap=\"soft\">"; #line 219 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get('description'); &$filter($output); }; $output .= "</textarea><br>\n\n <b>Filename:</b><br>\n <input type=\"text\" size=\"20\" name=\"filename\" value=\""; #line 222 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get('filename'); &$filter($output); }; $output .= "\"><br>\n <b>Size: </b>"; #line 223 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $filter = $context->filter('unitconvert') || $context->throw($context->error); $output .= $stash->get('datasize'); &$filter($output); }; $output .= "<br>\n\n <b>MIME Type:</b><br>\n <input type=\"text\" size=\"20\" name=\"contenttypeentry\" value=\""; #line 226 "template\en\default\attachment\edit.html.tmpl"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -