Commits

Anonymous committed 2d84bf6

Fixed mix of tabs and spaces.

Comments (0)

Files changed (1)

js/noprocrast/noprocrast.js

         message, prettyTime, dialog, panel, timeSelect;
 
     prettyTime = function(mins) {
-	if (mins > 120) {
-	    return Math.floor(mins / 60) + ' hours';
-	} else if (mins >= 60) {
-	    return '1 hour';
-	}
-	return mins + ' minutes';
+        if (mins > 120) {
+            return Math.floor(mins / 60) + ' hours';
+        } else if (mins >= 60) {
+            return '1 hour';
+        }
+        return mins + ' minutes';
     };
 
     if (minutes > threshold) {
-	dialog = new AJS.Dialog();
-	dialog.addHeader(header);
+        dialog = new AJS.Dialog();
+        dialog.addHeader(header);
 
-	message = '';
-	message += '<p>You will waste ' + minutes + ' minutes reading the comments on this page.</p>';
+        message = '';
+        message += '<p>You will waste ' + minutes + ' minutes reading the comments on this page.</p>';
         message += '<p>Is it really worth it? Be the change you seek!</p>';
-	message += '<div class="image" style="text-align: center"><img src="' + noprocrastImage + '" alt="" /></div>';
-	panel = dialog.addPanel('Minutes', message);
+        message += '<div class="image" style="text-align: center"><img src="' + noprocrastImage + '" alt="" /></div>';
+        panel = dialog.addPanel('Minutes', message);
 
-	dialog.addCancel("Woah, get me out of here", function() {
-	    var path = AJS.Confluence.getContextPath();
-	    if (history.length > 1) {
-		history.go(-1);
-	    } else if (path) {
-		document.location = path;
-	    } else {
-		document.location = "/";
-	    }
-	});
-	dialog.addSubmit("Just let me in!", function() {
+        dialog.addCancel("Woah, get me out of here", function() {
+            var path = AJS.Confluence.getContextPath();
+            if (history.length > 1) {
+                history.go(-1);
+            } else if (path) {
+                document.location = path;
+            } else {
+                document.location = "/";
+            }
+        });
+        dialog.addSubmit("Just let me in!", function() {
             dialog.hide();
         });
 
-	// Create a select input so that users can change their time threshold
-	timeSelect = $('<select></select>').addClass('noprocrast-time-select'); //css({'float': 'left', 'marginLeft': '0.5em'});
-	$.each(times, function(i, mins) {
-	    var option = $('<option></option>');
-	    option.val(mins).text(prettyTime(mins));
-	    if (mins == threshold) {
-		option.attr('selected', 'selected');
-	    }
-	    timeSelect.append(option);
-	});
-	timeSelect.change(function() {
-	    AJS.Cookie.save("noprocrast-time-threshold", timeSelect.val());
-	});
-	$(dialog.page[0].buttonpanel).append(timeSelect);
+        // Create a select input so that users can change their time threshold
+        timeSelect = $('<select></select>').addClass('noprocrast-time-select'); //css({'float': 'left', 'marginLeft': '0.5em'});
+        $.each(times, function(i, mins) {
+            var option = $('<option></option>');
+            option.val(mins).text(prettyTime(mins));
+            if (mins == threshold) {
+                option.attr('selected', 'selected');
+            }
+            timeSelect.append(option);
+        });
+        timeSelect.change(function() {
+            AJS.Cookie.save("noprocrast-time-threshold", timeSelect.val());
+        });
+        $(dialog.page[0].buttonpanel).append(timeSelect);
 
-	dialog.show();
+        dialog.show();
     }
 });