zsxsoft.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset=utf-8 />
  5. <title>Test DUOSHUO</title>
  6. <script src="http://zsxsoft.github.io/useragent.js/javascripts/useragent.min.js"></script>
  7. <!-- 关于以上组件,即useragent.js,见http://zsxsoft.github.io/useragent.js/ -->
  8. <!-- 然后设置duoshuoQuery和加载多说,并设置自定义的getUAString -->
  9. <script>
  10. var duoshuoQuery = {
  11. short_name: 'official',
  12. myIds: [1234567],
  13. getUAString: function(local) {
  14. var userAgent = USERAGENT.analyze(local.agent);
  15. return [
  16. '<div class="ds-os">',
  17. '<img src="http://zsxsoft.github.io/useragent.js/img/16/' + userAgent.platform.dir + '/' + userAgent.platform.image + '.png" alt="' + userAgent.platform.name + '" />',
  18. userAgent.platform.full,
  19. '</div>' +
  20. '<div class="ds-br">',
  21. '<img src="http://zsxsoft.github.io/useragent.js/img/16/browser/' + userAgent.browser.image + '.png" alt="' + userAgent.browser.name + '" />',
  22. userAgent.browser.full,
  23. '</div>',
  24. (local.webmaster ? '<div class="ds-webmaster">站长</div>' : '')
  25. ].join("");
  26. },
  27. };
  28. </script>
  29. <script src="../dist/duoshuo-ua-with-css.min.js"></script>
  30. <script src="http://static.duoshuo.com/embed.js"></script>
  31. </head>
  32. <body>
  33. <div class="ds-thread" data-thread-key="5174f0a16a04594d4800590e"></div>
  34. </body>
  35. </html>