You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

2 years ago
  1. $(function () {
  2. 'use strict';
  3. var sLang = $('[http-equiv="content-language"]').attr('content') || 'zh-TW',
  4. /*
  5. * 目的 抓取視頻設定
  6. */
  7. fnSetVideos = function (org) {
  8. return fnGetWebSiteSetting(function (saRes) {
  9. if (saRes.length > 0) {
  10. var sHtml = $('#temp_video').render(saRes);
  11. $('.forVideo').html(sHtml);
  12. }
  13. }, 'Video', sLang)
  14. },
  15. init = function () {
  16. var myHelpers = {
  17. setFilePath: function (val) {
  18. val = val || '';
  19. return gServerUrl + '/' + val.replace(/\\/g, "\/");
  20. },
  21. setFileName: function (val) {
  22. return val.split('.')[0] || '';
  23. },
  24. setLink: function (val) {
  25. var elVideo = '<iframe src="' + val + '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen class="video"></iframe>';
  26. if (!val) {
  27. elVideo = $('<img/>', { width: '100%', height: '100%', src: (sLang === 'zh-TW' ? '' : '../') + 'images/comingsoon.jpg' })[0].outerHTML;
  28. }
  29. return elVideo;
  30. },
  31. };
  32. $.views.helpers(myHelpers);
  33. fnSetVideos();
  34. };
  35. init();
  36. });