diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/BMO/web/producticons/devedition.png | bin | 0 -> 12491 bytes | |||
-rw-r--r-- | extensions/GuidedBugEntry/Extension.pm | 2 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl | 82 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/web/js/guided.js | 55 | ||||
-rw-r--r-- | extensions/GuidedBugEntry/web/style/guided.css | 6 |
5 files changed, 93 insertions, 52 deletions
diff --git a/extensions/BMO/web/producticons/devedition.png b/extensions/BMO/web/producticons/devedition.png Binary files differnew file mode 100644 index 000000000..9c0ff72b8 --- /dev/null +++ b/extensions/BMO/web/producticons/devedition.png diff --git a/extensions/GuidedBugEntry/Extension.pm b/extensions/GuidedBugEntry/Extension.pm index 19ac7385e..e36d0a2e4 100644 --- a/extensions/GuidedBugEntry/Extension.pm +++ b/extensions/GuidedBugEntry/Extension.pm @@ -97,6 +97,7 @@ sub _init_vars { $vars->{'platform'} = detect_platform(); $vars->{'op_sys'} = detect_op_sys(); + $vars->{'webdev'} = Bugzilla->cgi->param('webdev'); } sub page_before_template { @@ -117,6 +118,7 @@ sub page_before_template { } } $vars->{'create_bug_formats'} = \%bug_formats; + $vars->{'webdev'} = Bugzilla->cgi->param('webdev'); } __PACKAGE__->NAME; diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl index 9a1c09e6f..943370719 100644 --- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl +++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl @@ -38,6 +38,7 @@ YAHOO.util.Dom.removeClass('loading', 'hidden'); </script> <div id="steps"> +[% INCLUDE webdev_step %] [% INCLUDE product_step %] [% INCLUDE otherProducts_step %] [% INCLUDE dupes_step %] @@ -52,7 +53,7 @@ YAHOO.util.Dom.removeClass('loading', 'hidden'); <script type="text/javascript"> YAHOO.util.Dom.addClass('loading', 'hidden'); -guided.init(); +guided.init({ webdev: [% webdev ? "true" : "false" %] }); guided.detectedPlatform = '[% platform FILTER js %]'; guided.detectedOpSys = '[% op_sys FILTER js %]'; guided.currentUser = '[% user.login FILTER js %]'; @@ -81,20 +82,52 @@ dupes.setLabels( [% BLOCK page_title %] <div id="page_title"> <h2>Enter A [% terms.Bug %]</h2> - <h3>Step [% step_number FILTER html %] of 3</h3> </div> [% END %] [%############################################################################%] +[%# webdev step #%] +[%############################################################################%] + +[% BLOCK webdev_step %] +<div id="webdev_step" class="step hidden"> + +[% INCLUDE page_title %] + +<p>Are you reporting a [% terms.bug %] with:</p> + +<ul class="product-list"> +[% WRAPPER product_block + icon="component.png" + onclick="product.select('Core', 'Untriaged')" %] +HTML, CSS, JS, SVG, or some other web technology or combination of +web technologies? +[% END %] + +[% WRAPPER product_block + icon="devedition.png" + onclick="product.select('Firefox', 'Developer Tools')" %] +Firefox's developer tools +[% END %] + +[% WRAPPER product_block + icon="firefox.png" + onclick="product.select('Firefox', 'Untriaged')" %] +Firefox's user interface (for example, an issue with bookmarks, +tabbed browsing or the location bar) +[% END %] +</ul> +</div> +[% END %] + +[%############################################################################%] [%# product step #%] [%############################################################################%] [% BLOCK product_step %] <div id="product_step" class="step hidden"> -[% INCLUDE page_title - step_number = "1" -%] +[% INCLUDE page_title %] [% INCLUDE exits show = "all" @@ -160,9 +193,7 @@ Other Mozilla products which aren't listed here [% BLOCK otherProducts_step %] <div id="otherProducts_step" class="step hidden"> -[% INCLUDE page_title - step_number = "1" -%] +[% INCLUDE page_title %] [% INCLUDE exits show = "all" @@ -238,7 +269,8 @@ Other Mozilla products which aren't listed here </div> </td> <td class="exit_text_last"> - <a href="enter_bug.cgi?format=guided&product=Core">Report an issue with Firefox on a site that I've developed</a><br> + + <a onclick="product.select('Core', 'Untriaged')" href="javascript:void(0)">Report an issue with Firefox on a site that I've developed</a><br> <a href="http://input.mozilla.org/feedback/#sad">Report an issue with a web site that I use</a><br> </td> </tr> @@ -249,24 +281,6 @@ Other Mozilla products which aren't listed here </h3> [% END %] -[% BLOCK exit_block %] - <tr> - <td> - <div class="exit_img"> - <a href="[% href FILTER none %]" - ><img src="extensions/GuidedBugEntry/web/images/[% icon FILTER uri %]" width="32" height="32" - ></a> - </div> - </td> - <td width="100%"> - <h2> - <a href="[% href FILTER none %]">[% name FILTER html %]</a> - </h2> - [% desc FILTER html %] - </td> - </tr> -[% END %] - [%############################################################################%] [%# duplicates step #%] [%############################################################################%] @@ -274,13 +288,11 @@ Other Mozilla products which aren't listed here [% BLOCK dupes_step %] <div id="dupes_step" class="step hidden"> -[% INCLUDE page_title - step_number = "2" -%] +[% INCLUDE page_title %] <p> Product: <b><span id="dupes_product_name">?</span></b>: -(<a href="javascript:void(0)" onclick="guided.setStep('product')">Change</a>) +(<a href="javascript:void(0)" onclick="guided.setStep('default')">Change</a>) </p> <table border="0" cellpadding="5" cellspacing="0" id="product_support" class="hidden"> @@ -329,9 +341,7 @@ Product: <b><span id="dupes_product_name">?</span></b>: [% BLOCK bugForm_step %] <div id="bugForm_step" class="step hidden"> -[% INCLUDE page_title - step_number = "3" -%] +[% INCLUDE page_title %] <form method="post" action="post_bug.cgi" enctype="multipart/form-data" onsubmit="return bugForm.validate()"> <input type="hidden" name="token" value="[% token FILTER html %]"> @@ -376,7 +386,7 @@ explain how to write effective [% terms.bug %] reports.</li> <td class="label">Product:</td> <td id="productTD"> <span id="product_label"></span> - (<a href="javascript:void(0)" onclick="guided.setStep('product')">Change</a>) + (<a href="javascript:void(0)" onclick="guided.setStep('default')">Change</a>) </td> <td id="versionTD" class="hidden"> <span class="label">Version: @@ -477,7 +487,7 @@ explain how to write effective [% terms.bug %] reports.</li> </div> </td> </tr> -<tr> +<tr id="data_description_tr"> <td class="label">File Description:</td> <td colspan="2"><input type="text" name="description" id="data_description" class="textInput" disabled></td> <td> </td> diff --git a/extensions/GuidedBugEntry/web/js/guided.js b/extensions/GuidedBugEntry/web/js/guided.js index 6a4419ddf..d7fe2c75b 100644 --- a/extensions/GuidedBugEntry/web/js/guided.js +++ b/extensions/GuidedBugEntry/web/js/guided.js @@ -13,6 +13,7 @@ var History = YAHOO.util.History; var guided = { _currentStep: '', + _defaultStep: 'product', detectedPlatform: '', detectedOpSys: '', currentUser: '', @@ -23,6 +24,9 @@ var guided = { // initialise new step this.updateStep = true; switch(newStep) { + case 'webdev': + webdev.onShow(); + break; case 'product': product.onShow(); break; @@ -36,7 +40,7 @@ var guided = { bugForm.onShow(); break; default: - guided.setStep('product'); + guided.setStep(this._defaultStep); return; } @@ -60,11 +64,14 @@ var guided = { } }, - init: function() { + init: function(conf) { // init history manager + if (conf.webdev) { + this._defaultStep = 'webdev'; + this.webdev = true; + } try { - History.register('h', History.getBookmarkedState('h') || 'product', - this._onStateChange); + History.register('h', History.getBookmarkedState('h') || this._defaultStep, this._onStateChange); History.initialize("yui-history-field", "yui-history-iframe"); History.onReady(function () { guided._onStateChange(History.getCurrentState('h'), true); @@ -74,6 +81,7 @@ var guided = { } // init steps + webdev.onInit(); product.onInit(); dupes.onInit(); bugForm.onInit(); @@ -95,6 +103,16 @@ var guided = { } }; +// webdev step + +var webdev = { + details: false, + + onInit: function () { }, + + onShow: function () { } +}; + // product step var product = { @@ -109,8 +127,22 @@ var product = { Dom.removeClass('advanced', 'hidden'); }, - select: function(productName) { + select: function(productName, componentName) { + var prod = products[productName]; + // called when a product is selected + if (componentName) { + this.setPreselectedComponent(componentName); + if (prod && prod.defaultComponent) { + prod.originalDefaultComponent = prod.originalDefaultComponent || prod.defaultComponent; + prod.defaultComponent = componentName; + } + } + else { + if (prod && prod.defaultComponent && prod.originalDefaultComponent) { + prod.defaultComponent = prod.originalDefaultComponent; + } + } this.setName(productName); dupes.reset(); guided.setStep('dupes'); @@ -184,7 +216,7 @@ var product = { } // show/hide component selection row - if (products[productName] && products[productName].noComponentSelection) { + if (products[productName] && products[productName].noComponentSelection || guided.webdev) { if (!Dom.hasClass('componentTR', 'hidden')) { Dom.addClass('componentTR', 'hidden'); } @@ -468,7 +500,7 @@ var dupes = { // a search has happened Dom.addClass('advanced', 'hidden'); Dom.addClass('dupes_continue_button_top', 'hidden'); - var prod = product.getName(); + var prod = product.getName(); if (products[prod] && products[prod].l10n) { Dom.removeClass('l10n_message', 'hidden'); Dom.get('l10n_product').textContent = product.getName(); @@ -682,13 +714,10 @@ var bugForm = { // build components var elComponent = Dom.get('component'); - if (products[productName] && products[productName].noComponentSelection) { - + if (products[productName] && products[productName].noComponentSelection || guided.webdev) { elComponent.value = products[productName].defaultComponent; bugForm._mandatoryFields = [ 'short_desc', 'version_select' ]; - } else { - bugForm._mandatoryFields = [ 'short_desc', 'component_select', 'version_select' ]; // check for the default component @@ -836,10 +865,14 @@ var bugForm = { elReset.disabled = false; elDescription.value = filename; elDescription.disabled = false; + Dom.removeClass('reset_data', 'hidden'); + Dom.removeClass('data_description_tr', 'hidden'); } else { elReset.disabled = true; elDescription.value = ''; elDescription.disabled = true; + Dom.addClass('reset_data', 'hidden'); + Dom.addClass('data_description_tr', 'hidden'); } }, diff --git a/extensions/GuidedBugEntry/web/style/guided.css b/extensions/GuidedBugEntry/web/style/guided.css index eca500c69..1676880ce 100644 --- a/extensions/GuidedBugEntry/web/style/guided.css +++ b/extensions/GuidedBugEntry/web/style/guided.css @@ -207,14 +207,10 @@ ul.product-list > li > .product-item { padding: 5px; } -#bugForm tr:nth-child(even) td, #bugForm tr:nth-child(even) th { +#bugForm tr { background: #e0e0e0; } -#bugForm tr.odd td { - background: inherit; -} - #bugForm .label { text-align: left; font-weight: bold; |