Changeset 745

Show
Ignore:
Timestamp:
06/18/08 18:51:21 (6 months ago)
Author:
aranti..@gmail.com
Message:

Fixes #38

  • Incorporate the submitted patch. Add GM_deleteValue and GM_enumerateValues API methods.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/chrome/chromeFiles/content/miscapis.js

    r694 r745  
    6565}; 
    6666 
     67GM_ScriptStorage.prototype.deleteValue = function(name) { 
     68  return this.prefMan.remove(name); 
     69} 
     70 
     71GM_ScriptStorage.prototype.enumerateValues = function() { 
     72  return this.prefMan.enumerateValues(); 
     73} 
    6774 
    6875// Based on Mark Pilgrim's GM_addGlobalStyle from 
  • trunk/src/chrome/chromeFiles/content/prefmanager.js

    r692 r745  
    2929    return pref.getPrefType(prefName) != 0; 
    3030  }; 
     31 
     32  /** 
     33         * enumerate preferences 
     34         */ 
     35        this.enumerateValues = function() { 
     36                return pref.getChildList("",{}); 
     37        } 
    3138 
    3239  /** 
  • trunk/src/components/greasemonkey.js

    r737 r745  
    277277      sandbox.GM_setValue = GM_hitch(storage, "setValue"); 
    278278      sandbox.GM_getValue = GM_hitch(storage, "getValue"); 
     279      sandbox.GM_deleteValue = GM_hitch(storage, "deleteValue"); 
     280      sandbox.GM_enumerateValues = GM_hitch(storage, "enumerateValues"); 
    279281      sandbox.GM_getResourceURL = GM_hitch(resources, "getResourceURL"); 
    280282      sandbox.GM_getResourceText = GM_hitch(resources, "getResourceText");