diff options
| author | jez | 2011-05-14 20:34:29 -0400 |
|---|---|---|
| committer | jez | 2011-05-14 20:34:29 -0400 |
| commit | d6e059f2a3b8db7695de3851d48e62a6ca925af9 (patch) | |
| tree | 57a01d033f78f8b323e4503d33bbddbd833cd973 /lib | |
| parent | 9fa550086afb0e3bb944721f0422f60ec50b69b7 (diff) | |
| parent | 1cdbf5b3ceb6a35044eff1ffbfd54ac6e63bc84a (diff) | |
| download | vimium-d6e059f2a3b8db7695de3851d48e62a6ca925af9.tar.bz2 | |
Merge branch 'bookmarks'
Conflicts:
commands.js
linkHints.js
vimiumFrontend.js
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js new file mode 100644 index 00000000..0c992ad4 --- /dev/null +++ b/lib/utils.js @@ -0,0 +1,14 @@ +var utils = { + /* + * Takes a dot-notation object string and call the function + * that it points to with the correct value for 'this'. + */ + invokeCommandString: function(str, argArray) { + var components = str.split('.'); + var obj = window; + for (var i = 0; i < components.length - 1; i++) + obj = obj[components[i]]; + var func = obj[components.pop()]; + return func.apply(obj, argArray); + }, +}; |
