summaryrefslogtreecommitdiff
path: root/js/AutoVideos.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/AutoVideos.js')
-rw-r--r--js/AutoVideos.js33
1 files changed, 27 insertions, 6 deletions
diff --git a/js/AutoVideos.js b/js/AutoVideos.js
index 08a47fc..f92ea9d 100644
--- a/js/AutoVideos.js
+++ b/js/AutoVideos.js
@@ -43,12 +43,12 @@ function rmvmath(str)
}
}
return newstr;
-};
+}
function randItem(l)
{
return l[Math.floor(Math.random() * l.length)];
-};
+}
function countChar(string, letter)
{
@@ -61,7 +61,7 @@ function countChar(string, letter)
}
}
return amount;
-};
+}
function randEquation()
@@ -147,7 +147,7 @@ function randEquation()
equation += ')';
}
return equation;
-};
+}
function evalEquation(eq, x, y, t)
{
@@ -160,7 +160,8 @@ function evalEquation(eq, x, y, t)
{
return 0;
}
-};
+}
+
function create()
{
var d = new Date();
@@ -255,10 +256,30 @@ function create()
$("#Function").html('$Functions: \\newline\\newline Red: $' + rmvmath(requation) + '$\\newline\\newline Green: $' + rmvmath(gequation) + '$\\newline\\newline Blue: $' + rmvmath(bequation) + '$');
LatexIT.render('*',false);
+ stopLoading();
+
if(notify)
{
alert('Your video has finished.');
}
-};
+}
+
+function startLoading()
+{
+ $('#Create').prop('disabled', true);
+ $('#Create').html('Loading...');
+}
+
+function stopLoading()
+{
+ $('#Create').prop('disabled', false);
+ $('#Create').html('Create');
+}
+
+function start()
+{
+ startLoading();
+ window.setTimeout(create, 1);
+}