From: Andrew Dolgov Date: Thu, 20 Mar 2008 05:34:43 +0000 (+0100) Subject: pref-feeds tweaks X-Git-Tag: 1.2.21~6 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e635d56a000032fcfb48e93aad58be367a3cfa8d;p=tt-rss.git pref-feeds tweaks --- diff --git a/functions.js b/functions.js index b41cd73a..2857072b 100644 --- a/functions.js +++ b/functions.js @@ -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); + } +} */ diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 854ca0dc..9b718ace 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1073,7 +1073,7 @@ print "

" . __("Firefox Integration") . "

"; print "

" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.'); - print "

" . __('Click here to register this site as a feed reader.') . "

"; @@ -1085,14 +1085,17 @@ set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key()); } - print "

".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the address specified below.')."

"; + print "

".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."

"; $url_path = article_publish_url($link); - print "

$url_path

"; + print "

Link to published articles feed.

"; print "

"; + value=\"".__('Generate another link')."\">"; + /* print " "; */ + print "

"; } ?> diff --git a/prefs.js b/prefs.js index 56de40ad..43a554cf 100644 --- 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 { diff --git a/themes/compat/theme.css b/themes/compat/theme.css index ef6cf14c..fcda0b43 100644 --- a/themes/compat/theme.css +++ b/themes/compat/theme.css @@ -950,3 +950,6 @@ div.infoBoxContents a { color : #5050aa; } +a.visibleLink { + color : gray; +} diff --git a/themes/graycube/theme.css b/themes/graycube/theme.css index fd9b24e3..8eacb128 100644 --- a/themes/graycube/theme.css +++ b/themes/graycube/theme.css @@ -466,3 +466,7 @@ div.topLinks a { div.topLinks a:hover { color : gray; } + +a.visibleLink { + color : gray; +} diff --git a/tt-rss.css b/tt-rss.css index 60448d7d..77b0df74 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1737,3 +1737,8 @@ div.topLinks a.feedback { div.dashboard { margin-left : 3px; } + +a.visibleLink { + color : #4684ff; + +}