This commit is contained in:
Gregorio
2019-02-11 15:27:40 +01:00
4 changed files with 30 additions and 32 deletions
+7 -21
View File
@@ -5879,13 +5879,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -5898,18 +5896,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
@@ -6012,8 +6007,7 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
@@ -6023,7 +6017,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -6036,20 +6029,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -6066,7 +6056,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -6139,8 +6128,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
@@ -6150,7 +6138,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -6256,7 +6243,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
+7 -5
View File
@@ -1,6 +1,6 @@
import React from 'react';
import Wikipedia from './areainfo/Wikipedia';
import { Tabs, Tab, Table } from 'react-bootstrap';
import { Tabs, Tab } from 'react-bootstrap';
import {Link, withRouter} from 'react-router-dom';
import axios from 'axios';
import Linkify from "react-linkify";
@@ -12,7 +12,6 @@ import './css/VideoInfo.scss';
const ytclear = require('@c0b41/ytclear');
class VideoInfo extends React.Component {
state = {
@@ -25,7 +24,7 @@ class VideoInfo extends React.Component {
};
momentDuration(duration) {
return moment.duration(duration).format('hh:mm:ss');
return moment.duration(duration).format('hh:mm:ss')
}
ISO_8601parse(a) {
@@ -145,8 +144,8 @@ class VideoInfo extends React.Component {
render() {
const { error, isLoaded, VideoDetails, comments } = this.state;
const momentDuration = this.momentDuration; // bind momentDuration in render to the actual method
const ISO_8601parse = this.ISO_8601parse; // bind momentDuration in render to the actual method
const momentDuration = this.momentDuration;
const ISO_8601parse = this.ISO_8601parse;
if (error) {
return (
<span className="text-white">
@@ -204,6 +203,9 @@ class VideoInfo extends React.Component {
)
})}
</Tab>
<Tab className="text-white" eventKey="tweet" title="Tweet">
/* Insert code here */
</Tab>
<Tab className="text-white" eventKey="wikipedia" title="Wikipedia">
<Wikipedia
title={this.state.others.title}
+8 -3
View File
@@ -4,6 +4,7 @@ import axios from "axios";
import createpageToken from 'youtube-page-token';
import {Card} from "react-bootstrap";
import {Link} from "react-router-dom";
import moment from "moment";
class RecommenderRandom extends Component{
constructor(props){
@@ -13,6 +14,11 @@ class RecommenderRandom extends Component{
};
}
ISO_8601parse(a) {
return moment(a, moment.ISO_8601).format('ddd, DD/MM/YYYY hh:mm:ss');
}
componentDidMount(){
let pos = Math.floor(Math.random() * 500);
let pageToken = createpageToken(pos); /* createPageToken(pos) restituisce il pageToken relativo al numero
@@ -41,6 +47,7 @@ class RecommenderRandom extends Component{
}
render(){
const ISO_8601parse = this.ISO_8601parse;
return (
<div style={{width: '100rem',height:'100rem'}}>
{this.state.items.map(function (item,index) {
@@ -60,9 +67,7 @@ class RecommenderRandom extends Component{
<Card.ImgOverlay>
<Card.Title className="bg-dark d-inline text-white">
{item.snippet.title}<br/>
{item.snippet.channelTitle} - {item.snippet.publishedAt.replace(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).000Z/,function(match,p1,p2,p3,p4,p5,p6){
return(p3+'/'+p2+'/'+p1+' at '+p4+':'+p5+':'+p6); //Funzione che trasforma la data e ora di pubblicazione dal formato ISO nel normale formato da cristiani
})}
{item.snippet.channelTitle} - {ISO_8601parse(item.snippet.publishedAt)}
</Card.Title>
</Card.ImgOverlay>
</Link>
+8 -3
View File
@@ -2,6 +2,8 @@ import React, { Component } from 'react';
import axios from 'axios';
import {Link} from "react-router-dom";
import {Card} from "react-bootstrap";
import moment from "moment";
class Related extends Component {
constructor(props) {
@@ -12,6 +14,9 @@ class Related extends Component {
}
}
ISO_8601parse(a) {
return moment(a, moment.ISO_8601).format('ddd, DD/MM/YYYY hh:mm:ss');
}
componentWillMount() {
if(this.props.match.params.id){
if(this.props.match.params.id === this.state.videoId){}
@@ -51,6 +56,7 @@ class Related extends Component {
}
render() {
const ISO_8601parse = this.ISO_8601parse;
return (
<div style={{width: '100rem',height:'100rem'}}>
{this.state.items.map(function (item,index) {
@@ -70,9 +76,8 @@ class Related extends Component {
<Card.ImgOverlay>
<Card.Title className="bg-dark d-inline text-white">
{item.snippet.title}<br/>
{item.snippet.channelTitle} - {item.snippet.publishedAt.replace(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+).000Z/,function(match,p1,p2,p3,p4,p5,p6){
return(p3+'/'+p2+'/'+p1+' at '+p4+':'+p5+':'+p6); //Funzione che trasforma la data e ora di pubblicazione dal formato ISO nel normale formato da cristiani
})}
{item.snippet.channelTitle} - {ISO_8601parse(item.snippet.publishedAt)}
</Card.Title>
</Card.ImgOverlay>
</Link>