]> git.wh0rd.org - tt-rss.git/commitdiff
pref-feeds tweaks
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 20 Mar 2008 05:34:43 +0000 (06:34 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 20 Mar 2008 05:34:43 +0000 (06:34 +0100)
functions.js
modules/pref-feeds.php
prefs.js
themes/compat/theme.css
themes/graycube/theme.css
tt-rss.css

index b41cd73abaa13e270010ede9d211306059912b61..2857072b7854dd902dc191d595e79d642016bcc0 100644 (file)
@@ -1750,3 +1750,48 @@ function displayHelpInfobox(topic_id) {
 
        return false;
 }
+
+// http://www.dynamic-tools.net/toolbox/copyToClipboard/
+
+/*
+function copyToClipboard(s)
+{
+       if( window.clipboardData && clipboardData.setData )
+       {
+               clipboardData.setData("Text", s);
+       }
+       else
+       {
+               // You have to sign the code to enable this or allow the action in about:config by changing
+               user_pref("signed.applets.codebase_principal_support", true);
+               netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+
+               var clip Components.classes['@mozilla.org/widget/clipboard;[[[[1]]]]'].createInstance(Components.interfaces.nsIClipboard);
+               if (!clip) return;
+
+               // create a transferable
+               var trans = Components.classes['@mozilla.org/widget/transferable;[[[[1]]]]'].createInstance(Components.interfaces.nsITransferable);
+               if (!trans) return;
+
+               // specify the data we wish to handle. Plaintext in this case.
+               trans.addDataFlavor('text/unicode');
+
+               // To get the data from the transferable we need two new objects
+               var str = new Object();
+               var len = new Object();
+
+               var str = Components.classes["@mozilla.org/supports-string;[[[[1]]]]"].createInstance(Components.interfaces.nsISupportsString);
+
+               var copytext=meintext;
+
+               str.data=copytext;
+
+               trans.setTransferData("text/unicode",str,copytext.length*[[[[2]]]]);
+
+               var clipid=Components.interfaces.nsIClipboard;
+
+               if (!clip) return false;
+
+               clip.setData(trans,null,clipid.kGlobalClipboard);          
+       }
+} */
index 854ca0dc2adebbacfc6d095aa02974aa8c64d8a2..9b718ace61a09a981a522c3cd85beca82ec22fce 100644 (file)
                print "<h3>" . __("Firefox Integration") . "</h3>";
                 
                 print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.');
-               print "</p><p class=\"small\"> <a href='javascript:window.navigator.registerContentHandler(" .
+               print "</p><p> <a class='visibleLink' href='javascript:window.navigator.registerContentHandler(" .
                       "\"application/vnd.mozilla.maybe.feed\", " .
                       "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
                       __('Click here to register this site as a feed reader.') . "</a></p>";
                        set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key());
                }
                
-               print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the address specified below.')."</p>";
+               print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>";
 
                $url_path = article_publish_url($link);
 
-               print "<p class=\"small\"><a id=\"pubGenAddress\" target=\"_new\" href=\"$url_path\">$url_path</a></p>";
+               print "<p><a class=\"visibleLink\" id=\"pubGenAddress\" target=\"_new\" href=\"$url_path\">Link to published articles feed.</a></p>";           
 
                print "<p><input type=\"submit\" onclick=\"return pubRegenKey()\" class=\"button\"
-                       value=\"".__('Generate another address')."\"></p>";
+                       value=\"".__('Generate another link')."\">";
+               /* print " <input type=\"submit\" onclick=\"return pubToClipboard()\" class=\"button\"
+                       value=\"".__('Copy link to clipboard')."\">"; */
+               print "</p>";
 
        }
 ?>
index 56de40ad3dee02512107264fc632f378f46c2b33..43a554cf2ba02fb2b8045b0c4cd7f06156fb81ab 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -37,17 +37,17 @@ function replace_pubkey_callback() {
 
                                if (new_link) {
                                        link.href = new_link.firstChild.nodeValue;
-                                       link.innerHTML = new_link.firstChild.nodeValue;
+                                       //link.innerHTML = new_link.firstChild.nodeValue;
 
                                        new Effect.Highlight(link);
 
-                                       notify_info("Address changed.");
+                                       notify_info("Published feed URL changed.");
                                } else {
-                                       notify_error("Could not change address.");
+                                       notify_error("Could not change feed URL.");
                                }
 
                        } else {
-                               notify_error("Could not change address.");
+                               notify_error("Could not change feed URL.");
                        }
                } catch (e) {
                        exception_error("replace_pubkey_callback", e);
@@ -1815,6 +1815,25 @@ function pubRegenKey() {
        return false;
 }
 
+function pubToClipboard() {
+
+       try {
+
+               if (!xmlhttp_ready(xmlhttp)) {
+                       printLockingError();
+                       return false;
+               }
+       
+               var link = document.getElementById("pubGenAddress");
+               alert(link.href);
+
+       } catch (e) {
+               exception_error("pubToClipboard", e);
+       }
+
+       return false; 
+}
+
 function validatePrefsSave() {
        try {
 
index ef6cf14cca03685c33c8d412dadbc564e5c344f1..fcda0b431151a92c9bdb7a8e9462c0fde4dfed91 100644 (file)
@@ -950,3 +950,6 @@ div.infoBoxContents a {
        color : #5050aa;
 }
 
+a.visibleLink {
+       color : gray;
+}
index fd9b24e350a417bc52785387f691811a1db81d66..8eacb1286a359e1e4893d88861dd0ab62c120805 100644 (file)
@@ -466,3 +466,7 @@ div.topLinks a {
 div.topLinks a:hover {
        color : gray;
 }
+
+a.visibleLink {
+       color : gray;
+}
index 60448d7dac39325d8c5e4063e62a5fa7bd51492f..77b0df74d600af6689a2e15ec9cae6f2125f5c42 100644 (file)
@@ -1737,3 +1737,8 @@ div.topLinks a.feedback {
 div.dashboard {
        margin-left : 3px;
 }
+
+a.visibleLink {
+       color : #4684ff;
+
+}