]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
pref-feeds tweaks
[tt-rss.git] / functions.js
index ddfce24771765601d1a2f04918cf0b40b4877464..2857072b7854dd902dc191d595e79d642016bcc0 100644 (file)
@@ -209,7 +209,10 @@ function hotkey_handler(e) {
 
                }
        
-               if (!hotkeys_enabled) return;
+               if (!hotkeys_enabled) {
+                       debug("hotkeys disabled");
+                       return;
+               }
        
                if (window.event) {
                        keycode = window.event.keyCode;
@@ -329,6 +332,12 @@ function hotkey_handler(e) {
                        }
                }
 
+               if (keycode == 67 && shift_key) { // c
+                       if (typeof collapse_feedlist != 'undefined') {
+                               return collapse_feedlist();
+                       }
+               }
+
                if (typeof localHotkeyHandler != 'undefined') {
                        try {
                                return localHotkeyHandler(e);
@@ -1741,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);          
+       }
+} */