34 lines
855 B
TypeScript
34 lines
855 B
TypeScript
import {__, I } from "./globals";
|
|
declare const _romhackplaza_script_uploader: any;
|
|
declare const romhackplaza_modal_submissions: any;
|
|
|
|
export class Set_Favorite_Server {
|
|
|
|
/**
|
|
*
|
|
* @param callback - MUST BE FROM A Upload child.
|
|
*/
|
|
constructor( server_id: number ){
|
|
|
|
this.do_request( server_id );
|
|
|
|
}
|
|
|
|
private do_request( server_id : number ){
|
|
|
|
jQuery.ajax({
|
|
type: "POST",
|
|
url: _romhackplaza_script_uploader.submit_url,
|
|
data: {
|
|
action: 'set_favorite_server',
|
|
post_id: I.reserved_post_id,
|
|
favorite_server: server_id,
|
|
_wpnonce: _romhackplaza_script_uploader.set_favorite_nonce
|
|
},
|
|
success: function(){
|
|
console.log( "Favorite server set" );
|
|
}
|
|
});
|
|
|
|
}
|
|
} |