]> git.wh0rd.org Git - tt-rss.git/commitdiff
openArticleInNewWindow: add workaround for popup blockers
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 May 2008 07:42:30 +0000 (08:42 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 May 2008 07:42:30 +0000 (08:42 +0100)
functions.js
help/3.php

index e309c5e70ccd270ea27a4a05bfc5428e060e89f0..f46bc60f0a7f6a87c41d543b6a9675bfa32f8b3e 100644 (file)
@@ -75,10 +75,13 @@ function open_article_callback(transport) {
 
                        debug("open_article_callback, received link: " + link);
 
-                       if (link) {
-                               debug("link url: " + link.firstChild.nodeValue);
+                       if (link && id) {
 
-                               var w = window.open(link.firstChild.nodeValue, "_blank");
+                               var wname = "ttrss_article_" + id.firstChild.nodeValue;
+
+                               debug("link url: " + link.firstChild.nodeValue + ", wname " + wname);
+
+                               var w = window.open(link.firstChild.nodeValue, wname);
 
                                if (!w) { notify_error("Failed to load article in new window"); }
 
@@ -1502,8 +1505,13 @@ function openArticleInNewWindow(id) {
                debug("openArticleInNewWindow: " + id);
 
                var query = "backend.php?op=rpc&subop=getArticleLink&id=" + id;
+               var wname = "ttrss_article_" + id;
+
+               debug(query + " " + wname);
+
+               var w = window.open("", wname);
 
-               debug(query);
+               if (!w) notify_error("Failed to open window for the article");
 
                new Ajax.Request(query, {
                        onComplete: function(transport) { 
index 0644c214a0e40ef61d52bd7c844bbc348c8c9b2c..009376f5dccb0087204e3a2c44b354fb8ba7287e 100644 (file)
@@ -17,7 +17,7 @@
                <tr><td class='n'>shift-S</td><td><?php echo __("Toggle published") ?></td></tr>
                <tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
                <tr><td class='n'>t</td><td><?php echo __("Edit tags") ?></td></tr>
-               <!-- <tr><td class='n'>S</td><td>Edit score</td></tr> -->
+               <tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
        </table>
 
        <h2><?php echo __("Other actions") ?></h2>