From 1f5fd1308b4518826408342f94d99ab6e10a4a71 Mon Sep 17 00:00:00 2001 From: thlo Date: Sun, 13 Jan 2013 21:28:52 +0100 Subject: Various changes: Folder Support for Live, Spinner, Keyboard, etc --- smarttv-client/Javascript/Spinner.js | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 smarttv-client/Javascript/Spinner.js (limited to 'smarttv-client/Javascript/Spinner.js') diff --git a/smarttv-client/Javascript/Spinner.js b/smarttv-client/Javascript/Spinner.js new file mode 100644 index 0000000..4a9b8ea --- /dev/null +++ b/smarttv-client/Javascript/Spinner.js @@ -0,0 +1,51 @@ +var Spinner = +{ + index : 1, + run: 0, + timeout : 0 +}; + +Spinner.init = function () { +// var sp_width = $("#Spinning").width(); +// var sp_height = $("#Spinning").height(); + + // TODO: No Abs Number please + $("#Spinning").children().eq(0).css({"margin-left": "43px", "margin-top": "37px"}); +}; + +Spinner.show= function() { + if (this.run == 1) + return; + + if (this.timeout > 0) { + clearTimeout(this.timeout); + this.timeout = 0; + } + + this.index=1; + + if (this.run==0) { + this.run=1; + $("#Spinning").show(); + Spinner.step(); + } +}; + +Spinner.hide= function() { + $("#Spinning").hide(); + this.run=0; +}; + + Spinner.step=function() { + $("#Spinning").children().eq(0).attr("src", "Images/spinner/loading_"+this.index+".png"); + + this.index++; + + if (this.index > 12) { + this.index=1; + } + + if (this.run) { + this.timeout = setTimeout("Spinner.step();", 200); + } +}; -- cgit v1.2.3