mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
More Markdown refactoring - fixed bug with Pagedown not showing on user profile - replaced jQuery occurrences with $.
This commit is contained in:
@ -10,7 +10,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
|
||||
deleteAllPosts: function() {
|
||||
this.set('can_delete_all_posts', false);
|
||||
jQuery.ajax("/admin/users/" + (this.get('id')) + "/delete_all_posts", {type: 'PUT'});
|
||||
$.ajax("/admin/users/" + (this.get('id')) + "/delete_all_posts", {type: 'PUT'});
|
||||
},
|
||||
|
||||
// Revoke the user's admin access
|
||||
@ -18,14 +18,14 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
this.set('admin', false);
|
||||
this.set('can_grant_admin', true);
|
||||
this.set('can_revoke_admin', false);
|
||||
return jQuery.ajax("/admin/users/" + (this.get('id')) + "/revoke_admin", {type: 'PUT'});
|
||||
return $.ajax("/admin/users/" + (this.get('id')) + "/revoke_admin", {type: 'PUT'});
|
||||
},
|
||||
|
||||
grantAdmin: function() {
|
||||
this.set('admin', true);
|
||||
this.set('can_grant_admin', false);
|
||||
this.set('can_revoke_admin', true);
|
||||
jQuery.ajax("/admin/users/" + (this.get('id')) + "/grant_admin", {type: 'PUT'});
|
||||
$.ajax("/admin/users/" + (this.get('id')) + "/grant_admin", {type: 'PUT'});
|
||||
},
|
||||
|
||||
// Revoke the user's moderation access
|
||||
@ -33,18 +33,18 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
this.set('moderator', false);
|
||||
this.set('can_grant_moderation', true);
|
||||
this.set('can_revoke_moderation', false);
|
||||
return jQuery.ajax("/admin/users/" + (this.get('id')) + "/revoke_moderation", {type: 'PUT'});
|
||||
return $.ajax("/admin/users/" + (this.get('id')) + "/revoke_moderation", {type: 'PUT'});
|
||||
},
|
||||
|
||||
grantModeration: function() {
|
||||
this.set('moderator', true);
|
||||
this.set('can_grant_moderation', false);
|
||||
this.set('can_revoke_moderation', true);
|
||||
jQuery.ajax("/admin/users/" + (this.get('id')) + "/grant_moderation", {type: 'PUT'});
|
||||
$.ajax("/admin/users/" + (this.get('id')) + "/grant_moderation", {type: 'PUT'});
|
||||
},
|
||||
|
||||
refreshBrowsers: function() {
|
||||
jQuery.ajax("/admin/users/" + (this.get('id')) + "/refresh_browsers", {type: 'POST'});
|
||||
$.ajax("/admin/users/" + (this.get('id')) + "/refresh_browsers", {type: 'POST'});
|
||||
bootbox.alert("Message sent to all clients!");
|
||||
},
|
||||
|
||||
@ -52,7 +52,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
this.set('can_approve', false);
|
||||
this.set('approved', true);
|
||||
this.set('approved_by', Discourse.get('currentUser'));
|
||||
jQuery.ajax("/admin/users/" + (this.get('id')) + "/approve", {type: 'PUT'});
|
||||
$.ajax("/admin/users/" + (this.get('id')) + "/approve", {type: 'PUT'});
|
||||
},
|
||||
|
||||
username_lower: (function() {
|
||||
@ -79,7 +79,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
_this = this;
|
||||
if (duration = parseInt(window.prompt(Em.String.i18n('admin.user.ban_duration')), 10)) {
|
||||
if (duration > 0) {
|
||||
return jQuery.ajax("/admin/users/" + this.id + "/ban", {
|
||||
return $.ajax("/admin/users/" + this.id + "/ban", {
|
||||
type: 'PUT',
|
||||
data: {duration: duration},
|
||||
success: function() {
|
||||
@ -99,7 +99,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
|
||||
unban: function() {
|
||||
var _this = this;
|
||||
return jQuery.ajax("/admin/users/" + this.id + "/unban", {
|
||||
return $.ajax("/admin/users/" + this.id + "/unban", {
|
||||
type: 'PUT',
|
||||
success: function() {
|
||||
window.location.reload();
|
||||
@ -116,7 +116,7 @@ Discourse.AdminUser = Discourse.Model.extend({
|
||||
|
||||
impersonate: function() {
|
||||
var _this = this;
|
||||
return jQuery.ajax("/admin/impersonate", {
|
||||
return $.ajax("/admin/impersonate", {
|
||||
type: 'POST',
|
||||
data: {
|
||||
username_or_email: this.get('username')
|
||||
@ -145,7 +145,7 @@ Discourse.AdminUser.reopenClass({
|
||||
user.set('can_approve', false);
|
||||
return user.set('selected', false);
|
||||
});
|
||||
return jQuery.ajax("/admin/users/approve-bulk", {
|
||||
return $.ajax("/admin/users/approve-bulk", {
|
||||
type: 'PUT',
|
||||
data: {
|
||||
users: users.map(function(u) {
|
||||
@ -158,7 +158,7 @@ Discourse.AdminUser.reopenClass({
|
||||
find: function(username) {
|
||||
var promise;
|
||||
promise = new RSVP.Promise();
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
url: "/admin/users/" + username,
|
||||
success: function(result) {
|
||||
return promise.resolve(Discourse.AdminUser.create(result));
|
||||
@ -170,7 +170,7 @@ Discourse.AdminUser.reopenClass({
|
||||
findAll: function(query, filter) {
|
||||
var result;
|
||||
result = Em.A();
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
url: "/admin/users/list/" + query + ".json",
|
||||
data: {
|
||||
filter: filter
|
||||
|
Reference in New Issue
Block a user