UNPKG

820 BJavaScriptView Raw
1import Parse from '../parse';
2import { addEvent } from '../helpers';
3
4class MobileRich extends Parse {
5 constructor(option = { platform: 'mobile' }) {
6 super(option);
7 this.images = [];
8 this.lazyLoad = false;
9 this.unbindImageEvents = () => {};
10 this.clientHeight = 0;
11 }
12
13 renderImage(props) {
14 return `<div class="image-div"><img src=${props.url} data-src="${props.url}"><div>${props.desc}</div></div>`;
15 }
16
17 renderLink(props) {
18 // return `<p><a href="${props.url}" target="_blank">${props.text}</a></p>`;
19 return `<a href="${props.route.webUrl || props.route.webURL}" target="_blank">${props.content}</a>`;
20 }
21
22 renderVideo(props) {
23 return `<div class="video-div"><video controls='controls'>
24 <source src="${props.url}">
25 </video></div>`
26 }
27}
28
29export default MobileRich;