File indexing completed on 2024-05-12 06:01:03
0001 window.appHelpers = function () { 0002 0003 function getHostNameSuffix() { 0004 let hostNameSuffix = "org"; 0005 if (location.hostname.endsWith('cc')) { 0006 hostNameSuffix = "cc"; 0007 } else if (location.hostname.endsWith('localhost')) { 0008 hostNameSuffix = "localhost"; 0009 } 0010 return hostNameSuffix; 0011 } 0012 0013 function generateTabsMenuArray() { 0014 const baseUrl = "https://www.opendesktop." + this.getHostNameSuffix(); 0015 const tabsMenuArray = [{ 0016 title: "Supporters", 0017 url: baseUrl + "/community/getjson?e=supporters" 0018 }, { 0019 title: "Most plinged Creators", 0020 url: baseUrl + "/community/getjson?e=mostplingedcreators" 0021 }, { 0022 title: "Most plinged Products", 0023 url: baseUrl + "/community/getjson?e=mostplingedproducts" 0024 }, { 0025 title: "Recently plinged Products", 0026 url: baseUrl + "/community/getjson?e=plingedprojects" 0027 }, { 0028 title: "New Members", 0029 url: baseUrl + "/community/getjson?e=newmembers" 0030 }, { 0031 title: "Top Members", 0032 url: baseUrl + "/community/getjson?e=topmembers" 0033 }, { 0034 title: "Top List Members", 0035 url: baseUrl + "/community/getjson?e=toplistmembers" 0036 }]; 0037 return tabsMenuArray; 0038 } 0039 0040 function formatDate(dateString) { 0041 const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 0042 0043 const date = dateString.split(' ')[0]; 0044 const year = date.split('-')[0]; 0045 const month = date.split('-')[1]; 0046 const day = date.split('-')[2]; 0047 const monthNameIndex = parseInt(month) - 1; 0048 const monthName = monthNames[monthNameIndex]; 0049 0050 return monthName + ' ' + day + ' ' + year; 0051 } 0052 0053 return { 0054 getHostNameSuffix, 0055 generateTabsMenuArray, 0056 formatDate 0057 }; 0058 }(); 0059 0060 class CommunityPage extends React.Component { 0061 constructor(props) { 0062 super(props); 0063 this.state = { 0064 headerData: window.json_data.data 0065 }; 0066 } 0067 0068 componentDidMount() { 0069 /* 0070 var json_data = <?=json_encode($this->json_data)?>; hier bekommest du die oberteil info 0071 tabs info top members https://www.opendesktop.cc 0072 hier ist supporters https://www.opendesktop.cc/community/getjson?e=supporters 0073 alle tab events sind hier. /var/www/ocs-webserver/application/modules/default/controllers/CommunityController.php 0074 getjsonAction 0075 */ 0076 } 0077 0078 render() { 0079 return React.createElement( 0080 "div", 0081 { id: "community-page" }, 0082 React.createElement( 0083 "div", 0084 { className: "container" }, 0085 React.createElement(CommunityPageHeader, { 0086 headerData: this.state.headerData 0087 }), 0088 React.createElement(CommunityPageTabsContainer, null) 0089 ) 0090 ); 0091 } 0092 } 0093 0094 class CommunityPageHeader extends React.Component { 0095 constructor(props) { 0096 super(props); 0097 this.state = {}; 0098 } 0099 0100 render() { 0101 return React.createElement( 0102 "div", 0103 { id: "community-page-header", className: "head-wrap" }, 0104 React.createElement( 0105 "h1", 0106 null, 0107 "Community" 0108 ), 0109 React.createElement( 0110 "div", 0111 { id: "community-page-header-banner", className: "col-lg-5 col-md-5 col-sm-6 col-xs-8" }, 0112 React.createElement( 0113 "div", 0114 { id: "header-banner-top" }, 0115 React.createElement( 0116 "div", 0117 { className: "header-banner-row" }, 0118 React.createElement( 0119 "p", 0120 null, 0121 this.props.headerData.countActiveMembers 0122 ), 0123 React.createElement( 0124 "span", 0125 null, 0126 "contributors added" 0127 ) 0128 ), 0129 React.createElement( 0130 "div", 0131 { className: "header-banner-row" }, 0132 React.createElement( 0133 "p", 0134 null, 0135 this.props.headerData.countProjects 0136 ), 0137 React.createElement( 0138 "span", 0139 null, 0140 "products" 0141 ) 0142 ) 0143 ), 0144 React.createElement( 0145 "div", 0146 { id: "header-banner-bottom" }, 0147 React.createElement( 0148 "div", 0149 { className: "center" }, 0150 React.createElement( 0151 "a", 0152 { className: "btn btn-native", href: "/register" }, 0153 "Register" 0154 ), 0155 React.createElement( 0156 "span", 0157 null, 0158 "to join the community" 0159 ) 0160 ) 0161 ) 0162 ) 0163 ); 0164 } 0165 } 0166 0167 class CommunityPageTabsContainer extends React.Component { 0168 constructor(props) { 0169 super(props); 0170 this.state = { 0171 loading: true, 0172 tabs: window.appHelpers.generateTabsMenuArray(), 0173 selectedIndex: 0 0174 }; 0175 this.renderTabs = this.renderTabs.bind(this); 0176 this.getSelectedTabData = this.getSelectedTabData.bind(this); 0177 this.handleTabMenuItemClick = this.handleTabMenuItemClick.bind(this); 0178 } 0179 0180 componentDidMount() { 0181 this.getSelectedTabData(); 0182 } 0183 0184 renderTabs(selectedIndex) { 0185 if (!selectedIndex) { 0186 selectedIndex = 0; 0187 } 0188 const tabs = window.appHelpers.generateTabsMenuArray(); 0189 this.setState({ 0190 tabs: tabs, 0191 selectedIndex: selectedIndex 0192 }, function () { 0193 this.getSelectedTabData(); 0194 }); 0195 } 0196 0197 getSelectedTabData() { 0198 // get selected tab thing 0199 const self = this; 0200 const selectedTab = self.state.tabs[self.state.selectedIndex]; 0201 $.ajax({ url: selectedTab.url, cache: false }).done(function (response) { 0202 self.setState({ 0203 tabContent: { 0204 title: selectedTab.title, 0205 data: response.data 0206 }, 0207 loading: false 0208 }); 0209 }); 0210 } 0211 0212 handleTabMenuItemClick(itemIndex) { 0213 this.setState({ loading: true }, function () { 0214 this.renderTabs(itemIndex); 0215 }); 0216 } 0217 0218 render() { 0219 const selectedIndex = this.state.selectedIndex; 0220 const tabsMenuDisplay = this.state.tabs.map((t, index) => React.createElement(CommunityPageTabMenuItem, { 0221 key: index, 0222 index: index, 0223 selectedIndex: selectedIndex, 0224 tab: t, 0225 onTabMenuItemClick: this.handleTabMenuItemClick 0226 })); 0227 0228 let tabContent; 0229 if (this.state.loading) { 0230 0231 tabContent = React.createElement( 0232 "div", 0233 { id: "loading-container" }, 0234 React.createElement("div", { className: "ajax-loader" }) 0235 ); 0236 } else if (this.state.loading === false) { 0237 0238 const data = this.state.tabContent.data; 0239 0240 if (this.state.selectedIndex === 0 || this.state.selectedIndex === 4) { 0241 tabContent = React.createElement(UsersTab, { selectedIndex: this.state.selectedIndex, items: data }); 0242 } else if (this.state.selectedIndex === 1) { 0243 tabContent = React.createElement(CreatorsTab, { selectedIndex: this.state.selectedIndex, items: data }); 0244 } else if (this.state.selectedIndex === 2 || this.state.selectedIndex === 3) { 0245 tabContent = React.createElement(PlingedProductsTab, { selectedIndex: this.state.selectedIndex, items: data }); 0246 } else if (this.state.selectedIndex === 5 || this.state.selectedIndex === 6) { 0247 tabContent = React.createElement(MemberScoresTab, { selectedIndex: this.state.selectedIndex, items: data }); 0248 } 0249 } 0250 0251 return React.createElement( 0252 "div", 0253 { id: "community-page-tabs-container", className: "body-wrap" }, 0254 React.createElement( 0255 "div", 0256 { id: "tabs-menu" }, 0257 tabsMenuDisplay 0258 ), 0259 React.createElement( 0260 "div", 0261 { id: "tabs-content" }, 0262 tabContent 0263 ) 0264 ); 0265 } 0266 } 0267 0268 class CommunityPageTabMenuItem extends React.Component { 0269 constructor(props) { 0270 super(props); 0271 this.state = {}; 0272 this.onTabMenuItemClick = this.onTabMenuItemClick.bind(this); 0273 } 0274 0275 onTabMenuItemClick() { 0276 this.props.onTabMenuItemClick(this.props.index); 0277 } 0278 0279 render() { 0280 const activeCssClass = this.props.index === this.props.selectedIndex ? "active" : ""; 0281 return React.createElement( 0282 "div", 0283 { className: "tab-menu-item " + activeCssClass }, 0284 React.createElement( 0285 "a", 0286 { onClick: this.onTabMenuItemClick }, 0287 this.props.tab.title 0288 ) 0289 ); 0290 } 0291 } 0292 0293 class UsersTab extends React.Component { 0294 constructor(props) { 0295 super(props); 0296 this.state = {}; 0297 } 0298 0299 render() { 0300 let usersDisplay; 0301 if (this.props.items && this.props.items.length > 0) { 0302 const selectedIndex = this.props.selectedIndex; 0303 usersDisplay = this.props.items.map((user, index) => React.createElement(CommunityListItem, { 0304 key: index, 0305 index: index, 0306 selectedIndex: selectedIndex, 0307 item: user, 0308 type: 'user' 0309 })); 0310 } 0311 return React.createElement( 0312 "div", 0313 { className: "community-tab card-list-display", id: "supporters-tab" }, 0314 React.createElement( 0315 "ul", 0316 null, 0317 usersDisplay 0318 ) 0319 ); 0320 } 0321 } 0322 0323 class CreatorsTab extends React.Component { 0324 constructor(props) { 0325 super(props); 0326 this.state = {}; 0327 } 0328 0329 render() { 0330 let creatorsDisplay; 0331 if (this.props.items && this.props.items.length > 0) { 0332 const selectedIndex = this.props.selectedIndex; 0333 creatorsDisplay = this.props.items.map((creator, index) => React.createElement(CommunityListItem, { 0334 key: index, 0335 item: creator, 0336 type: 'creator', 0337 index: index, 0338 selectedIndex: selectedIndex 0339 })); 0340 } 0341 return React.createElement( 0342 "div", 0343 { className: "community-tab top-list-display", id: "most-pling-creators-tab" }, 0344 React.createElement( 0345 "ol", 0346 null, 0347 creatorsDisplay 0348 ) 0349 ); 0350 } 0351 } 0352 0353 class PlingedProductsTab extends React.Component { 0354 constructor(props) { 0355 super(props); 0356 this.state = {}; 0357 } 0358 0359 render() { 0360 let products; 0361 if (this.props.items && this.props.items.length > 0) { 0362 const selectedIndex = this.props.selectedIndex; 0363 products = this.props.items.map((product, index) => React.createElement(CommunityListItem, { 0364 key: index, 0365 item: product, 0366 type: 'product', 0367 index: index, 0368 selectedIndex: selectedIndex 0369 })); 0370 } 0371 0372 let productsDisplay, tabContainerCssClass; 0373 if (this.props.selectedIndex === 2) { 0374 productsDisplay = React.createElement( 0375 "ol", 0376 null, 0377 products 0378 ); 0379 tabContainerCssClass = "top-list-display"; 0380 } else if (this.props.selectedIndex === 3) { 0381 productsDisplay = React.createElement( 0382 "ul", 0383 null, 0384 products 0385 ); 0386 tabContainerCssClass = "card-list-display"; 0387 } 0388 return React.createElement( 0389 "div", 0390 { className: "community-tab " + tabContainerCssClass, id: "most-pling-product-tab" }, 0391 productsDisplay 0392 ); 0393 } 0394 } 0395 0396 class MemberScoresTab extends React.Component { 0397 constructor(props) { 0398 super(props); 0399 this.state = {}; 0400 } 0401 0402 render() { 0403 let members; 0404 if (this.props.items && this.props.items.length > 0) { 0405 const selectedIndex = this.props.selectedIndex; 0406 members = this.props.items.map((member, index) => React.createElement(CommunityListItem, { 0407 key: index, 0408 item: member, 0409 type: 'score', 0410 index: index, 0411 selectedIndex: selectedIndex 0412 })); 0413 } 0414 0415 let membersDisplay, tabContainerCssClass; 0416 if (this.props.selectedIndex === 6) { 0417 membersDisplay = React.createElement( 0418 "ol", 0419 null, 0420 members 0421 ); 0422 tabContainerCssClass = "top-list-display"; 0423 } else if (this.props.selectedIndex === 5) { 0424 membersDisplay = React.createElement( 0425 "ul", 0426 null, 0427 members 0428 ); 0429 tabContainerCssClass = "card-list-display"; 0430 } 0431 0432 return React.createElement( 0433 "div", 0434 { className: "community-tab " + tabContainerCssClass, id: "score-tab" }, 0435 membersDisplay 0436 ); 0437 } 0438 } 0439 0440 class CommunityListItem extends React.Component { 0441 constructor(props) { 0442 super(props); 0443 this.state = {}; 0444 } 0445 0446 render() { 0447 0448 const i = this.props.item; 0449 0450 /* USER DISPLAY */ 0451 const userDisplay = React.createElement(CommunityListItemUserDisplay, { 0452 selectedIndex: this.props.selectedIndex, 0453 item: i 0454 }); 0455 /* /USER DISPLAY */ 0456 0457 /* PROJECT DISPLAY */ 0458 let imageBaseUrl; 0459 if (i.image_small) { 0460 imageBaseUrl = "https://cn.opendesktop." + window.appHelpers.getHostNameSuffix() + "/cache/167x167-0/img/" + i.image_small; 0461 } 0462 0463 const projectDisplay = React.createElement( 0464 "a", 0465 { href: "/p/" + i.project_id }, 0466 React.createElement( 0467 "div", 0468 { className: "project" }, 0469 React.createElement( 0470 "figure", 0471 null, 0472 React.createElement("img", { src: imageBaseUrl }) 0473 ), 0474 React.createElement( 0475 "div", 0476 { className: "project-info" }, 0477 React.createElement( 0478 "h3", 0479 { className: "project-title" }, 0480 i.title, 0481 " ", 0482 React.createElement( 0483 "span", 0484 { className: "version" }, 0485 i.version 0486 ) 0487 ), 0488 React.createElement( 0489 "span", 0490 { className: "cat-title" }, 0491 i.catTitle 0492 ) 0493 ) 0494 ) 0495 ); 0496 /* /PROJECT DISPLAY */ 0497 0498 /* SCORE DISPLAY */ 0499 const scoreDisplay = React.createElement(CommunityListItemScoreDisplay, { 0500 item: i 0501 }); 0502 /* /SCORE DISPLAY */ 0503 0504 /* DISPLAY TEMPLATE */ 0505 let displayTemplate; 0506 if (this.props.selectedIndex === 0 || this.props.selectedIndex === 4) { 0507 displayTemplate = React.createElement( 0508 "div", 0509 { className: "list-item-template" }, 0510 userDisplay 0511 ); 0512 } else if (this.props.selectedIndex === 1) { 0513 displayTemplate = React.createElement( 0514 "div", 0515 { className: "list-item-template" }, 0516 React.createElement( 0517 "div", 0518 { className: "creator-wrapper" }, 0519 React.createElement( 0520 "div", 0521 { className: "list-ranking" }, 0522 this.props.index + 1 0523 ), 0524 userDisplay, 0525 scoreDisplay 0526 ) 0527 ); 0528 } else if (this.props.selectedIndex === 2 || this.props.selectedIndex === 3) { 0529 displayTemplate = React.createElement( 0530 "div", 0531 { className: "list-item-template" }, 0532 React.createElement( 0533 "div", 0534 { className: "creator-wrapper" }, 0535 React.createElement( 0536 "div", 0537 { className: "left-side-section" }, 0538 React.createElement( 0539 "div", 0540 { className: "list-ranking" }, 0541 this.props.index + 1 0542 ), 0543 projectDisplay 0544 ), 0545 React.createElement( 0546 "div", 0547 { className: "right-side-section" }, 0548 userDisplay, 0549 scoreDisplay 0550 ) 0551 ) 0552 ); 0553 } else if (this.props.selectedIndex === 5 || this.props.selectedIndex === 6) { 0554 displayTemplate = React.createElement( 0555 "div", 0556 { className: "list-item-template" }, 0557 React.createElement( 0558 "div", 0559 { className: "scored-wrapper" }, 0560 userDisplay, 0561 React.createElement( 0562 "div", 0563 { className: "list-ranking" }, 0564 React.createElement( 0565 "span", 0566 { className: "rank" }, 0567 this.props.index + 1 0568 ), 0569 React.createElement( 0570 "span", 0571 { className: "sum-plings" }, 0572 i.score 0573 ) 0574 ) 0575 ) 0576 ); 0577 } 0578 /* /DISPLAY TEMPLATE */ 0579 0580 return React.createElement( 0581 "li", 0582 { className: "list-item" }, 0583 displayTemplate 0584 ); 0585 } 0586 } 0587 0588 class CommunityListItemUserDisplay extends React.Component { 0589 constructor(props) { 0590 super(props); 0591 this.state = { 0592 showHoverDiv: false 0593 }; 0594 this.handleImageLoaded = this.handleImageLoaded.bind(this); 0595 this.getImageElementDimensions = this.getImageElementDimensions.bind(this); 0596 this.handleMouseIn = this.handleMouseIn.bind(this); 0597 this.handleMouseOut = this.handleMouseOut.bind(this); 0598 } 0599 0600 componentDidMount() { 0601 this.getImageElementDimensions(); 0602 console.log(this.props.selectedIndex); 0603 } 0604 0605 getImageElementDimensions() { 0606 const height = this.divElement.clientHeight; 0607 const width = this.divElement.clientWidth; 0608 this.setState({ 0609 imgHeight: height, 0610 imgWidth: width 0611 }); 0612 } 0613 0614 handleMouseIn() { 0615 this.setState({ 0616 showHoverDiv: true, 0617 loading: true 0618 }, function () { 0619 const self = this; 0620 $.get('/member/' + this.props.item.member_id + '/tooltip/', function (res) { 0621 self.setState({ userData: res.data, loading: false }); 0622 }); 0623 }); 0624 } 0625 0626 handleMouseOut() { 0627 this.setState({ showHoverDiv: false }); 0628 } 0629 0630 handleImageLoaded() { 0631 this.getImageElementDimensions(); 0632 } 0633 0634 render() { 0635 0636 const i = this.props.item; 0637 0638 let userCreatedAt; 0639 if (i.created_at) { 0640 userCreatedAt = window.appHelpers.formatDate(i.created_at); 0641 } 0642 let byDisplay; 0643 if (this.props.selectedIndex === 2) { 0644 byDisplay = React.createElement( 0645 "span", 0646 { className: "by" }, 0647 "by" 0648 ); 0649 } 0650 0651 let userHoverDivDisplay; 0652 if (this.state.showHoverDiv) { 0653 let infoDisplay; 0654 if (this.state.loading) { 0655 infoDisplay = React.createElement( 0656 "div", 0657 { className: "user-hover-info" }, 0658 React.createElement("div", { className: "ajax-loader" }) 0659 ); 0660 } else { 0661 0662 const userData = this.state.userData; 0663 0664 let locationDisplay; 0665 if (userData.countrycity) { 0666 locationDisplay = React.createElement( 0667 "span", 0668 null, 0669 React.createElement("span", { className: "glyphicon glyphicon-map-marker" }), 0670 userData.countrycity 0671 ); 0672 } 0673 0674 infoDisplay = React.createElement( 0675 "div", 0676 { className: "user-hover-info" }, 0677 React.createElement( 0678 "span", 0679 { className: "username" }, 0680 i.username, 0681 " ", 0682 locationDisplay 0683 ), 0684 React.createElement( 0685 "span", 0686 null, 0687 userData.cntProjects, 0688 " products" 0689 ), 0690 React.createElement( 0691 "span", 0692 null, 0693 userData.totalComments, 0694 " comments" 0695 ), 0696 React.createElement( 0697 "span", 0698 null, 0699 "Liked ", 0700 userData.cntLikesGave, 0701 " products" 0702 ), 0703 React.createElement( 0704 "span", 0705 null, 0706 "Got ", 0707 userData.cntLikesGot, 0708 " Likes ", 0709 React.createElement("span", { className: "glyphicon glyphicon-heart" }) 0710 ), 0711 React.createElement( 0712 "span", 0713 null, 0714 "Last time active: ", 0715 userData.lastactive_at 0716 ), 0717 React.createElement( 0718 "span", 0719 null, 0720 "Member since: ", 0721 userData.created_at 0722 ) 0723 ); 0724 } 0725 0726 const userHoverDivStyle = { 0727 "left": this.state.imgWidth + "px", 0728 "marginTop": this.state.imgHeight / 2 + "px" 0729 }; 0730 0731 let userHoverCssClass = ""; 0732 if (this.state.loading) { 0733 userHoverCssClass = "loading-user"; 0734 } 0735 0736 userHoverDivDisplay = React.createElement( 0737 "div", 0738 { className: "user-hover-display " + userHoverCssClass, style: userHoverDivStyle }, 0739 infoDisplay 0740 ); 0741 } 0742 0743 let userNameDisplay; 0744 if (this.props.selectedIndex === 2) { 0745 userNameDisplay = React.createElement( 0746 "span", 0747 { 0748 ref: divElement => this.divElement = divElement, 0749 onMouseOver: e => this.handleMouseIn(e), 0750 onMouseOut: this.handleMouseOut, 0751 className: "username" }, 0752 byDisplay, 0753 i.username 0754 ); 0755 } else { 0756 userNameDisplay = React.createElement( 0757 "span", 0758 { className: "username" }, 0759 byDisplay, 0760 i.username 0761 ); 0762 } 0763 0764 return React.createElement( 0765 "a", 0766 { href: "/u/" + i.username + "/", className: "user-display-container" }, 0767 React.createElement( 0768 "div", 0769 { className: "user" }, 0770 React.createElement( 0771 "figure", 0772 { 0773 ref: divElement => this.divElement = divElement, 0774 onMouseOver: e => this.handleMouseIn(e), 0775 onMouseOut: this.handleMouseOut }, 0776 React.createElement("img", { 0777 onLoad: this.handleImageLoaded, 0778 src: i.profile_image_url }) 0779 ), 0780 userNameDisplay, 0781 React.createElement( 0782 "span", 0783 { className: "user-created" }, 0784 userCreatedAt 0785 ) 0786 ), 0787 userHoverDivDisplay 0788 ); 0789 } 0790 } 0791 0792 class CommunityListItemScoreDisplay extends React.Component { 0793 constructor(props) { 0794 super(props); 0795 this.state = {}; 0796 this.handleMouseIn = this.handleMouseIn.bind(this); 0797 this.handleMouseOut = this.handleMouseOut.bind(this); 0798 } 0799 0800 handleMouseIn() { 0801 this.setState({ 0802 showHoverDiv: true, 0803 loading: true 0804 }, function () { 0805 const self = this; 0806 $.get('/plings/tooltip/id/' + this.props.item.project_id, function (res) { 0807 console.log(res); 0808 self.setState({ scoreUsers: res.data, loading: false }); 0809 }); 0810 }); 0811 } 0812 0813 handleMouseOut() { 0814 this.setState({ showHoverDiv: false }); 0815 } 0816 0817 render() { 0818 0819 let scoreUsersHoverDiv; 0820 if (this.state.showHoverDiv) { 0821 let scoreUsersDisplay, scoreUsersHoverDivHeight; 0822 if (this.state.loading) { 0823 scoreUsersDisplay = React.createElement( 0824 "div", 0825 { className: "score-users-display" }, 0826 React.createElement("div", { className: "ajax-loader" }) 0827 ); 0828 } else { 0829 const scoreUsers = this.state.scoreUsers.map((su, index) => React.createElement( 0830 "div", 0831 { className: "score-user", key: index }, 0832 React.createElement( 0833 "figure", 0834 null, 0835 React.createElement("img", { src: su.profile_image_url }) 0836 ), 0837 React.createElement( 0838 "span", 0839 null, 0840 su.username 0841 ) 0842 )); 0843 const scoreUserNumRows = Math.ceil(this.state.scoreUsers.length / 4); 0844 scoreUsersHoverDivHeight = scoreUserNumRows * 70; 0845 scoreUsersDisplay = React.createElement( 0846 "div", 0847 { className: "score-users-display" }, 0848 scoreUsers 0849 ); 0850 } 0851 scoreUsersHoverDiv = React.createElement( 0852 "div", 0853 { className: "score-hover-container", style: { "top": "-" + scoreUsersHoverDivHeight / 2 } }, 0854 scoreUsersDisplay 0855 ); 0856 } 0857 0858 console.log(this.props.item); 0859 0860 let scoreDisplay; 0861 if (this.props.selectedIndex === 2) { 0862 scoreDisplay = React.createElement( 0863 "span", 0864 { className: "score", 0865 ref: divElement => this.divElement = divElement, 0866 onMouseOver: this.handleMouseIn, 0867 onMouseOut: this.handleMouseOut }, 0868 React.createElement("img", { src: "/images/system/pling-btn-active.png" }), 0869 this.props.item.laplace_score 0870 ); 0871 } else { 0872 scoreDisplay = React.createElement( 0873 "span", 0874 { className: "score" }, 0875 React.createElement("img", { src: "/images/system/pling-btn-active.png" }), 0876 this.props.item.cnt 0877 ); 0878 } 0879 0880 return React.createElement( 0881 "div", 0882 { 0883 className: "score-container" }, 0884 scoreDisplay, 0885 scoreUsersHoverDiv 0886 ); 0887 } 0888 } 0889 0890 ReactDOM.render(React.createElement(CommunityPage, null), document.getElementById('community-page-container'));