📄 edit.html.tmpl
字号:
#------------------------------------------------------------------------# Compiled template generated by the Template Toolkit version 2.20#------------------------------------------------------------------------Template::Document->new({ METADATA => { 'modtime' => '1205829200', 'name' => 'attachment/edit.html.tmpl', }, BLOCK => sub { my $context = shift || die "template sub called without context\n"; my $stash = $context->stash; my $output = ''; my $_tt_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 28 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('title', do { my $output = ''; $output .= "\n Attachment "; #line 27 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['attachment', 0, 'id', 0]); $output .= " Details for "; #line 27 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['terms', 0, 'Bug', 0]); $output .= " "; #line 27 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['attachment', 0, 'bug_id', 0]); $output; }); #line 32 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('header', do { my $output = ''; $output .= "\n Attachment "; #line 30 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['attachment', 0, 'id', 0]); $output .= " Details for\n "; #line 0 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('none') || $context->throw($context->error); # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('bug_link', [ $stash->get(['attachment', 0, 'bug_id', 0]) ]) || $context->throw($context->error); $output .= ($stash->get(['terms', 0, 'Bug', 0]) . " " . $stash->get(['attachment', 0, 'bug_id', 0])); &$_tt_filter($output); }; &$_tt_filter($output); }; $output; }); #line 33 "template\en\default\attachment\edit.html.tmpl" # CAPTURE $stash->set('subheader', do { my $output = ''; #line 33 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get('bugsummary'); &$_tt_filter($output); }; $output; }); $output .= "\n"; #line 35 "template\en\default\attachment\edit.html.tmpl" $output .= $context->process('global/header.html.tmpl', { 'title' => $stash->get('title'), 'header' => $stash->get('header'), 'subheader' => $stash->get('subheader') }); $output .= "\n\n<script type=\"text/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 58 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('js') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'contenttype', 0]); &$_tt_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\\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 103 "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 99 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['attachment', 0, 'id', 0]); $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 124 "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 130 "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 144 "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 150 "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) && (small.style.display == 'none') )\n {\n small.parentNode.removeChild(small);\n }\n if ( (big) && (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 197 "template\en\default\attachment\edit.html.tmpl" $output .= $stash->get(['attachment', 0, 'id', 0]); $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><label for=\"description\">Description</label>:</b><br>"; #line 207 "template\en\default\attachment\edit.html.tmpl" $output .= $context->include('global/textarea.html.tmpl', { 'id' => 'description', 'name' => 'description', 'minrows' => 3, 'cols' => 25, 'wrap' => 'soft', 'defaultcontent' => $stash->get(['attachment', 0, 'description', 0]) }); $output .= "<br>\n"; #line 240 "template\en\default\attachment\edit.html.tmpl" if ($stash->get(['attachment', 0, 'isurl', 0])) { $output .= "\n <input type=\"hidden\" name=\"filename\"\n value=\""; #line 218 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'filename', 0]); &$_tt_filter($output); }; $output .= "\">\n <input type=\"hidden\" name=\"contenttypeentry\"\n value=\""; #line 220 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'contenttype', 0]); &$_tt_filter($output); }; $output .= "\">"; } else { $output .= "\n <b><label for=\"filename\">Filename</label>:</b><br>\n <input type=\"text\" size=\"20\" id=\"filename\" name=\"filename\"\n value=\""; #line 224 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'filename', 0]); &$_tt_filter($output); }; $output .= "\"><br>\n <b>Size:</b>"; #line 230 "template\en\default\attachment\edit.html.tmpl" if ($stash->get(['attachment', 0, 'datasize', 0])) { $output .= "\n "; #line 227 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('unitconvert') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'datasize', 0]); &$_tt_filter($output); }; } else { $output .= "\n <em>deleted</em>"; } $output .= "<br>\n\n <b><label for=\"contenttypeentry\">MIME Type</label>:</b><br>\n <input type=\"text\" size=\"20\"\n id=\"contenttypeentry\" name=\"contenttypeentry\"\n value=\""; #line 235 "template\en\default\attachment\edit.html.tmpl" # FILTER $output .= do { my $output = ''; my $_tt_filter = $context->filter('html') || $context->throw($context->error); $output .= $stash->get(['attachment', 0, 'contenttype', 0]); &$_tt_filter($output); }; $output .= "\"><br>\n\n <input type=\"checkbox\" id=\"ispatch\" name=\"ispatch\" value=\"1\""; #line 238 "template\en\default\attachment\edit.html.tmpl" if ($stash->get(['attachment', 0, 'ispatch', 0])) { $output .= 'checked="checked"'; } $output .= ">\n <label for=\"ispatch\">patch</label>"; } $output .= "\n <input type=\"checkbox\" id=\"isobsolete\" name=\"isobsolete\" value=\"1\"";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -