github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/public/profile_member.js (about)

     1  function handle_profile_hashbit() {
     2  	var hash_class = "";
     3  	switch(window.location.hash.substr(1)) {
     4  		case "ban_user":
     5  			hash_class = "ban_user_hash";
     6  			break;
     7  		case "delete_posts":
     8  			hash_class = "delete_posts_hash";
     9  			break;
    10  		default:
    11  			log("Unknown hashbit");
    12  			return;
    13  	}
    14  	$(".hash_hide").hide();
    15  	$("." + hash_class).show();
    16  }
    17  
    18  (() => {
    19  addInitHook("end_init", () => {
    20  	if(window.location.hash) handle_profile_hashbit();
    21  	window.addEventListener("hashchange", handle_profile_hashbit, false);
    22  });
    23  })();