⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form.html.tmpl

📁 bugzilla的安装文件
💻 TMPL
📖 第 1 页 / 共 4 页
字号:
#------------------------------------------------------------------------# Compiled template generated by the Template Toolkit version 2.13#------------------------------------------------------------------------Template::Document->new({    METADATA => {        'modtime' => '1102724902',        'name' => 'search/form.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 25 "template\en\default\search\form.html.tmpl"    $output .=  $context->process('global/variables.none.tmpl');    $output .=  "\n\n  ";    $output .=  "\n\n<script language=\"JavaScript\" type=\"text/javascript\"> <!--\n\nvar first_load = true;         ";    $output .=  "\nvar last_sel = new Array();    ";    $output .=  "\n\nvar cpts = new Array();\nvar vers = new Array();";    #line 41 "template\en\default\search\form.html.tmpl"    if ($stash->get(['Param', [ 'usetargetmilestone' ]])) {    $output .=  "\nvar tms = new Array();";    }        $output .=  "\n\n";    $output .=  "\n";    #line 47 "template\en\default\search\form.html.tmpl"    $stash->set('n', 0);        #line 60 "template\en\default\search\form.html.tmpl"        # FOREACH     do {        my ($value, $error, $oldloop);        my $list = $stash->get('product');                unless (UNIVERSAL::isa($list, 'Template::Iterator')) {            $list = Template::Config->iterator($list)                || die $Template::Config::ERROR, "\n";         }            ($value, $error) = $list->get_first();        eval { $oldloop = $stash->get('loop') };        $stash->set('loop', $list);        eval {    LOOP:   while (! $error) {                $stash->{'p'} = $value;    $output .=  "\n  cpts[";    #line 48 "template\en\default\search\form.html.tmpl"    $output .=  $stash->get('n');    $output .=  "] = [";    #line 50 "template\en\default\search\form.html.tmpl"        # FOREACH     do {        my ($value, $error, $oldloop);        my $list = $stash->get(['p', 0, 'components', 0]);                unless (UNIVERSAL::isa($list, 'Template::Iterator')) {            $list = Template::Config->iterator($list)                || die $Template::Config::ERROR, "\n";         }            ($value, $error) = $list->get_first();        eval { $oldloop = $stash->get('loop') };        $stash->set('loop', $list);        eval {    LOOP:   while (! $error) {                $stash->{'item'} = $value;    $output .=  "'";    #line 50 "template\en\default\search\form.html.tmpl"        # FILTER    $output .=  do {        my $output = '';        my $filter = $context->filter('js')                  || $context->throw($context->error);        $output .=  $stash->get('item');                &$filter($output);    };        $output .=  "'";    #line 50 "template\en\default\search\form.html.tmpl"    if (!($stash->get(['loop', 0, 'last', 0]))) {    $output .=  ', ';    }    ;                ($value, $error) = $list->get_next();            }        };        $stash->set('loop', $oldloop);        die $@ if $@;        $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;        die $error if $error;    };        $output .=  " ];\n  vers[";    #line 51 "template\en\default\search\form.html.tmpl"    $output .=  $stash->get('n');    $output .=  "] = [";    #line 53 "template\en\default\search\form.html.tmpl"        # FOREACH     do {        my ($value, $error, $oldloop);        my $list = $stash->get(['p', 0, 'versions', 0]);                unless (UNIVERSAL::isa($list, 'Template::Iterator')) {            $list = Template::Config->iterator($list)                || die $Template::Config::ERROR, "\n";         }            ($value, $error) = $list->get_first();        eval { $oldloop = $stash->get('loop') };        $stash->set('loop', $list);        eval {    LOOP:   while (! $error) {                $stash->{'item'} = $value;    $output .=  "'";    #line 53 "template\en\default\search\form.html.tmpl"        # FILTER    $output .=  do {        my $output = '';        my $filter = $context->filter('js')                  || $context->throw($context->error);        $output .=  $stash->get('item');                &$filter($output);    };        $output .=  "'";    #line 53 "template\en\default\search\form.html.tmpl"    if (!($stash->get(['loop', 0, 'last', 0]))) {    $output .=  ', ';    }    ;                ($value, $error) = $list->get_next();            }        };        $stash->set('loop', $oldloop);        die $@ if $@;        $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;        die $error if $error;    };        $output .=  " ];";    #line 60 "template\en\default\search\form.html.tmpl"    if ($stash->get(['Param', [ 'usetargetmilestone' ]])) {    $output .=  "\n  tms[";    #line 56 "template\en\default\search\form.html.tmpl"    $output .=  $stash->get('n');    $output .=  "]  = [";    #line 58 "template\en\default\search\form.html.tmpl"        # FOREACH     do {        my ($value, $error, $oldloop);        my $list = $stash->get(['p', 0, 'milestones', 0]);                unless (UNIVERSAL::isa($list, 'Template::Iterator')) {            $list = Template::Config->iterator($list)                || die $Template::Config::ERROR, "\n";         }            ($value, $error) = $list->get_first();        eval { $oldloop = $stash->get('loop') };        $stash->set('loop', $list);        eval {    LOOP:   while (! $error) {                $stash->{'item'} = $value;    $output .=  "'";    #line 58 "template\en\default\search\form.html.tmpl"        # FILTER    $output .=  do {        my $output = '';        my $filter = $context->filter('js')                  || $context->throw($context->error);        $output .=  $stash->get('item');                &$filter($output);    };        $output .=  "'";    #line 58 "template\en\default\search\form.html.tmpl"    if (!($stash->get(['loop', 0, 'last', 0]))) {    $output .=  ', ';    }    ;                ($value, $error) = $list->get_next();            }        };        $stash->set('loop', $oldloop);        die $@ if $@;        $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;        die $error if $error;    };        $output .=  " ];";    }        #line 60 "template\en\default\search\form.html.tmpl"    $stash->set('n', $stash->get('n') + 1);    ;                ($value, $error) = $list->get_next();            }        };        $stash->set('loop', $oldloop);        die $@ if $@;        $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;        die $error if $error;    };        $output .=  "\n\n";    $output .=  "\n\nfunction updateSelect(array, sel, target, merging) {\n\n    var i, item;\n\n    ";    $output .=  "\n    if (array.length < 1) {\n        target.options.length = 0;\n        return false;\n    }\n\n    if (merging) {\n        ";    $output .=  "\n        ";    $output .=  "\n        item = merge_arrays(array[sel[0]], target.options, 1);\n\n        ";    $output .=  "\n        for (i = 1 ; i < sel.length ; i++) {\n            item = merge_arrays(array[sel[i]], item, 0);\n        }\n    } else if ( sel.length > 1 ) {\n        ";    $output .=  "\n        item = merge_arrays(array[sel[0]],array[sel[1]], 0);\n\n        ";    $output .=  "\n        for (i = 2; i < sel.length; i++) {\n            item = merge_arrays(item, array[sel[i]], 0);\n        }\n    } else { ";    $output .=  "\n        item = array[sel[0]];\n    }\n\n    ";    $output .=  "\n    target.options.length = 0;\n\n    ";    $output .=  "\n    for (i = 0; i < item.length; i++) {\n        target.options[i] = new Option(item[i], item[i]);\n    }\n    return true;\n}\n\n";    $output .=  "\nfunction fake_diff_array(a, b) {\n    var newsel = new Array();\n    var found = false;\n\n    ";    $output .=  "\n    for (var ia in a) {\n        for (var ib in b) {\n            if (a[ia] == b[ib]) {\n                found = true;\n            }\n        }\n        if (!found) {\n            newsel[newsel.length] = a[ia];\n        }\n        found = false;\n    }\n    return newsel;\n}\n\n";    $output .=  "\nfunction merge_arrays(a, b, b_is_select) {\n    var pos_a = 0;\n    var pos_b = 0;\n    var ret = new Array();\n    var bitem, aitem;\n\n    ";    $output .=  "\n    while ((pos_a < a.length) && (pos_b < b.length)) {\n        if (b_is_select) {\n            bitem = b[pos_b].value;\n        } else {\n            bitem = b[pos_b];\n        }\n        aitem = a[pos_a];\n\n        ";    $output .=  "\n        if (aitem.toLowerCase() < bitem.toLowerCase()) {\n            ret[ret.length] = aitem;\n            pos_a++;\n        } else {\n            ";    $output .=  "\n            if (aitem.toLowerCase() > bitem.toLowerCase()) {\n                ret[ret.length] = bitem;\n                pos_b++;\n            } else {\n                ";    $output .=  "\n                ret[ret.length] = aitem;\n                pos_a++;\n                pos_b++;\n            }\n        }\n    }\n\n    ";    $output .=  "\n    if (pos_a < a.length) {\n        for (; pos_a < a.length ; pos_a++) {\n            ret[ret.length] = a[pos_a];\n        }\n    }\n\n    if (pos_b < b.length) {\n        for (; pos_b < b.length; pos_b++) {\n            if (b_is_select) {\n                bitem = b[pos_b].value;\n            } else {\n                bitem = b[pos_b];\n            }\n            ret[ret.length] = bitem;\n        }\n    }\n    return ret;\n}\n\n";    $output .=  "\nfunction get_selection(control, findall, want_values) {\n    var ret = new Array();\n\n    if ((!findall) && (control.selectedIndex == -1)) {\n        return ret;\n    }\n\n    for (var i=0; i<control.length; i++) {\n        if (findall || control.options[i].selected) {\n            ret[ret.length] = want_values ? control.options[i].value : i;\n        }\n    }\n    return ret;\n}\n\n";    $output .=  "\nfunction restoreSelection(control, selnames) {\n    ";    $output .=  "\n    for (var j=0; j < selnames.length; j++) {\n        for (var i=0; i < control.options.length; i++) {\n            if (control.options[i].value == selnames[j]) {\n                control.options[i].selected = true;\n            }\n        }\n    }\n}\n\n";    $output .=  "\nfunction selectProduct(f) {\n    ";    $output .=  "\n    if ((!f) || (!f.product)) {\n        return;\n    }\n\n    ";    $output .=  "\n    if ((first_load) && (f.product.selectedIndex == -1)) {\n        first_load = false;\n        return;\n    }\n\n    ";    $output .=  "\n    first_load = false;\n\n    ";    $output .=  "\n    var merging = false;\n    var sel = Array();\n\n    ";    $output .=  "\n    var findall = f.product.selectedIndex == -1;\n    sel = get_selection(f.product, findall, false);\n    if (!findall) {\n        ";    $output .=  "\n        var tmp = sel;\n\n        ";    $output .=  "\n        if ((last_sel.length > 0) && (last_sel.length < sel.length)) {\n            sel = fake_diff_array(sel, last_sel);\n            merging = true;\n        }\n        last_sel = tmp;\n    }\n    ";    $output .=  "\n    var saved_cpts = get_selection(f.component, false, true);\n    var saved_vers = get_selection(f.version, false, true);";    #line 314 "template\en\default\search\form.html.tmpl"    if ($stash->get(['Param', [ 'usetargetmilestone' ]])) {    $output .=  "\n    var saved_tms = get_selection(f.target_milestone, false, true);";    }        $output .=  "\n\n    ";    $output .=  "\n    updateSelect(cpts, sel, f.component, merging);\n    restoreSelection(f.component, saved_cpts);\n    updateSelect(vers, sel, f.version, merging);\n    restoreSelection(f.version, saved_vers);";    #line 326 "template\en\default\search\form.html.tmpl"    if ($stash->get(['Param', [ 'usetargetmilestone' ]])) {    $output .=  "\n    updateSelect(tms, sel, f.target_milestone, merging);\n    restoreSelection(f.target_milestone, saved_tms);";    }        $output .=  "\n}\n\n// -->\n</script>\n";    #line 333 "template\en\default\search\form.html.tmpl"    $stash->set('query_variants', [ { 'value' => 'allwordssubstr', 'description' => 'contains all of the words/strings'  }, { 'value' => 'anywordssubstr', 'description' => 'contains any of the words/strings'  }, { 'value' => 'substring', 'description' => 'contains the string'  }, { 'value' => 'casesubstring', 'description' => 'contains the string (exact case)'  }, { 'value' => 'allwords', 'description' => 'contains all of the words'  }, { 'value' => 'anywords', 'description' => 'contains any of the words'  }, { 'value' => 'regexp', 'description' => 'matches the regexp'  }, { 'value' => 'notregexp', 'description' => 'doesn\'t match the regexp'  } ]);        $output .=  "\n";    #line 344 "template\en\default\search\form.html.tmpl"    $output .=  $context->process('global/field-descs.none.tmpl');    $output .=  "\n\n";    #line 346 "template\en\default\search\form.html.tmpl"    $stash->set('thisformat', $stash->get('query_format') ne '' ? $stash->get('query_format') : $stash->get('format'));        $output .=  "\n<input type=\"hidden\" name=\"query_format\" value=\"";    #line 347 "template\en\default\search\form.html.tmpl"        # FILTER    $output .=  do {        my $output = '';        my $filter = $context->filter('html')                  || $context->throw($context->error);    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -