summaryrefslogtreecommitdiff
path: root/static/resizetest/dump.fm.av.files/admin.js
diff options
context:
space:
mode:
authoryo momma <shutup@oops.wtf>2026-02-03 22:17:28 +0000
committeryo momma <shutup@oops.wtf>2026-02-03 22:17:28 +0000
commit079fa651299418f8fed63f0d2bdb7e05abbec01a (patch)
treed4cb76542d7fe90f6f205c4e1fca652be9d7e9b5 /static/resizetest/dump.fm.av.files/admin.js
parent5c0f41e1960d7b6f0ca5cc4795c5ab25eedca5c2 (diff)
Hump.fm: rename legacy resizetest/nickinterview fixtures
Diffstat (limited to 'static/resizetest/dump.fm.av.files/admin.js')
-rwxr-xr-xstatic/resizetest/dump.fm.av.files/admin.js120
1 files changed, 0 insertions, 120 deletions
diff --git a/static/resizetest/dump.fm.av.files/admin.js b/static/resizetest/dump.fm.av.files/admin.js
deleted file mode 100755
index fc18685..0000000
--- a/static/resizetest/dump.fm.av.files/admin.js
+++ /dev/null
@@ -1,120 +0,0 @@
-var Admin = {};
-
-Admin._dialogHtml = '<div class="dialog">';
-
-Admin._select = function(name, opts) {
- var sel = $('<select>').attr('name', name);
- $.each(opts, function(i, o) {
- sel.append($('<option>').html(o));
- });
- return sel;
-}
-
-Admin.mute = function(nick) {
- var time = $('<input type="text" name="time" size="3">');
- var unit = Admin._select('unit', ['minutes', 'hours', 'days']);
- var reason = $('<textarea name="reason" rows="4" cols="30">');
- var html = $('<div>')
- .append($('<div>').text(nick + ' will be muted for:'))
- .append(time)
- .append(unit)
- .append($('<br>'))
- .append($('<br>'))
- .append($('<div>').text('Reason:'))
- .append(reason)
- .appendTo($(Admin._dialogHtml));
- var title = 'Mute ' + nick;
- var close = function() { html.dialog('close'); }
- var submit = function() {
- html.find('[name]').removeClass('ui-state-error');
-
- var t = parseInt(time.val());
- var u = unit.val();
- var r = reason.val();
-
- if (!t) { time.addClass('ui-state-error'); }
- if (!u) { reason.addClass('ui-state-error'); }
- if (!r) { reason.addClass('ui-state-error'); }
- if (!t || !u || !r) { return; }
-
- $.ajax({
- type: 'POST',
- timeout: 5000,
- url: '/mute',
- cache: false,
- data: { 'time': t, 'unit': u,
- 'reason': r, 'nick': nick },
- success: close,
- error: function(s) {
- alert("Error muting user: " + s.responseText);
- }
- });
- };
- html.dialog({
- modal: true,
- title: title,
- width: 400,
- buttons: { 'OK': submit , 'Cancel': close }
- });
- html.dialog('open');
-};
-
-Admin.cancelMute = function(id, nick) {
- var reason = $('<textarea name="reason" rows="4" cols="30">');
- var html = $('<div>')
- .append($('<div>').text('Cancelling mute for ' + nick))
- .append($('<br>'))
- .append($('<div>').text('Reason:'))
- .append(reason)
- .appendTo($(Admin._dialogHtml));
- var title = 'Cancelling mute for ' + nick;
- var close = function() { html.dialog('close'); }
- var submit = function() {
- html.find('[name]').removeClass('ui-state-error');
-
- var r = reason.val();
- if (!r) {
- reason.addClass('ui-state-error');
- return;
- }
-
- var onSuccess = function(resp) {
- location.reload();
- };
-
- $.ajax({
- type: 'POST',
- timeout: 5000,
- url: '/cancel-mute',
- cache: false,
- data: { 'mute_id': id, 'reason': r },
- success: onSuccess,
- error: function(s) {
- alert("Error cancelling mute: " + s.responseText);
- close();
- }
- });
- };
- html.dialog({
- modal: true,
- title: title,
- width: 400,
- buttons: { 'OK': submit , 'Cancel': close }
- });
- html.dialog('open');
-}
-
-
-/*
-$('.msgDiv').live('mouseenter', function() {
- $(this).css({'border': '1px dotted red',
- 'margin': '-1' });
-})
-
-$('.msgDiv').live('mouseleave', function() {
- $(this).css({'border': 'none',
- 'margin': '0'});
-})
-
-
-*/ \ No newline at end of file