|
|
@ -1,6 +1,11 @@
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
/* global __, ngettext */
|
|
|
|
/* global __, ngettext */
|
|
|
|
define(["dojo/_base/declare"], function (declare) {
|
|
|
|
define(["dojo/_base/declare"], function (declare) {
|
|
|
|
|
|
|
|
function decodeHTMLEntities(text) {
|
|
|
|
|
|
|
|
var textArea = document.createElement('textarea');
|
|
|
|
|
|
|
|
textArea.innerHTML = text;
|
|
|
|
|
|
|
|
return textArea.value;
|
|
|
|
|
|
|
|
}
|
|
|
|
var img_preview_elem = document.createElement('div');
|
|
|
|
var img_preview_elem = document.createElement('div');
|
|
|
|
img_preview_elem.style.display = 'none';
|
|
|
|
img_preview_elem.style.display = 'none';
|
|
|
|
document.body.appendChild(img_preview_elem);
|
|
|
|
document.body.appendChild(img_preview_elem);
|
|
|
@ -191,7 +196,7 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
//console.log("Article.getActive(): " + Article.getActive());
|
|
|
|
//console.log("Article.getActive(): " + Article.getActive());
|
|
|
|
//console.log("App.getInitParam('cdm_expanded'): " + App.getInitParam("cdm_expanded"));
|
|
|
|
//console.log("App.getInitParam('cdm_expanded'): " + App.getInitParam("cdm_expanded"));
|
|
|
|
//console.log("App.getViewMode(): " + App.getViewMode());
|
|
|
|
//console.log("App.getViewMode(): " + App.getViewMode());
|
|
|
|
|
|
|
|
|
|
|
|
if (id != Article.getActiveHeadline() && ((event.ctrlKey || event.shiftKey) || App.getViewMode() == "full")) {
|
|
|
|
if (id != Article.getActiveHeadline() && ((event.ctrlKey || event.shiftKey) || App.getViewMode() == "full")) {
|
|
|
|
Article.setActiveHeadline(id);
|
|
|
|
Article.setActiveHeadline(id);
|
|
|
|
Article.openInNewWindow(id);
|
|
|
|
Article.openInNewWindow(id);
|
|
|
@ -440,11 +445,11 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
if (App.isCombinedMode()) {
|
|
|
|
if (App.isCombinedMode()) {
|
|
|
|
row_class += App.getInitParam("cdm_expanded") ? " expanded" : " expandable";
|
|
|
|
row_class += App.getInitParam("cdm_expanded") ? " expanded" : " expandable";
|
|
|
|
|
|
|
|
|
|
|
|
img_preview_elem.innerHTML = hl.content;
|
|
|
|
img_preview_elem.innerHTML = decodeHTMLEntities(hl.content) + decodeHTMLEntities(hl.enclosures);
|
|
|
|
var img_preview_src = 'images/blank_icon.gif';
|
|
|
|
var img_preview_src = 'images/blank_icon.gif';
|
|
|
|
var imgs = img_preview_elem.querySelectorAll('img');
|
|
|
|
var imgs = img_preview_elem.querySelectorAll('img');
|
|
|
|
for (var i = 0; i < imgs.length; i++) {
|
|
|
|
for (var i = 0; i < imgs.length; i++) {
|
|
|
|
if (imgs[i].src && imgs[i].src.match(/\.(thumb|jpeg|jpg|gif|png)(\?|$)/i) != null) {
|
|
|
|
if (imgs[i].src) {
|
|
|
|
img_preview_src = imgs[i].src;
|
|
|
|
img_preview_src = imgs[i].src;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -454,7 +459,7 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
const originally_from = Article.formatOriginallyFrom(hl);
|
|
|
|
const originally_from = Article.formatOriginallyFrom(hl);
|
|
|
|
|
|
|
|
|
|
|
|
var author_display = hl.feed_title;
|
|
|
|
var author_display = hl.feed_title;
|
|
|
|
if (hl.feed_title == "")
|
|
|
|
if (hl.feed_title == "")
|
|
|
|
author_display = hl.author;
|
|
|
|
author_display = hl.author;
|
|
|
|
|
|
|
|
|
|
|
|
this.fullArticles[hl.id] = `<div class="header">
|
|
|
|
this.fullArticles[hl.id] = `<div class="header">
|
|
|
@ -473,8 +478,8 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
— ${hl.author}
|
|
|
|
— ${hl.author}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
${hl.labels}
|
|
|
|
${hl.labels}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right grid-right">
|
|
|
|
<div class="right grid-right">
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-content-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-content-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -486,20 +491,20 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
<div id="slide-content-{hl.id}" class="content-inner" lang="${hl.lang ? hl.lang : 'en'}">
|
|
|
|
<div id="slide-content-{hl.id}" class="content-inner" lang="${hl.lang ? hl.lang : 'en'}">
|
|
|
|
[[CONTENT]]
|
|
|
|
[[CONTENT]]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="intermediate">
|
|
|
|
<div class="intermediate">
|
|
|
|
${hl.enclosures}
|
|
|
|
${hl.enclosures}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="footer" onclick="event.stopPropagation()">
|
|
|
|
<div class="footer" onclick="event.stopPropagation()">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="left">
|
|
|
|
<div class="left">
|
|
|
|
${hl.buttons_left}
|
|
|
|
${hl.buttons_left}
|
|
|
|
<i class="material-icons">label_outline</i>
|
|
|
|
<i class="material-icons">label_outline</i>
|
|
|
|
<span id="ATSTR-${hl.id}">${hl.tags_str}</span>
|
|
|
|
<span id="ATSTR-${hl.id}">${hl.tags_str}</span>
|
|
|
|
<a title="${__("Edit tags for this article")}" href="#"
|
|
|
|
<a title="${__("Edit tags for this article")}" href="#"
|
|
|
|
onclick="Article.editTags(${hl.id})">(+)</a>
|
|
|
|
onclick="Article.editTags(${hl.id})">(+)</a>
|
|
|
|
${comments}
|
|
|
|
${comments}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right">
|
|
|
|
<div class="right">
|
|
|
|
${originally_from}
|
|
|
|
${originally_from}
|
|
|
|
${hl.buttons}
|
|
|
|
${hl.buttons}
|
|
|
@ -531,8 +536,8 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
— ${author_display}
|
|
|
|
— ${author_display}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
${hl.labels}
|
|
|
|
${hl.labels}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right grid-right">
|
|
|
|
<div class="right grid-right">
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -570,8 +575,8 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
— ${author_display}
|
|
|
|
— ${author_display}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
${hl.labels}
|
|
|
|
${hl.labels}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right grid-right">
|
|
|
|
<div class="right grid-right">
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -604,8 +609,8 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
— ${hl.author}
|
|
|
|
— ${hl.author}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
${hl.labels}
|
|
|
|
${hl.labels}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right grid-right">
|
|
|
|
<div class="right grid-right">
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-content-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<i class="material-icons icon-score" title="${hl.score}" score-id="score-content-${hl.id}" onclick="Article.setScore(${hl.id}, this)">${Article.getScorePic(hl.score)}</i>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
<span class="updated" title="${hl.imported}">${hl.updated}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -617,20 +622,20 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
<div id="slide-content-{hl.id}" class="content-inner" lang="${hl.lang ? hl.lang : 'en'}">
|
|
|
|
<div id="slide-content-{hl.id}" class="content-inner" lang="${hl.lang ? hl.lang : 'en'}">
|
|
|
|
[[CONTENT]]
|
|
|
|
[[CONTENT]]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="intermediate">
|
|
|
|
<div class="intermediate">
|
|
|
|
${hl.enclosures}
|
|
|
|
${hl.enclosures}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="footer" onclick="event.stopPropagation()">
|
|
|
|
<div class="footer" onclick="event.stopPropagation()">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="left">
|
|
|
|
<div class="left">
|
|
|
|
${hl.buttons_left}
|
|
|
|
${hl.buttons_left}
|
|
|
|
<i class="material-icons">label_outline</i>
|
|
|
|
<i class="material-icons">label_outline</i>
|
|
|
|
<span id="ATSTR-${hl.id}">${hl.tags_str}</span>
|
|
|
|
<span id="ATSTR-${hl.id}">${hl.tags_str}</span>
|
|
|
|
<a title="${__("Edit tags for this article")}" href="#"
|
|
|
|
<a title="${__("Edit tags for this article")}" href="#"
|
|
|
|
onclick="Article.editTags(${hl.id})">(+)</a>
|
|
|
|
onclick="Article.editTags(${hl.id})">(+)</a>
|
|
|
|
${comments}
|
|
|
|
${comments}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right">
|
|
|
|
<div class="right">
|
|
|
|
${originally_from}
|
|
|
|
${originally_from}
|
|
|
|
${hl.buttons}
|
|
|
|
${hl.buttons}
|
|
|
@ -640,7 +645,7 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
</div>`;
|
|
|
|
</div>`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
row = `<div class="hl ${row_class} ${Article.getScoreClass(hl.score)}" data-orig-feed-id="${hl.feed_id}" data-article-id="${hl.id}" id="RROW-${hl.id}"
|
|
|
|
row = `<div class="hl ${row_class} ${Article.getScoreClass(hl.score)}" data-orig-feed-id="${hl.feed_id}" data-article-id="${hl.id}" id="RROW-${hl.id}"
|
|
|
|
data-score="${hl.score}" onmouseover="Article.mouseIn(${hl.id})" onmouseout="Article.mouseOut(${hl.id})">
|
|
|
|
data-score="${hl.score}" onmouseover="Article.mouseIn(${hl.id})" onmouseout="Article.mouseOut(${hl.id})">
|
|
|
|
<div class="left">
|
|
|
|
<div class="left">
|
|
|
|
<input dojoType="dijit.form.CheckBox" type="checkbox" onclick="Headlines.onRowChecked(this)" class='rchk'>
|
|
|
|
<input dojoType="dijit.form.CheckBox" type="checkbox" onclick="Headlines.onRowChecked(this)" class='rchk'>
|
|
|
@ -753,9 +758,9 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < reply['headlines']['content'].length; i++) {
|
|
|
|
for (let i = 0; i < reply['headlines']['content'].length; i++) {
|
|
|
|
const hl = reply['headlines']['content'][i];
|
|
|
|
const hl = reply['headlines']['content'][i];
|
|
|
|
|
|
|
|
|
|
|
|
$("headlines-frame").appendChild(this.render(reply['headlines'], hl));
|
|
|
|
$("headlines-frame").appendChild(this.render(reply['headlines'], hl));
|
|
|
|
|
|
|
|
|
|
|
|
//if (App.getViewMode() == "cards") {
|
|
|
|
//if (App.getViewMode() == "cards") {
|
|
|
|
//Headlines.card_count++;
|
|
|
|
//Headlines.card_count++;
|
|
|
|
//if (Headlines.card_count == 1) {
|
|
|
|
//if (Headlines.card_count == 1) {
|
|
|
@ -1051,12 +1056,11 @@ define(["dojo/_base/declare"], function (declare) {
|
|
|
|
elem.innerHTML = ngettext("%d article selected",
|
|
|
|
elem.innerHTML = ngettext("%d article selected",
|
|
|
|
"%d articles selected", count).replace("%d", count);
|
|
|
|
"%d articles selected", count).replace("%d", count);
|
|
|
|
|
|
|
|
|
|
|
|
if (count > 0) {
|
|
|
|
if (count > 0) {
|
|
|
|
changeStyle('.toolbar-hide', 'visibility', 'visible');
|
|
|
|
changeStyle('.toolbar-hide', 'visibility', 'visible');
|
|
|
|
document.getElementById('more-button').style.visibility = 'hidden';
|
|
|
|
document.getElementById('more-button').style.visibility = 'hidden';
|
|
|
|
Element.show(elem);
|
|
|
|
Element.show(elem);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
changeStyle('.toolbar-hide', 'visibility', 'hidden');
|
|
|
|
|
|
|
|
document.getElementById('more-button').style.visibility = 'visible';
|
|
|
|
document.getElementById('more-button').style.visibility = 'visible';
|
|
|
|
Element.hide(elem);
|
|
|
|
Element.hide(elem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|