/war/src/main/webapp/js/admin/about.js

http://github.com/b3log/b3log-solo · JavaScript · 58 lines · 29 code · 2 blank · 27 comment · 2 complexity · bda1af5a1e02b5295032df0a115ea9ca MD5 · raw file

  1. /*
  2. * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * about for admin
  18. *
  19. * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
  20. * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
  21. * @version 1.0.0.3, Jan 7, 2012
  22. */
  23. /* about ???? */
  24. admin.about = {
  25. init: function () {
  26. $.ajax({
  27. url: "http://rhythm.b3log.org/version/solo/latest/" + Label.version,
  28. type: "GET",
  29. cache: false,
  30. dataType:"jsonp",
  31. error: function() {
  32. // alert("Error loading articles from Rhythm");
  33. },
  34. success: function(data, textStatus) {
  35. var version = data.soloVersion;
  36. if (version === Label.version) {
  37. $("#aboutLatest").text(Label.upToDateLabel);
  38. } else {
  39. $("#aboutLatest").html(Label.outOfDateLabel +
  40. "<a href='" + data.soloDownload + "'>" + version + "</a>");
  41. }
  42. $("#loadMsg").text("");
  43. }
  44. });
  45. }
  46. };
  47. /*
  48. * ??? admin ????
  49. */
  50. admin.register["about"] = {
  51. "obj": admin.about,
  52. "init": admin.about.init,
  53. "refresh": function () {
  54. $("#loadMsg").text("");
  55. }
  56. }