From f5e0338d8443844e9a487bdb37c44c69a38de8a5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Aug 2007 14:54:17 +0100 Subject: [PATCH] fix article starring/publishing on MSIE (closes #139) --- functions.php | 20 ++++---- images/mark_set.gif | Bin 0 -> 316 bytes images/mark_set.png | Bin 524 -> 0 bytes images/mark_unset.gif | Bin 0 -> 211 bytes images/mark_unset.png | Bin 496 -> 0 bytes images/pub_set.gif | Bin 0 -> 583 bytes images/pub_set.png | Bin 3267 -> 0 bytes images/pub_unset.gif | Bin 0 -> 987 bytes images/pub_unset.png | Bin 551 -> 0 bytes localized_js.php | 7 +++ viewfeed.js | 105 +++++++++++++----------------------------- 11 files changed, 50 insertions(+), 82 deletions(-) create mode 100644 images/mark_set.gif delete mode 100644 images/mark_set.png create mode 100644 images/mark_unset.gif delete mode 100644 images/mark_unset.png create mode 100644 images/pub_set.gif delete mode 100644 images/pub_set.png create mode 100644 images/pub_unset.gif delete mode 100644 images/pub_unset.png diff --git a/functions.php b/functions.php index 364024ba..56b4a3c9 100644 --- a/functions.php +++ b/functions.php @@ -3546,14 +3546,14 @@ if ($num_starred > 0) $class .= "Unread"; printFeedEntry(-1, $class, __("Starred articles"), $num_starred, - "images/mark_set.png", $link); + "images/mark_set.gif", $link); $class = "virt"; if ($num_published > 0) $class .= "Unread"; printFeedEntry(-2, $class, __("Published articles"), $num_published, - "images/pub_set.png", $link); + "images/pub_set.gif", $link); if (get_pref($link, 'ENABLE_FEED_CATS')) { print ""; @@ -4253,23 +4253,23 @@ } if ($line["marked"] == "t" || $line["marked"] == "1") { - $marked_pic = "\"Reset"; + alt=\"Unstar article\" onclick='javascript:tMark($id)'>"; } else { - $marked_pic = "\"Set"; + alt=\"Star article\" onclick='javascript:tMark($id)'>"; } if ($line["published"] == "t" || $line["published"] == "1") { - $published_pic = "\"Unpublish\""; + alt=\"Unpublish article\" onclick='javascript:tPub($id)'>"; } else { - $published_pic = "\"Publish\""; + alt=\"Publish article\" onclick='javascript:tPub($id)'>"; } # $content_link = "" . diff --git a/images/mark_set.gif b/images/mark_set.gif new file mode 100644 index 0000000000000000000000000000000000000000..aae4809e305841e47691a4ef67c1e1fffd524bcf GIT binary patch literal 316 zcmZ?wbhEHb6krfwxT?btv*d5)>c5eT{^qXx`{3RG58wYc?D*HZ>u>Ase>Y$K@7?$J z>#zTJ-u$oJ{I`Dl-^AsAn|A&!SpWCmzyDo({}yljTe;=$($jzMy#DV$_wUE=|8v&< zU3}{Aq(lF%zW86W_3zB1e;arHi&*sc;k*A^uKv66@_*0%e@(moMKAsvFz@f@AOFAq z`oH4r-~a#rGmr}uf3h$#Fz5gw5P`K}i6u`7xAbrKk3HRT3EtAMRaI*JAVL^jDo2PJrFq;RzytJI0v^>9u1|O5E U4ile-hlGNQf<)lF`Hl?M0KjjJMgRZ+ literal 0 HcmV?d00001 diff --git a/images/mark_set.png b/images/mark_set.png deleted file mode 100644 index b35655c85e566494dbda268f798a63f308f1ba64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 524 zcmV+n0`vWeP)L zl0i!wQ51#0cgGn9D-ET^T3ocyg+UxGNm9grE#2zaiHt4 zl|R?-JV6kdMFp!0R)fea-dVtPs4UFjFU;V(4wX?nb#sY9WTt^R;HBqK35rYt=snKT z9`Awgz)u~@@wLF)k39iCh+@-GaL*&X@8dpuz~pQJ1#onVt+zSroYVc2;`J;T%O~KS zveptr=Fx=k<@rONmS*urjSKMYh%`?4l^IraC@lfdp|mo?a-6WgbI8T0;+;b-;)MOo zu&hIA^(|3{(#{Mk2Pf3yWVkp^;NXOM-no61@4JEyr6Y=l>kJFH4v3DKdNcnR??(d#6m%%RZ?ymv0jV|F z&J0V{vTRh#vXL27Bb*GS{m{{Q3f|Ip_D*6IJ!=l|vK|K{@lFU! zz^1Zv8$-t9$rv`Bg<^DY5T8%Sp#-5oi4@4`V1ZhuC=3)+Kt(tNiG;w3pa7GH;q#aP N-sMr@9_#l*06Tn#g`)rf literal 0 HcmV?d00001 diff --git a/images/mark_unset.png b/images/mark_unset.png deleted file mode 100644 index bf9059a32181c698e9f098167361233bd5cc4dfc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 496 zcmVL zlTR-LVGzcDv%8x0uS6P=-H4-uh}0(jv9S1AXYMWqAlX;$bXP%jPMOFEaS-rq8Vm^$R@5OO?fwr)dx@*7gAdHv=ia;^- zfA@eb?0Q*TFNcaSg_YdkXMs|cl`vu(I0eoFpS!OdIk`~_*b~^a z1Tqc{*P(B$pMlYS1fcSa-ak`+Y4X-+l1UU4_JJ)?Rl1jnVK9S)2&^A>qi2sY=ter34|3Vls1U!0K zv|OVB9Hh|t#4wps6#+&9pQnxzfEmCl*Emd+g}lc`-eV(C7RogaQ+`Vq?Gl>6a^B;( mZ8m4XY8bJUaym=+i+uoaii}R7(4bfV0000{Y+hyEdzL?N;AryF6~Ndz`QLb(-CWZtLe| z1~2=Z-nANk>@s;>XY``l{6VJ9<08}F`8oXOp`(tP0-w)4zJ-zYw)y)sR4!_sO zf0<+P)Me?LC`UhMX`A^2{x_Ro!3-&SY*InexTd)eRjPyc;> zc0bGD%bpour&|BoQTBOB+M9N}UwfNBPWAn9WY+CCt%rFg-#3+h?6-W~VED9H?`56& zvnt~cb5p<1wEua0*2j%q|DK=wGROb-uJZq2z%Zad@h1x-14Af-4#*XtIALI4(h%Cz z+|t_C-Y)LVD=NjuBWWkxD(+?IC@aU!&cewg)8eBN5~A)eHkXM_r-j$k!9X*FS$7pH zSBt2ui#fYJ1A{&*he(T*+!E$sZ3ZDNdHxnYZZT!+5KH$EJ!yp&9(FSeV`d=^D-8*O z7D*O{5GS<|U)vBxr4~QVK%*e%kN~fMg$J82utam%KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmR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?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~A^8LW002S&EC2ui01yBW000QM0EGw~NU)&6g9Z_BNU^}cfea5IKq!EK zAcqhnfDGvHL4bq^3JMTRkl^3H06ai^R3P91!38ixY{+qv0!s%62pSl$!G!<@1PHWn zFu(x81075TU_gOD02>w-5X|raM1vCl7^wL7BEbcM4+O|)Fd{&J0RePOs6Y^c1OopW z1o_wF$3F}j2*!xOV#kRZ|8T7MN8<*;0yhU(NH77z3=|#+A}C{Qm37 zwSTW~{C;-*-^VBaK0W*U;`-m0H~zl5@$dEZf3L3pe025S`}@D1T>t&_+OMbAe?GkW z=jDx`kFWpx{QBoJpb6K0KDqJt<@LX>Z~c0F_3zsU|K8sE{rbWGzrX%~1n>N~f93bn z>wiBy{`24))(iFTPFZ#D%;g!`7&xmmJpF8U0o}{M;OXk;vd$@?2>^;XWU2rF diff --git a/localized_js.php b/localized_js.php index 77b9ea2f..1f2c7c17 100644 --- a/localized_js.php +++ b/localized_js.php @@ -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("Mark %d article(s) as read?"); 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( diff --git a/viewfeed.js b/viewfeed.js index c7a85fdb..2984b4bc 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -345,8 +345,8 @@ function tMark_afh_off(effect) { debug("tMark_afh_off : " + elem.id); if (elem) { - elem.src = "images/mark_unset.png"; - elem.alt = "Set mark"; + elem.src = elem.src.replace("mark_set", "mark_unset"); + elem.alt = __("Star article"); Element.show(elem); } @@ -362,8 +362,8 @@ function tPub_afh_off(effect) { debug("tPub_afh_off : " + elem.id); if (elem) { - elem.src = "images/pub_unset.png"; - elem.alt = "Publish"; + elem.src = elem.src.replace("pub_set", "pub_unset"); + elem.alt = __("Publish article"); Element.show(elem); } @@ -372,7 +372,7 @@ function tPub_afh_off(effect) { } } -function toggleMark(id) { +function toggleMark(id, client_only, no_effects) { try { @@ -395,9 +395,9 @@ function toggleMark(id) { var vfeedu = document.getElementById("FEEDU--1"); var crow = document.getElementById("RROW-" + id); - if (mark_img.alt != "Reset mark") { - mark_img.src = "images/mark_set.png"; - mark_img.alt = "Reset mark"; + if (mark_img.src.match("mark_unset")) { + mark_img.src = mark_img.src.replace("mark_unset", "mark_set"); + mark_img.alt = __("Unstar article"); query = query + "&mark=1"; /* if (vfeedu && crow.className.match("Unread")) { @@ -406,18 +406,18 @@ function toggleMark(id) { } else { //mark_img.src = "images/mark_unset.png"; - mark_img.alt = "Please wait..."; + mark_img.alt = __("Please wait..."); query = query + "&mark=0"; /* if (vfeedu && crow.className.match("Unread")) { 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}); } else { - mark_img.src = "images/mark_unset.png"; - mark_img.alt = "Set mark"; + mark_img.src = mark_img.src.replace("mark_set", "mark_unset"); + mark_img.alt = __("Star article"); } } @@ -440,18 +440,20 @@ function toggleMark(id) { //new Ajax.Request(query); */ - debug(query); + if (!client_only) { + debug(query); - xmlhttp_rpc.open("GET", query, true); - xmlhttp_rpc.onreadystatechange=all_counters_callback; - xmlhttp_rpc.send(null); + xmlhttp_rpc.open("GET", query, true); + xmlhttp_rpc.onreadystatechange=all_counters_callback; + xmlhttp_rpc.send(null); + } } catch (e) { exception_error("toggleMark", e); } } -function togglePub(id) { +function togglePub(id, client_only, no_effects) { try { @@ -474,9 +476,9 @@ function togglePub(id) { var vfeedu = document.getElementById("FEEDU--2"); var crow = document.getElementById("RROW-" + id); - if (mark_img.alt != "Unpublish") { - mark_img.src = "images/pub_set.png"; - mark_img.alt = "Unpublish"; + if (mark_img.src.match("pub_unset")) { + mark_img.src = mark_img.src.replace("pub_unset", "pub_set"); + mark_img.alt = __("Unpublish article"); query = query + "&pub=1"; /* if (vfeedu && crow.className.match("Unread")) { @@ -485,18 +487,18 @@ function togglePub(id) { } else { //mark_img.src = "images/pub_unset.png"; - mark_img.alt = "Please wait..."; + mark_img.alt = __("Please wait..."); query = query + "&pub=0"; /* if (vfeedu && crow.className.match("Unread")) { 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}); } else { - mark_img.src = "images/pub_unset.png"; - mark_img.alt = "Publish"; + mark_img.src = mark_img.src.replace("pub_set", "pub_unset"); + mark_img.alt = __("Publish article"); } } @@ -519,9 +521,11 @@ function togglePub(id) { new Ajax.Request(query); */ - xmlhttp_rpc.open("GET", query, true); - xmlhttp_rpc.onreadystatechange=all_counters_callback; - xmlhttp_rpc.send(null); + if (!client_only) { + xmlhttp_rpc.open("GET", query, true); + xmlhttp_rpc.onreadystatechange=all_counters_callback; + xmlhttp_rpc.send(null); + } } catch (e) { @@ -737,30 +741,7 @@ function selectionToggleMarked(cdm_mode) { } for (i = 0; i < rows.length; i++) { - var row = document.getElementById("RROW-" + rows[i]); - 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}); - - } - } + toggleMark(rows[i], true, true); } if (rows.length > 0) { @@ -808,27 +789,7 @@ function selectionTogglePublished(cdm_mode) { } for (i = 0; i < rows.length; i++) { - var row = document.getElementById("RROW-" + rows[i]); - 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}); - - } - } + togglePub(rows[i], true, true); } if (rows.length > 0) { -- 2.39.5