Clean up code

Fix indentations, whitespace, and layout
This commit is contained in:
Adrianl3d 2014-11-22 10:39:34 +10:00
parent f1543a9d36
commit 6a66351e7f

View file

@ -70,7 +70,7 @@ var ourWidth = Window.innerWidth;
var ourHeight = Window.innerHeight;
var text = "placeholder";
var last_users = GlobalServices.onlineUsers;
var users =[];
var users = [];
var ctrlIsPressed = false;
var ready = true;
@ -115,7 +115,7 @@ function createNotification(text){
color: textColor,
backgroundColor: backColor,
alpha: backgroundAlpha,
topargin: topMargin,
topMargin: topMargin,
leftMargin: leftMargin,
font: {size: fontSize},
text: text,
@ -124,8 +124,8 @@ function createNotification(text){
var buttonProperties = {
x: buttonLocationX,
y: bLevel,
width: 15.0,//37
height: 15.0,//35
width: 15.0,
height: 15.0,
subImage: { x: 0, y: 0, width: 10, height: 10 },
imageURL: "http://hifi-public.s3.amazonaws.com/images/close-small-light.svg",
color: { red: 255, green: 255, blue: 255},
@ -140,7 +140,7 @@ function createNotification(text){
// Pushes data to each array and sets up data for 2nd dimension array
// to handle auxiliary data not carried by the overlay class
// specifically notification "heights", "times" of creation, and .
function Notify (notice, button, height ){
function Notify(notice, button, height){
notifications.push((Overlays.addOverlay("text",notice)));
buttons.push((Overlays.addOverlay("image",button)));
@ -246,8 +246,8 @@ function wordWrap(str){
}
// wraps whole word to newline
function stringDivider(str, slotWidth, spaceReplacer) {
if (str.length>slotWidth) {
var p=slotWidth;
if (str.length > slotWidth) {
var p = slotWidth;
for (; p > 0 && str[p] != ' '; p--) {
}
if (p > 0) {
@ -259,7 +259,7 @@ function stringDivider(str, slotWidth, spaceReplacer) {
return str;
}
//This fires a notification on window resize
// This fires a notification on window resize
function checkSize(){
if((Window.innerWidth!=ourWidth)||(Window.innerHeight!=ourHeight)){
var windowResize = "Window has been resized";
@ -320,7 +320,7 @@ function update(){
}
}
// This checks the age of the notification and prepares to fade it after 9.0 seconds (var persistTime - 1)
// This checks the age of the notification and prepares to fade it after 9.0 seconds (var persistTime - 1)
for (var i = 0; i < arrays.length; i++){
if (ready){
var j = arrays[i][2];
@ -365,7 +365,6 @@ var working = firstOut
times.splice(firstOut, 1);
heights.splice(firstOut, 1);
myAlpha.splice(firstOut,1);
}
onMuteStateChanged();