summaryrefslogtreecommitdiff
path: root/frontend/static/js/test-admin.js
diff options
context:
space:
mode:
authorroot <root@lalalizard.com>2012-11-26 12:05:40 -0500
committerroot <root@lalalizard.com>2012-11-26 12:05:40 -0500
commitef51b60c6481254d88c5fc3c34f4127b7f881a58 (patch)
tree42a9596a7d53951d2a10f60fea4c2854fc9348af /frontend/static/js/test-admin.js
parentddc5b25b4a47ef8175aced9c06fc1767d004e826 (diff)
Frontend static/ folder
Diffstat (limited to 'frontend/static/js/test-admin.js')
-rw-r--r--frontend/static/js/test-admin.js93
1 files changed, 93 insertions, 0 deletions
diff --git a/frontend/static/js/test-admin.js b/frontend/static/js/test-admin.js
new file mode 100644
index 0000000..5c34099
--- /dev/null
+++ b/frontend/static/js/test-admin.js
@@ -0,0 +1,93 @@
+function Enterable (id, callback)
+ {
+ function thisKeydown (e)
+ {
+ if (e.keyCode === 13)
+ {
+ var s = $(id).val()
+ if (s)
+ callback(s)
+ }
+ }
+ $("#lookup-room").keydown(thisKeydown)
+ }
+var Background =
+ {
+ off: function ()
+ {
+ $("#bg").hide()
+ }
+ }
+var Main = {load: function(){}}
+var AdminTest =
+ {
+ init: function ()
+ {
+ d.warn("INIT TEST")
+ $(window).bind("resize", AdminTest.resize)
+ AdminTest.resize()
+ Auth.error = AdminTest.error
+ Auth.success = AdminTest.success
+ if ( ! Auth.init() )
+ AdminTest.error()
+ else
+ Auth.checkin()
+ },
+ resize: function ()
+ {
+ var h = $(window).height()
+ var statsheight = h-285-20-20-30
+ $("#stats").css({height: statsheight})
+ },
+ error: function ()
+ {
+ $("body").hide()
+ },
+ success: function ()
+ {
+ $("#session").html(Auth.session)
+ $("#bg-off").click(Background.off)
+ $(".remove").live("click", Admin.removeVideoClick)
+ AdminTest.lookupRoom(roomName)
+ AdminTest.lookupRoomEnterable = new Enterable ("#lookup-room", AdminTest.lookupRoom)
+ AdminTest.statsLoad()
+ },
+ lookupRoom: function (s)
+ {
+ d.warn("LOOKUP ROOM "+s)
+ Room.name = s
+ Admin.viewRoom()
+ setTimeout(AdminTest.refresh, 500)
+ },
+ refresh: function ()
+ {
+ d.warn("ROOM REFRESH")
+ Room.settingsOpen()
+ $("#room-name").html(Room.name)
+ $("#return-link").attr("href", "/"+Room.name)
+ $("#room-lastlog").val(Lastlog.old)
+ $("#pnp").attr("src", "http://scannerjammer.com/"+Room.name+"/read")
+ },
+ statsLoad: function ()
+ {
+ $.get(API.URL.room.stats).success(AdminTest.statsDump)
+ },
+ statsDump: function (html)
+ {
+ var greetings = ""
+ greetings += "&gt;&gt;&gt; <a href='/register/reset'>Need to fix someone's password?</a>"
+ greetings += "<br/><br/>"
+ greetings += "<b>Congratulations, %%USERNAME%%!</b> You, on the basis of your score, have been selected to be a SCANNERJAMMER MODERATOR!<br/><br/>"
+ greetings += "This means we are asking you to be a part of our team. As a moderator, your responsibility is to clear all of the crap videos from the playlist. If something seems like it doesn't belong, do not hesitate to remove it. We care about the content of our site. Soon we will also be adding a mute feature.<br/><br/>Another power you have been granted is to make your OWN SCANNERJAMMER ROOM. Only mods can do this! All you need to do is add the name of your new room to the end of the URL. For example, type <i><b>scannerjammer.com/whatupdoe</b></i> into the address bar and lo and behold, the SCANNERJAMMER \"whatupdoe\" room has been created!<br/><br/>This is a great way to have a more private SCANNERJAMMER experience, should you want to talk to friends. Feel free to create as many rooms as you want.<br><br/> Thank you, we love you! -Pepper and ryz"
+ greetings = greetings.replace("%%USERNAME%%", Auth.username)
+ if (html)
+ greetings += "<br/><br/><b>STATS TODAY</b><br/>"+html
+ $("#stats").html(greetings).fadeIn(1000)
+ }
+ }
+var Main =
+ {
+ }
+AdminTest.init()
+$("#msg").hide()
+