From f0bdce8efc196fc1c74bd82523331c4efc7d5bc0 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 7 Feb 2013 15:39:24 -0500 Subject: Bug 833969 - Implement bug entry template for product Mozilla Developer Network --- .../en/default/bug/create/create-mdn.html.tmpl | 261 +++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl (limited to 'extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl') diff --git a/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl new file mode 100644 index 000000000..c8ea5d0dd --- /dev/null +++ b/extensions/BMO/template/en/default/bug/create/create-mdn.html.tmpl @@ -0,0 +1,261 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% inline_style = BLOCK %] +strong.required:before { + content: "* "; + color: red; +} +#yui-history-iframe { + position: absolute; + top: 0; + left: 0; + width: 1px; + height: 1px; + visibility: hidden; +} +[% END %] +[% inline_javascript = BLOCK %] + var Dom = YAHOO.util.Dom; + var Event = YAHOO.util.Event; + var History = YAHOO.util.History; + var mdn = { + _initial_state: 'initial', + _current_state: 'initial', + _current_type: 'Bug', + _required_fields: { + 'Bug': { + 'bug_actions': 'Please enter some text for "What did you do?"', + 'bug_actual_results': 'Please enter some text for "What happened?"', + 'bug_expected_results': 'Please enter some text for "What should have happened?"', + }, + 'Feature': { + 'feature_problem_solving': 'Please enter some text for "What problems would this solve?"', + 'feature_audience': 'Please enter some text for "Who would use this?"', + 'feature_interface': 'Please enter some text for "What would users see?"', + 'feature_process': 'Please enter some text for "What would users do? What would happen as a result?"', + }, + 'Change': { + 'change_feature': 'Please enter some text for "What feature should be changed? Please provide the URL of the feature if possible"', + 'change_problem_solving': 'Please enter some text for "What problems would this solve?"', + 'change_audience': 'Please enter some text for "Who would use this?"', + 'change_interface': 'Please enter some text for "What would users see?"', + 'change_process': 'Please enter some text for "What would users do? What would happen as a result?"', + } + }, + setState: function(state, request_type, no_set_history) { + if (state == 'detail') { + request_type = request_type || this._getRadioValueByClass('request_type'); + request_type = request_type.toLowerCase(); + if (request_type == 'bug') { + Dom.get('detail_header').innerHTML = '

Bug Report

'; + Dom.get('secure_type').innerHTML = 'report'; + } + if (request_type == 'feature') { + Dom.get('detail_header').innerHTML = '

Feature Request

'; + Dom.get('secure_type').innerHTML = 'request'; + } + if (request_type == 'change') { + Dom.get('detail_header').innerHTML = '

Change Request

'; + Dom.get('secure_type').innerHTML = 'request'; + } + Dom.addClass('detail_' + this._current_type, 'bz_default_hidden'); + Dom.removeClass('detail_' + request_type, 'bz_default_hidden'); + this._current_type = request_type; + } + Dom.addClass(this._current_state + '_form', 'bz_default_hidden'); + Dom.removeClass(state + '_form', 'bz_default_hidden'); + this._current_state = state; + if (History && !no_set_history) { + History.navigate('h', state + + (request_type ? '|' + request_type : '')); + } + return true; + }, + validateAndSubmit: function() { + var request_type = this._getRadioValueByClass('request_type'); + var alert_text = ''; + if (!isFilledOut('short_desc')) alert_text += 'Please enter a "Summary".\n'; + for (require_type in this._required_fields) { + if (require_type == request_type) { + for (field in this._required_fields[require_type]) { + if (!isFilledOut(field)) + alert_text += this._required_fields[require_type][field] + "\n"; + } + } + } + if (alert_text != '') { + alert(alert_text); + return false; + } + var whiteboard = Dom.get('status_whiteboard'); + whiteboard.value = "[specification][type:" + request_type.toLowerCase() + "]"; + return true; + }, + _getRadioValueByClass: function(class_name) { + var elements = Dom.getElementsByClassName(class_name); + for (var i = 0, l = elements.length; i < l; i++) { + if (elements[i].checked) return elements[i].value; + } + }, + init: function() { + var bookmarked_state = History.getBookmarkedState('h'); + this._initial_state = bookmarked_state || 'initial'; + try { + History.register('h', this._initial_state, mdn.onStateChange); + History.initialize('yui-history-field', 'yui-history-iframe'); + History.onReady(function () { + mdn.onStateChange(History.getCurrentState('h'), true); + }); + } + catch(e) { + console.log('error initializing history: ' + e); + History = false; + } + }, + onStateChange: function(state, no_set_history) { + var state_data = state.split('|'); + mdn.setState(state_data[0], state_data[1], no_set_history); + } + }; + Event.on('show_detail', 'click', function() { mdn.setState('detail'); }); +[% END %] + +[% PROCESS global/header.html.tmpl + title = "Mozilla Developer Network Feedback" + style = inline_style + javascript = inline_javascript + yui = [ 'history' ] + javascript_urls = [ 'extensions/BMO/web/js/form_validate.js' ] +%] + + + + +

Mozilla Developer Network Feedback

+ +
+ + + + + + + + + + +
+

+ +
+ +
+ +
+
+ +

+
+ +
+

+ +

+ Summary
+ +

+ +
+

+ What did you do?
+ +

+

+ What happened?
+ +

+

+ What should have happened?
+ +

+
+ +
+

+ What problems would this solve?
+ +

+

+ Who would use this?
+ +

+

+ What would users see?
+ +

+

+ What would users do? What would happen as a result?
+ +

+
+ +
+

+ What feature should be changed? Please provide the URL of the feature if possible.
+ +

+

+ What problems would this solve?
+ +

+

+ Who would use this?
+ +

+

+ What would users see?
+ +

+

+ What would users do? What would happen as a result?
+ +

+
+ +

+ Is there anything else we should know?
+ +

+ +

+ [% sec_group = sec_groups.${product.name} || sec_groups._default %] + + +

+ + +
+
+ + + +[% PROCESS global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b