forums.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. function SortFuntion(){
  2. var data = JSON.stringify({
  3. display: $('#display').val(),
  4. sort: $('#sort').val(),
  5. st: $('#st').val(),
  6. type:sortData.type,
  7. uid:sortData.uid,
  8. page:sortData.page
  9. });
  10. $.ajax ({
  11. type : "POST",
  12. url : "/order",
  13. data:data,
  14. contentType: 'application/json;charset=UTF-8',
  15. success: function(result) {
  16. $('div.topiclist').html(result);
  17. }
  18. });
  19. }
  20. $(document).ready(function(){
  21. $('#display').change(function() {
  22. SortFuntion();
  23. });
  24. $('#sort').change(function() {
  25. SortFuntion();
  26. });
  27. $('#st').change(function() {
  28. SortFuntion();
  29. });
  30. $('span#email-confirm').click(function(){
  31. $.ajax ({
  32. type : "POST",
  33. url : "/confirm-email",
  34. data:JSON.stringify({
  35. }),
  36. contentType: 'application/json;charset=UTF-8',
  37. success: function(result) {
  38. if (result.judge === true)
  39. {
  40. alert(result.error);
  41. } else
  42. {
  43. alert(result.error);
  44. }}
  45. });
  46. });
  47. });
  48. function dispatch() {
  49. var q = document.getElementById("search");
  50. if (q.value !== "") {
  51. var url = 'https://www.google.com/search?q=site:forums.honmaple.org%20' + q.value;
  52. if (navigator.userAgent.indexOf('iPad') > -1 || navigator.userAgent.indexOf('iPod') > -1 || navigator.userAgent.indexOf('iPhone') > -1) {
  53. location.href = url;
  54. } else {
  55. window.open(url, "_blank");
  56. }
  57. return false;
  58. } else {
  59. return false;
  60. }
  61. }