|
|
@ -10,24 +10,24 @@
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const limit = 300;
|
|
|
|
const limit = 300;
|
|
|
|
function checkUseMore() {
|
|
|
|
function checkUseMore() {
|
|
|
|
let elements = document.getElementsByClassName("useMore");
|
|
|
|
var elements = document.getElementsByClassName("useMore");
|
|
|
|
|
|
|
|
|
|
|
|
for (let index = 0; index < elements.length; index++) {
|
|
|
|
for (var index = 0; index < elements.length; index++) {
|
|
|
|
const element = elements[index];
|
|
|
|
const element = elements[index];
|
|
|
|
let display = element.style.display;
|
|
|
|
var display = element.style.display;
|
|
|
|
let originalText = element.textContent;
|
|
|
|
var originalText = element.textContent;
|
|
|
|
if (originalText.length <= limit) {
|
|
|
|
if (originalText.length <= limit) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let newText = originalText.substr(0, limit);
|
|
|
|
var newText = originalText.substr(0, limit);
|
|
|
|
|
|
|
|
|
|
|
|
let newElement = document.createElement(element.tagName);
|
|
|
|
var newElement = document.createElement(element.tagName);
|
|
|
|
newElement.textContent = newText;
|
|
|
|
newElement.textContent = newText;
|
|
|
|
|
|
|
|
|
|
|
|
newElement.classList.add("short-version");
|
|
|
|
newElement.classList.add("short-version");
|
|
|
|
element.classList.add("long-version");
|
|
|
|
element.classList.add("long-version");
|
|
|
|
|
|
|
|
|
|
|
|
let more = document.createElement("a");
|
|
|
|
var more = document.createElement("a");
|
|
|
|
more.textContent = " show more";
|
|
|
|
more.textContent = " show more";
|
|
|
|
more.style.cursor = "pointer";
|
|
|
|
more.style.cursor = "pointer";
|
|
|
|
more.onclick = function () {
|
|
|
|
more.onclick = function () {
|
|
|
@ -35,7 +35,7 @@
|
|
|
|
newElement.style.display = "none";
|
|
|
|
newElement.style.display = "none";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let less = document.createElement("a");
|
|
|
|
var less = document.createElement("a");
|
|
|
|
less.textContent = " show less";
|
|
|
|
less.textContent = " show less";
|
|
|
|
less.style.cursor = "pointer";
|
|
|
|
less.style.cursor = "pointer";
|
|
|
|
less.onclick = function () {
|
|
|
|
less.onclick = function () {
|
|
|
@ -53,7 +53,7 @@
|
|
|
|
checkUseMore();
|
|
|
|
checkUseMore();
|
|
|
|
|
|
|
|
|
|
|
|
function openPlayer(itemId, podcastId) {
|
|
|
|
function openPlayer(itemId, podcastId) {
|
|
|
|
let url = "/player?";
|
|
|
|
var url = "/player?";
|
|
|
|
if (itemId) {
|
|
|
|
if (itemId) {
|
|
|
|
url += "&itemId=" + itemId;
|
|
|
|
url += "&itemId=" + itemId;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -66,7 +66,7 @@
|
|
|
|
function getIdentifier() {
|
|
|
|
function getIdentifier() {
|
|
|
|
if(localStorage){
|
|
|
|
if(localStorage){
|
|
|
|
if (localStorage.identifier) {
|
|
|
|
if (localStorage.identifier) {
|
|
|
|
return localStorage?.identifier;
|
|
|
|
return localStorage.identifier;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var id = +new Date();
|
|
|
|
var id = +new Date();
|
|
|
|
localStorage.identifier = id;
|
|
|
|
localStorage.identifier = id;
|
|
|
|