1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-19 13:31:29 +00:00

fix article starring/publishing on MSIE (closes #139)

This commit is contained in:
Andrew Dolgov
2007-08-23 14:54:17 +01:00
parent e9e4d0c49f
commit f5e0338d84
11 changed files with 50 additions and 82 deletions

View File

@@ -3546,14 +3546,14 @@
if ($num_starred > 0) $class .= "Unread"; if ($num_starred > 0) $class .= "Unread";
printFeedEntry(-1, $class, __("Starred articles"), $num_starred, printFeedEntry(-1, $class, __("Starred articles"), $num_starred,
"images/mark_set.png", $link); "images/mark_set.gif", $link);
$class = "virt"; $class = "virt";
if ($num_published > 0) $class .= "Unread"; if ($num_published > 0) $class .= "Unread";
printFeedEntry(-2, $class, __("Published articles"), $num_published, printFeedEntry(-2, $class, __("Published articles"), $num_published,
"images/pub_set.png", $link); "images/pub_set.gif", $link);
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (get_pref($link, 'ENABLE_FEED_CATS')) {
print "</ul>"; print "</ul>";
@@ -4253,23 +4253,23 @@
} }
if ($line["marked"] == "t" || $line["marked"] == "1") { if ($line["marked"] == "t" || $line["marked"] == "1") {
$marked_pic = "<img id=\"FMPIC-$id\" src=\"images/mark_set.png\" $marked_pic = "<img id=\"FMPIC-$id\" src=\"images/mark_set.gif\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Reset mark\" onclick='javascript:tMark($id)'>"; alt=\"Unstar article\" onclick='javascript:tMark($id)'>";
} else { } else {
$marked_pic = "<img id=\"FMPIC-$id\" src=\"images/mark_unset.png\" $marked_pic = "<img id=\"FMPIC-$id\" src=\"images/mark_unset.gif\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Set mark\" onclick='javascript:tMark($id)'>"; alt=\"Star article\" onclick='javascript:tMark($id)'>";
} }
if ($line["published"] == "t" || $line["published"] == "1") { if ($line["published"] == "t" || $line["published"] == "1") {
$published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_set.png\" $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_set.gif\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Unpublish\" onclick='javascript:tPub($id)'>"; alt=\"Unpublish article\" onclick='javascript:tPub($id)'>";
} else { } else {
$published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_unset.png\" $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_unset.gif\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Publish\" onclick='javascript:tPub($id)'>"; alt=\"Publish article\" onclick='javascript:tPub($id)'>";
} }
# $content_link = "<a target=\"_new\" href=\"".$line["link"]."\">" . # $content_link = "<a target=\"_new\" href=\"".$line["link"]."\">" .

BIN
images/mark_set.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

BIN
images/mark_unset.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

BIN
images/pub_set.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/pub_unset.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

View File

@@ -119,6 +119,13 @@ print T_js_decl("Entered passwords do not match.");
print T_js_decl("No articles found to mark"); print T_js_decl("No articles found to mark");
print T_js_decl("Mark %d article(s) as read?"); print T_js_decl("Mark %d article(s) as read?");
print T_js_decl("No article is selected."); print T_js_decl("No article is selected.");
print T_js_decl("Star article");
print T_js_decl("Unstar article");
print T_js_decl("Please wait...");
print T_js_decl("Publish article");
print T_js_decl("Unpublish article");
#print T_js_decl(
#print T_js_decl(
#print T_js_decl( #print T_js_decl(
#print T_js_decl( #print T_js_decl(
#print T_js_decl( #print T_js_decl(

View File

@@ -345,8 +345,8 @@ function tMark_afh_off(effect) {
debug("tMark_afh_off : " + elem.id); debug("tMark_afh_off : " + elem.id);
if (elem) { if (elem) {
elem.src = "images/mark_unset.png"; elem.src = elem.src.replace("mark_set", "mark_unset");
elem.alt = "Set mark"; elem.alt = __("Star article");
Element.show(elem); Element.show(elem);
} }
@@ -362,8 +362,8 @@ function tPub_afh_off(effect) {
debug("tPub_afh_off : " + elem.id); debug("tPub_afh_off : " + elem.id);
if (elem) { if (elem) {
elem.src = "images/pub_unset.png"; elem.src = elem.src.replace("pub_set", "pub_unset");
elem.alt = "Publish"; elem.alt = __("Publish article");
Element.show(elem); Element.show(elem);
} }
@@ -372,7 +372,7 @@ function tPub_afh_off(effect) {
} }
} }
function toggleMark(id) { function toggleMark(id, client_only, no_effects) {
try { try {
@@ -395,9 +395,9 @@ function toggleMark(id) {
var vfeedu = document.getElementById("FEEDU--1"); var vfeedu = document.getElementById("FEEDU--1");
var crow = document.getElementById("RROW-" + id); var crow = document.getElementById("RROW-" + id);
if (mark_img.alt != "Reset mark") { if (mark_img.src.match("mark_unset")) {
mark_img.src = "images/mark_set.png"; mark_img.src = mark_img.src.replace("mark_unset", "mark_set");
mark_img.alt = "Reset mark"; mark_img.alt = __("Unstar article");
query = query + "&mark=1"; query = query + "&mark=1";
/* if (vfeedu && crow.className.match("Unread")) { /* if (vfeedu && crow.className.match("Unread")) {
@@ -406,18 +406,18 @@ function toggleMark(id) {
} else { } else {
//mark_img.src = "images/mark_unset.png"; //mark_img.src = "images/mark_unset.png";
mark_img.alt = "Please wait..."; mark_img.alt = __("Please wait...");
query = query + "&mark=0"; query = query + "&mark=0";
/* if (vfeedu && crow.className.match("Unread")) { /* if (vfeedu && crow.className.match("Unread")) {
vfeedu.innerHTML = (+vfeedu.innerHTML) - 1; vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
} */ } */
if (document.getElementById("headlinesList")) { if (document.getElementById("headlinesList") && !no_effects) {
Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off}); Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
} else { } else {
mark_img.src = "images/mark_unset.png"; mark_img.src = mark_img.src.replace("mark_set", "mark_unset");
mark_img.alt = "Set mark"; mark_img.alt = __("Star article");
} }
} }
@@ -440,18 +440,20 @@ function toggleMark(id) {
//new Ajax.Request(query); */ //new Ajax.Request(query); */
if (!client_only) {
debug(query); debug(query);
xmlhttp_rpc.open("GET", query, true); xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=all_counters_callback; xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null); xmlhttp_rpc.send(null);
}
} catch (e) { } catch (e) {
exception_error("toggleMark", e); exception_error("toggleMark", e);
} }
} }
function togglePub(id) { function togglePub(id, client_only, no_effects) {
try { try {
@@ -474,9 +476,9 @@ function togglePub(id) {
var vfeedu = document.getElementById("FEEDU--2"); var vfeedu = document.getElementById("FEEDU--2");
var crow = document.getElementById("RROW-" + id); var crow = document.getElementById("RROW-" + id);
if (mark_img.alt != "Unpublish") { if (mark_img.src.match("pub_unset")) {
mark_img.src = "images/pub_set.png"; mark_img.src = mark_img.src.replace("pub_unset", "pub_set");
mark_img.alt = "Unpublish"; mark_img.alt = __("Unpublish article");
query = query + "&pub=1"; query = query + "&pub=1";
/* if (vfeedu && crow.className.match("Unread")) { /* if (vfeedu && crow.className.match("Unread")) {
@@ -485,18 +487,18 @@ function togglePub(id) {
} else { } else {
//mark_img.src = "images/pub_unset.png"; //mark_img.src = "images/pub_unset.png";
mark_img.alt = "Please wait..."; mark_img.alt = __("Please wait...");
query = query + "&pub=0"; query = query + "&pub=0";
/* if (vfeedu && crow.className.match("Unread")) { /* if (vfeedu && crow.className.match("Unread")) {
vfeedu.innerHTML = (+vfeedu.innerHTML) - 1; vfeedu.innerHTML = (+vfeedu.innerHTML) - 1;
} */ } */
if (document.getElementById("headlinesList")) { if (document.getElementById("headlinesList") && !no_effects) {
Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off}); Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
} else { } else {
mark_img.src = "images/pub_unset.png"; mark_img.src = mark_img.src.replace("pub_set", "pub_unset");
mark_img.alt = "Publish"; mark_img.alt = __("Publish article");
} }
} }
@@ -519,9 +521,11 @@ function togglePub(id) {
new Ajax.Request(query); */ new Ajax.Request(query); */
if (!client_only) {
xmlhttp_rpc.open("GET", query, true); xmlhttp_rpc.open("GET", query, true);
xmlhttp_rpc.onreadystatechange=all_counters_callback; xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null); xmlhttp_rpc.send(null);
}
} catch (e) { } catch (e) {
@@ -737,30 +741,7 @@ function selectionToggleMarked(cdm_mode) {
} }
for (i = 0; i < rows.length; i++) { for (i = 0; i < rows.length; i++) {
var row = document.getElementById("RROW-" + rows[i]); toggleMark(rows[i], true, true);
var mark_img = document.getElementById("FMPIC-" + rows[i]);
if (row && mark_img) {
if (mark_img.alt == "Set mark") {
mark_img.src = "images/mark_set.png";
mark_img.alt = "Reset mark";
//mark_img.setAttribute('onclick',
// 'javascript:toggleMark('+rows[i]+', false)');
} else {
mark_img.src = "images/mark_unset.png";
mark_img.alt = "Set mark";
//mark_img.alt = "Please wait...";
//mark_img.setAttribute('onclick',
// 'javascript:toggleMark('+rows[i]+', true)');
//Effect.Puff(mark_img, {duration : 0.25, afterFinish: tMark_afh_off});
}
}
} }
if (rows.length > 0) { if (rows.length > 0) {
@@ -808,27 +789,7 @@ function selectionTogglePublished(cdm_mode) {
} }
for (i = 0; i < rows.length; i++) { for (i = 0; i < rows.length; i++) {
var row = document.getElementById("RROW-" + rows[i]); togglePub(rows[i], true, true);
var mark_img = document.getElementById("FPPIC-" + rows[i]);
if (row && mark_img) {
if (mark_img.alt == "Publish") {
mark_img.src = "images/pub_set.png";
mark_img.alt = "Unpublish";
// mark_img.setAttribute('onclick',
// 'javascript:togglePub('+rows[i]+', false)');
} else {
mark_img.src = "images/pub_unset.png";
mark_img.alt = "Publish";
// mark_img.setAttribute('onclick',
// 'javascript:togglePub('+rows[i]+', true)');
// Effect.Puff(mark_img, {duration : 0.25, afterFinish: tPub_afh_off});
}
}
} }
if (rows.length > 0) { if (rows.length > 0) {