Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/webroot/js/editors.js
diff options
context:
space:
mode:
Diffstat (limited to 'site/app/webroot/js/editors.js')
-rw-r--r--site/app/webroot/js/editors.js45
1 files changed, 23 insertions, 22 deletions
diff --git a/site/app/webroot/js/editors.js b/site/app/webroot/js/editors.js
index d6e1bba..6a00292 100644
--- a/site/app/webroot/js/editors.js
+++ b/site/app/webroot/js/editors.js
@@ -26,7 +26,7 @@ function toggleFilters() {
* editors/review *
*************************************************/
//Array of possible actions
-var actions = ['public', 'sandbox', 'superreview'];
+var actions = ['public', 'sandbox', 'info', 'superreview'];
//Simulate radio button group for action icons
function selectAction(action) {
@@ -36,34 +36,33 @@ function selectAction(action) {
//Select action and deselect other actions
for (var i = 0; i < actions.length; i++) {
if (actions[i] == action) {
- color(actions[i]);
+ changeIcon(actions[i], 'color');
document.getElementById('details-' + actions[i]).style.display = '';
}
else {
- bw(actions[i]);
+ changeIcon(actions[i], 'bw');
document.getElementById('details-' + actions[i]).style.display = 'none';
}
}
+ // when rejecting, pre-select notification box
+ $('#subscribe input').attr('checked', (action=='sandbox'));
+ // no canned responses/app/os for info request
+ if (action=='info')
+ $('#canned,#testing').hide();
+ else
+ $('#canned,#testing').show();
+
$('#subform').show('medium');
}
-//Turn an icon colored
-function color(action) {
+//Turn an icon colored/bw
+function changeIcon(action, colorbw) {
var icon = document.getElementById(action + 'Icon');
var span = document.getElementById(action);
- icon.src = '../../../../img/developers/' + action + '-color.png';
- span.className = 'action_color';
-}
-
-//Turn an icon bw
-function bw(action) {
- var icon = document.getElementById(action + 'Icon');
- var span = document.getElementById(action);
-
- icon.src = '../../../../img/developers/' + action + '-bw.png';
- span.className = 'action_bw';
+ icon.src = icon.src.substring(0, icon.src.lastIndexOf('/')+1) + action + '-' + colorbw + '.png';
+ span.className = 'action_'+colorbw;
}
//Get number of selected files
@@ -95,7 +94,13 @@ function selectedFile() {
//Validate review form
function validateReview(type) {
- if (type == 'pending') {
+ //Make sure an action was selected
+ var action = document.getElementById('actionField').value;
+ if (action == '') {
+ errors += '- ' + localized['action'] + '\n';
+ }
+
+ if (type == 'pending' && action!='info') {
//Make sure at least one file is selected
var filesSelected = selectedFileCount();
@@ -107,15 +112,11 @@ function validateReview(type) {
var errors = '';
- //Make sure an action was selected
- if (document.getElementById('actionField').value == '') {
- errors += '- ' + localized['action'] + '\n';
- }
//Make sure comments were entered
if (document.getElementById('comments').value == '') {
errors += '- ' + localized['comments'] + '\n';
}
- if (type == 'pending') {
+ if (type == 'pending' && action!='info') {
//Make sure tested operating system was entered
if (document.getElementById('ApprovalOs').value == '') {
errors += '- ' + localized['os'] + '\n';