Skip to content

Commit

Permalink
discourse-lazy-videos-.br.js.download
Browse files Browse the repository at this point in the history
Stock control supervisors
  • Loading branch information
bombastictranz authored Jun 4, 2024
1 parent 28976ca commit 9da08c9
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
define("discourse/plugins/discourse-lazy-videos/discourse/components/lazy-iframe",["exports","@glimmer/component","@ember/component","@ember/template-factory"],(function(e,t,i,r){"use strict"
var o
Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
class a extends t.default{get iframeSrc(){switch(this.args.providerName){case"youtube":let e=`https://www.youtube.com/embed/${this.args.videoId}?autoplay=1&rel=0`
return this.args.startTime&&(e+=`&start=${function(e){const t=e.toString().match(/(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?/),[i,r,o]=t.slice(1)
if(i||r||o)return 3600*(parseInt(i,10)||0)+60*(parseInt(r,10)||0)+(parseInt(o,10)||0)
return e}(this.args.startTime)}`),e
case"vimeo":return`https://player.vimeo.com/video/${this.args.videoId}${this.args.videoId.includes("?")?"&":"?"}autoplay=1`
case"tiktok":return`https://www.tiktok.com/embed/v2/${this.args.videoId}`}}}e.default=a,o=a,(0,i.setComponentTemplate)((0,r.createTemplateFactory)({id:"GBbnVjZj",block:'[[[1,"\\n"],[41,[30,1],[[[1," "],[10,"iframe"],[15,"src",[30,0,["iframeSrc"]]],[15,"title",[30,2]],[14,"allowFullScreen",""],[14,"scrolling","no"],[14,"frameborder","0"],[14,"seamless","seamless"],[14,"allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"],[12],[13],[1,"\\n"]],[]],null],[1," "]],["@providerName","@title"],false,["if"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-lazy-videos/discourse/components/lazy-iframe.js",isStrictMode:!0}),o)})),define("discourse/plugins/discourse-lazy-videos/discourse/components/lazy-video",["exports","@glimmer/component","@glimmer/tracking","@ember/helper","@ember/modifier","@ember/object","@ember/template","discourse/helpers/concat-class","discourse/plugins/discourse-lazy-videos/discourse/components/lazy-iframe","@ember/component","@ember/template-factory"],(function(e,t,i,r,o,a,s,l,n,d,c){"use strict"
var u,p,m
function v(e,t,i,r,o){var a={}
return Object.keys(r).forEach((function(e){a[e]=r[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=i.slice().reverse().reduce((function(i,r){return r(e,t,i)||i}),a),o&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(o):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
e.default=(m=class extends t.default{constructor(){var e,t,i,r
super(...arguments),e=this,t="isLoaded",r=this,(i=p)&&Object.defineProperty(e,t,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(r):void 0})}get thumbnailStyle(){const e=this.args.videoAttributes.dominantColor
if(e?.match(/^[0-9A-Fa-f]+$/))return(0,s.htmlSafe)(`background-color: #${e};`)}loadEmbed(){this.isLoaded||(this.isLoaded=!0,this.args.onLoadedVideo?.())}onKeyPress(e){"Enter"===e.key&&(e.preventDefault(),this.loadEmbed())}},(0,d.setComponentTemplate)((0,c.createTemplateFactory)({id:"1eaF/Mtc",block:'[[[1,"\\n "],[10,0],[15,"data-video-id",[30,1,["id"]]],[15,"data-video-title",[30,1,["title"]]],[15,"data-video-start-time",[30,1,["startTime"]]],[15,"data-provider-name",[30,1,["providerName"]]],[15,0,[28,[32,0],["lazy-video-container",[28,[32,1],[[30,1,["providerName"]],"-onebox"],null],[52,[30,0,["isLoaded"]],"video-loaded"]],null]],[12],[1,"\\n"],[41,[30,0,["isLoaded"]],[[[1," "],[8,[32,2],null,[["@providerName","@title","@videoId","@startTime"],[[30,1,["providerName"]],[30,1,["title"]],[30,1,["id"]],[30,1,["startTime"]]]],null],[1,"\\n"]],[]],[[[1," "],[11,0],[24,"tabindex","0"],[16,5,[30,0,["thumbnailStyle"]]],[16,0,[28,[32,0],["video-thumbnail",[30,1,["providerName"]]],null]],[4,[32,3],["click",[30,0,["loadEmbed"]]],null],[4,[32,3],["keypress",[30,0,["loadEmbed"]]],null],[12],[1,"\\n "],[10,"img"],[15,"src",[30,1,["thumbnail"]]],[15,"title",[30,1,["title"]]],[14,"loading","lazy"],[15,0,[28,[32,1],[[30,1,["providerName"]],"-thumbnail"],null]],[12],[13],[1,"\\n "],[10,0],[15,0,[28,[32,0],["icon",[28,[32,1],[[30,1,["providerName"]],"-icon"],null]],null]],[12],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"title-container"],[12],[1,"\\n "],[10,0],[14,0,"title-wrapper"],[12],[1,"\\n "],[10,3],[15,6,[30,1,["url"]]],[15,"title",[30,1,["title"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[14,0,"title-link"],[12],[1,"\\n "],[1,[30,1,["title"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n "]],["@videoAttributes"],false,["if"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-lazy-videos/discourse/components/lazy-video.js",scope:()=>[l.default,r.concat,n.default,o.on],isStrictMode:!0}),m),p=v((u=m).prototype,"isLoaded",[i.tracked],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),v(u.prototype,"loadEmbed",[a.action],Object.getOwnPropertyDescriptor(u.prototype,"loadEmbed"),u.prototype),v(u.prototype,"onKeyPress",[a.action],Object.getOwnPropertyDescriptor(u.prototype,"onKeyPress"),u.prototype),u)})),define("discourse/plugins/discourse-lazy-videos/initializers/lazy-videos",["exports","discourse/lib/plugin-api","discourse/plugins/discourse-lazy-videos/lib/lazy-video-attributes","@ember/template-factory"],(function(e,t,i,r){"use strict"
function o(e){e.decorateCookedElement(((t,o)=>{if(t.classList.contains("d-editor-preview"))return
t.querySelectorAll(".lazy-video-container").forEach((a=>{const s=e.container.lookup("service:site-settings"),l=(0,i.default)(a)
if(s[`lazy_${l.providerName}_enabled`]){const i=()=>{const i=t.closest("article")?.dataset?.postId
i&&e.preventCloak(parseInt(i,10))},s=o.renderGlimmer("p.lazy-video-wrapper",(0,r.createTemplateFactory)({id:"BIb4XPBx",block:'[[[8,[39,0],null,[["@videoAttributes","@onLoadedVideo"],[[30,1,["param"]],[30,1,["onLoadedVideo"]]]],null]],["@data"],false,["lazy-video"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-lazy-videos/initializers/lazy-videos.js",isStrictMode:!1}),{param:l,onLoadedVideo:i})
a.replaceWith(s)}}))}),{onlyStream:!0})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0
e.default={name:"discourse-lazy-videos",initialize(){(0,t.withPluginApi)("1.6.0",o)}}})),define("discourse/plugins/discourse-lazy-videos/lib/lazy-video-attributes",["exports"],(function(e){"use strict"
Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){if(!e.classList.contains("lazy-video-container"))return{}
const t=e.querySelector("a")?.getAttribute("href"),i=e.querySelector("img"),r=i?.getAttribute("src"),o=i?.dataset?.dominantColor,a=e.dataset.videoTitle,s=e.dataset.videoStartTime,l=e.dataset.providerName,n=e.dataset.videoId
return{url:t,thumbnail:r,title:a,providerName:l,id:n,dominantColor:o,startTime:s}}}))

//# sourceMappingURL=discourse-lazy-videos-e77ab4be24923d888daa3d8946041abf569257c5cd29c6504ed48adcbc022805.map
//!

;

0 comments on commit 9da08c9

Please sign in to comment.